cistern 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3de1bf9f141d828eb4bf959659312d6f42f9f4d
4
- data.tar.gz: e925e41ac94223d588567509c2ac7851c21f074b
3
+ metadata.gz: 9f248cb091a6313cee4f42390b45755120759d22
4
+ data.tar.gz: f91fa47b5dc99d4db1ec9f84f798882e2ef3231c
5
5
  SHA512:
6
- metadata.gz: bfe27266c4b6b4b4ab467b667eed563fbc1eca9b7466f9b8a6e60c0074c60e62222acd745d566a9e833fcb8d4aa71e3a980ef6e0f0081ddb1403f3d615b25d5a
7
- data.tar.gz: b413e43327c69559351136add3012cd708a50b7cc69da31d18e4d4900643b5e70b17abc619b30ad2fb0e38df071b9601235b5f9084e71c7b159c4fb5ab209c70
6
+ metadata.gz: 07c1776f56bbb673648409b4a1ba8b51ef36c90acb67634e7892703bc8dc894fac33aa23c4a48734dbbebf75e5932d612176ec5a6816c8f4092dd46f68f9baf2
7
+ data.tar.gz: 4e4b03ea861eb4151dcd8a033e3c9a511f24b90a3d29363ed6f203e19c417772bf0671469956693db576b139636ecad2889a02734fefeb2e395d72dfec5a7138
data/Gemfile CHANGED
@@ -8,8 +8,8 @@ group :test do
8
8
  gem "guard-bundler", "~> 2.0", require: false
9
9
  gem "pry-nav"
10
10
  gem "rake"
11
- gem "rspec", "~> 2.0"
12
- gem "redis-namespace"
11
+ gem "rspec", "~> 2.99"
12
+ gem "redis-namespace", "~> 1.4", "< 1.5"
13
13
  gem "codeclimate-test-reporter", require: false
14
14
  end
15
15
 
data/lib/cistern/model.rb CHANGED
@@ -31,12 +31,22 @@ class Cistern::Model
31
31
  end
32
32
 
33
33
  def ==(comparison_object)
34
- comparison_object.equal?(self) ||
34
+ super ||
35
35
  (comparison_object.is_a?(self.class) &&
36
36
  comparison_object.identity == self.identity &&
37
37
  !comparison_object.new_record?)
38
38
  end
39
39
 
40
+ alias :eql? :==
41
+
42
+ def hash
43
+ if self.identity
44
+ [self.class, self.identity].join(":").hash
45
+ else
46
+ super
47
+ end
48
+ end
49
+
40
50
  def service
41
51
  self.connection ? self.connection.class : Cistern
42
52
  end
@@ -1,3 +1,3 @@
1
1
  module Cistern
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
File without changes
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "cistern hashes" do
3
+ describe "Cistern::Hash" do
4
4
  describe "#slice" do
5
5
  let(:input) do
6
6
  { one: "one", two: "two", three: "three" }
data/spec/model_spec.rb CHANGED
@@ -13,7 +13,7 @@ describe "Cistern::Model" do
13
13
  duplicate = model.dup
14
14
 
15
15
  expect(duplicate).to eq(model)
16
- expect(duplicate).not_to eql model
16
+ expect(duplicate).to eql(model)
17
17
 
18
18
  model.name= "anotherstring"
19
19
  expect(duplicate.name).to eq("string")
@@ -59,14 +59,14 @@ describe "Cistern::Model" do
59
59
  end
60
60
 
61
61
  it "should parse boolean" do
62
- expect(TypeSpec.new(flag: "false").flag).to be_false
63
- expect(TypeSpec.new(flag: "true").flag).to be_true
64
- expect(TypeSpec.new(flag: false).flag).to be_false
65
- expect(TypeSpec.new(flag: true).flag).to be_true
66
- expect(TypeSpec.new(flag: "0").flag).to be_false
67
- expect(TypeSpec.new(flag: "1").flag).to be_true
68
- expect(TypeSpec.new(flag: 0).flag).to be_false
69
- expect(TypeSpec.new(flag: 1).flag).to be_true
62
+ expect(TypeSpec.new(flag: "false").flag).to be_falsey
63
+ expect(TypeSpec.new(flag: "true").flag).to be_truthy
64
+ expect(TypeSpec.new(flag: false).flag).to be_falsey
65
+ expect(TypeSpec.new(flag: true).flag).to be_truthy
66
+ expect(TypeSpec.new(flag: "0").flag).to be_falsey
67
+ expect(TypeSpec.new(flag: "1").flag).to be_truthy
68
+ expect(TypeSpec.new(flag: 0).flag).to be_falsey
69
+ expect(TypeSpec.new(flag: 1).flag).to be_truthy
70
70
  expect(TypeSpec.new(flag: false)).not_to be_flag
71
71
  expect(TypeSpec.new(flag: true)).to be_flag
72
72
  end
@@ -26,7 +26,7 @@ end
26
26
 
27
27
  describe 'Cistern#wait_for' do
28
28
  it "should return false if timeout exceeded" do
29
- expect(Cistern.wait_for(0, 0) { false }).to be_false
29
+ expect(Cistern.wait_for(0, 0) { false }).to be_falsey
30
30
  end
31
31
  end
32
32
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cistern
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-17 00:00:00.000000000 Z
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: API client framework extracted from Fog
14
14
  email:
@@ -44,9 +44,9 @@ files:
44
44
  - lib/cistern/timeout.rb
45
45
  - lib/cistern/version.rb
46
46
  - lib/cistern/wait_for.rb
47
- - spec/cistern_hash_spec.rb
48
- - spec/cistern_spec.rb
49
47
  - spec/collection_spec.rb
48
+ - spec/formatter_spec.rb
49
+ - spec/hash_spec.rb
50
50
  - spec/mock_data_spec.rb
51
51
  - spec/model_spec.rb
52
52
  - spec/singular_spec.rb
@@ -77,9 +77,9 @@ signing_key:
77
77
  specification_version: 4
78
78
  summary: API client framework
79
79
  test_files:
80
- - spec/cistern_hash_spec.rb
81
- - spec/cistern_spec.rb
82
80
  - spec/collection_spec.rb
81
+ - spec/formatter_spec.rb
82
+ - spec/hash_spec.rb
83
83
  - spec/mock_data_spec.rb
84
84
  - spec/model_spec.rb
85
85
  - spec/singular_spec.rb