settingslogic 1.0.1 → 1.0.2

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.
@@ -1,3 +1,7 @@
1
+ == 1.0.2 released 2009-04-09
2
+
3
+ * Call key? off of the self in the class level name method.
4
+
1
5
  == 1.0.1 released 2009-04-02
2
6
 
3
7
  * Inherit from hash.
@@ -1,13 +1,13 @@
1
1
  CHANGELOG.rdoc
2
+ MIT-LICENSE
3
+ Manifest.txt
4
+ README.rdoc
5
+ Rakefile
2
6
  init.rb
7
+ lib/settingslogic.rb
3
8
  lib/settingslogic/config.rb
4
9
  lib/settingslogic/settings.rb
5
10
  lib/settingslogic/version.rb
6
- lib/settingslogic.rb
7
- Manifest
8
- MIT-LICENSE
9
- Rakefile
10
- README.rdoc
11
11
  test/application.yml
12
12
  test/application2.yml
13
13
  test/test_config.rb
data/Rakefile CHANGED
@@ -1,15 +1,20 @@
1
- require 'rubygems'
2
- require 'echoe'
1
+ ENV['RDOCOPT'] = "-S -f html -T hanna"
3
2
 
3
+ require "rubygems"
4
+ require "hoe"
4
5
  require File.dirname(__FILE__) << "/lib/settingslogic/version"
5
6
 
6
- Echoe.new 'settingslogic' do |p|
7
- p.version = Settingslogic::Version::STRING
7
+ Hoe.new("Settingslogic", Settingslogic::Version::STRING) do |p|
8
+ p.name = "settingslogic"
8
9
  p.author = "Ben Johnson of Binary Logic"
9
10
  p.email = 'bjohnson@binarylogic.com'
10
- p.project = 'settingslogic'
11
- p.summary = "Simple and straightforward application wide settings"
11
+ p.summary = "Simple settings manaement using YAML"
12
+ p.description = "Simple settings manaement using YAML"
12
13
  p.url = "http://github.com/binarylogic/settingslogic"
13
- p.dependencies = []
14
- p.include_rakefile = true
14
+ p.history_file = "CHANGELOG.rdoc"
15
+ p.readme_file = "README.rdoc"
16
+ p.extra_rdoc_files = ["CHANGELOG.rdoc", "README.rdoc"]
17
+ p.remote_rdoc_dir = ''
18
+ p.test_globs = ["test/*/test_*.rb", "test/*_test.rb", "test/*/*_test.rb"]
19
+ p.extra_deps = %w(activesupport)
15
20
  end
@@ -10,4 +10,4 @@ rescue(NameError)
10
10
  end
11
11
 
12
12
  # Since we don't have a Settings constant, lets go ahead and use it
13
- ::Settings = Settingslogic::Settings unless defined?(Settings)
13
+ ::Settings = Settingslogic::Settings unless defined?(Settings)
@@ -1,5 +1,4 @@
1
1
  module Settingslogic
2
- # = Config
3
2
  # Sets configuration on Settingslogic.
4
3
  class Config
5
4
  class << self
@@ -1,11 +1,9 @@
1
1
  module Settingslogic
2
- # = Setting
3
- #
4
2
  # A simple settings solution using a YAML file. See README for more information.
5
3
  class Settings < Hash
6
4
  class << self
7
5
  def name # :nodoc:
8
- instance._settings.key?("name") ? instance.name : super
6
+ instance.key?("name") ? instance.name : super
9
7
  end
10
8
 
11
9
  # Resets the singleton instance. Useful if you are changing the configuration on the fly. If you are changing the configuration on the fly you should consider creating instances.
@@ -1,29 +1,4 @@
1
- # (The MIT License)
2
- #
3
- # Copyright (c) 2008 Jamis Buck <jamis@37signals.com>,
4
- # with modifications by Bruce Williams <bruce@fiveruns.com>
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining
7
- # a copy of this software and associated documentation files (the
8
- # 'Software'), to deal in the Software without restriction, including
9
- # without limitation the rights to use, copy, modify, merge, publish,
10
- # distribute, sublicense, and/or sell copies of the Software, and to
11
- # permit persons to whom the Software is furnished to do so, subject to
12
- # the following conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be
15
- # included in all copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20
- # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21
- # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22
- # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23
- # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
1
  module Settingslogic
25
- # = Version
26
- #
27
2
  # A class for describing the current version of a library. The version
28
3
  # consists of three parts: the +major+ number, the +minor+ number, and the
29
4
  # +tiny+ (or +patch+) number.
@@ -67,7 +42,7 @@ module Settingslogic
67
42
 
68
43
  MAJOR = 1
69
44
  MINOR = 0
70
- TINY = 1
45
+ TINY = 2
71
46
 
72
47
  # The current version as a Version instance
73
48
  CURRENT = new(MAJOR, MINOR, TINY)
@@ -3,3 +3,4 @@ setting1:
3
3
 
4
4
  setting2: 5
5
5
  setting3: <%= 5 * 5 %>
6
+ name: test
@@ -1,6 +1,10 @@
1
1
  require File.dirname(__FILE__) + '/test_helper.rb'
2
2
 
3
3
  class TestSetting < Test::Unit::TestCase
4
+ def test_conflicting_class_methods
5
+ assert_equal "test", Settings.name
6
+ end
7
+
4
8
  def test_singleton_access
5
9
  assert_equal Settings, Settings.setting1.class
6
10
  assert_equal "saweet", Settings.setting1.setting1_child
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: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Johnson of Binary Logic
@@ -9,48 +9,59 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-02 00:00:00 -04:00
12
+ date: 2009-04-09 00:00:00 -04:00
13
13
  default_executable:
14
- dependencies: []
15
-
16
- description: Simple and straightforward application wide settings
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activesupport
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: hoe
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.12.1
34
+ version:
35
+ description: Simple settings manaement using YAML
17
36
  email: bjohnson@binarylogic.com
18
37
  executables: []
19
38
 
20
39
  extensions: []
21
40
 
22
41
  extra_rdoc_files:
42
+ - Manifest.txt
23
43
  - CHANGELOG.rdoc
24
- - lib/settingslogic/config.rb
25
- - lib/settingslogic/settings.rb
26
- - lib/settingslogic/version.rb
27
- - lib/settingslogic.rb
28
44
  - README.rdoc
29
45
  files:
30
46
  - CHANGELOG.rdoc
47
+ - MIT-LICENSE
48
+ - Manifest.txt
49
+ - README.rdoc
50
+ - Rakefile
31
51
  - init.rb
52
+ - lib/settingslogic.rb
32
53
  - lib/settingslogic/config.rb
33
54
  - lib/settingslogic/settings.rb
34
55
  - lib/settingslogic/version.rb
35
- - lib/settingslogic.rb
36
- - Manifest
37
- - MIT-LICENSE
38
- - Rakefile
39
- - README.rdoc
40
56
  - test/application.yml
41
57
  - test/application2.yml
42
58
  - test/test_config.rb
43
59
  - test/test_helper.rb
44
60
  - test/test_setting.rb
45
- - settingslogic.gemspec
46
61
  has_rdoc: true
47
62
  homepage: http://github.com/binarylogic/settingslogic
48
63
  post_install_message:
49
64
  rdoc_options:
50
- - --line-numbers
51
- - --inline-source
52
- - --title
53
- - Settingslogic
54
65
  - --main
55
66
  - README.rdoc
56
67
  require_paths:
@@ -65,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
76
  requirements:
66
77
  - - ">="
67
78
  - !ruby/object:Gem::Version
68
- version: "1.2"
79
+ version: "0"
69
80
  version:
70
81
  requirements: []
71
82
 
@@ -73,8 +84,6 @@ rubyforge_project: settingslogic
73
84
  rubygems_version: 1.3.1
74
85
  signing_key:
75
86
  specification_version: 2
76
- summary: Simple and straightforward application wide settings
77
- test_files:
78
- - test/test_config.rb
79
- - test/test_helper.rb
80
- - test/test_setting.rb
87
+ summary: Simple settings manaement using YAML
88
+ test_files: []
89
+
@@ -1,32 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = %q{settingslogic}
5
- s.version = "1.0.1"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Ben Johnson of Binary Logic"]
9
- s.date = %q{2009-04-02}
10
- s.description = %q{Simple and straightforward application wide settings}
11
- s.email = %q{bjohnson@binarylogic.com}
12
- s.extra_rdoc_files = ["CHANGELOG.rdoc", "lib/settingslogic/config.rb", "lib/settingslogic/settings.rb", "lib/settingslogic/version.rb", "lib/settingslogic.rb", "README.rdoc"]
13
- s.files = ["CHANGELOG.rdoc", "init.rb", "lib/settingslogic/config.rb", "lib/settingslogic/settings.rb", "lib/settingslogic/version.rb", "lib/settingslogic.rb", "Manifest", "MIT-LICENSE", "Rakefile", "README.rdoc", "test/application.yml", "test/application2.yml", "test/test_config.rb", "test/test_helper.rb", "test/test_setting.rb", "settingslogic.gemspec"]
14
- s.has_rdoc = true
15
- s.homepage = %q{http://github.com/binarylogic/settingslogic}
16
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Settingslogic", "--main", "README.rdoc"]
17
- s.require_paths = ["lib"]
18
- s.rubyforge_project = %q{settingslogic}
19
- s.rubygems_version = %q{1.3.1}
20
- s.summary = %q{Simple and straightforward application wide settings}
21
- s.test_files = ["test/test_config.rb", "test/test_helper.rb", "test/test_setting.rb"]
22
-
23
- if s.respond_to? :specification_version then
24
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
25
- s.specification_version = 2
26
-
27
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
28
- else
29
- end
30
- else
31
- end
32
- end