Skip to content
Browse files

get with the times

  • Loading branch information...
1 parent c510aff commit 08792a6dd770e0754a73edffdc525507dfcdb81d @binarylogic committed Dec 30, 2012
Showing with 46 additions and 178 deletions.
  1. +0 −27 CHANGELOG.rdoc
  2. +2 −13 Gemfile
  3. +15 −27 Gemfile.lock
  4. +9 −19 README.rdoc
  5. +4 −23 Rakefile
  6. +0 −5 VERSION.yml
  7. +0 −1 init.rb
  8. +0 −1 rails/init.rb
  9. +16 −62 settingslogic.gemspec
View
27 CHANGELOG.rdoc
@@ -1,27 +0,0 @@
-== 2.0.2 released 2009-08-22
-
-* Define methods during method_missing instead of during initialization. Allows for modification on the fly.
-
-== 2.0.0 released 2009-08-22
-
-* Less magic, instead of automatically defining a Settings constant, you should define your own constant. See the readme for an example.
-
-== 1.0.3 released 2009-04-23
-
-* Fix Settings initialized with a Hash to work with both symbol and string hash keys.
-
-== 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.
-
-== 1.0.0 released 2008-12-05
-
-* Only define methods if we have settings.
-
-== 0.9.0 released 2008-10-30
-
-* Initial release
View
15 Gemfile
@@ -1,13 +1,2 @@
-source "http://rubygems.org"
-
-group :development do
- gem 'rake'
- gem 'jeweler'
- gem 'rspec', :require => 'spec'
- gem 'rcov'
- if RUBY_VERSION < "1.9"
- gem 'ruby-debug'
- else
- gem 'ruby-debug19'
- end
-end
+source :rubygems
+gemspec
View
42 Gemfile.lock
@@ -1,38 +1,26 @@
+PATH
+ remote: .
+ specs:
+ settingslogic (2.0.9)
+
GEM
remote: http://rubygems.org/
specs:
- columnize (0.3.6)
diff-lcs (1.1.3)
- git (1.2.5)
- jeweler (1.6.4)
- bundler (~> 1.0)
- git (>= 1.2.5)
- rake
- linecache (0.46)
- rbx-require-relative (> 0.0.4)
- rake (0.9.2.2)
- rbx-require-relative (0.0.5)
- rcov (0.9.11)
- rspec (2.8.0)
- rspec-core (~> 2.8.0)
- rspec-expectations (~> 2.8.0)
- rspec-mocks (~> 2.8.0)
- rspec-core (2.8.0)
- rspec-expectations (2.8.0)
- diff-lcs (~> 1.1.2)
- rspec-mocks (2.8.0)
- ruby-debug (0.10.4)
- columnize (>= 0.1)
- ruby-debug-base (~> 0.10.4.0)
- ruby-debug-base (0.10.4)
- linecache (>= 0.3)
+ rake (10.0.3)
+ rspec (2.12.0)
+ rspec-core (~> 2.12.0)
+ rspec-expectations (~> 2.12.0)
+ rspec-mocks (~> 2.12.0)
+ rspec-core (2.12.2)
+ rspec-expectations (2.12.1)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.12.1)
PLATFORMS
ruby
DEPENDENCIES
- jeweler
rake
- rcov
rspec
- ruby-debug
+ settingslogic!
View
28 README.rdoc
@@ -3,8 +3,6 @@
Settingslogic is a simple configuration / settings solution that uses an ERB enabled YAML file. It has been great for
our apps, maybe you will enjoy it too. Settingslogic works with Rails, Sinatra, or any Ruby project.
-So here is my question to you.....is Settingslogic a great settings solution or the greatest?
-
== Helpful links
* <b>Documentation:</b> http://rdoc.info/projects/binarylogic/settingslogic
@@ -13,15 +11,7 @@ So here is my question to you.....is Settingslogic a great settings solution or
== Installation
-Install from rubyforge/gemcutter:
-
- sudo gem install settingslogic
-
-Or as a Rails plugin:
-
- script/plugin install git://github.com/binarylogic/settingslogic.git
-
-Settingslogic does not have any dependencies on Rails. Installing as a gem is recommended.
+ gem install settingslogic
== Usage
@@ -54,7 +44,7 @@ Using a namespace allows us to change our configuration depending on our environ
saweet: nested settings
neat_setting: 24
awesome_setting: <%= "Did you know 5 + 5 = #{5 + 5}?" %>
-
+
development:
<<: *defaults
neat_setting: 800
@@ -65,7 +55,7 @@ Using a namespace allows us to change our configuration depending on our environ
production:
<<: *defaults
-_Note_: Certain Ruby/Bundler versions include a version of the Psych YAML parser which incorrectly handles merges (the `<<` in the example above.)
+_Note_: Certain Ruby/Bundler versions include a version of the Psych YAML parser which incorrectly handles merges (the `<<` in the example above.)
If your default settings seem to be overwriting your environment-specific settings, including the following lines in your config/boot.rb file may solve the problem:
require 'yaml'
@@ -78,17 +68,17 @@ If your default settings seem to be overwriting your environment-specific settin
>> Settings.cool
=> "#<Settingslogic::Settings ... >"
-
+
>> Settings.cool.saweet
=> "nested settings"
-
+
>> Settings.neat_setting
=> 800
-
+
>> Settings.awesome_setting
=> "Did you know 5 + 5 = 10?"
-You can use these settings anywhere, for example in a model:
+You can use these settings anywhere, for example in a model:
class Post < ActiveRecord::Base
self.per_page = Settings.pagination.posts_per_page
@@ -116,7 +106,7 @@ Modifying our model example:
class Post < ActiveRecord::Base
self.per_page = Settings.posts['per_page'] || Settings.pagination.per_page
end
-
+
This would allow you to specify a custom value for per_page just for posts, or
to fall back to your default value if not specified.
@@ -145,7 +135,7 @@ in the global Object namespace:
This can cause collisions with Settingslogic, since those methods are global. Luckily, the
solution is to just add a call to load! in your class:
-
+
class Settings < Settingslogic
source "#{Rails.root}/config/application.yml"
namespace Rails.env
View
27 Rakefile
@@ -1,26 +1,7 @@
-require 'rubygems'
-require 'rake'
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "settingslogic"
- gem.summary = "A simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern."
- gem.email = "bjohnson@binarylogic.com"
- gem.homepage = "http://github.com/binarylogic/settingslogic"
- gem.authors = ["Ben Johnson of Binary Logic"]
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
-end
+require 'bundler'
+Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'
-RSpec::Core::RakeTask.new(:spec)
-
-RSpec::Core::RakeTask.new(:rcov) do |spec|
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
-end
+RSpec::Core::RakeTask.new
-task :default => :spec
+task :default => :spec
View
5 VERSION.yml
@@ -1,5 +0,0 @@
----
-:major: 2
-:minor: 0
-:patch: 8
-:build:
View
1 init.rb
@@ -1 +0,0 @@
-require File.dirname(__FILE__) + "/rails/init.rb"
View
1 rails/init.rb
@@ -1 +0,0 @@
-require "settingslogic"
View
78 settingslogic.gemspec
@@ -1,67 +1,21 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
- s.name = "settingslogic"
- s.version = "2.0.8"
+ s.name = "settingslogic"
+ s.version = "2.0.9"
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Ben Johnson"]
+ s.email = ["bjohnson@binarylogic.com"]
+ s.homepage = "http://github.com/binarylogic/settingslogic"
+ s.summary = %q{A simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern.}
+ s.description = %q{A simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern.}
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Ben Johnson of Binary Logic"]
- s.date = "2012-01-09"
- s.email = "bjohnson@binarylogic.com"
- s.extra_rdoc_files = [
- "LICENSE",
- "README.rdoc"
- ]
- s.files = [
- "CHANGELOG.rdoc",
- "Gemfile",
- "Gemfile.lock",
- "LICENSE",
- "README.rdoc",
- "Rakefile",
- "VERSION.yml",
- "init.rb",
- "lib/settingslogic.rb",
- "rails/init.rb",
- "settingslogic.gemspec",
- "spec/settings.rb",
- "spec/settings.yml",
- "spec/settings2.rb",
- "spec/settings3.rb",
- "spec/settings4.rb",
- "spec/settingslogic_spec.rb",
- "spec/spec_helper.rb"
- ]
- s.homepage = "http://github.com/binarylogic/settingslogic"
- s.require_paths = ["lib"]
- s.rubygems_version = "1.8.10"
- s.summary = "A simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern."
-
- if s.respond_to? :specification_version then
- s.specification_version = 3
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<rake>, [">= 0"])
- s.add_development_dependency(%q<jeweler>, [">= 0"])
- s.add_development_dependency(%q<rspec>, [">= 0"])
- s.add_development_dependency(%q<rcov>, [">= 0"])
- s.add_development_dependency(%q<ruby-debug19>, [">= 0"])
- else
- s.add_dependency(%q<rake>, [">= 0"])
- s.add_dependency(%q<jeweler>, [">= 0"])
- s.add_dependency(%q<rspec>, [">= 0"])
- s.add_dependency(%q<rcov>, [">= 0"])
- s.add_dependency(%q<ruby-debug19>, [">= 0"])
- end
- else
- s.add_dependency(%q<rake>, [">= 0"])
- s.add_dependency(%q<jeweler>, [">= 0"])
- s.add_dependency(%q<rspec>, [">= 0"])
- s.add_dependency(%q<rcov>, [">= 0"])
- s.add_dependency(%q<ruby-debug19>, [">= 0"])
- end
-end
+ s.add_development_dependency 'rake'
+ s.add_development_dependency 'rspec'
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+end

0 comments on commit 08792a6

Please sign in to comment.
Something went wrong with that request. Please try again.