elephas 4.1.5 → 4.1.6

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.
@@ -8,7 +8,7 @@ source "http://rubygems.org"
8
8
 
9
9
  gemspec
10
10
 
11
- # Testing gems
11
+ # Testing
12
12
  gem "rspec", "~> 2.14.1"
13
13
  gem "rake", "~> 10.1.0"
14
14
  gem "simplecov", ">= 0.7.1"
@@ -7,4 +7,4 @@ rvm:
7
7
  script: bundle exec rake spec:coverage
8
8
  gemfile: .travis-gemfile
9
9
  notifications:
10
- email: false
10
+ email: false
data/Rakefile CHANGED
@@ -9,3 +9,21 @@ require "rspec/core/rake_task"
9
9
 
10
10
  RSpec::Core::RakeTask.new("spec")
11
11
  RSpec::Core::RakeTask.new("spec:coverage") { |t| t.ruby_opts = "-r./spec/coverage_helper" }
12
+
13
+ desc "Generate the documentation"
14
+ task :docs do
15
+ system("yardoc") || raise("Failed Execution of: yardoc")
16
+ end
17
+
18
+ desc "Get the current release version"
19
+ task :version, :with_name do |_, args|
20
+ gem = Bundler::GemHelper.instance.gemspec
21
+ puts [args[:with_name] == "true" ? gem.name : nil, gem.version].compact.join("-")
22
+ end
23
+
24
+ desc "Prepare the release"
25
+ task :prerelease => ["spec:coverage", "docs"] do
26
+ ["git add -A", "git commit -am \"Version #{Bundler::GemHelper.instance.gemspec.version}\""].each do |cmd|
27
+ system(cmd) || raise("Failed Execution of: #{cmd}")
28
+ end
29
+ end
@@ -121,7 +121,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
121
121
  </div>
122
122
 
123
123
  <div id="footer">
124
- Generated on Sun Jul 14 15:54:08 2013 by
124
+ Generated on Sat Jul 20 10:45:30 2013 by
125
125
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
126
126
  0.8.6.2 (ruby-1.9.3).
127
127
  </div>
@@ -118,7 +118,7 @@
118
118
  </div>
119
119
 
120
120
  <div id="footer">
121
- Generated on Sun Jul 14 15:54:08 2013 by
121
+ Generated on Sat Jul 20 10:45:30 2013 by
122
122
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
123
123
  0.8.6.2 (ruby-1.9.3).
124
124
  </div>
@@ -662,7 +662,7 @@
662
662
  </div>
663
663
 
664
664
  <div id="footer">
665
- Generated on Sun Jul 14 15:54:09 2013 by
665
+ Generated on Sat Jul 20 10:45:30 2013 by
666
666
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
667
667
  0.8.6.2 (ruby-1.9.3).
668
668
  </div>
@@ -876,7 +876,7 @@
876
876
  </div>
877
877
 
878
878
  <div id="footer">
879
- Generated on Sun Jul 14 15:54:09 2013 by
879
+ Generated on Sat Jul 20 10:45:30 2013 by
880
880
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
881
881
  0.8.6.2 (ruby-1.9.3).
882
882
  </div>
@@ -597,7 +597,7 @@
597
597
  </div>
598
598
 
599
599
  <div id="footer">
600
- Generated on Sun Jul 14 15:54:09 2013 by
600
+ Generated on Sat Jul 20 10:45:31 2013 by
601
601
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
602
602
  0.8.6.2 (ruby-1.9.3).
603
603
  </div>
@@ -1839,7 +1839,7 @@ end</p>
1839
1839
  </div>
1840
1840
 
1841
1841
  <div id="footer">
1842
- Generated on Sun Jul 14 15:54:09 2013 by
1842
+ Generated on Sat Jul 20 10:45:30 2013 by
1843
1843
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1844
1844
  0.8.6.2 (ruby-1.9.3).
1845
1845
  </div>
@@ -2155,7 +2155,7 @@
2155
2155
  </div>
2156
2156
 
2157
2157
  <div id="footer">
2158
- Generated on Sun Jul 14 15:54:09 2013 by
2158
+ Generated on Sat Jul 20 10:45:30 2013 by
2159
2159
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2160
2160
  0.8.6.2 (ruby-1.9.3).
2161
2161
  </div>
@@ -149,7 +149,7 @@
149
149
 
150
150
  </div>
151
151
  </dt>
152
- <dd><pre class="code"><span class='int'>5</span></pre></dd>
152
+ <dd><pre class="code"><span class='int'>6</span></pre></dd>
153
153
 
154
154
  <dt id="STRING-constant" class="">STRING =
155
155
  <div class="docstring">
@@ -180,7 +180,7 @@
180
180
  </div>
181
181
 
182
182
  <div id="footer">
183
- Generated on Sun Jul 14 15:54:08 2013 by
183
+ Generated on Sat Jul 20 10:45:30 2013 by
184
184
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
185
185
  0.8.6.2 (ruby-1.9.3).
186
186
  </div>
@@ -190,7 +190,7 @@
190
190
  </div>
191
191
 
192
192
  <div id="footer">
193
- Generated on Sun Jul 14 15:54:08 2013 by
193
+ Generated on Sat Jul 20 10:45:30 2013 by
194
194
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
195
195
  0.8.6.2 (ruby-1.9.3).
196
196
  </div>
@@ -128,7 +128,7 @@ end
128
128
  </div></div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Sun Jul 14 15:54:08 2013 by
131
+ Generated on Sat Jul 20 10:45:30 2013 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.8.6.2 (ruby-1.9.3).
134
134
  </div>
@@ -128,7 +128,7 @@ end
128
128
  </div></div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Sun Jul 14 15:54:08 2013 by
131
+ Generated on Sat Jul 20 10:45:30 2013 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
133
  0.8.6.2 (ruby-1.9.3).
134
134
  </div>
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Sun Jul 14 15:54:08 2013 by
106
+ Generated on Sat Jul 20 10:45:30 2013 by
107
107
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
108
  0.8.6.2 (ruby-1.9.3).
109
109
  </div>
@@ -24,5 +24,5 @@ Gem::Specification.new do |gem|
24
24
 
25
25
  gem.required_ruby_version = ">= 1.9.3"
26
26
 
27
- gem.add_dependency("lazier", "~> 3.2.5")
27
+ gem.add_dependency("lazier", "~> 3.2.6")
28
28
  end
@@ -17,7 +17,7 @@ module Elephas
17
17
  MINOR = 1
18
18
 
19
19
  # The patch version.
20
- PATCH = 5
20
+ PATCH = 6
21
21
 
22
22
  # The current version of elephas.
23
23
  STRING = [MAJOR, MINOR, PATCH].compact.join(".")
@@ -12,15 +12,15 @@ describe Elephas::Cache do
12
12
 
13
13
  describe ".use" do
14
14
  it "should use the provider for reading the value" do
15
- reference.backend.should_receive(:read)
15
+ expect(reference.backend).to receive(:read)
16
16
  reference.use("KEY") do "VALUE" end
17
17
  end
18
18
 
19
19
  it "should skip the provider if requested to" do
20
20
  reference.use("KEY", {ttl: 0}) do "VALUE" end
21
- reference.backend.should_not_receive(:read)
21
+ expect(reference.backend).not_to receive(:read)
22
22
  reference.use("KEY", {force: true}) do "VALUE" end
23
- reference.backend.should_not_receive(:read)
23
+ expect(reference.backend).not_to receive(:read)
24
24
  end
25
25
 
26
26
  it "should use the block for value computation" do
@@ -49,28 +49,28 @@ describe Elephas::Cache do
49
49
 
50
50
  describe ".read" do
51
51
  it "should be forwarded to the provider" do
52
- reference.backend.should_receive(:read)
52
+ expect(reference.backend).to receive(:read)
53
53
  reference.read("KEY")
54
54
  end
55
55
  end
56
56
 
57
57
  describe ".write" do
58
58
  it "should be forwarded to the provider" do
59
- reference.backend.should_receive(:write)
59
+ expect(reference.backend).to receive(:write)
60
60
  reference.write("KEY", "VALUE")
61
61
  end
62
62
  end
63
63
 
64
64
  describe ".delete" do
65
65
  it "should be forwarded to the provider" do
66
- reference.backend.should_receive(:delete)
66
+ expect(reference.backend).to receive(:delete)
67
67
  reference.delete("KEY")
68
68
  end
69
69
  end
70
70
 
71
71
  describe ".exists?" do
72
72
  it "should be forwarded to the provider" do
73
- reference.backend.should_receive(:exists?)
73
+ expect(reference.backend).to receive(:exists?)
74
74
  reference.exists?("KEY")
75
75
  end
76
76
  end
@@ -12,14 +12,14 @@ describe Elephas::Entry do
12
12
 
13
13
  describe "#initialize" do
14
14
  it "should initialize with good defaults" do
15
- ::Time.stub(:now).and_return(123.456)
15
+ allow(::Time).to receive(:now).and_return(123.456)
16
16
  expect(subject.key).to eq("KEY")
17
17
  expect(subject.value).to eq("VALUE")
18
18
  expect(subject.hash).to eq("5ca24005b740717ba4f3f6bc48a230700e68c2a4b11ecedb96f169f4efaf1f21")
19
19
  expect(subject.ttl).to eq(360000)
20
20
  expect(subject.updated_at).to eq(123.456)
21
21
 
22
- ::Time.stub(:now).and_return(123.789)
22
+ allow(::Time).to receive(:now).and_return(123.789)
23
23
  other = ::Elephas::Entry.new("KEY 1", "VALUE 1", "HASH", 7200)
24
24
  expect(other.key).to eq("KEY 1")
25
25
  expect(other.value).to eq("VALUE 1")
@@ -31,12 +31,12 @@ describe Elephas::Entry do
31
31
 
32
32
  describe "#refresh" do
33
33
  before(:each) do
34
- ::Time.stub(:now).and_return(123.123)
34
+ allow(::Time).to receive(:now).and_return(123.123)
35
35
  end
36
36
 
37
37
  it "should update the updated_at field" do
38
38
  expect(subject.updated_at).to eq(123.123)
39
- ::Time.stub(:now).and_return(456.456)
39
+ allow(::Time).to receive(:now).and_return(456.456)
40
40
  subject.refresh
41
41
  expect(subject.updated_at).to eq(456.456)
42
42
  end
@@ -50,16 +50,16 @@ describe Elephas::Entry do
50
50
 
51
51
  describe "#valid?" do
52
52
  before(:each) do
53
- ::Time.stub(:now).and_return(100)
53
+ allow(::Time).to receive(:now).and_return(100)
54
54
  end
55
55
 
56
56
  it "should return true if the ttl is still valid" do
57
- ::Time.stub(:now).and_return(1000)
57
+ allow(::Time).to receive(:now).and_return(1000)
58
58
  expect(subject.valid?(backend)).to be_true
59
59
  end
60
60
 
61
61
  it "should return true if the ttl has expired" do
62
- ::Time.stub(:now).and_return(10000)
62
+ allow(::Time).to receive(:now).and_return(10000)
63
63
  subject.updated_at = 1000
64
64
  expect(subject.valid?(backend)).to be_false
65
65
  end
@@ -35,8 +35,8 @@ describe Elephas::Backends::Base do
35
35
 
36
36
  describe "#now" do
37
37
  it "return a representation for the current time" do
38
- Time.stub(:now).and_return(123.456)
39
- expect(provider.now).to eq(Time.now.to_f)
38
+ allow(::Time).to receive(:now).and_return(123.456)
39
+ expect(provider.now).to eq(::Time.now.to_f)
40
40
  end
41
41
  end
42
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elephas
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.5
4
+ version: 4.1.6
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-07-14 00:00:00.000000000 Z
12
+ date: 2013-07-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: lazier
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 3.2.5
21
+ version: 3.2.6
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 3.2.5
29
+ version: 3.2.6
30
30
  description: A storage agnostic caching framework.
31
31
  email:
32
32
  - shogun_panda@me.com
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  segments:
102
102
  - 0
103
- hash: 827268066999832390
103
+ hash: -4482017480642708661
104
104
  requirements: []
105
105
  rubyforge_project: elephas
106
106
  rubygems_version: 1.8.25