flagstack 0.1.0

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.
@@ -0,0 +1,27 @@
1
+ require "rails/generators"
2
+
3
+ module Flagstack
4
+ module Generators
5
+ class InstallGenerator < Rails::Generators::Base
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ desc "Creates a Flagstack initializer"
9
+
10
+ def create_initializer
11
+ template "flagstack.rb.tt", "config/initializers/flagstack.rb"
12
+ end
13
+
14
+ def show_instructions
15
+ say ""
16
+ say "Flagstack installed!", :green
17
+ say ""
18
+ say "Next steps:"
19
+ say " 1. Get your API token from https://flagstack.io"
20
+ say " 2. Add to your environment: FLAGSTACK_TOKEN=fs_dev_xxxxx"
21
+ say " 3. Check flags: Flipper.enabled?(:my_feature)"
22
+ say " 4. With users: Flipper.enabled?(:my_feature, current_user)"
23
+ say ""
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,31 @@
1
+ # Flagstack syncs feature flags from your Flagstack account to a local Flipper adapter.
2
+ # After configuration, use standard Flipper methods: Flipper.enabled?(:feature)
3
+
4
+ Flagstack.configure do |config|
5
+ # Your API token from https://flagstack.io
6
+ # Tokens are environment-specific:
7
+ # fs_live_xxx -> Production
8
+ # fs_test_xxx -> Staging
9
+ # fs_dev_xxx -> Development
10
+ # fs_personal_xxx -> Your personal environment
11
+ config.token = ENV["FLAGSTACK_TOKEN"]
12
+
13
+ # Flagstack server URL (default: https://flagstack.io)
14
+ # config.url = ENV.fetch("FLAGSTACK_URL", "https://flagstack.io")
15
+
16
+ # How often to sync flags in seconds (default: 10, minimum: 10)
17
+ # config.sync_interval = 10
18
+
19
+ # Sync method: :poll (background thread) or :manual
20
+ # config.sync_method = :poll
21
+
22
+ # HTTP timeouts in seconds
23
+ # config.read_timeout = 5
24
+ # config.open_timeout = 2
25
+
26
+ # Local adapter (auto-detected if flipper-active_record is present)
27
+ # config.local_adapter = Flipper::Adapters::ActiveRecord.new
28
+
29
+ # Logging
30
+ # config.logger = Rails.logger
31
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flagstack
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Flagstack
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: flipper
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: logger
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.4'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.4'
40
+ description: Ruby client for Flagstack feature flag management. Syncs flags to local
41
+ Flipper adapter for fast reads and offline resilience.
42
+ email:
43
+ - hello@flagstack.io
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - LICENSE.txt
49
+ - README.md
50
+ - lib/flagstack.rb
51
+ - lib/flagstack/client.rb
52
+ - lib/flagstack/configuration.rb
53
+ - lib/flagstack/poller.rb
54
+ - lib/flagstack/railtie.rb
55
+ - lib/flagstack/synchronizer.rb
56
+ - lib/flagstack/telemetry.rb
57
+ - lib/flagstack/telemetry/metric.rb
58
+ - lib/flagstack/telemetry/metric_storage.rb
59
+ - lib/flagstack/telemetry/submitter.rb
60
+ - lib/flagstack/version.rb
61
+ - lib/generators/flagstack/install_generator.rb
62
+ - lib/generators/flagstack/templates/flagstack.rb.tt
63
+ homepage: https://flagstack.io
64
+ licenses:
65
+ - MIT
66
+ metadata:
67
+ homepage_uri: https://flagstack.io
68
+ source_code_uri: https://github.com/flagstack-dev/flagstack-ruby
69
+ changelog_uri: https://github.com/flagstack-dev/flagstack-ruby/blob/main/CHANGELOG.md
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: 3.0.0
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubygems_version: 3.7.2
85
+ specification_version: 4
86
+ summary: Feature flag client for Flagstack
87
+ test_files: []