burger_fixins 0.0.2 → 0.0.4

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.
@@ -10,7 +10,8 @@ There's so many different options for burger fixins.
10
10
 
11
11
  class SiteSettings
12
12
  include BurgerFixins
13
-
13
+
14
+ redis_instance Redis.new(:db => 15)
14
15
  setting :bacon, :boolean
15
16
  setting :lettuce_types, :array
16
17
  setting :burger_limit, :integer
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.4
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{burger_fixins}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Patrick Tulskie"]
@@ -70,9 +70,9 @@ module BurgerFixins
70
70
 
71
71
  def create_burger_fixins_boolean(setting_name)
72
72
  module_eval <<-STR
73
- def self.#{setting_name}; Redis::Value.new('#{setting_name}', settings_store).value ; end
74
- def self.#{setting_name}=(v); Redis::Value.new('#{setting_name}', settings_store).value = v ; end
75
- def self.#{setting_name}?; !!settings_store['#{setting_name.to_s}'] ; end
73
+ def self.#{setting_name}; Redis::Value.new('#{setting_name}', settings_store).value == "true" ; end
74
+ def self.#{setting_name}=(v); settings_store['#{setting_name.to_s}'] = v.to_s ; end
75
+ def self.#{setting_name}?; Redis::Value.new('#{setting_name}', settings_store).value == "true" ; end
76
76
  STR
77
77
  end
78
78
 
@@ -29,6 +29,20 @@ describe 'burger_fixins' do
29
29
  Redis.new(:db => 15)['TestSettings:bacon'].should == "true"
30
30
  end
31
31
 
32
+ it "should be able to false boolean values" do
33
+ TestSettings.bacon = true
34
+ TestSettings.bacon.should be_true
35
+ TestSettings.bacon = false
36
+ TestSettings.bacon.should be_false
37
+ end
38
+
39
+ it "should be able to answer boolean questions" do
40
+ TestSettings.bacon = true
41
+ TestSettings.bacon?.should be_true
42
+ TestSettings.bacon = false
43
+ TestSettings.bacon?.should be_false
44
+ end
45
+
32
46
  it "should retrieve a setting" do
33
47
  TestSettings.bacon = true
34
48
  TestSettings.bacon.should be_true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: burger_fixins
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Patrick Tulskie