Skip to content

Commit fe6bd31

Browse files
author
Daniel Rinehart
committed
rename gem to flagsmith and update documentation and code to reference new name
1 parent 2d6fb90 commit fe6bd31

File tree

11 files changed

+176
-190
lines changed

11 files changed

+176
-190
lines changed

.rubocop.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
inherit_from: .rubocop_todo.yml
2+
23
Layout/HashAlignment:
34
AllowMultipleStyles: true
45
EnforcedColonStyle: separator
5-
6+
AllCops:
7+
NewCops: enable
8+
SuggestExtensions: false

.rubocop_todo.yml

Lines changed: 14 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,30 @@
11
# This configuration was generated by
2-
# `rubocop --auto-gen-config`
3-
# on 2020-01-16 04:57:18 -1000 using RuboCop version 0.79.0.
2+
# `rubocop --auto-gen-config --auto-gen-only-exclude`
3+
# on 2020-12-30 22:56:14 UTC using RuboCop version 1.7.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 3
10-
# Cop supports --auto-correct.
11-
# Configuration parameters: EnforcedStyle, IndentationWidth.
12-
# SupportedStyles: special_inside_parentheses, consistent, align_braces
13-
Layout/FirstHashElementIndentation:
14-
Exclude:
15-
- 'lib/bullet_train.rb'
16-
- 'spec/bullet_train_spec.rb'
17-
18-
# Offense count: 8
19-
# Cop supports --auto-correct.
20-
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
21-
# SupportedHashRocketStyles: key, separator, table
22-
# SupportedColonStyles: key, separator, table
23-
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
24-
Layout/HashAlignment:
25-
Exclude:
26-
- 'lib/bullet_train.rb'
27-
- 'spec/bullet_train_spec.rb'
28-
29-
# Offense count: 2
30-
# Cop supports --auto-correct.
31-
Layout/SpaceAroundKeyword:
32-
Exclude:
33-
- 'spec/bullet_train_spec.rb'
34-
35-
# Offense count: 1
36-
# Cop supports --auto-correct.
37-
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
38-
# SupportedStyles: space, no_space
39-
# SupportedStylesForEmptyBraces: space, no_space
40-
Layout/SpaceInsideBlockBraces:
41-
Exclude:
42-
- 'Gemfile'
43-
44-
# Offense count: 1
45-
# Cop supports --auto-correct.
46-
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
47-
Lint/UnusedBlockArgument:
48-
Exclude:
49-
- 'Gemfile'
50-
519
# Offense count: 1
52-
# Configuration parameters: CountComments, ExcludedMethods.
53-
# ExcludedMethods: refine
10+
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
11+
# IgnoredMethods: refine
5412
Metrics/BlockLength:
55-
Max: 111
56-
57-
# Offense count: 1
58-
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
59-
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
60-
Naming/FileName:
61-
Exclude:
62-
- 'lib/bullet-train.rb'
63-
64-
# Offense count: 3
65-
# Cop supports --auto-correct.
66-
# Configuration parameters: EnforcedStyle.
67-
# SupportedStyles: always, never
68-
Style/FrozenStringLiteralComment:
6913
Exclude:
70-
- 'Gemfile'
71-
- 'Rakefile'
72-
- 'bullet-train-ruby.gemspec'
14+
- '**/*.gemspec'
15+
- 'spec/flagsmith_spec.rb'
7316

7417
# Offense count: 1
75-
# Cop supports --auto-correct.
76-
# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
77-
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
78-
Style/HashSyntax:
18+
# Configuration parameters: AllowedMethods.
19+
# AllowedMethods: respond_to_missing?
20+
Style/OptionalBooleanParameter:
7921
Exclude:
80-
- 'Rakefile'
22+
- 'lib/flagsmith.rb'
8123

82-
# Offense count: 13
83-
# Cop supports --auto-correct.
84-
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
85-
# SupportedStyles: single_quotes, double_quotes
86-
Style/StringLiterals:
87-
Exclude:
88-
- 'Gemfile'
89-
- 'Rakefile'
90-
- 'bullet-train-ruby.gemspec'
91-
92-
# Offense count: 11
24+
# Offense count: 1
9325
# Cop supports --auto-correct.
94-
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
26+
# Configuration parameters: AutoCorrect, Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
9527
# URISchemes: http, https
9628
Layout/LineLength:
97-
Max: 188
29+
Exclude:
30+
- 'flagsmith.gemspec'

Gemfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
source "https://rubygems.org"
1+
# frozen_string_literal: true
22

3-
git_source(:github) {|repo_name| "https://github.com/SolidStateGroup/bullet-train-ruby-client" }
3+
source 'https://rubygems.org'
44

5-
# Specify your gem's dependencies in bullet-train-ruby.gemspec
5+
git_source(:github) { |_repo_name| 'https://github.com/Flagsmith/flagsmith-ruby-client' }
6+
7+
# Specify your gem's dependencies in flagsmith.gemspec
68
gemspec

Gemfile.lock

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
PATH
2+
remote: .
3+
specs:
4+
flagsmith (2.0.0)
5+
faraday
6+
faraday_middleware
7+
8+
GEM
9+
remote: https://rubygems.org/
10+
specs:
11+
ast (2.4.1)
12+
diff-lcs (1.4.4)
13+
faraday (1.2.0)
14+
multipart-post (>= 1.2, < 3)
15+
ruby2_keywords
16+
faraday_middleware (1.0.0)
17+
faraday (~> 1.0)
18+
gem-release (2.2.0)
19+
multipart-post (2.1.1)
20+
parallel (1.20.1)
21+
parser (3.0.0.0)
22+
ast (~> 2.4.1)
23+
rainbow (3.0.0)
24+
rake (13.0.3)
25+
regexp_parser (2.0.3)
26+
rexml (3.2.4)
27+
rspec (3.10.0)
28+
rspec-core (~> 3.10.0)
29+
rspec-expectations (~> 3.10.0)
30+
rspec-mocks (~> 3.10.0)
31+
rspec-core (3.10.1)
32+
rspec-support (~> 3.10.0)
33+
rspec-expectations (3.10.1)
34+
diff-lcs (>= 1.2.0, < 2.0)
35+
rspec-support (~> 3.10.0)
36+
rspec-mocks (3.10.1)
37+
diff-lcs (>= 1.2.0, < 2.0)
38+
rspec-support (~> 3.10.0)
39+
rspec-support (3.10.1)
40+
rubocop (1.7.0)
41+
parallel (~> 1.10)
42+
parser (>= 2.7.1.5)
43+
rainbow (>= 2.2.2, < 4.0)
44+
regexp_parser (>= 1.8, < 3.0)
45+
rexml
46+
rubocop-ast (>= 1.2.0, < 2.0)
47+
ruby-progressbar (~> 1.7)
48+
unicode-display_width (>= 1.4.0, < 2.0)
49+
rubocop-ast (1.3.0)
50+
parser (>= 2.7.1.5)
51+
ruby-progressbar (1.10.1)
52+
ruby2_keywords (0.0.2)
53+
unicode-display_width (1.7.0)
54+
55+
PLATFORMS
56+
ruby
57+
58+
DEPENDENCIES
59+
bundler
60+
flagsmith!
61+
gem-release
62+
rake
63+
rspec
64+
rubocop
65+
66+
BUNDLED WITH
67+
1.17.2

README.md

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
<img width="100%" src="https://raw.githubusercontent.com/SolidStateGroup/bullet-train-frontend/master/hero.png"/>
1+
<img width="100%" src="https://raw.githubusercontent.com/Flagsmith/flagsmith-frontend/master/hero.png"/>
22

3-
# Bullet Train Client
4-
The SDK clients for Ruby [https://bullet-train.io/](https://www.bullet-train.io/). Bullet Train allows you to manage feature flags and remote config across multiple projects, environments and organisations.
3+
# Flagsmith Client
4+
5+
The SDK clients for Ruby [https://flagsmith.com/](https://www.flagsmith.com/). Flagsmith allows you to manage feature flags and remote config across multiple projects, environments and organizations.
56

67
## Getting Started
78

@@ -10,53 +11,56 @@ These instructions will get you a copy of the project up and running on your loc
1011
## Installing
1112

1213
### VIA gem
13-
```gem install bullet-train-client```
14+
15+
`gem install flagsmith`
1416

1517
## Usage
18+
1619
**Retrieving feature flags for your project**
1720

18-
**For full documentation visit [https://docs.bullet-train.io](https://docs.bullet-train.io)**
21+
**For full documentation visit [https://docs.flagsmith.com/](https://docs.flagsmith.com/)**
22+
1923
```ruby
20-
require "bullet-train-ruby-client"
24+
require "flagsmith"
2125

22-
bt = BulletTrain.new("<<Your API KEY>>")
26+
flagsmith = Flagsmith.new("<<Your API KEY>>")
2327

24-
if bt.get_value("font_size")
28+
if flagsmith.get_value("font_size")
2529
# Do something awesome with the font size
2630
end
2731

28-
if bt.feature_enabled?("does_not_exist")
32+
if flagsmith.feature_enabled?("does_not_exist")
2933
#do something
3034
else
3135
#do nothing, or something else
3236
end
3337

3438
```
39+
3540
**Available Options**
3641

37-
| Property | Description | Required | Default Value |
38-
| ------------- |:-------------:| -----:| -----:|
39-
| ```api_key``` | Defines which project environment you wish to get flags for. *example ACME Project - Staging.* | **YES** | null
40-
| ```url``` | Use this property to define where you're getting feature flags from, e.g. if you're self hosting. | **NO** | https://bullet-train-api.dokku1.solidstategroup.com/api/v1/
42+
| Property | Description | Required | Default Value | Environment Key |
43+
| --------- | :-----------------------------------------------------------------------------------------------: | -------: | --------------------------------: | ----------------: |
44+
| `api_key` | Defines which project environment you wish to get flags for. _example ACME Project - Staging._ | **YES** | null | FLAGSMITH_API_KEY |
45+
| `url` | Use this property to define where you're getting feature flags from, e.g. if you're self hosting. | **NO** | https://api.flagsmith.com/api/v1/ | FLAGSMITH_URL |
4146

4247
**Available Functions**
4348

44-
| Property | Description |
45-
| ------------- |:-------------:|
46-
| ```init``` | Initialise the sdk against a particular environment
47-
| ```feature_enabled?(key)``` | Get the value of a particular feature e.g. ```bulletTrain.feature_enabled?("powerUserFeature") // true```
48-
| ```feature_enabled?(key, user_id, default = false)``` | Get the value of a particular feature for a user e.g. ```bulletTrain.feature_enabled?("powerUserFeature", 1234) // true```
49-
| ```get_value(key)``` | Get the value of a particular feature e.g. ```bulletTrain.get_value("font_size") // 10```
50-
| ```get_value(key, user_id, default = nil)``` | Get the value of a particular feature for a specificed user e.g. ```bulletTrain.get_value("font_size", 1234) // 15```
51-
| ```get_flags()``` | Trigger a manual fetch of the environment features, if a user is identified it will fetch their features
52-
| ```get_flags(user_id)``` | Trigger a manual fetch of the environment features with a given user id
53-
49+
| Property | Description |
50+
| ------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------: |
51+
| `init` | Initialize the sdk against a particular environment |
52+
| `feature_enabled?(key)` | Get the value of a particular feature e.g. `flagsmith.feature_enabled?("powerUserFeature") // true` |
53+
| `feature_enabled?(key, user_id, default = false)` | Get the value of a particular feature for a user e.g. `flagsmith.feature_enabled?("powerUserFeature", 1234) // true` |
54+
| `get_value(key)` | Get the value of a particular feature e.g. `flagsmith.get_value("font_size") // 10` |
55+
| `get_value(key, user_id, default = nil)` | Get the value of a particular feature for a specified user e.g. `flagsmith.get_value("font_size", 1234) // 15` |
56+
| `get_flags()` | Trigger a manual fetch of the environment features, if a user is identified it will fetch their features |
57+
| `get_flags(user_id)` | Trigger a manual fetch of the environment features with a given user id |
58+
| `set_trait(user_id, trait, value)` | Set the value of a trait for the given user id |
5459

55-
**Identifying users**
56-
57-
Identifying users allows you to target specific users from the [Bullet Train dashboard](https://www.bullet-train.io/).
58-
You can include an optional user identifier as part of the `hasFeature` and `getValue` methods to retrieve unique user flags and variables.
60+
**Identifying Users**
5961

62+
Identifying users allows you to target specific users from the [Flagsmith dashboard](https://www.flagsmith.com/).
63+
You can include an optional user identifier as part of the `feature_enabled?` and `get_value` methods to retrieve unique user flags and variables.
6064

6165
## Contributing
6266

@@ -72,10 +76,8 @@ If you have any questions about our projects you can email <a href="mailto:proje
7276

7377
## Useful links
7478

75-
[Website](https://bullet-train.io)
76-
77-
[Documentation](https://docs.bullet-train.io/)
79+
[Website](https://flagsmith.com)
7880

79-
[Code Examples](https://github.com/SolidStateGroup/bullet-train-docs)
81+
[Documentation](https://docs.flagsmith.com/)
8082

81-
[Youtube Tutorials](https://www.youtube.com/channel/UCki7GZrOdZZcsV9rAIRchCw)
83+
[YouTube Tutorials](https://www.youtube.com/channel/UCki7GZrOdZZcsV9rAIRchCw)

Rakefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
require "bundler/gem_tasks"
2-
require "rspec/core/rake_task"
1+
# frozen_string_literal: true
2+
3+
require 'bundler/gem_tasks'
4+
require 'rspec/core/rake_task'
35

46
RSpec::Core::RakeTask.new(:spec)
57

6-
task :default => :spec
8+
task default: :spec

bullet-train-ruby.gemspec

Lines changed: 0 additions & 19 deletions
This file was deleted.

flagsmith.gemspec

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# frozen_string_literal: true
2+
3+
Gem::Specification.new do |spec|
4+
spec.required_ruby_version = '>= 2.4.0'
5+
spec.name = 'flagsmith'
6+
spec.version = '2.0.0'
7+
spec.authors = ['Tom Stuart', 'Brian Moelk']
8+
9+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
10+
11+
spec.summary = 'Flagsmith - Ship features with confidence'
12+
spec.description = 'Ruby Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://flagsmith.com'
13+
spec.homepage = 'https://flagsmith.com'
14+
15+
spec.add_development_dependency 'bundler'
16+
spec.add_development_dependency 'gem-release'
17+
spec.add_development_dependency 'rake'
18+
spec.add_development_dependency 'rspec'
19+
spec.add_development_dependency 'rubocop'
20+
spec.add_dependency 'faraday'
21+
spec.add_dependency 'faraday_middleware'
22+
end

lib/bullet-train.rb

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)