Browse files

Release v1.0.2

  • Loading branch information...
1 parent 48b4cbf commit 2b1b6629e74c342a27e9b8a0d9ad92740459683e @binarylogic committed Apr 9, 2009
View
4 CHANGELOG.rdoc
@@ -1,3 +1,7 @@
+== 1.0.2 released 2009-04-09
+
+* Call key? off of the self in the class level name method.
+
== 1.0.1 released 2009-04-02
* Inherit from hash.
View
10 Manifest → Manifest.txt
@@ -1,13 +1,13 @@
CHANGELOG.rdoc
+MIT-LICENSE
+Manifest.txt
+README.rdoc
+Rakefile
init.rb
+lib/settingslogic.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
View
21 Rakefile
@@ -1,15 +1,20 @@
-require 'rubygems'
-require 'echoe'
+ENV['RDOCOPT'] = "-S -f html -T hanna"
+require "rubygems"
+require "hoe"
require File.dirname(__FILE__) << "/lib/settingslogic/version"
-Echoe.new 'settingslogic' do |p|
- p.version = Settingslogic::Version::STRING
+Hoe.new("Settingslogic", Settingslogic::Version::STRING) do |p|
+ p.name = "settingslogic"
p.author = "Ben Johnson of Binary Logic"
p.email = 'bjohnson@binarylogic.com'
- p.project = 'settingslogic'
- p.summary = "Simple and straightforward application wide settings"
+ p.summary = "Simple settings manaement using YAML"
+ p.description = "Simple settings manaement using YAML"
p.url = "http://github.com/binarylogic/settingslogic"
- p.dependencies = []
- p.include_rakefile = true
+ p.history_file = "CHANGELOG.rdoc"
+ p.readme_file = "README.rdoc"
+ p.extra_rdoc_files = ["CHANGELOG.rdoc", "README.rdoc"]
+ p.remote_rdoc_dir = ''
+ p.test_globs = ["test/*/test_*.rb", "test/*_test.rb", "test/*/*_test.rb"]
+ p.extra_deps = %w(activesupport)
end
View
2 lib/settingslogic.rb
@@ -10,4 +10,4 @@
end
# Since we don't have a Settings constant, lets go ahead and use it
-::Settings = Settingslogic::Settings unless defined?(Settings)
+::Settings = Settingslogic::Settings unless defined?(Settings)
View
1 lib/settingslogic/config.rb
@@ -1,5 +1,4 @@
module Settingslogic
- # = Config
# Sets configuration on Settingslogic.
class Config
class << self
View
4 lib/settingslogic/settings.rb
@@ -1,11 +1,9 @@
module Settingslogic
- # = Setting
- #
# A simple settings solution using a YAML file. See README for more information.
class Settings < Hash
class << self
def name # :nodoc:
- instance._settings.key?("name") ? instance.name : super
+ instance.key?("name") ? instance.name : super
end
# 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.
View
27 lib/settingslogic/version.rb
@@ -1,29 +1,4 @@
-# (The MIT License)
-#
-# Copyright (c) 2008 Jamis Buck <jamis@37signals.com>,
-# with modifications by Bruce Williams <bruce@fiveruns.com>
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# 'Software'), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
module Settingslogic
- # = Version
- #
# A class for describing the current version of a library. The version
# consists of three parts: the +major+ number, the +minor+ number, and the
# +tiny+ (or +patch+) number.
@@ -67,7 +42,7 @@ def to_a
MAJOR = 1
MINOR = 0
- TINY = 1
+ TINY = 2
# The current version as a Version instance
CURRENT = new(MAJOR, MINOR, TINY)
View
1 test/application.yml
@@ -3,3 +3,4 @@ setting1:
setting2: 5
setting3: <%= 5 * 5 %>
+name: test
View
4 test/test_setting.rb
@@ -1,6 +1,10 @@
require File.dirname(__FILE__) + '/test_helper.rb'
class TestSetting < Test::Unit::TestCase
+ def test_conflicting_class_methods
+ assert_equal "test", Settings.name
+ end
+
def test_singleton_access
assert_equal Settings, Settings.setting1.class
assert_equal "saweet", Settings.setting1.setting1_child

0 comments on commit 2b1b662

Please sign in to comment.