flagship 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +6 -5
- data/CHANGELOG.md +6 -0
- data/flagship.gemspec +1 -1
- data/lib/flagship/context.rb +21 -13
- data/lib/flagship/version.rb +1 -1
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 60210addd43057e1808189582ab298a84f14bb70468c1685e676ceb5481a7a8a
|
4
|
+
data.tar.gz: 4f85d9c988e71f2d219938310990757869269cf31e84706e093640f0e07b1326
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43dd867d1d2a6de1433833709fdd9c251ee095fd088a0d4f024fc802d966067f24c80a4d0615202892663014c03f22ba295dacc4c55610982ed2d5f4316a3c9f
|
7
|
+
data.tar.gz: 45152c852249cfa8692da6c234f1d6f246ab30c1111c7458436ea8a99ab792077a0af4608570954bf9a4ea4ab2aff859a09e5067453d0867552acf68b7fc15e2
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/flagship.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
-
spec.add_development_dependency "bundler", "
|
24
|
+
spec.add_development_dependency "bundler", "> 1.13"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
26
|
spec.add_development_dependency "rspec", "~> 3.5.0"
|
27
27
|
end
|
data/lib/flagship/context.rb
CHANGED
@@ -1,18 +1,16 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
1
3
|
class Flagship::Context
|
2
4
|
extend Forwardable
|
3
|
-
def_delegators
|
4
|
-
|
5
|
-
def initialize
|
6
|
-
@values = {}
|
7
|
-
end
|
5
|
+
def_delegators :current_values, :clear
|
8
6
|
|
9
7
|
def __set(key, value)
|
10
|
-
|
8
|
+
current_values[key.to_sym] = value
|
11
9
|
end
|
12
10
|
|
13
11
|
def method_missing(name, args = [], &block)
|
14
|
-
if
|
15
|
-
value =
|
12
|
+
if current_values.key?(name)
|
13
|
+
value = current_values[name]
|
16
14
|
|
17
15
|
if value.respond_to?(:call)
|
18
16
|
value.call
|
@@ -25,14 +23,24 @@ class Flagship::Context
|
|
25
23
|
end
|
26
24
|
|
27
25
|
def respond_to_missing?(name, include_private = false)
|
28
|
-
|
26
|
+
current_values.key?(name) or super
|
29
27
|
end
|
30
28
|
|
31
|
-
def with_values(
|
32
|
-
original_values =
|
33
|
-
|
29
|
+
def with_values(new_values, &block)
|
30
|
+
original_values = current_values
|
31
|
+
self.current_values = current_values.dup.merge(new_values)
|
34
32
|
block.call
|
35
33
|
ensure
|
36
|
-
|
34
|
+
self.current_values = original_values
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def current_values
|
40
|
+
Thread.current[:__flagship_context_values] ||= {}
|
41
|
+
end
|
42
|
+
|
43
|
+
def current_values=(new_values)
|
44
|
+
Thread.current[:__flagship_context_values] = new_values
|
37
45
|
end
|
38
46
|
end
|
data/lib/flagship/version.rb
CHANGED
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flagship
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuya Takeyama
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.13'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.13'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -82,7 +82,7 @@ homepage: https://github.com/yuya-takeyama/flagship
|
|
82
82
|
licenses:
|
83
83
|
- MIT
|
84
84
|
metadata: {}
|
85
|
-
post_install_message:
|
85
|
+
post_install_message:
|
86
86
|
rdoc_options: []
|
87
87
|
require_paths:
|
88
88
|
- lib
|
@@ -97,9 +97,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
|
-
|
101
|
-
|
102
|
-
signing_key:
|
100
|
+
rubygems_version: 3.1.2
|
101
|
+
signing_key:
|
103
102
|
specification_version: 4
|
104
103
|
summary: Ship/unship features using flags defined with declarative DSL
|
105
104
|
test_files: []
|