flipper 1.3.4 → 1.3.6
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.
- checksums.yaml +4 -4
- data/CLAUDE.md +74 -0
- data/lib/flipper/cloud/configuration.rb +1 -1
- data/lib/flipper/instrumentation/log_subscriber.rb +1 -1
- data/lib/flipper/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f53e9dadf45ea1d00e7abd24358748347d516d761ea347c438057f62fdbc185
|
4
|
+
data.tar.gz: 8c2a73d793d41ce64ed26c559bf532127f73e17e20944930aa6bf14aff355a57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af26df5e8c10540348e2b8dd31f11198dafdc8f3bcb6ef8e5361e3a764caa5a872734c64807746f1d077cfbc95df9143959e4c3446429dce1d5d871e46861fa7
|
7
|
+
data.tar.gz: 2005a736ea665c359154bf85f56495fcf9b326e9ecb740d2e1aca0c52a698367b44334a90ae2b1277c2a3c0dcdddcc478eab3126975f210fc796a454202913f4
|
data/CLAUDE.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# CLAUDE.md
|
2
|
+
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
4
|
+
|
5
|
+
## Development Commands
|
6
|
+
|
7
|
+
### Testing
|
8
|
+
- `bundle exec rake` - Run all tests (RSpec, Minitest, and Rails tests)
|
9
|
+
- `bundle exec rspec` - Run RSpec tests only
|
10
|
+
- `bundle exec rake spec:ui` - Run UI-specific specs
|
11
|
+
- `bundle exec rake test` - Run Minitest tests only
|
12
|
+
- `bundle exec rake test_rails` - Run Rails generator tests
|
13
|
+
- `script/test` - Bootstrap and run tests across multiple Rails versions (5.0-8.0)
|
14
|
+
|
15
|
+
### Development Setup
|
16
|
+
- `script/bootstrap` - Bundle install dependencies and setup binstubs
|
17
|
+
- `script/console` - Start interactive console with Flipper loaded (uses Pry)
|
18
|
+
- `script/server` - Start local UI server on port 9999 for testing web interface
|
19
|
+
|
20
|
+
### Building and Releasing
|
21
|
+
- `bundle exec rake build` - Build all gems into pkg/ directory
|
22
|
+
- `bundle exec rake release` - Tag version, push to remote, and push gems (requires OTP)
|
23
|
+
|
24
|
+
## Architecture Overview
|
25
|
+
|
26
|
+
Flipper is a feature flag library for Ruby with a modular adapter-based architecture:
|
27
|
+
|
28
|
+
### Core Components
|
29
|
+
|
30
|
+
**DSL Layer** (`lib/flipper/dsl.rb`):
|
31
|
+
- Main interface for feature flag operations
|
32
|
+
- Delegates to Feature instances
|
33
|
+
- Handles memoization and instrumentation
|
34
|
+
- Thread-safe instance management
|
35
|
+
|
36
|
+
**Feature** (`lib/flipper/feature.rb`):
|
37
|
+
- Represents individual feature flags
|
38
|
+
- Manages enable/disable operations through gates
|
39
|
+
- Handles instrumentation events
|
40
|
+
- Works with adapters for persistence
|
41
|
+
|
42
|
+
**Adapters** (`lib/flipper/adapters/`):
|
43
|
+
- Pluggable storage backends (Redis, ActiveRecord, Memory, etc.)
|
44
|
+
- Common interface for all storage implementations
|
45
|
+
- Support for caching, failover, and synchronization patterns
|
46
|
+
|
47
|
+
**Gates** (`lib/flipper/gates/`):
|
48
|
+
- Different targeting mechanisms:
|
49
|
+
- Boolean (on/off for everyone)
|
50
|
+
- Actor (specific users/entities)
|
51
|
+
- Group (predefined user groups)
|
52
|
+
- Percentage of Actors (rollout to X% of users)
|
53
|
+
- Percentage of Time (probabilistic enabling)
|
54
|
+
- Expression (complex conditional logic)
|
55
|
+
|
56
|
+
### Multi-Gem Structure
|
57
|
+
|
58
|
+
The project is structured as multiple gems:
|
59
|
+
- `flipper` - Core library
|
60
|
+
- `flipper-ui` - Web interface
|
61
|
+
- `flipper-api` - REST API
|
62
|
+
- `flipper-cloud` - Cloud service integration
|
63
|
+
- `flipper-*` - Various adapter gems (redis, active_record, mongo, etc.)
|
64
|
+
|
65
|
+
### Key Patterns
|
66
|
+
|
67
|
+
**Configuration**: Global configuration through `Flipper.configure` with per-thread instances
|
68
|
+
**Instrumentation**: Built-in event system for monitoring and debugging
|
69
|
+
**Memoization**: Automatic caching of feature checks within request/thread scope
|
70
|
+
**Type Safety**: Strong typing system for actors, percentages, and other values
|
71
|
+
|
72
|
+
### Testing
|
73
|
+
|
74
|
+
Uses both RSpec (currently preferred for new tests) and Minitest. Shared adapter specs ensure consistency across all storage backends. Extensive testing across multiple Rails versions (5.0-8.0).
|
@@ -245,7 +245,7 @@ module Flipper
|
|
245
245
|
if required
|
246
246
|
option_value = send(name)
|
247
247
|
if option_value.nil? || option_value.empty?
|
248
|
-
message = "Flipper::Cloud #{name} is missing. Please "
|
248
|
+
message = String.new("Flipper::Cloud #{name} is missing. Please ")
|
249
249
|
message << "set #{env_var} or " if from_env
|
250
250
|
message << "provide #{name} (e.g. Flipper::Cloud.new(#{name}: value))."
|
251
251
|
raise ArgumentError, message
|
@@ -56,7 +56,7 @@ module Flipper
|
|
56
56
|
operation = event.payload[:operation]
|
57
57
|
result = event.payload[:result]
|
58
58
|
|
59
|
-
description = 'Flipper '
|
59
|
+
description = String.new('Flipper ')
|
60
60
|
description << "feature(#{feature_name}) " unless feature_name.nil?
|
61
61
|
description << "adapter(#{adapter_name}) "
|
62
62
|
description << "#{operation} "
|
data/lib/flipper/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: concurrent-ruby
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- ".github/workflows/ci.yml"
|
36
36
|
- ".github/workflows/examples.yml"
|
37
37
|
- ".rspec"
|
38
|
+
- CLAUDE.md
|
38
39
|
- CODE_OF_CONDUCT.md
|
39
40
|
- Changelog.md
|
40
41
|
- Dockerfile
|
@@ -314,7 +315,7 @@ metadata:
|
|
314
315
|
homepage_uri: https://www.flippercloud.io
|
315
316
|
source_code_uri: https://github.com/flippercloud/flipper
|
316
317
|
bug_tracker_uri: https://github.com/flippercloud/flipper/issues
|
317
|
-
changelog_uri: https://github.com/flippercloud/flipper/releases/tag/v1.3.
|
318
|
+
changelog_uri: https://github.com/flippercloud/flipper/releases/tag/v1.3.6
|
318
319
|
funding_uri: https://github.com/sponsors/flippercloud
|
319
320
|
rdoc_options: []
|
320
321
|
require_paths:
|
@@ -330,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
330
331
|
- !ruby/object:Gem::Version
|
331
332
|
version: '0'
|
332
333
|
requirements: []
|
333
|
-
rubygems_version: 3.6.
|
334
|
+
rubygems_version: 3.6.9
|
334
335
|
specification_version: 4
|
335
336
|
summary: Beautiful, performant feature flags for Ruby and Rails.
|
336
337
|
test_files:
|