co_config 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/co_config.gemspec +5 -4
- data/lib/co_config/version.rb +1 -1
- metadata +5 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0dd0158f19428fd11977fcdcd73052d740009c9
|
4
|
+
data.tar.gz: e7b25976ff15f046c9760691efab7b43391bed7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85f00707b88108da65ad9080b8216810c4a7ec3b0e8e5990b8d90453ec4831bcc73b286b69629e311c112fc518e0e8cbf1c40e03083807195783a32cfbf74217
|
7
|
+
data.tar.gz: 03c49d91faa5142fcedaa27d396f67056128dabf9e5a9bb1ae6af52abafe74464382ccf3064ab8eea31cd598317c51c0a45f2d1c2e251a2666e085549f59da7d
|
data/co_config.gemspec
CHANGED
@@ -2,9 +2,6 @@
|
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require 'co_config/version'
|
5
|
-
require 'pathname'
|
6
|
-
|
7
|
-
readme = Pathname.new(File.expand_path('../readme.md', __FILE__))
|
8
5
|
|
9
6
|
Gem::Specification.new do |spec|
|
10
7
|
spec.name = "co_config"
|
@@ -13,7 +10,11 @@ Gem::Specification.new do |spec|
|
|
13
10
|
spec.email = ["erabinovich@gmail.com"]
|
14
11
|
|
15
12
|
spec.summary = %q{Simple configuration management gem.}
|
16
|
-
spec.description =
|
13
|
+
spec.description = <<-EOF.gsub(/^\s{4}/, '')
|
14
|
+
Simple configuration management. For a description on
|
15
|
+
how to use this gem please check the readme file on
|
16
|
+
https://github.com/comparaonline/co_config/blob/master/README.md
|
17
|
+
EOF
|
17
18
|
spec.homepage = "https://github.com/comparaonline/co_config"
|
18
19
|
spec.license = "MIT"
|
19
20
|
|
data/lib/co_config/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: co_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezequiel Rabinovich
|
@@ -92,35 +92,10 @@ dependencies:
|
|
92
92
|
- - "~>"
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '3'
|
95
|
-
description:
|
96
|
-
|
97
|
-
this
|
98
|
-
|
99
|
-
co_config\n\n## Usage\n\nCreate a `configuration.rb` file on your rails application's
|
100
|
-
config folder.\nThis file will indicate which files are loaded.\n\n```ruby\n# To
|
101
|
-
load the test.yml file into the CoConfig::TEST hash\nload 'test' \n\n# To validate
|
102
|
-
the configuration you could use\nload 'test2' { |c| c.token.present? } \n# or\nload
|
103
|
-
'test3' { |c| raise if token.empty? }\n```\n\nYAML files must have a root key called
|
104
|
-
like the current `Rails.env`. A key called `defaults` can be used to specify defaults
|
105
|
-
for undefined environments.\n\n```yaml\n# test.yml\n---\n\ndevelopment:\n value:
|
106
|
-
1\n```\n\n```yaml\n# test2.yml\n---\n\ndefaults:\n token: 'MYAWESOMETOKEN'\n```\n\nTo
|
107
|
-
read your configuration you can access the hash (with indifferent access) at `CoConfig::CONFIG_NAME_UPPERCASE`\n\n##
|
108
|
-
To use on your engine/gem\n\nIf you want to load configuration from a different
|
109
|
-
path (e.g. your engine's directory), you can do this:\n\n```ruby\n# lib/my_engine/railtie.rb\nrequire
|
110
|
-
'rails/railtie'\nmodule MyEngine\n class Railtie < ::Rails::Railtie\n config.before_configuration
|
111
|
-
do\n CoConfig.load(MyEngine::Engine.root.join('config'))\n end\n end\nend\n\n#
|
112
|
-
lib/my_engine.rb\nrequire 'my_engine/railtie'\n\nmodule MyEngine\n class Engine
|
113
|
-
< ::Rails::Engine\n end\nend\n```\n\nIt will load `my_engine/config/configuration.rb`,
|
114
|
-
and in there, `load` method calls will include configuration files in the same directory.\n\n##
|
115
|
-
Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies.
|
116
|
-
Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive
|
117
|
-
prompt that will allow you to experiment.\n\nTo install this gem onto your local
|
118
|
-
machine, run `bundle exec rake install`. To release a new version, update the version
|
119
|
-
number in `version.rb`, and then run `bundle exec rake release`, which will create
|
120
|
-
a git tag for the version, push git commits and tags, and push the `.gem` file to
|
121
|
-
[rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull
|
122
|
-
requests are welcome on GitHub at https://github.com/comparaonline/co_config.\n\n\n##
|
123
|
-
License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n"
|
95
|
+
description: |
|
96
|
+
Simple configuration management. For a description on
|
97
|
+
how to use this gem please check the readme file on
|
98
|
+
https://github.com/comparaonline/co_config/blob/master/README.md
|
124
99
|
email:
|
125
100
|
- erabinovich@gmail.com
|
126
101
|
executables: []
|