settingslogic 0.9.0 → 1.0.0
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/CHANGELOG.rdoc +4 -0
- data/README.rdoc +19 -6
- data/lib/settingslogic.rb +1 -1
- data/lib/settingslogic/settings.rb +2 -1
- data/lib/settingslogic/version.rb +2 -2
- data/settingslogic.gemspec +6 -4
- metadata +3 -3
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -4,6 +4,24 @@ Settingslogic is an old library of mine that I decided to go ahead and share wit
|
|
4
4
|
|
5
5
|
So here is my question to you.....is Settingslogic a great settings solution or the greatest?
|
6
6
|
|
7
|
+
== Helpful links
|
8
|
+
|
9
|
+
* <b>Documentation:</b> http://settingslogic.rubyforge.org
|
10
|
+
* <b>Bugs / feature suggestions:</b> http://binarylogic.lighthouseapp.com/projects/19028-settingslogic
|
11
|
+
|
12
|
+
== Install and use
|
13
|
+
|
14
|
+
sudo gem install settingslogic
|
15
|
+
|
16
|
+
For rails, as a gem (recommended):
|
17
|
+
|
18
|
+
# config/environment.rb
|
19
|
+
config.gem "settingslogic"
|
20
|
+
|
21
|
+
Or as a plugin (for older versions of rails)
|
22
|
+
|
23
|
+
script/plugin install git://github.com/binarylogic/settingslogic.git
|
24
|
+
|
7
25
|
== Create your settings
|
8
26
|
|
9
27
|
By default Settingslogic tries to load config/application.yml. This is just a typical YAML file, notice ERB is allowed.
|
@@ -58,13 +76,8 @@ Configuration is optional. See Settingslogic::Config for more details.
|
|
58
76
|
config.file_name = :config # will look for config/config.yml
|
59
77
|
config.file_name = "config" # will look for config
|
60
78
|
config.file_name = "config.yaml" # will look for confg.yaml
|
61
|
-
config.file_name = "/absolute/path/config.yml" # will look for /absolute/path/config.
|
79
|
+
config.file_name = "/absolute/path/config.yml" # will look for /absolute/path/config.yml
|
62
80
|
end
|
63
81
|
|
64
|
-
== Helpful links
|
65
|
-
|
66
|
-
* <b>Documentation:</b> http://settingslogic.rubyforge.org
|
67
|
-
* <b>Bugs / feature suggestions:</b> http://binarylogic.lighthouseapp.com/projects/19028-settingslogic
|
68
|
-
|
69
82
|
|
70
83
|
Copyright (c) 2008 {Ben Johnson}[http://github.com/binarylogic] of {Binary Logic}[http://www.binarylogic.com], released under the MIT license
|
data/lib/settingslogic.rb
CHANGED
@@ -44,7 +44,7 @@ module Settingslogic
|
|
44
44
|
self._settings = YAML.load(ERB.new(File.read(file_path)).result)
|
45
45
|
self._settings = _settings[RAILS_ENV] if defined?(RAILS_ENV)
|
46
46
|
else
|
47
|
-
raise ArgumentError.new("Your settings must be a hash
|
47
|
+
raise ArgumentError.new("Your settings must be a hash, a symbol representing the name of the .yml file in your config directory, or a string representing the abosolute path to your settings file.")
|
48
48
|
end
|
49
49
|
define_settings!
|
50
50
|
end
|
@@ -55,6 +55,7 @@ module Settingslogic
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def define_settings!
|
58
|
+
return if _settings.nil?
|
58
59
|
_settings.each do |key, value|
|
59
60
|
case value
|
60
61
|
when Hash
|
data/settingslogic.gemspec
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
1
3
|
Gem::Specification.new do |s|
|
2
4
|
s.name = %q{settingslogic}
|
3
|
-
s.version = "0.
|
5
|
+
s.version = "1.0.0"
|
4
6
|
|
5
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
6
8
|
s.authors = ["Ben Johnson of Binary Logic"]
|
7
|
-
s.date = %q{2008-
|
9
|
+
s.date = %q{2008-12-05}
|
8
10
|
s.description = %q{Simple and straightforward application wide settings}
|
9
11
|
s.email = %q{bjohnson@binarylogic.com}
|
10
12
|
s.extra_rdoc_files = ["CHANGELOG.rdoc", "lib/settingslogic/config.rb", "lib/settingslogic/settings.rb", "lib/settingslogic/version.rb", "lib/settingslogic.rb", "README.rdoc"]
|
@@ -14,7 +16,7 @@ Gem::Specification.new do |s|
|
|
14
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Settingslogic", "--main", "README.rdoc"]
|
15
17
|
s.require_paths = ["lib"]
|
16
18
|
s.rubyforge_project = %q{settingslogic}
|
17
|
-
s.rubygems_version = %q{1.
|
19
|
+
s.rubygems_version = %q{1.3.1}
|
18
20
|
s.summary = %q{Simple and straightforward application wide settings}
|
19
21
|
s.test_files = ["test/test_config.rb", "test/test_helper.rb", "test/test_setting.rb"]
|
20
22
|
|
@@ -22,7 +24,7 @@ Gem::Specification.new do |s|
|
|
22
24
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
23
25
|
s.specification_version = 2
|
24
26
|
|
25
|
-
if
|
27
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
26
28
|
s.add_development_dependency(%q<echoe>, [">= 0"])
|
27
29
|
else
|
28
30
|
s.add_dependency(%q<echoe>, [">= 0"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: settingslogic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Johnson of Binary Logic
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-12-05 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements: []
|
80
80
|
|
81
81
|
rubyforge_project: settingslogic
|
82
|
-
rubygems_version: 1.
|
82
|
+
rubygems_version: 1.3.1
|
83
83
|
signing_key:
|
84
84
|
specification_version: 2
|
85
85
|
summary: Simple and straightforward application wide settings
|