yettings 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 +31 -22
- data/Rakefile +4 -3
- data/VERSION +1 -1
- data/yettings.gemspec +7 -8
- metadata +7 -29
data/README.rdoc
CHANGED
@@ -9,8 +9,18 @@ use this to store API keys, constants, and other key/value pairs. This plugin w
|
|
9
9
|
have to add a class and point to the YML file. The Yetting class will be created dynamically and will be available to your Rails app. This plugin is also
|
10
10
|
more basic than settingslogic. It does not have support for dynamic setting creation... only the values in the yetting.yml will be available.
|
11
11
|
|
12
|
+
== This project only supports Rails 3
|
13
|
+
|
12
14
|
== Usage
|
13
15
|
|
16
|
+
===Install the gem
|
17
|
+
|
18
|
+
Add this to your Gemfile
|
19
|
+
gem "yettings"
|
20
|
+
|
21
|
+
Install with Bundler
|
22
|
+
bundle install
|
23
|
+
|
14
24
|
===Adding the YAML file with your key/value pairs
|
15
25
|
|
16
26
|
1. Create a YAML file inside /your_rails_app/config called yetting.yaml
|
@@ -20,23 +30,23 @@ more basic than settingslogic. It does not have support for dynamic setting cre
|
|
20
30
|
You can define key/value pairs in the YAML file and these will be available in your app. You can set the defaults and any environment specific values.
|
21
31
|
The file must contain each environment that you will use in your Rails app. Here is a sample:
|
22
32
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
33
|
+
defaults: &defaults
|
34
|
+
api_key: asdf12345lkj
|
35
|
+
some_number: 999
|
36
|
+
an_erb_yetting: <%= "erb stuff works" %>
|
37
|
+
some_array:
|
38
|
+
- element1
|
39
|
+
- element2
|
30
40
|
|
31
|
-
|
32
|
-
|
33
|
-
|
41
|
+
development:
|
42
|
+
<<: *defaults
|
43
|
+
api_key: api key for dev
|
34
44
|
|
35
|
-
|
36
|
-
|
45
|
+
test:
|
46
|
+
<<: *defaults
|
37
47
|
|
38
|
-
|
39
|
-
|
48
|
+
production:
|
49
|
+
<<: *defaults
|
40
50
|
|
41
51
|
In the above example, you can define the key/value pair using strings, numbers, erb code, or arrays. Notice that the "api_key" in the development
|
42
52
|
environment will override the "api_key" from defaults.
|
@@ -47,13 +57,13 @@ You simply call the Yetting class or the namespaced class and the key as a class
|
|
47
57
|
/your_rails_app/config/yettings/ to a class name and append Yetting. So if you have main.yml, then it will use MainYetting as the class name.
|
48
58
|
Then you can call the key that you put in the YAML as a class method. Here are 2 examples:
|
49
59
|
|
50
|
-
|
51
|
-
|
52
|
-
|
60
|
+
#/your_rails_app/config/yetting.yml in production
|
61
|
+
Yetting.some_number #=> 999
|
62
|
+
Yetting.api_key #=> "asdf12345lkj"
|
53
63
|
|
54
|
-
|
55
|
-
|
56
|
-
|
64
|
+
#/your_rails_app/config/yettings/main.yml
|
65
|
+
MainYetting.some_number #=> 999
|
66
|
+
MainYetting.some_array #=> ["element1","element2"]
|
57
67
|
|
58
68
|
|
59
69
|
== Contributing to yettings
|
@@ -69,5 +79,4 @@ Then you can call the key that you put in the YAML as a class method. Here are
|
|
69
79
|
== Copyright
|
70
80
|
|
71
81
|
Copyright (c) 2011 cowboycoded. See LICENSE.txt for
|
72
|
-
further details.
|
73
|
-
|
82
|
+
further details.
|
data/Rakefile
CHANGED
@@ -13,13 +13,14 @@ require 'jeweler'
|
|
13
13
|
Jeweler::Tasks.new do |gem|
|
14
14
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
15
|
gem.name = "yettings"
|
16
|
-
gem.homepage = "http://github.com/
|
16
|
+
gem.homepage = "http://github.com/charlotte-ruby/yettings"
|
17
17
|
gem.license = "MIT"
|
18
18
|
gem.summary = %Q{YAML Settings}
|
19
19
|
gem.description = %Q{Create settings/contants for your Rails 3 app using yml key/value pairs}
|
20
20
|
gem.email = "john.mcaliley@gmail.com"
|
21
|
-
gem.authors = ["
|
22
|
-
gem.files.exclude 'test_app'
|
21
|
+
gem.authors = ["johnmcaliley"]
|
22
|
+
gem.files.exclude 'test_app/**/*'
|
23
|
+
gem.files.exclude 'test_app/**/.*'
|
23
24
|
end
|
24
25
|
Jeweler::RubygemsDotOrgTasks.new
|
25
26
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/yettings.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{yettings}
|
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
|
-
s.authors = [
|
12
|
-
s.date = %q{2011-
|
11
|
+
s.authors = [%q{johnmcaliley}]
|
12
|
+
s.date = %q{2011-06-09}
|
13
13
|
s.description = %q{Create settings/contants for your Rails 3 app using yml key/value pairs}
|
14
14
|
s.email = %q{john.mcaliley@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -28,14 +28,13 @@ Gem::Specification.new do |s|
|
|
28
28
|
"lib/yettings/railtie.rb",
|
29
29
|
"yettings.gemspec"
|
30
30
|
]
|
31
|
-
s.homepage = %q{http://github.com/
|
32
|
-
s.licenses = [
|
33
|
-
s.require_paths = [
|
34
|
-
s.rubygems_version = %q{1.
|
31
|
+
s.homepage = %q{http://github.com/charlotte-ruby/yettings}
|
32
|
+
s.licenses = [%q{MIT}]
|
33
|
+
s.require_paths = [%q{lib}]
|
34
|
+
s.rubygems_version = %q{1.8.5}
|
35
35
|
s.summary = %q{YAML Settings}
|
36
36
|
|
37
37
|
if s.respond_to? :specification_version then
|
38
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
39
38
|
s.specification_version = 3
|
40
39
|
|
41
40
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
metadata
CHANGED
@@ -1,21 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yettings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
version: 0.1.0
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.1
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
|
-
-
|
8
|
+
- johnmcaliley
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-
|
18
|
-
default_executable:
|
13
|
+
date: 2011-06-09 00:00:00 Z
|
19
14
|
dependencies:
|
20
15
|
- !ruby/object:Gem::Dependency
|
21
16
|
name: rspec
|
@@ -24,10 +19,6 @@ dependencies:
|
|
24
19
|
requirements:
|
25
20
|
- - ~>
|
26
21
|
- !ruby/object:Gem::Version
|
27
|
-
segments:
|
28
|
-
- 2
|
29
|
-
- 1
|
30
|
-
- 0
|
31
22
|
version: 2.1.0
|
32
23
|
type: :development
|
33
24
|
prerelease: false
|
@@ -39,10 +30,6 @@ dependencies:
|
|
39
30
|
requirements:
|
40
31
|
- - ~>
|
41
32
|
- !ruby/object:Gem::Version
|
42
|
-
segments:
|
43
|
-
- 1
|
44
|
-
- 0
|
45
|
-
- 0
|
46
33
|
version: 1.0.0
|
47
34
|
type: :development
|
48
35
|
prerelease: false
|
@@ -54,10 +41,6 @@ dependencies:
|
|
54
41
|
requirements:
|
55
42
|
- - ~>
|
56
43
|
- !ruby/object:Gem::Version
|
57
|
-
segments:
|
58
|
-
- 1
|
59
|
-
- 5
|
60
|
-
- 1
|
61
44
|
version: 1.5.1
|
62
45
|
type: :development
|
63
46
|
prerelease: false
|
@@ -69,8 +52,6 @@ dependencies:
|
|
69
52
|
requirements:
|
70
53
|
- - ">="
|
71
54
|
- !ruby/object:Gem::Version
|
72
|
-
segments:
|
73
|
-
- 0
|
74
55
|
version: "0"
|
75
56
|
type: :development
|
76
57
|
prerelease: false
|
@@ -95,8 +76,7 @@ files:
|
|
95
76
|
- lib/yettings.rb
|
96
77
|
- lib/yettings/railtie.rb
|
97
78
|
- yettings.gemspec
|
98
|
-
|
99
|
-
homepage: http://github.com/cowboycoded/yettings
|
79
|
+
homepage: http://github.com/charlotte-ruby/yettings
|
100
80
|
licenses:
|
101
81
|
- MIT
|
102
82
|
post_install_message:
|
@@ -109,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
89
|
requirements:
|
110
90
|
- - ">="
|
111
91
|
- !ruby/object:Gem::Version
|
112
|
-
hash:
|
92
|
+
hash: 2284600777893832243
|
113
93
|
segments:
|
114
94
|
- 0
|
115
95
|
version: "0"
|
@@ -118,13 +98,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
98
|
requirements:
|
119
99
|
- - ">="
|
120
100
|
- !ruby/object:Gem::Version
|
121
|
-
segments:
|
122
|
-
- 0
|
123
101
|
version: "0"
|
124
102
|
requirements: []
|
125
103
|
|
126
104
|
rubyforge_project:
|
127
|
-
rubygems_version: 1.
|
105
|
+
rubygems_version: 1.8.5
|
128
106
|
signing_key:
|
129
107
|
specification_version: 3
|
130
108
|
summary: YAML Settings
|