config_yml 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ test/version_tmp
16
16
  tmp
17
17
  .DS_Store
18
18
  config/
19
+ .ruby-*
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- config_yml (0.0.3)
4
+ config_yml (0.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- config.yml
1
+ config_yml
2
2
  ==========
3
3
 
4
4
  Simplify your app configuration.
@@ -6,7 +6,7 @@ Simplify your app configuration.
6
6
  Description
7
7
  -----------
8
8
 
9
- config.yml provides a very simple way of configure your ruby applications through yaml files.
9
+ config_yml provides a very simple way of configure your ruby applications through yaml files.
10
10
 
11
11
  Installation
12
12
  ------------
@@ -35,8 +35,8 @@ then in your Ruby code:
35
35
  require "configuration"
36
36
  ```
37
37
 
38
- Examples
39
- --------
38
+ Usage
39
+ -----
40
40
 
41
41
  ```yaml
42
42
  # config/redis.yml
@@ -114,6 +114,23 @@ foo:
114
114
  Configuration.matryoshka[:foo][:bar][:baz] # => { :array => [:red, :green, :blue] }
115
115
  ```
116
116
 
117
+ Manage yaml files
118
+ -----------------
119
+
120
+ Avoid maintain .yml files in your repository since they very ofter cointain sensitive information. You can use .yml.sample or .yml.example file instead with fake data.
121
+
122
+ To transform sample files in yaml files, you can use the following task:
123
+
124
+ ```console
125
+ $ rake config_yml:generate
126
+ ```
127
+
128
+ If you are not using Rails, first add this to your Rakefile:
129
+
130
+ ```ruby
131
+ require "configuration/tasks"
132
+ ```
133
+
117
134
  License
118
135
  -------
119
136
 
@@ -1,3 +1,3 @@
1
1
  module Configuration
2
- VERSION = "0.0.4".freeze
2
+ VERSION = "0.0.5".freeze
3
3
  end
data/lib/configuration.rb CHANGED
@@ -21,7 +21,7 @@ module Configuration
21
21
  #
22
22
  class << self
23
23
  def method_missing(method, *args)
24
- if file = files.select { |f| f =~ /#{method.to_s}/ }[0]
24
+ if file = files.select { |f| f == "config/#{method.to_s}.yml" }[0]
25
25
  hash[method] ||= load_yml(file)
26
26
  end
27
27
  end
@@ -3,6 +3,7 @@ require "spec_helper"
3
3
  describe Configuration::Tasks::Generate do
4
4
  before do
5
5
  Dir.stub(:glob).and_return(files)
6
+ FileUtils.stub(:cp)
6
7
  subject.instance_variable_set(:@grouped_files, nil)
7
8
  end
8
9
 
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_yml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Vitor Kiyoshi Arimitsu
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-05-10 00:00:00.000000000 Z
12
+ date: 2013-05-20 00:00:00.000000000 Z
12
13
  dependencies: []
13
14
  description: A very simple way of configure your ruby applications through yaml files.
14
15
  email: to@vitork.com
@@ -36,26 +37,27 @@ files:
36
37
  homepage: https://github.com/vitork/config_yml
37
38
  licenses:
38
39
  - MIT
39
- metadata: {}
40
40
  post_install_message:
41
41
  rdoc_options: []
42
42
  require_paths:
43
43
  - lib
44
44
  required_ruby_version: !ruby/object:Gem::Requirement
45
+ none: false
45
46
  requirements:
46
47
  - - ! '>='
47
48
  - !ruby/object:Gem::Version
48
49
  version: '0'
49
50
  required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
50
52
  requirements:
51
53
  - - ! '>='
52
54
  - !ruby/object:Gem::Version
53
55
  version: '0'
54
56
  requirements: []
55
57
  rubyforge_project:
56
- rubygems_version: 2.0.3
58
+ rubygems_version: 1.8.25
57
59
  signing_key:
58
- specification_version: 4
60
+ specification_version: 3
59
61
  summary: Simplify your app configuration.
60
62
  test_files:
61
63
  - spec/lib/configuration/syntax/conf_spec.rb
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- OTFhOTViODNiZTBlYTIzMTkzZGExMzBjZDIxMzc1ZjQzYjk3OWNmYQ==
5
- data.tar.gz: !binary |-
6
- ZmI0YjUxNDI3OWI5ZTgxZjc1MGZkOGRkNDdkMTJkMzExMmMyZTc5ZA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZDgzNmRhZDk1YTE4NGY0MjA1MjgwOGU4NjE1MzM0NTg5YzgwMzM4MTJjM2Mx
10
- YWQ5OTdmODE5MmYzZGEzODRlMzUyZTEzNmIzOTM4Y2ViYjIzZDg5YzU4ODdi
11
- NWY4NGQ1ZTliZDFhYWE1Mzk3NzA0MjY5NmM5MTJkYmIzOWNlOTA=
12
- data.tar.gz: !binary |-
13
- NDY3ZDBiYjVjNjBiMjk3NzUwNWZmODc4YzE4NjUxYTFkMzg3NTUzMDZlMTY4
14
- MjM1ZWFlOTI0ZmZlOWEyMjc3ZTczM2IyMjQ2NjRhMWQ5M2IzZDlmZjgxYzFm
15
- OTU1NWNjOWRjM2M2Y2MwOGQ5ZmY4ZTc0YjBkMGM2ZTI1ZGI4OGI=