memcached-manager 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/lib/extensions/memcached_settings.rb +2 -2
- data/memcached-manager.gemspec +2 -5
- data/spec/lib/extensions/memcached_settings_spec.rb +15 -0
- metadata +3 -19
data/Gemfile
CHANGED
@@ -3,13 +3,13 @@ source 'https://rubygems.org'
|
|
3
3
|
gem "sinatra"
|
4
4
|
gem "sinatra-contrib"
|
5
5
|
gem "dalli"
|
6
|
-
gem "poltergeist"
|
7
6
|
|
8
7
|
group :development do
|
9
8
|
gem "jeweler", "~> 1.8.8"
|
10
9
|
end
|
11
10
|
|
12
11
|
group :test do
|
12
|
+
gem "poltergeist"
|
13
13
|
gem "rack-test", :require => "rack/test"
|
14
14
|
gem "rspec"
|
15
15
|
gem "mocha"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.1
|
@@ -2,12 +2,12 @@ module Sinatra
|
|
2
2
|
module MemcachedSettings
|
3
3
|
def memcached_host session
|
4
4
|
return session['host'] if configured? session, 'host'
|
5
|
-
'localhost'
|
5
|
+
ENV['memcached_host'] || 'localhost'
|
6
6
|
end
|
7
7
|
|
8
8
|
def memcached_port session
|
9
9
|
return session['port'] if configured? session, 'port'
|
10
|
-
'11211'
|
10
|
+
ENV['memcached_port'] || '11211'
|
11
11
|
end
|
12
12
|
|
13
13
|
private
|
data/memcached-manager.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "memcached-manager"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Thiago Fernandes Massa"]
|
12
|
-
s.date = "2013-10-
|
12
|
+
s.date = "2013-10-17"
|
13
13
|
s.description = "A sinatra memcached-manager that allows you to view status, flush/view keys and so on. Also easily pluggable to a Rails app."
|
14
14
|
s.email = "thiagown@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -119,7 +119,6 @@ Gem::Specification.new do |s|
|
|
119
119
|
s.add_runtime_dependency(%q<sinatra>, [">= 0"])
|
120
120
|
s.add_runtime_dependency(%q<sinatra-contrib>, [">= 0"])
|
121
121
|
s.add_runtime_dependency(%q<dalli>, [">= 0"])
|
122
|
-
s.add_runtime_dependency(%q<poltergeist>, [">= 0"])
|
123
122
|
s.add_development_dependency(%q<jeweler>, ["~> 1.8.8"])
|
124
123
|
s.add_development_dependency(%q<jasmine>, ["= 1.3.2"])
|
125
124
|
s.add_development_dependency(%q<cucumber>, [">= 0"])
|
@@ -127,7 +126,6 @@ Gem::Specification.new do |s|
|
|
127
126
|
s.add_dependency(%q<sinatra>, [">= 0"])
|
128
127
|
s.add_dependency(%q<sinatra-contrib>, [">= 0"])
|
129
128
|
s.add_dependency(%q<dalli>, [">= 0"])
|
130
|
-
s.add_dependency(%q<poltergeist>, [">= 0"])
|
131
129
|
s.add_dependency(%q<jeweler>, ["~> 1.8.8"])
|
132
130
|
s.add_dependency(%q<jasmine>, ["= 1.3.2"])
|
133
131
|
s.add_dependency(%q<cucumber>, [">= 0"])
|
@@ -136,7 +134,6 @@ Gem::Specification.new do |s|
|
|
136
134
|
s.add_dependency(%q<sinatra>, [">= 0"])
|
137
135
|
s.add_dependency(%q<sinatra-contrib>, [">= 0"])
|
138
136
|
s.add_dependency(%q<dalli>, [">= 0"])
|
139
|
-
s.add_dependency(%q<poltergeist>, [">= 0"])
|
140
137
|
s.add_dependency(%q<jeweler>, ["~> 1.8.8"])
|
141
138
|
s.add_dependency(%q<jasmine>, ["= 1.3.2"])
|
142
139
|
s.add_dependency(%q<cucumber>, [">= 0"])
|
@@ -4,6 +4,11 @@ describe Sinatra::MemcachedSettings do
|
|
4
4
|
let(:configured_session) { { 'host' => 'i.am', 'port' => '1337' } }
|
5
5
|
let(:empty_session) { {} }
|
6
6
|
let(:klass) { Class.new.extend(Sinatra::MemcachedSettings) }
|
7
|
+
|
8
|
+
before :each do
|
9
|
+
ENV.stubs(:[]).with("memcached_host").returns(nil)
|
10
|
+
ENV.stubs(:[]).with("memcached_port").returns(nil)
|
11
|
+
end
|
7
12
|
|
8
13
|
context '#memcached_host' do
|
9
14
|
it "host exists" do
|
@@ -13,6 +18,11 @@ describe Sinatra::MemcachedSettings do
|
|
13
18
|
it "host doesn't exist" do
|
14
19
|
klass.memcached_host(empty_session).should eql 'localhost'
|
15
20
|
end
|
21
|
+
|
22
|
+
it "host is set as an env variable" do
|
23
|
+
ENV.stubs(:[]).with("memcached_host").returns('ruby-lang.org')
|
24
|
+
klass.memcached_host(empty_session).should eql 'ruby-lang.org'
|
25
|
+
end
|
16
26
|
end
|
17
27
|
|
18
28
|
context '#memcached_port' do
|
@@ -23,6 +33,11 @@ describe Sinatra::MemcachedSettings do
|
|
23
33
|
it "port doesn't exist" do
|
24
34
|
klass.memcached_port(empty_session).should eql '11211'
|
25
35
|
end
|
36
|
+
|
37
|
+
it "port is set as an env variable" do
|
38
|
+
ENV.stubs(:[]).with("memcached_port").returns('9000')
|
39
|
+
klass.memcached_port(empty_session).should eql '9000'
|
40
|
+
end
|
26
41
|
end
|
27
42
|
|
28
43
|
context '-#configured?' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memcached-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
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: 2013-10-
|
12
|
+
date: 2013-10-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|
@@ -59,22 +59,6 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: poltergeist
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :runtime
|
71
|
-
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0'
|
78
62
|
- !ruby/object:Gem::Dependency
|
79
63
|
name: jeweler
|
80
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -235,7 +219,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
235
219
|
version: '0'
|
236
220
|
segments:
|
237
221
|
- 0
|
238
|
-
hash: -
|
222
|
+
hash: -2396676989804410349
|
239
223
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
224
|
none: false
|
241
225
|
requirements:
|