rsettings 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.7.0
@@ -5,7 +5,7 @@ class Defaults
5
5
 
6
6
  def get(setting)
7
7
  real_name = @names.reverse_for setting
8
- Setting.new defaults[real_name]
8
+ Setting.new(defaults[real_name] || defaults[real_name.to_sym])
9
9
  end
10
10
 
11
11
  def add(name, value)
@@ -11,5 +11,5 @@ class ConvertibleSettingName
11
11
  @name,@names = name,names
12
12
  end
13
13
 
14
- def value; @names.for @name; end
14
+ def value; @names.for(@name) || @name; end
15
15
  end
data/rsettings.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "rsettings"
8
- s.version = "0.6.0"
8
+ s.version = "0.7.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben Biddington"]
12
- s.date = "2014-05-07"
12
+ s.date = "2014-06-18"
13
13
  s.description = "Settings"
14
14
  s.email = "ben.biddington@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -36,4 +36,12 @@ describe "default values for missing settings" do
36
36
 
37
37
  expect(settings.colour).to eql "pink"
38
38
  end
39
+
40
+ it "can default a flag too" do
41
+ settings = Settings.new do
42
+ default :loud, :to => "on"
43
+ end
44
+
45
+ expect(settings.loud?).to be_true
46
+ end
39
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsettings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-07 00:00:00.000000000 Z
12
+ date: 2014-06-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: audible
@@ -142,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  segments:
144
144
  - 0
145
- hash: -127506227
145
+ hash: -663822927
146
146
  required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  none: false
148
148
  requirements: