sferik/twitter-ruby
70.0
Adequate · 26 September 2026
8.1k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
This system is a Ruby gem that provides a modern, modular client library for interacting with the Twitter API. It supports REST and streaming endpoints, handling authentication via OAuth, and offers structured object models for tweets, media, entities, and direct messages. The library includes comprehensive type signatures and a robust test suite to ensure reliability and static type checking.
How it got here
2006 — Modernization and toolchain overhaul
6 changes.
The project underwent a comprehensive modernization, replacing the legacy Hoe-based build system with a Bundler-managed workflow and integrating modern linting, testing, and static type checking tools. The core library was refactored to replace the old email/password authentication with a modular OAuth-based client architecture, while legacy code, documentation, and old gem versions were removed to clean up the repository.
2007–2012 — Rich media support and testing infrastructure
6 changes.
The project introduced dedicated entity classes and model support for rich media types, including animated GIFs and videos, to better represent Twitter API data structures. Concurrently, the testing framework was modernized by migrating to Minitest and WebMock, significantly expanding test coverage for API interactions and data models.
2013–2026 — API modularization and type safety
6 changes.
The project refactored the Twitter REST and streaming clients into modular components and modernized the streaming implementation with updated HTTP handling. It expanded feature coverage by adding support for Direct Message welcome messages and introduced RBS type signatures to enable static type checking.
Features
Add RBS type signatures for the Twitter gem
Added a new RBS signature file (\sig/twitter.rbs\) that defines type annotations for the Twitter gem, including classes like \Base\, \Identity\, \RateLimit\, \Factory\, and \Error\, as well as modules for versioning and utilities. This enables static type checking for code interacting with the Twitter gem.
sig · high confidence
Add entity-relationship diagram for the Twitter library
The \etc/\ directory now includes an entity-relationship diagram (ERD) visualizing the class hierarchy of the Twitter library. This is provided as a source Graphviz DOT file (\erd.dot\), a Ruby script (\erd.rb\) to regenerate the diagram from the live codebase, and a pre-rendered SVG file (\erd.svg\) for immediate viewing.
etc · high confidence
Add support for Twitter Direct Message welcome messages
Users can now interact with Twitter Direct Message welcome messages through new model classes. The library introduces \Twitter::DirectMessages::WelcomeMessage\ to represent the message content (including text and name) and \Twitter::DirectMessages::WelcomeMessageRule\ to handle associated rules. Wrapper classes (\WelcomeMessageWrapper\ and \WelcomeMessageRuleWrapper\) are provided to parse API responses, automatically handling timestamp conversion and URL expansion within the message text.
_lib/twitter/direct\messages · high confidence
Add support for Twitter animated GIF, video, and video metadata media entities
Users can now access animated GIFs, videos, and associated video metadata from Twitter timelines. This change introduces new model classes—\Twitter::Media::AnimatedGif\, \Twitter::Media::Video\, and \Twitter::Media::VideoInfo\—alongside an updated \Twitter::Media::Photo\ class. These classes expose attributes such as \type\, \indices\, \sizes\, and for videos, \video\_info\ (containing aspect ratio, duration, and variants), allowing applications to programmatically interact with rich media content.
lib/twitter/media · high confidence
Added welcome message and rule management for Direct Messages
Users can now create, update, retrieve, and delete Twitter Direct Message welcome messages and their associated rules. This change introduces the \WelcomeMessages\ module within the \lib/twitter/rest/direct\_messages\ directory, providing methods such as \create\_welcome\_message\, \update\_welcome\_message\, \destroy\_welcome\_message\, \welcome\_message\, \welcome\_message\_list\, \create\_welcome\_message\_rule\, \destroy\_welcome\_message\_rule\, \welcome\_message\_rule\, and \welcome\_message\_rule\_list\ to interact with the Twitter API endpoints for welcome message management.
_lib/twitter/rest/direct\messages · high confidence
Introduce new Twitter gem core classes and modules
The lib/twitter directory now includes a comprehensive set of new classes and modules that form the foundation of the library's object model and request handling. This adds support for parsing tweet entities (hashtags, media, URLs, user mentions), handling geographic data (points, polygons, results), managing pagination via cursors, and processing direct messages and events. It also introduces a new Client class for authentication, a robust Error hierarchy mapping HTTP status codes to specific exceptions, and utilities for argument parsing and object creation.
lib/twitter · high confidence
Removals
Removal of legacy Twitter gem versions 0.0.1 and 0.0.2
The \pkg/twitter-0.0.1\ and \pkg/twitter-0.0.2\ directories have been completely removed from the repository. This deletion eliminates the legacy Ruby gem codebase, including its command-line interface, API client logic, and associated build scripts (Rakefile, setup.rb), effectively cleaning up the project history.
pkg, pkg/twitter-0.0.1, pkg/twitter-0.0.2 · high confidence
Architecture
Restructure REST API into modular components
The Twitter REST client has been refactored from a single monolithic class into a modular architecture. The \Twitter::REST::Client\ now includes the \Twitter::REST::API\ module, which aggregates distinct feature modules such as \AccountActivity\, \DirectMessages\, \Favorites\, \FriendsAndFollowers\, \Lists\, \OAuth\, \PlacesAndGeo\, \PremiumSearch\, and others. This change organizes the API surface into separate files (e.g., \lib/twitter/rest/account\_activity.rb\, \lib/twitter/rest/direct\_messages.rb\) while maintaining the same public interface for users interacting with the client.
lib/twitter/rest · high confidence
Behavioural changes
Added setup and console scripts; removed legacy twitter binary
The project now includes bin/setup to install dependencies via Bundler and bin/console to launch an IRB session with the gem loaded, facilitating easier development and experimentation. The previous bin/twitter executable, which served as the legacy command-line interface, has been removed.
bin · high confidence
Introduce dedicated entity classes for hashtags, symbols, URIs, and user mentions
The library now provides specific entity classes (Hashtag, Symbol, URI, UserMention) under the Twitter::Entity namespace to represent tweet components. Hashtag and Symbol entities expose a \text\ attribute containing the content without the leading symbol (\# or $). URI entities now explicitly distinguish between the raw \uri\ and the \expanded\_uri\ via dedicated accessors, while UserMention entities provide \id\, \name\, and \screen\_name\ attributes for mentioned users. This change structures entity data into distinct types rather than generic hashes or strings.
lib/twitter/entity · high confidence
Introduce new Twitter::Streaming::Client with modern HTTP handling
The streaming API client has been rewritten to use the HTTP gem v6 and a custom TCP/SSL connection layer, replacing the previous implementation. This new client supports all standard streaming endpoints (filter, firehose, sample, site, user) and introduces dedicated object types for streaming events, including DeletedTweet, Event, FriendList, and StallWarning. Users can now inject custom TCP/SSL socket classes for advanced connection control, use a before\_request callback, and explicitly close streams. The change also replaces the Addressable library with Ruby's standard URI for query string building and uses the llhttp parser for response parsing.
lib/twitter/streaming · high confidence
Major library restructuring and API modernization
The library has been completely refactored to replace the legacy authentication and request handling with a modern, modular architecture. The old class-based interface using email/password has been removed in favor of a new \Twitter::REST::Client\ and \Twitter::Streaming::Client\ that support OAuth and provide a more consistent, class-like interface. The codebase now explicitly requires many more specific components (such as \cursor\, \entity\, \geo\_factory\, \media\_factory\, and various direct message wrappers) and relies on the standard library \uri\ instead of external gems like \addressable\ or \mash\. This change represents a significant behavioral shift for users, requiring them to update their initialization code to use the new client classes and OAuth credentials rather than the previous simple username/password approach.
lib · high confidence
Project build, linting, and testing toolchain overhaul
The project has replaced the legacy Hoe-based build system with a modern, Bundler-managed workflow. The Rakefile now integrates RuboCop and StandardRB for linting, Minitest for testing, Mutant for mutation testing, and Steep for static type checking. Configuration files have been added for these tools (\.rubocop.yml\, \.standard.yml\, \.mutant.yml\, \.rspec\, \.yardopts\), and the old \setup.rb\ and \Manifest.txt\ files have been removed in favor of a \.gitignore\ and \Steepfile\.
(repo-wide) · high confidence
Removed generated RDoc documentation from version control
The generated RDoc HTML documentation files for the Twitter library classes (including Base, Command, and EasyClassMaker) have been removed from the repository. This change cleans up the version control history by excluding static, auto-generated documentation artifacts, which are no longer tracked in the \doc\ directory.
doc, doc/files · high confidence
Test coverage
Added test fixtures for account activity, media uploads, and direct messages; Expanded test coverage for Twitter API client and data models; New test infrastructure with Minitest and WebMock integration.
Dependencies
Update runtime dependencies and development tooling
The gem's runtime dependencies have been updated to use the HTTP gem version 6.0, simple\_oauth 1.0, and URI 1.1, while development dependencies now include RBS 4, Steep 2, and RuboCop 1.82.1. The project also enforces a minimum Ruby version of 3.3.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 41 → 70 (+28.9)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 100 → 100 (+0.0)
- Architecture 94 → 100 (+5.6)
- Maturity 59 → 61 (+1.5)
- Readiness 32 → 69 (+37.0)
- Security 26 → 77 (+50.7)
Resolved (24)
- Coverage not measured — test suite did not build
- Dimension evaluation failed
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 4 more
New (32)
- Ambiguous distinction between singular and plural methods. Similar to Users, list and lists have identical args signatures, creating confusion about whether to pass a single slug/ID or a collection.
- Ambiguous distinction between singular and plural methods. user and users likely map to single ID lookup vs. multiple ID lookup, but the argument signature args is identical, making it unclear if the caller should pass a single ID or an array, or if the method dispatches based on input type.
- Confusingly similar names for distinct but related resources. direct_message and direct_message_event are likely different API endpoints (legacy DMs vs. DM Events API), but the naming is too close, increasing the risk of calling the wrong method.
- Documentation: no contributor guidance (README.md)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 12 more
Changes since last survey
- 9 commits — 8 feature/other, 1 fixes
By area
- .github/workflows — 4 commits
- (root) — 3 commits
- lib/twitter — 1 commit
- test/test_helper.rb — 1 commit
Notable commits
- fix: Fix query string parsing on Ruby 4.0
- change: Bump ruby/setup-ruby from 1.321.0 to 1.322.0
- change: Bump ruby/setup-ruby from 1.322.0 to 1.323.0
- change: Bump ruby/setup-ruby from 1.323.0 to 1.324.0
- change: Bump rubygems/configure-rubygems-credentials from 2.0.0 to 2.1.0
- change: Drop the base64 dependency
- change: Enable method coverage
- change: Prepare for version 8.3.2 release
- change: Update simple_oauth to version 1.0
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
sferik/twitter-ruby was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 26 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 81050f7f9ff6173824343bd67de0265759810a70 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-7c1cb6328e11.