Skip to content

Commit 08792a6

Browse files
committed
get with the times
1 parent c510aff commit 08792a6

File tree

9 files changed

+46
-178
lines changed

9 files changed

+46
-178
lines changed

CHANGELOG.rdoc

Lines changed: 0 additions & 27 deletions
This file was deleted.

Gemfile

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,2 @@
1-
source "http://rubygems.org"
2-
3-
group :development do
4-
gem 'rake'
5-
gem 'jeweler'
6-
gem 'rspec', :require => 'spec'
7-
gem 'rcov'
8-
if RUBY_VERSION < "1.9"
9-
gem 'ruby-debug'
10-
else
11-
gem 'ruby-debug19'
12-
end
13-
end
1+
source :rubygems
2+
gemspec

Gemfile.lock

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,26 @@
1+
PATH
2+
remote: .
3+
specs:
4+
settingslogic (2.0.9)
5+
16
GEM
27
remote: http://rubygems.org/
38
specs:
4-
columnize (0.3.6)
59
diff-lcs (1.1.3)
6-
git (1.2.5)
7-
jeweler (1.6.4)
8-
bundler (~> 1.0)
9-
git (>= 1.2.5)
10-
rake
11-
linecache (0.46)
12-
rbx-require-relative (> 0.0.4)
13-
rake (0.9.2.2)
14-
rbx-require-relative (0.0.5)
15-
rcov (0.9.11)
16-
rspec (2.8.0)
17-
rspec-core (~> 2.8.0)
18-
rspec-expectations (~> 2.8.0)
19-
rspec-mocks (~> 2.8.0)
20-
rspec-core (2.8.0)
21-
rspec-expectations (2.8.0)
22-
diff-lcs (~> 1.1.2)
23-
rspec-mocks (2.8.0)
24-
ruby-debug (0.10.4)
25-
columnize (>= 0.1)
26-
ruby-debug-base (~> 0.10.4.0)
27-
ruby-debug-base (0.10.4)
28-
linecache (>= 0.3)
10+
rake (10.0.3)
11+
rspec (2.12.0)
12+
rspec-core (~> 2.12.0)
13+
rspec-expectations (~> 2.12.0)
14+
rspec-mocks (~> 2.12.0)
15+
rspec-core (2.12.2)
16+
rspec-expectations (2.12.1)
17+
diff-lcs (~> 1.1.3)
18+
rspec-mocks (2.12.1)
2919

3020
PLATFORMS
3121
ruby
3222

3323
DEPENDENCIES
34-
jeweler
3524
rake
36-
rcov
3725
rspec
38-
ruby-debug
26+
settingslogic!

README.rdoc

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
Settingslogic is a simple configuration / settings solution that uses an ERB enabled YAML file. It has been great for
44
our apps, maybe you will enjoy it too. Settingslogic works with Rails, Sinatra, or any Ruby project.
55

6-
So here is my question to you.....is Settingslogic a great settings solution or the greatest?
7-
86
== Helpful links
97

108
* <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
1311

1412
== Installation
1513

16-
Install from rubyforge/gemcutter:
17-
18-
sudo gem install settingslogic
19-
20-
Or as a Rails plugin:
21-
22-
script/plugin install git://github.com/binarylogic/settingslogic.git
23-
24-
Settingslogic does not have any dependencies on Rails. Installing as a gem is recommended.
14+
gem install settingslogic
2515

2616
== Usage
2717

@@ -54,7 +44,7 @@ Using a namespace allows us to change our configuration depending on our environ
5444
saweet: nested settings
5545
neat_setting: 24
5646
awesome_setting: <%= "Did you know 5 + 5 = #{5 + 5}?" %>
57-
47+
5848
development:
5949
<<: *defaults
6050
neat_setting: 800
@@ -65,7 +55,7 @@ Using a namespace allows us to change our configuration depending on our environ
6555
production:
6656
<<: *defaults
6757

68-
_Note_: Certain Ruby/Bundler versions include a version of the Psych YAML parser which incorrectly handles merges (the `<<` in the example above.)
58+
_Note_: Certain Ruby/Bundler versions include a version of the Psych YAML parser which incorrectly handles merges (the `<<` in the example above.)
6959
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:
7060

7161
require 'yaml'
@@ -78,17 +68,17 @@ If your default settings seem to be overwriting your environment-specific settin
7868

7969
>> Settings.cool
8070
=> "#<Settingslogic::Settings ... >"
81-
71+
8272
>> Settings.cool.saweet
8373
=> "nested settings"
84-
74+
8575
>> Settings.neat_setting
8676
=> 800
87-
77+
8878
>> Settings.awesome_setting
8979
=> "Did you know 5 + 5 = 10?"
9080

91-
You can use these settings anywhere, for example in a model:
81+
You can use these settings anywhere, for example in a model:
9282

9383
class Post < ActiveRecord::Base
9484
self.per_page = Settings.pagination.posts_per_page
@@ -116,7 +106,7 @@ Modifying our model example:
116106
class Post < ActiveRecord::Base
117107
self.per_page = Settings.posts['per_page'] || Settings.pagination.per_page
118108
end
119-
109+
120110
This would allow you to specify a custom value for per_page just for posts, or
121111
to fall back to your default value if not specified.
122112

@@ -145,7 +135,7 @@ in the global Object namespace:
145135

146136
This can cause collisions with Settingslogic, since those methods are global. Luckily, the
147137
solution is to just add a call to load! in your class:
148-
138+
149139
class Settings < Settingslogic
150140
source "#{Rails.root}/config/application.yml"
151141
namespace Rails.env

Rakefile

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
1-
require 'rubygems'
2-
require 'rake'
3-
4-
begin
5-
require 'jeweler'
6-
Jeweler::Tasks.new do |gem|
7-
gem.name = "settingslogic"
8-
gem.summary = "A simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern."
9-
gem.email = "bjohnson@binarylogic.com"
10-
gem.homepage = "http://github.com/binarylogic/settingslogic"
11-
gem.authors = ["Ben Johnson of Binary Logic"]
12-
end
13-
Jeweler::GemcutterTasks.new
14-
rescue LoadError
15-
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
16-
end
1+
require 'bundler'
2+
Bundler::GemHelper.install_tasks
173

184
require 'rspec/core/rake_task'
19-
RSpec::Core::RakeTask.new(:spec)
20-
21-
RSpec::Core::RakeTask.new(:rcov) do |spec|
22-
spec.pattern = 'spec/**/*_spec.rb'
23-
spec.rcov = true
24-
end
5+
RSpec::Core::RakeTask.new
256

26-
task :default => :spec
7+
task :default => :spec

VERSION.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

init.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

rails/init.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

settingslogic.gemspec

Lines changed: 16 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,21 @@
1-
# Generated by jeweler
2-
# DO NOT EDIT THIS FILE DIRECTLY
3-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
41
# -*- encoding: utf-8 -*-
2+
$:.push File.expand_path("../lib", __FILE__)
53

64
Gem::Specification.new do |s|
7-
s.name = "settingslogic"
8-
s.version = "2.0.8"
5+
s.name = "settingslogic"
6+
s.version = "2.0.9"
7+
s.platform = Gem::Platform::RUBY
8+
s.authors = ["Ben Johnson"]
9+
s.email = ["bjohnson@binarylogic.com"]
10+
s.homepage = "http://github.com/binarylogic/settingslogic"
11+
s.summary = %q{A simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern.}
12+
s.description = %q{A simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern.}
913

10-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11-
s.authors = ["Ben Johnson of Binary Logic"]
12-
s.date = "2012-01-09"
13-
s.email = "bjohnson@binarylogic.com"
14-
s.extra_rdoc_files = [
15-
"LICENSE",
16-
"README.rdoc"
17-
]
18-
s.files = [
19-
"CHANGELOG.rdoc",
20-
"Gemfile",
21-
"Gemfile.lock",
22-
"LICENSE",
23-
"README.rdoc",
24-
"Rakefile",
25-
"VERSION.yml",
26-
"init.rb",
27-
"lib/settingslogic.rb",
28-
"rails/init.rb",
29-
"settingslogic.gemspec",
30-
"spec/settings.rb",
31-
"spec/settings.yml",
32-
"spec/settings2.rb",
33-
"spec/settings3.rb",
34-
"spec/settings4.rb",
35-
"spec/settingslogic_spec.rb",
36-
"spec/spec_helper.rb"
37-
]
38-
s.homepage = "http://github.com/binarylogic/settingslogic"
39-
s.require_paths = ["lib"]
40-
s.rubygems_version = "1.8.10"
41-
s.summary = "A simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern."
42-
43-
if s.respond_to? :specification_version then
44-
s.specification_version = 3
45-
46-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47-
s.add_development_dependency(%q<rake>, [">= 0"])
48-
s.add_development_dependency(%q<jeweler>, [">= 0"])
49-
s.add_development_dependency(%q<rspec>, [">= 0"])
50-
s.add_development_dependency(%q<rcov>, [">= 0"])
51-
s.add_development_dependency(%q<ruby-debug19>, [">= 0"])
52-
else
53-
s.add_dependency(%q<rake>, [">= 0"])
54-
s.add_dependency(%q<jeweler>, [">= 0"])
55-
s.add_dependency(%q<rspec>, [">= 0"])
56-
s.add_dependency(%q<rcov>, [">= 0"])
57-
s.add_dependency(%q<ruby-debug19>, [">= 0"])
58-
end
59-
else
60-
s.add_dependency(%q<rake>, [">= 0"])
61-
s.add_dependency(%q<jeweler>, [">= 0"])
62-
s.add_dependency(%q<rspec>, [">= 0"])
63-
s.add_dependency(%q<rcov>, [">= 0"])
64-
s.add_dependency(%q<ruby-debug19>, [">= 0"])
65-
end
66-
end
14+
s.add_development_dependency 'rake'
15+
s.add_development_dependency 'rspec'
6716

17+
s.files = `git ls-files`.split("\n")
18+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20+
s.require_paths = ["lib"]
21+
end

0 commit comments

Comments
 (0)