gazay/gon
59.2
Adequate · 17 November 2026
749
lines of production code
Ruby
with JavaScript
5
measurements over time
What this system is
Features
Added CoffeeScript watch, unwatch, and unwatchAll functions
A new CoffeeScript implementation of the watch module has been added to the application. This introduces \gon.watch\ to monitor variables via AJAX polling or single requests, supporting optional error callbacks. It also provides \gon.unwatch\ to stop monitoring a specific variable's callback and \gon.unwatchAll\ to clear all active timers and reset the watched variables state.
coffee · high confidence
Added JavaScript watch functionality for polling Gon variables
The js/watch.js file introduces a new client-side mechanism to monitor changes to server-side Gon variables via periodic AJAX polling. Users can now call gon.watch() to set up a timer that fetches updated variable values at a specified interval, with support for both success and error callbacks. The module also provides gon.unwatch() to stop a specific watcher and gon.unwatchAll() to clear all active timers, ensuring proper cleanup of background requests.
js · high confidence
Behavioural changes
Add compatibility support for Rails versions prior to 3.2.1
A new compatibility layer for older Rails versions has been introduced in lib/gon/compatibility/old\_rails.rb. This file defines the Gon::ControllerHelpers module, which overrides the gon\_request\_uuid method to use SecureRandom.uuid instead of ActionDispatch::Request\#uuid, ensuring correct functionality on Rails versions below 3.2.1 where the native uuid method is unavailable.
lib/gon/compatibility · high confidence
Gon 8.0.0: Major rewrite with request-scoped storage, CSP support, and AMD compatibility
Gon has been rewritten for version 8.0.0, introducing significant architectural and behavioral changes. The library now uses \ActiveSupport::CurrentAttributes\ (with a \request\_store\ fallback for older Rails) to store data, ensuring variables are strictly scoped to the current request and eliminating thread-safety issues. It adds Content Security Policy (CSP) support via nonce injection in the generated script tags and provides an AMD-compatible version of the \include\_gon\ helper. The API has been updated to support global variables (\Gon::Global\) and watchable variables (\Gon::Watch\) that can be returned via AJAX, while maintaining backward compatibility for Jbuilder and RABL template integration.
lib/gon · high confidence
Introduce RuboCop linting and streamline test execution
The project now includes RuboCop for code style enforcement, configured with a gradual baseline via \.rubocop\_todo.yml\ and targeting Ruby 2.2. Test execution is simplified by adding a \.rspec\ file to automatically require the spec helper and updating the Rakefile to run RSpec specs as the default task.
(repo-wide) · high confidence
Jbuilder templates can now use Rails URL helpers
The Jbuilder parser now includes Rails URL helpers (such as \user\_path\ or \root\_url\) in the evaluation context of Jbuilder templates. This allows developers to generate URLs directly within their \.jbuilder\ views without needing to pass them explicitly as locals or access the controller indirectly, aligning Jbuilder behavior more closely with standard view templates.
lib/gon/jbuilder · high confidence
Refactored Gon into a modular class-based architecture with new integration features
The Gon library has been significantly refactored from a module-based structure into a class-based architecture, introducing dedicated modules for global variables (Gon::Global), request environment handling (Gon::EnvFinder), and variable watching (Gon::Watch). This change introduces new public APIs including \Gon.global\, \Gon.watch\, and a \push\ method for bulk variable assignment, while also adding native support for Jbuilder and RABL template handlers. The refactoring replaces the previous \Rails.cache\ storage mechanism with a request-scoped storage approach using \Gon::Current\ and \Gon::Request\, ensuring thread-safety and preventing variable leakage between requests, and includes compatibility shims for older Rails versions.
lib · high confidence
Refactored Gon rendering engine with new configuration options
The core rendering logic in lib/gon/base.rb has been rewritten to support a comprehensive set of configuration options, including AMD module compatibility, Content Security Policy (CSP) nonce injection, and global variable namespacing. Users can now control script tag attributes (type, cdata), enable automatic camelization of hash keys with configurable depth, and utilize a new 'watch' feature to automatically include dynamically added variables. The change also introduces a keys cache for improved performance and ensures thread safety by replacing Thread.current with RequestStore.
gon · high confidence
Test coverage
Added comprehensive test suite for Gon core, helpers, and integrations; Added test fixtures for jbuilder and rabl template rendering; Standardize test environment with spec\_helper.rb.
Dependencies
Update gem dependencies and lock vulnerable versions
The gemspec now explicitly declares runtime dependencies on actionpack, activesupport, i18n, and multi\_json, while moving jbuilder, pry, and other tools to development dependencies. The Gemfile has been updated to use HTTPS for the source and adds conditional constraints for concurrent-ruby, i18n, loofah, and oj based on Ruby and Rails versions to ensure compatibility. Notably, loofah is pinned to version 2.20.0 for Ruby versions below 2.5 to address security concerns, and oj is restricted to specific versions for older Ruby releases.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 61.7 → 59.2 (-2.5)
- Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 75.7 → 73.1 (-2.6)
- Architecture 69.0 → 69.0 (0.0)
- Maturity 47.5 → 42.9 (-4.6)
- Readiness 77.6 → 77.6 (0.0)
- Security 98.3 → 98.3 (0.0)
Resolved (1)
- Medium CVE: [GHSA redacted] (Gemfile)
New (4)
- Edited copy of a member (12 corresponding lines) (lib/gon/jbuilder.rb)
- Low coverage: lib/gon/compatibility/old_rails.rb (lib/gon/compatibility/old_rails.rb)
- Low coverage: lib/gon/current.rb (lib/gon/current.rb)
- Medium CVE: [GHSA redacted] (Gemfile)
Architecture
- Unchanged — 0 containers · 1 contexts · 0 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
gazay/gon 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 17 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 609da10a73143981a7aa11f5cf7a03f46509063f — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.85+preprod-eba6548ac50f.