quonfig 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/lib/quonfig/sse_config_client.rb +1 -1
  4. data/lib/quonfig/version.rb +5 -0
  5. data/lib/quonfig.rb +2 -1
  6. data/quonfig.gemspec +30 -165
  7. metadata +28 -183
  8. data/.claude/rules/constitution.md +0 -81
  9. data/.claude/rules/git-safety.md +0 -11
  10. data/.claude/rules/issue-tracking.md +0 -13
  11. data/.claude/rules/testing-workflow.md +0 -28
  12. data/.envrc.sample +0 -3
  13. data/.github/CODEOWNERS +0 -2
  14. data/.github/pull_request_template.md +0 -8
  15. data/.github/workflows/release.yml +0 -49
  16. data/.github/workflows/ruby.yml +0 -60
  17. data/.github/workflows/test.yaml +0 -40
  18. data/.rubocop.yml +0 -13
  19. data/.tool-versions +0 -1
  20. data/CLAUDE.md +0 -29
  21. data/CODEOWNERS +0 -1
  22. data/Gemfile +0 -26
  23. data/Gemfile.lock +0 -177
  24. data/Rakefile +0 -64
  25. data/VERSION +0 -1
  26. data/dev/allocation_stats +0 -60
  27. data/dev/benchmark +0 -40
  28. data/dev/console +0 -12
  29. data/dev/script_setup.rb +0 -18
  30. data/test/fixtures/datafile.json +0 -87
  31. data/test/integration/test_context_precedence.rb +0 -112
  32. data/test/integration/test_datadir_environment.rb +0 -54
  33. data/test/integration/test_dev_overrides.rb +0 -40
  34. data/test/integration/test_enabled.rb +0 -478
  35. data/test/integration/test_enabled_with_contexts.rb +0 -64
  36. data/test/integration/test_get.rb +0 -136
  37. data/test/integration/test_get_feature_flag.rb +0 -28
  38. data/test/integration/test_get_or_raise.rb +0 -60
  39. data/test/integration/test_get_weighted_values.rb +0 -34
  40. data/test/integration/test_helpers.rb +0 -667
  41. data/test/integration/test_helpers_test.rb +0 -73
  42. data/test/integration/test_post.rb +0 -44
  43. data/test/integration/test_telemetry.rb +0 -170
  44. data/test/support/common_helpers.rb +0 -106
  45. data/test/support/mock_base_client.rb +0 -27
  46. data/test/support/mock_config_loader.rb +0 -1
  47. data/test/test_bound_client.rb +0 -109
  48. data/test/test_caching_http_connection.rb +0 -218
  49. data/test/test_client.rb +0 -255
  50. data/test/test_client_network_mode.rb +0 -136
  51. data/test/test_client_telemetry.rb +0 -175
  52. data/test/test_config_loader.rb +0 -70
  53. data/test/test_context.rb +0 -139
  54. data/test/test_context_shape.rb +0 -37
  55. data/test/test_context_shape_aggregator.rb +0 -126
  56. data/test/test_datadir.rb +0 -203
  57. data/test/test_details_getters.rb +0 -242
  58. data/test/test_dev_context.rb +0 -163
  59. data/test/test_duration.rb +0 -37
  60. data/test/test_encryption.rb +0 -16
  61. data/test/test_evaluation_summaries_aggregator.rb +0 -180
  62. data/test/test_evaluator.rb +0 -285
  63. data/test/test_example_contexts_aggregator.rb +0 -119
  64. data/test/test_exponential_backoff.rb +0 -44
  65. data/test/test_fixed_size_hash.rb +0 -119
  66. data/test/test_helper.rb +0 -17
  67. data/test/test_http_connection.rb +0 -81
  68. data/test/test_internal_logger.rb +0 -34
  69. data/test/test_options.rb +0 -198
  70. data/test/test_rate_limit_cache.rb +0 -44
  71. data/test/test_reason.rb +0 -79
  72. data/test/test_rename.rb +0 -65
  73. data/test/test_resolver.rb +0 -291
  74. data/test/test_semantic_logger_filter.rb +0 -144
  75. data/test/test_semver.rb +0 -108
  76. data/test/test_should_log.rb +0 -186
  77. data/test/test_sse_config_client.rb +0 -297
  78. data/test/test_stdlib_formatter.rb +0 -195
  79. data/test/test_telemetry_reporter.rb +0 -209
  80. data/test/test_typed_getters.rb +0 -131
  81. data/test/test_types.rb +0 -141
  82. data/test/test_weighted_value_resolver.rb +0 -84
@@ -1,28 +0,0 @@
1
- ---
2
- description: Testing workflow rules for all code projects
3
- globs: ["app-quonfig/**", "www-quonfig/**", "ai-starter/**", "api-telemetry/**", "api-delivery/**", "sdk-node/**", "sdk-go/**"]
4
- ---
5
-
6
- IMPORTANT: Default to TDD — write the failing test first, run it and confirm it fails (red), then implement until it passes (green). The red→green sequence is the cheapest check that the test is real and that the change actually worked. Paste both the failing and passing output as evidence.
7
-
8
- IMPORTANT: The goal is **verification**, not test volume. If a change genuinely isn't red/green testable in code (UI polish, infra glue, config-only changes, anything where the test rig would be more complex than the fix), pick one:
9
- 1. **Simulated verification** — drive the real flow (browser automation, live HTTP call, dev server) and paste the evidence it worked.
10
- 2. **Block for human** — `bd update <id> --status blocked --add-label needs-human` with a comment explaining what you tried and why verification needs human hands. Do NOT `bd close` — that hides the bead from the human queue.
11
-
12
- Never ship with zero verification. Don't build elaborate test scaffolding when the change doesn't warrant it — the form can flex, the evidence cannot.
13
-
14
- IMPORTANT: Run the relevant test suite before marking a task complete (the file or package you touched, not necessarily the whole repo).
15
-
16
- ## Browser / Chrome DevTools testing (app-quonfig)
17
-
18
- When any task requires browser testing in app-quonfig, ALWAYS read these skills first:
19
- - `/user-test-login` — `.claude/skills/user-test-login/SKILL.md`
20
- - `/user-create-test` — `.claude/skills/user-create-test/SKILL.md`
21
-
22
- Key points so you don't go off-script:
23
- - Test accounts live in `app-quonfig/.dev/test-users.json` (gitignored, alias-keyed)
24
- - The dev-agent login route (`POST /api/dev/login-as`) is the preferred way to sign in headlessly — requires `DEV_AGENT_LOGIN=true` in `.env`
25
- - Use `isolatedContext` in Chrome MCP when you need a clean session that doesn't share cookies
26
- - Avoid `@example.com` emails — that domain triggers SSO via the Test Organization
27
- - Verification codes for new sign-ups come from the WorkOS Events API (see `/user-create-test` for the node snippet)
28
- - If a test requires a user with a specific state (e.g. pending invite, no org), create a fresh account with `/user-create-test` rather than reusing an existing one
data/.envrc.sample DELETED
@@ -1,3 +0,0 @@
1
- export AWS_ACCESS_KEY_ID=
2
- export AWS_SECRET_ACCESS_KEY=
3
- export PREFAB_INTEGRATION_TEST_API_KEY=
data/.github/CODEOWNERS DELETED
@@ -1,2 +0,0 @@
1
- # All changes require review from prefabdevs team
2
- * @prefab-cloud/prefabdevs
@@ -1,8 +0,0 @@
1
- ## Description
2
- *(Brief overview of what this PR changes and/or why the changes are needed)*
3
-
4
- ## Testing & Validation
5
- *(Outline the steps needed to be taken to verify the changes.)*
6
-
7
- ## Rollout
8
- *(Optional section: Provide rollout and rollback procedures, when outside the bounds or requiring additional work beyond standard deployment)*
@@ -1,49 +0,0 @@
1
- ---
2
- name: Push gem
3
-
4
- "on":
5
- workflow_run:
6
- workflows: ["Ruby"]
7
- branches: [main]
8
- types:
9
- - completed
10
-
11
- jobs:
12
- push:
13
- runs-on: ubuntu-latest
14
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
15
-
16
- permissions:
17
- contents: write
18
- id-token: write
19
-
20
- steps:
21
- - uses: actions/checkout@v4
22
- with:
23
- persist-credentials: false
24
- submodules: recursive
25
-
26
- - name: Set up Ruby
27
- uses: ruby/setup-ruby@v1
28
- with:
29
- bundler-cache: false
30
- ruby-version: '3.3'
31
-
32
- - name: Install runtime dependencies
33
- run: bundle install --without development --jobs 4 --retry 3
34
-
35
- - name: Check if version already exists
36
- id: version-check
37
- run: |
38
- VERSION=$(cat VERSION)
39
- if gem list -r quonfig | grep -q "quonfig ($VERSION)"; then
40
- echo "version-exists=true" >> $GITHUB_OUTPUT
41
- echo "Version $VERSION already exists on RubyGems, skipping publish"
42
- else
43
- echo "version-exists=false" >> $GITHUB_OUTPUT
44
- echo "Version $VERSION not found, proceeding with publish"
45
- fi
46
-
47
- - name: Release gem
48
- if: steps.version-check.outputs.version-exists == 'false'
49
- uses: rubygems/release-gem@v1
@@ -1,60 +0,0 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support
4
- # documentation.
5
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
-
8
- name: Ruby
9
-
10
- on:
11
- push:
12
- branches: [ "main" ]
13
- pull_request:
14
- branches: [ "main" ]
15
-
16
- permissions:
17
- contents: read
18
-
19
- jobs:
20
- test:
21
-
22
- runs-on: ubuntu-latest
23
- strategy:
24
- fail-fast: false
25
- matrix:
26
- ruby-version: ['3.2','3.3','3.4']
27
-
28
- steps:
29
- - name: Checkout sdk-ruby
30
- uses: actions/checkout@v4
31
- with:
32
- submodules: recursive
33
- path: sdk-ruby
34
-
35
- - name: Checkout integration-test-data
36
- uses: actions/checkout@v4
37
- with:
38
- repository: quonfig/integration-test-data
39
- path: integration-test-data
40
- ref: main
41
-
42
- - name: Set up Ruby
43
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
44
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
45
- # uses: ruby/setup-ruby@v1
46
- # uses: ruby/setup-ruby@2b019609e2b0f1ea1a2bc8ca11cb82ab46ada124
47
- uses: ruby/setup-ruby@v1
48
- with:
49
- ruby-version: ${{ matrix.ruby-version }}
50
- bundler-cache: false # runs 'bundle install' and caches installed gems automatically
51
- working-directory: sdk-ruby
52
- - name: Install dependencies
53
- working-directory: sdk-ruby
54
- run: bundle install --without development --jobs 4 --retry 3
55
- - name: Run tests
56
- working-directory: sdk-ruby
57
- run: bundle exec rake --trace
58
- env:
59
- NOT_A_NUMBER: "abcd"
60
- IS_A_NUMBER: "1234"
@@ -1,40 +0,0 @@
1
- name: Test
2
- on:
3
- push:
4
- branches: [main]
5
- pull_request:
6
-
7
- jobs:
8
- test:
9
- runs-on: ubuntu-latest
10
- strategy:
11
- fail-fast: false
12
- matrix:
13
- ruby-version: ['3.1', '3.2', '3.3']
14
- steps:
15
- - name: Checkout sdk-ruby
16
- uses: actions/checkout@v4
17
- with:
18
- path: sdk-ruby
19
-
20
- - name: Checkout integration-test-data
21
- uses: actions/checkout@v4
22
- with:
23
- repository: quonfig/integration-test-data
24
- path: integration-test-data
25
- ref: main
26
-
27
- - name: Set up Ruby ${{ matrix.ruby-version }}
28
- uses: ruby/setup-ruby@v1
29
- with:
30
- ruby-version: ${{ matrix.ruby-version }}
31
- bundler-cache: true
32
- working-directory: sdk-ruby
33
-
34
- - name: Install dependencies
35
- working-directory: sdk-ruby
36
- run: bundle install
37
-
38
- - name: Run tests
39
- working-directory: sdk-ruby
40
- run: bundle exec rake test
data/.rubocop.yml DELETED
@@ -1,13 +0,0 @@
1
- AllCops:
2
- NewCops: enable
3
- Exclude:
4
- - sdk-reforge.gemspec
5
- - lib/prefab_pb.rb
6
-
7
- Metrics:
8
- Exclude:
9
- - 'test/*.rb'
10
-
11
- Layout/LineLength:
12
- Exclude:
13
- - 'test/*.rb'
data/.tool-versions DELETED
@@ -1 +0,0 @@
1
- ruby 3.2.7
data/CLAUDE.md DELETED
@@ -1,29 +0,0 @@
1
- # Quonfig Ruby SDK
2
-
3
- Ruby SDK for Quonfig feature flags and configuration.
4
-
5
- ## Build & Test
6
-
7
- ```bash
8
- bundle install # install dependencies
9
- bundle exec rake test # run all tests
10
- bundle exec ruby test/test_FOO.rb # run a single test file
11
- bundle exec rake # default task — runs tests
12
- ```
13
-
14
- ## Directory layout
15
-
16
- - `lib/quonfig/` — SDK source code
17
- - `test/` — unit tests (one `test_*.rb` per module)
18
- - `test/integration/` — integration tests driven by shared YAML specs
19
-
20
- Integration tests require the sibling directory `../../integration-test-data/`
21
- to exist (cloned from `quonfig/integration-test-data`). Without it the
22
- integration suite cannot resolve its YAML specs.
23
-
24
- ## Environment variables
25
-
26
- - `QUONFIG_BACKEND_SDK_KEY` — backend SDK key for authenticated config delivery
27
- - `QUONFIG_DIR` — path to a local Quonfig workspace (datadir mode)
28
- - `QUONFIG_ENVIRONMENT` — which environment to evaluate (`production`, `staging`, `development`)
29
- - `QUONFIG_DOMAIN` — base domain used to derive api/sse/telemetry URLs (default `quonfig.com`). Setting `QUONFIG_DOMAIN=quonfig-staging.com` derives `https://primary.quonfig-staging.com`, `https://stream.primary.quonfig-staging.com`, and `https://telemetry.quonfig-staging.com` automatically. Explicit `api_urls:` / `telemetry_url:` kwargs override this.
data/CODEOWNERS DELETED
@@ -1 +0,0 @@
1
- * @prefab-cloud/prefabdevs @prefab-cloud/prefabmaintainers @prefab-cloud/prefabadmins
data/Gemfile DELETED
@@ -1,26 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'concurrent-ruby', '~> 1.0', '>= 1.0.5'
4
- gem 'faraday'
5
- gem 'ld-eventsource'
6
- gem 'uuid'
7
-
8
- gem 'activesupport', '>= 4'
9
-
10
- group :development do
11
- gem 'allocation_stats'
12
- gem 'benchmark-ips'
13
- gem 'bundler'
14
- gem 'juwelier', '~> 2.4.9'
15
- gem 'rdoc'
16
- gem 'simplecov', '>= 0'
17
- end
18
-
19
- group :test do
20
- gem 'semantic_logger', '!= 4.16.0', require: "semantic_logger/sync"
21
- gem 'minitest'
22
- gem 'minitest-focus'
23
- gem 'minitest-reporters'
24
- gem 'timecop'
25
- gem 'webrick'
26
- end
data/Gemfile.lock DELETED
@@ -1,177 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- activesupport (7.1.3.2)
5
- base64
6
- bigdecimal
7
- concurrent-ruby (~> 1.0, >= 1.0.2)
8
- connection_pool (>= 2.2.5)
9
- drb
10
- i18n (>= 1.6, < 2)
11
- minitest (>= 5.1)
12
- mutex_m
13
- tzinfo (~> 2.0)
14
- addressable (2.8.6)
15
- public_suffix (>= 2.0.2, < 6.0)
16
- allocation_stats (0.1.5)
17
- ansi (1.5.0)
18
- base64 (0.2.0)
19
- benchmark-ips (2.13.0)
20
- bigdecimal (3.1.7)
21
- builder (3.2.4)
22
- concurrent-ruby (1.2.3)
23
- connection_pool (2.4.1)
24
- descendants_tracker (0.0.4)
25
- thread_safe (~> 0.3, >= 0.3.1)
26
- docile (1.4.0)
27
- domain_name (0.6.20240107)
28
- drb (2.2.1)
29
- faraday (1.10.3)
30
- faraday-em_http (~> 1.0)
31
- faraday-em_synchrony (~> 1.0)
32
- faraday-excon (~> 1.1)
33
- faraday-httpclient (~> 1.0)
34
- faraday-multipart (~> 1.0)
35
- faraday-net_http (~> 1.0)
36
- faraday-net_http_persistent (~> 1.0)
37
- faraday-patron (~> 1.0)
38
- faraday-rack (~> 1.0)
39
- faraday-retry (~> 1.0)
40
- ruby2_keywords (>= 0.0.4)
41
- faraday-em_http (1.0.0)
42
- faraday-em_synchrony (1.0.0)
43
- faraday-excon (1.1.0)
44
- faraday-httpclient (1.0.1)
45
- faraday-multipart (1.0.4)
46
- multipart-post (~> 2)
47
- faraday-net_http (1.0.1)
48
- faraday-net_http_persistent (1.2.0)
49
- faraday-patron (1.0.0)
50
- faraday-rack (1.0.0)
51
- faraday-retry (1.0.3)
52
- ffi (1.17.4)
53
- ffi-compiler (1.3.2)
54
- ffi (>= 1.15.5)
55
- rake
56
- git (1.19.1)
57
- addressable (~> 2.8)
58
- rchardet (~> 1.8)
59
- github_api (0.19.0)
60
- addressable (~> 2.4)
61
- descendants_tracker (~> 0.0.4)
62
- faraday (>= 0.8, < 2)
63
- hashie (~> 3.5, >= 3.5.2)
64
- oauth2 (~> 1.0)
65
- hashie (3.6.0)
66
- highline (3.0.1)
67
- http (5.2.0)
68
- addressable (~> 2.8)
69
- base64 (~> 0.1)
70
- http-cookie (~> 1.0)
71
- http-form_data (~> 2.2)
72
- llhttp-ffi (~> 0.5.0)
73
- http-cookie (1.0.5)
74
- domain_name (~> 0.5)
75
- http-form_data (2.3.0)
76
- i18n (1.14.4)
77
- concurrent-ruby (~> 1.0)
78
- juwelier (2.4.9)
79
- builder
80
- bundler
81
- git
82
- github_api
83
- highline
84
- kamelcase (~> 0)
85
- nokogiri
86
- psych
87
- rake
88
- rdoc
89
- semver2
90
- jwt (2.8.1)
91
- base64
92
- kamelcase (0.0.2)
93
- semver2 (~> 3)
94
- ld-eventsource (2.2.2)
95
- concurrent-ruby (~> 1.0)
96
- http (>= 4.4.1, < 6.0.0)
97
- llhttp-ffi (0.5.0)
98
- ffi-compiler (~> 1.0)
99
- rake (~> 13.0)
100
- macaddr (1.7.2)
101
- systemu (~> 2.6.5)
102
- mini_portile2 (2.8.9)
103
- minitest (5.22.3)
104
- minitest-focus (1.4.0)
105
- minitest (>= 4, < 6)
106
- minitest-reporters (1.6.1)
107
- ansi
108
- builder
109
- minitest (>= 5.0)
110
- ruby-progressbar
111
- multi_json (1.15.0)
112
- multi_xml (0.6.0)
113
- multipart-post (2.4.0)
114
- mutex_m (0.2.0)
115
- nokogiri (1.18.9)
116
- mini_portile2 (~> 2.8.2)
117
- racc (~> 1.4)
118
- oauth2 (1.4.11)
119
- faraday (>= 0.17.3, < 3.0)
120
- jwt (>= 1.0, < 3.0)
121
- multi_json (~> 1.3)
122
- multi_xml (~> 0.5)
123
- rack (>= 1.2, < 4)
124
- psych (5.1.2)
125
- stringio
126
- public_suffix (5.0.4)
127
- racc (1.8.1)
128
- rack (3.1.18)
129
- rake (13.1.0)
130
- rchardet (1.8.0)
131
- rdoc (6.6.3.1)
132
- psych (>= 4.0.0)
133
- ruby-progressbar (1.13.0)
134
- ruby2_keywords (0.0.5)
135
- semantic_logger (4.15.0)
136
- concurrent-ruby (~> 1.0)
137
- semver2 (3.4.2)
138
- simplecov (0.22.0)
139
- docile (~> 1.1)
140
- simplecov-html (~> 0.11)
141
- simplecov_json_formatter (~> 0.1)
142
- simplecov-html (0.12.3)
143
- simplecov_json_formatter (0.1.4)
144
- stringio (3.1.0)
145
- systemu (2.6.5)
146
- thread_safe (0.3.6)
147
- timecop (0.9.8)
148
- tzinfo (2.0.6)
149
- concurrent-ruby (~> 1.0)
150
- uuid (2.3.9)
151
- macaddr (~> 1.0)
152
- webrick (1.8.2)
153
-
154
- PLATFORMS
155
- ruby
156
-
157
- DEPENDENCIES
158
- activesupport (>= 4)
159
- allocation_stats
160
- benchmark-ips
161
- bundler
162
- concurrent-ruby (~> 1.0, >= 1.0.5)
163
- faraday
164
- juwelier (~> 2.4.9)
165
- ld-eventsource
166
- minitest
167
- minitest-focus
168
- minitest-reporters
169
- rdoc
170
- semantic_logger (!= 4.16.0)
171
- simplecov
172
- timecop
173
- uuid
174
- webrick
175
-
176
- BUNDLED WITH
177
- 2.3.5
data/Rakefile DELETED
@@ -1,64 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rubygems'
4
- require 'bundler'
5
- begin
6
- Bundler.setup(:default, :development)
7
- rescue Bundler::BundlerError => e
8
- warn e.message
9
- warn 'Run `bundle install` to install missing gems'
10
- exit e.status_code
11
- end
12
-
13
- require 'rake'
14
-
15
- require 'rake/testtask'
16
- Rake::TestTask.new(:test) do |test|
17
- test.libs << 'lib' << 'test'
18
- test.pattern = 'test/**/test_*.rb'
19
- test.verbose = true
20
- end
21
-
22
- task default: :test
23
-
24
- unless ENV['CI']
25
- require 'juwelier'
26
- Juwelier::Tasks.new do |gem|
27
- # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
28
- gem.name = 'quonfig'
29
- gem.homepage = 'https://github.com/quonfig/sdk-ruby'
30
- gem.license = 'MIT'
31
- gem.summary = %(Quonfig Ruby SDK)
32
- gem.description = %(Quonfig — feature flags and live config, stored as files in git.)
33
- gem.email = 'jeff@quonfig.com'
34
- gem.authors = ['Jeff Dwyer']
35
-
36
- # dependencies defined in Gemfile
37
- end
38
- Juwelier::RubygemsDotOrgTasks.new
39
-
40
- desc 'Code coverage detail'
41
- task :simplecov do
42
- ENV['COVERAGE'] = 'true'
43
- Rake::Task['test'].execute
44
- end
45
-
46
- require 'rdoc/task'
47
- Rake::RDocTask.new do |rdoc|
48
- version = File.exist?('VERSION') ? File.read('VERSION') : ''
49
-
50
- rdoc.rdoc_dir = 'rdoc'
51
- rdoc.title = "quonfig #{version}"
52
- rdoc.rdoc_files.include('README*')
53
- rdoc.rdoc_files.include('lib/**/*.rb')
54
- end
55
- end
56
-
57
- # Add release task for CI
58
- task :release do
59
- sh 'mkdir -p pkg'
60
- version = File.read('VERSION').strip
61
- gem_file = "pkg/quonfig-#{version}.gem"
62
- sh "gem build quonfig.gemspec --output #{gem_file}"
63
- sh "gem push #{gem_file}"
64
- end
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.10
data/dev/allocation_stats DELETED
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
-
6
- gemspec = Dir.glob(File.expand_path("../../*.gemspec", __FILE__)).first
7
- spec = Gem::Specification.load(gemspec)
8
-
9
- # Add the require paths to the $LOAD_PATH
10
- spec.require_paths.each do |path|
11
- full_path = File.expand_path("../" + path, __dir__)
12
- $LOAD_PATH.unshift(full_path) unless $LOAD_PATH.include?(full_path)
13
- end
14
-
15
- spec.require_paths.each do |path|
16
- require "./lib/reforge-sdk"
17
- end
18
-
19
- require 'reforge-sdk'
20
-
21
- $prefab = Reforge::Client.new(collect_logger_counts: false, collect_evaluation_summaries: false,
22
- context_upload_mode: :none)
23
- $prefab.get('a.live.integer')
24
-
25
- puts '-' * 80
26
-
27
- require 'allocation_stats'
28
-
29
- $runs = 100
30
-
31
- def measure(description)
32
- puts "Measuring #{description}..."
33
- stats = $prefab.with_context(user: { email_suffix: 'yahoo.com' }) do
34
- AllocationStats.trace do
35
- $runs.times do
36
- yield
37
- end
38
- end
39
- end
40
-
41
- allocations = stats.allocations(alias_paths: true).group_by(:sourcefile, :sourceline, :class)
42
-
43
- if ENV['TOP']
44
- puts allocations.sort_by_size.to_text.split("\n").first(20)
45
- end
46
-
47
- puts "Total allocations: #{allocations.all.values.map(&:size).sum}"
48
- puts "Total memory: #{allocations.all.values.flatten.map(&:memsize).sum}"
49
- puts stats.gc_profiler_report
50
- end
51
-
52
- measure "no-JIT context (#{$runs} runs)" do
53
- $prefab.get('a.live.integer')
54
- end
55
-
56
- puts "\n\n"
57
-
58
- measure "with JIT context (#{$runs} runs)" do
59
- $prefab.get('a.live.integer', { a: { b: "c" } })
60
- end
data/dev/benchmark DELETED
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
-
6
- gemspec = Dir.glob(File.expand_path("../../*.gemspec", __FILE__)).first
7
- spec = Gem::Specification.load(gemspec)
8
-
9
- # Add the require paths to the $LOAD_PATH
10
- spec.require_paths.each do |path|
11
- full_path = File.expand_path("../" + path, __dir__)
12
- $LOAD_PATH.unshift(full_path) unless $LOAD_PATH.include?(full_path)
13
- end
14
-
15
- spec.require_paths.each do |path|
16
- require "./lib/reforge-sdk"
17
- end
18
-
19
- require 'reforge-sdk'
20
- require 'benchmark/ips'
21
-
22
- prefab = Reforge::Client.new(collect_logger_counts: false, collect_evaluation_summaries: false,
23
- context_upload_mode: :none)
24
-
25
- prefab.get('prefab.auth.allowed_origins')
26
-
27
- prefab.with_context(user: { email_suffix: 'yahoo.com' }) do
28
- Benchmark.ips do |x|
29
- x.report("noop") do
30
- end
31
-
32
- x.report('prefab.get') do
33
- prefab.get('prefab.auth.allowed_origins')
34
- end
35
-
36
- x.report('prefab.get with jit context') do
37
- prefab.get('prefab.auth.allowed_origins', { a: { b: "c" } })
38
- end
39
- end
40
- end
data/dev/console DELETED
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env bundle exec ruby
2
- # frozen_string_literal: true
3
-
4
- require 'irb'
5
- require_relative "./script_setup"
6
-
7
- if !ENV['REFORGE_LOG_CLIENT_BOOTSTRAP_LOG_LEVEL']
8
- puts "run with REFORGE_LOG_CLIENT_BOOTSTRAP_LOG_LEVEL=debug (or trace) for more output"
9
- end
10
-
11
- # Start an IRB session
12
- IRB.start(__FILE__)
data/dev/script_setup.rb DELETED
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/setup'
4
-
5
- gemspec = Dir.glob(File.expand_path("../../*.gemspec", __FILE__)).first
6
- spec = Gem::Specification.load(gemspec)
7
-
8
- # Add the require paths to the $LOAD_PATH
9
- spec.require_paths.each do |path|
10
- full_path = File.expand_path("../" + path, __dir__)
11
- $LOAD_PATH.unshift(full_path) unless $LOAD_PATH.include?(full_path)
12
- end
13
-
14
- spec.require_paths.each do |path|
15
- require "./lib/quonfig"
16
- end
17
-
18
- SemanticLogger.add_appender(io: $stdout)