persey 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/lib/persey/builder.rb +1 -1
- data/lib/persey/version.rb +1 -1
- data/test/lib/persey_test.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c452b231ea5687d4a3e655cda07171445ceeac98
|
4
|
+
data.tar.gz: cb8fa6a1298b11b67dd17abb8d28e73370eb07b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b0d716b41f2782f1dd95bbc8529b65e4c943c5b5d830461997001235e91ab5f50b62ec0373d4000fd3eea75acf1b4d568eb4f4d6b37ae9932e347dd83b22934
|
7
|
+
data.tar.gz: eff169c18ce5442cdb37ac4525a20dfdce1c1e2725fcc6652c06e7576f2b91ad6b24733674f9bc5764cac5dddaa8155d16e29fb7443c93d542823abab3bafbee
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
## Summary
|
5
5
|
|
6
|
-
Persey help you easily manage the configuration, depending on the environment.
|
6
|
+
Persey help you easily manage the configuration, depending on the environment.
|
7
7
|
The main objective is to provide opportunities to reuse the
|
8
8
|
configuration provided by the project, as the default configuration.
|
9
9
|
|
@@ -11,12 +11,12 @@ configuration provided by the project, as the default configuration.
|
|
11
11
|
|
12
12
|
For the occurrence of the gem was a few prerequisites.
|
13
13
|
|
14
|
-
* Work on opensource projects that support the relevance of problem configurations, changing the appearance of new versions and functionality.
|
15
|
-
* Use in the project configuration, diversity in different files, and the inability to unite all in one configuration
|
14
|
+
* Work on opensource projects that support the relevance of problem configurations, changing the appearance of new versions and functionality.
|
15
|
+
* Use in the project configuration, diversity in different files, and the inability to unite all in one configuration
|
16
16
|
* Desire to use sensitive data as easily as those that can be safely stored in the repository.
|
17
|
-
* Sometimes configuration happens in a variety of formats: yaml, json, ini
|
17
|
+
* Sometimes configuration happens in a variety of formats: yaml, json, ini
|
18
18
|
|
19
|
-
I do not want to engage in writing parsers, I want to work fine :)
|
19
|
+
I do not want to engage in writing parsers, I want to work fine :)
|
20
20
|
|
21
21
|
This solution allows to **accumulate** different configs in one, with the **possibility of reusability** of configuration options and **simple override**. It uses an **intuitive DSL**.
|
22
22
|
|
@@ -25,7 +25,7 @@ This solution allows to **accumulate** different configs in one, with the **poss
|
|
25
25
|
Add this to your `Gemfile`:
|
26
26
|
|
27
27
|
``` ruby
|
28
|
-
gem "persey", '>= 0.0.
|
28
|
+
gem "persey", '>= 0.0.8'
|
29
29
|
```
|
30
30
|
|
31
31
|
Generate default config file
|
@@ -90,9 +90,9 @@ Persey.init Rails.env do # set current environment
|
|
90
90
|
# and now we use configs for our options, which are not declared in any config
|
91
91
|
uri -> { "#{protocol}://#{domain}:#{port}" }
|
92
92
|
end
|
93
|
-
|
93
|
+
|
94
94
|
site_uri -> { web.uri } # we can re-re-use different options
|
95
|
-
|
95
|
+
|
96
96
|
email do
|
97
97
|
pop do
|
98
98
|
address 'pop.example.com'
|
@@ -135,7 +135,7 @@ module AppName
|
|
135
135
|
def self.config
|
136
136
|
Persey.config
|
137
137
|
end
|
138
|
-
|
138
|
+
|
139
139
|
class Application < Rails::Application
|
140
140
|
# ...
|
141
141
|
end
|
data/lib/persey/builder.rb
CHANGED
data/lib/persey/version.rb
CHANGED
data/test/lib/persey_test.rb
CHANGED
@@ -20,6 +20,10 @@ class PerseyTest < TestCase
|
|
20
20
|
first "first value"
|
21
21
|
second "second value"
|
22
22
|
end
|
23
|
+
|
24
|
+
first do
|
25
|
+
testss -> { second }
|
26
|
+
end
|
23
27
|
end
|
24
28
|
end
|
25
29
|
end
|
@@ -31,6 +35,9 @@ class PerseyTest < TestCase
|
|
31
35
|
def test_correct_config
|
32
36
|
@config = Persey.config
|
33
37
|
assert { @config.option.first == "first value" }
|
38
|
+
assert { @config.first.testss == "foo value" }
|
39
|
+
assert { @config.first.second == "foo value" }
|
40
|
+
assert { @config.namespace.another_key == "another key value" }
|
34
41
|
assert { @config.namespace.another_key == "another key value" }
|
35
42
|
assert { @config.key == "key value" }
|
36
43
|
assert { @config.json_config.owner.name == "John Doe" }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: persey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Kumanyaev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
137
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.0.
|
138
|
+
rubygems_version: 2.0.14
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: Helps you easily manage environment specific settings
|