burger_fixins 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.mdown +1 -1
- data/VERSION +1 -1
- data/burger_fixins.gemspec +2 -2
- data/lib/burger_fixins/burger_fixins.rb +7 -3
- data/spec/burger_fixins_spec.rb +3 -5
- metadata +4 -4
data/README.mdown
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/burger_fixins.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{burger_fixins}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.2"
|
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"]
|
12
|
-
s.date = %q{2011-05-
|
12
|
+
s.date = %q{2011-05-05}
|
13
13
|
s.description = %q{Simple, yet, flexible redis-backed site/application settings manager. Works with Rails, Sinatra, or just plain old Ruby.}
|
14
14
|
s.email = %q{patricktulskie@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -7,10 +7,14 @@ module BurgerFixins
|
|
7
7
|
end
|
8
8
|
|
9
9
|
module ClassMethods
|
10
|
-
def redis_instance
|
11
|
-
|
10
|
+
def redis_instance(r = nil)
|
11
|
+
if r
|
12
|
+
@@redis_instance = r
|
13
|
+
else
|
14
|
+
defined?(@@redis_instance) ? @@redis_instance : Redis.current
|
15
|
+
end
|
12
16
|
end
|
13
|
-
|
17
|
+
|
14
18
|
def settings_store
|
15
19
|
Redis::Namespace.new(self.to_s, :redis => redis_instance)
|
16
20
|
end
|
data/spec/burger_fixins_spec.rb
CHANGED
@@ -8,22 +8,20 @@ describe 'burger_fixins' do
|
|
8
8
|
class TestSettings
|
9
9
|
include BurgerFixins
|
10
10
|
|
11
|
+
redis_instance Redis.new(:db => 15)
|
11
12
|
setting :bacon, :boolean
|
12
13
|
setting :lettuce_types, :array
|
13
14
|
setting :burger_limit, :integer
|
14
15
|
|
15
|
-
def self.redis_instance
|
16
|
-
Redis.new(:db => 15)
|
17
|
-
end
|
18
16
|
end
|
19
17
|
end
|
20
18
|
|
21
19
|
before(:each) do
|
22
|
-
|
20
|
+
Redis.new(:db => 15).flushdb
|
23
21
|
end
|
24
22
|
|
25
23
|
after(:each) do
|
26
|
-
|
24
|
+
Redis.new(:db => 15).flushdb
|
27
25
|
end
|
28
26
|
|
29
27
|
it "should save a setting" do
|
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:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Patrick Tulskie
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-05-
|
18
|
+
date: 2011-05-05 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|