konfig 0.1.0 → 0.1.1
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/README.rdoc +40 -2
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/konfig.gemspec +3 -3
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -21,12 +21,50 @@ It works like this:
|
|
21
21
|
|
22
22
|
=> "baz"
|
23
23
|
|
24
|
+
== Installation
|
24
25
|
|
25
|
-
|
26
|
+
Add this to your Gemfile
|
27
|
+
|
28
|
+
gem konfig
|
29
|
+
|
30
|
+
Then make sure that config/settings exsits. That's it. Konfig
|
31
|
+
automagically loads all .yml files in the
|
26
32
|
RAILS_ROOT/config/settings directory. It makes them
|
27
33
|
accessible via the Konfig module. ie. Konfig[:filename][:key]
|
28
34
|
|
29
|
-
|
35
|
+
== Raw power
|
36
|
+
|
37
|
+
There are often times when you need to make the same config data
|
38
|
+
avalible in sevaral different forms.
|
39
|
+
|
40
|
+
Konfig makes this easy by letting you embed ruby in your yaml templates.
|
41
|
+
This code has access to all of the data in the template.
|
42
|
+
|
43
|
+
# config/settings/example.yml
|
44
|
+
|
45
|
+
one: 1
|
46
|
+
two: 2
|
47
|
+
one_plus_two: << data[:one] + data[:two]
|
48
|
+
|
49
|
+
== Helpers
|
50
|
+
|
51
|
+
You can also access helper methods in your embedded code.
|
52
|
+
|
53
|
+
# config/settings/example.yml
|
54
|
+
|
55
|
+
# You might use this for a list of <select> options
|
56
|
+
colors:
|
57
|
+
- ["Red", "#ff0000"]
|
58
|
+
- ["Green", "#00ff00"]
|
59
|
+
- ["Blue", "#0000ff"]
|
60
|
+
|
61
|
+
# This returns {"#ff0000" => "Red", ...etc }
|
62
|
+
color_names: << names_by_value(:colors)
|
63
|
+
|
64
|
+
|
65
|
+
== Rails 3
|
66
|
+
|
67
|
+
Konfig only works with Rails 3
|
30
68
|
|
31
69
|
== Note on Patches/Pull Requests
|
32
70
|
|
data/Rakefile
CHANGED
@@ -5,8 +5,8 @@ begin
|
|
5
5
|
require 'jeweler'
|
6
6
|
Jeweler::Tasks.new do |gem|
|
7
7
|
gem.name = "konfig"
|
8
|
-
gem.summary = %Q{
|
9
|
-
gem.description = %Q{
|
8
|
+
gem.summary = %Q{Yaml config file manager for rails 3 apps}
|
9
|
+
gem.description = %Q{ Automatically loads yaml config files and makes them available to your rails app.}
|
10
10
|
gem.email = "starr@chromahq.com"
|
11
11
|
gem.homepage = "http://github.com/starrhorne/konfig"
|
12
12
|
gem.authors = ["Starr Horne"]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/konfig.gemspec
CHANGED
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{konfig}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Starr Horne"]
|
12
12
|
s.date = %q{2010-05-27}
|
13
|
-
s.description = %q{
|
13
|
+
s.description = %q{ Automatically loads yaml config files and makes them available to your rails app.}
|
14
14
|
s.email = %q{starr@chromahq.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
|
|
40
40
|
s.rdoc_options = ["--charset=UTF-8"]
|
41
41
|
s.require_paths = ["lib"]
|
42
42
|
s.rubygems_version = %q{1.3.6}
|
43
|
-
s.summary = %q{
|
43
|
+
s.summary = %q{Yaml config file manager for rails 3 apps}
|
44
44
|
s.test_files = [
|
45
45
|
"test/helper.rb",
|
46
46
|
"test/test_evaluator.rb",
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Starr Horne
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: "0"
|
30
30
|
type: :development
|
31
31
|
version_requirements: *id001
|
32
|
-
description:
|
32
|
+
description: " Automatically loads yaml config files and makes them available to your rails app."
|
33
33
|
email: starr@chromahq.com
|
34
34
|
executables: []
|
35
35
|
|
@@ -86,7 +86,7 @@ rubyforge_project:
|
|
86
86
|
rubygems_version: 1.3.6
|
87
87
|
signing_key:
|
88
88
|
specification_version: 3
|
89
|
-
summary:
|
89
|
+
summary: Yaml config file manager for rails 3 apps
|
90
90
|
test_files:
|
91
91
|
- test/helper.rb
|
92
92
|
- test/test_evaluator.rb
|