settei 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d7db95b9bd55c016fd36a30e28f42d6c360fadf
4
- data.tar.gz: 6a6638dc0f1403b4070bdfde0ec9194f52683f44
3
+ metadata.gz: 420fd42e68113f4e584bd112c0fcf0614d5f9622
4
+ data.tar.gz: e3fb141eca64df590927a41d97ce581832ec697f
5
5
  SHA512:
6
- metadata.gz: 6a052e47b595948163a00b02a1138b09124acbff2d3fce28cf5882d5f6e2761899ff8c9cd065623e26186a0abb72e0e12073e06af66698dcf6cc473ec9f927e6
7
- data.tar.gz: '094233cf0983684d86bf189e1b4a18119335356a992e5a4d7859d93da4bf1bed70bf6f9608257809fc8a00f812323df06e9dd131d98bc2289271eabc1e4dab41'
6
+ metadata.gz: '083334231d67b72fbfb8fada4b0212e58d709bf4b94ff8c679e09342d9a96fbc83fc38378edebcc7a61d928f6c632ac22df0b7e0d571c7f25c2846810629dc1b'
7
+ data.tar.gz: '058da9d1f4ef97479c449d9a6edcec8ac6a31c9e52f129da5601290a6b9e7861d0b2f0b59ab05c636c4fe12089ca9f9123d621fc2c2a5e61033c7431574e1c14'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- settei (0.1.0)
4
+ settei (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -29,7 +29,7 @@ Or install it yourself as:
29
29
 
30
30
  For Rails, a rake task is available for simple setup:
31
31
 
32
- $ settei:install:rails
32
+ $ rake settei:install:rails
33
33
 
34
34
  A `config/setting.rb` file is added for basic setup.
35
35
 
@@ -41,7 +41,7 @@ In your app, you can access the settings like this:
41
41
  Setting.dig(:google, :api, :secret)
42
42
  ```
43
43
 
44
- ## Settei::Base
44
+ ### Settei::Base
45
45
 
46
46
  `Settei::Base` is the core class for accessing the configurations. It is initialized by a hash. It is a light wrapper intended for you to extend.
47
47
 
@@ -49,9 +49,11 @@ Setting.dig(:google, :api, :secret)
49
49
 
50
50
  `#dig_and_wrap` will return a `Settei::Base` if it the return value is a hash.
51
51
 
52
+ For other methods, [check here](http://www.rubydoc.info/github/lulalala/settei/master/Settei/Base).
53
+
52
54
  Install script maps `Setting` to an instance of `Settei::Base`, for convenience.
53
55
 
54
- ## Loader
56
+ ### Loader
55
57
 
56
58
  `Settei::Loaders::SimpleLoader` is responsible for providing the hash to initialize `Settei::Base`. It loads from a source such as YAML or environment variable. It can also serialize the whole hash into one string, suitable for deploying via environment variables.
57
59
 
@@ -62,13 +64,15 @@ loader.load(:production).as_env_value # loads production.yml and returns "XYZ"
62
64
  loader.load(:test).as_env_assignment # loads test.yml and returns "APP_CONG=XYZ"
63
65
  ```
64
66
 
65
- We welcome PRs for different types of loaders, as `SimpleLoader` is not suitable for every situation.
67
+ We welcome PRs for different types of loaders, as `SimpleLoader` probably can't handle all situations.
68
+
69
+ For other methods, [check here](http://www.rubydoc.info/github/lulalala/settei/master/Settei/Loaders/SimpleLoader).
66
70
 
67
- ## Deployment
71
+ ### Deployment
68
72
 
69
73
  If `deploy.rb` is present, `rake settei:install:rails` will append code to it, allow serialized config to be passed as an environment variable.
70
74
 
71
- ## Frameworks other than Rails
75
+ ### Frameworks other than Rails
72
76
 
73
77
  Settei is designed to be simple so you can integrate it into any frameworks easily. The steps are mainly:
74
78
 
@@ -79,11 +83,11 @@ Settei is designed to be simple so you can integrate it into any frameworks easi
79
83
 
80
84
  We also welcome PRs for generators of other frameworks too.
81
85
 
82
- # Ruby < 2.3
86
+ ## Ruby < 2.3
83
87
 
84
88
  `Settei::Base` uses `dig` to access the configuration, available since Ruby 2.3. If your Ruby is not new enough, don't be afraid. Write your own hash accessor literally takes minutes. You can even use `SettingsLogic.new(hash)` .
85
89
 
86
- # FAQ
90
+ ## FAQ
87
91
 
88
92
  **Q:** Would serialized configuration be too big for environment variable?
89
93
  **A:** [The upper limit is pretty big.](https://stackoverflow.com/a/1078125/474597)
@@ -1,3 +1,3 @@
1
1
  module Settei
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/settei.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["lulalala"]
9
9
  spec.email = ["mark@goodlife.tw"]
10
10
 
11
- spec.summary = %q{Ruby configuration}
12
- #spec.description = %q{TODO: Write a longer description or delete this line.}
11
+ spec.summary = %q{Hash based configuration}
12
+ spec.description = %q{Hash based configuration with flexibility and 12-factor app deployment in mind. Settei allows use of nested hash, and can be serialized as environment variable, suitable for 12-factor app.}
13
13
  spec.homepage = "https://github.com/lulalala/settei"
14
14
  spec.licenses = ['MIT']
15
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: settei
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - lulalala
@@ -66,7 +66,9 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description:
69
+ description: Hash based configuration with flexibility and 12-factor app deployment
70
+ in mind. Settei allows use of nested hash, and can be serialized as environment
71
+ variable, suitable for 12-factor app.
70
72
  email:
71
73
  - mark@goodlife.tw
72
74
  executables: []
@@ -118,5 +120,5 @@ rubyforge_project:
118
120
  rubygems_version: 2.6.13
119
121
  signing_key:
120
122
  specification_version: 4
121
- summary: Ruby configuration
123
+ summary: Hash based configuration
122
124
  test_files: []