ohm-contrib 2.0.1 → 2.2.0

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: a52426f91b67c71d40fe30b9349b19523cc2ae49
4
- data.tar.gz: b3e078c7c34c4f5936d1674317f71b6607c81f4e
3
+ metadata.gz: a6d0332468e71364193f8b9101b274b3d68e0506
4
+ data.tar.gz: e9f7ed58326d36a0a1773590971d34ab4dccabae
5
5
  SHA512:
6
- metadata.gz: 1bb1072d4f28ea0e59bb49cc0057e950f25cc831da0e4a12cc25b09ed613dba38e455efea60209cf8c8376d34f82afae804c909d437a1b6b83a01901441ead50
7
- data.tar.gz: 5842bd888c672735b63919fd819e6bad5f8c75252c104664d445fe60728b7bcb49e2ed5fc8ba4fa6cf810dcdf9b554937c18249b96eef5d710cf259a7b651de7
6
+ metadata.gz: 3488b53d5c3102d660be34c4af46966e6454feea8e1c4363c05cb5c900e7900880c91d99a0ebd360cb5a4fe3d6ad37d3813c2add6165a7dca6190c3e407ae375
7
+ data.tar.gz: 829fc7c088742507391e8cbc7bca26ef3582d12f21d0ddd4553a500641c77ee0080fb610ccd83e425bf76a817de0ce91af54a7e94b860d41488632927633cff6
data/.gems CHANGED
@@ -1,4 +1,4 @@
1
- cutest -v 1.2.1
2
1
  iconv -v 1.0.4
3
- ohm -v 2.0.0
4
2
  override -v 0.0.10
3
+ ohm -v 2.1.0
4
+ cutest -v 1.2.2
@@ -16,32 +16,21 @@ module Ohm
16
16
  end
17
17
  end
18
18
 
19
- # In Ohm v1.2, the Set and MultiSet initialize methods
20
- # are defined on themselves. Hence the trick of doing a
21
- # module OverloadedSet with an initialize method doesn't
22
- # work anymore.
19
+ # In Ohm v1.2, the Set initialize method is defined on
20
+ # itself. Hence the trick of doing a module OverloadedSet
21
+ # with an initialize method doesn't work anymore.
23
22
  #
24
23
  # The simplest way to solve that as of now is to duplicate
25
- # and extend the #initialize method for each of these.
24
+ # and extend the #initialize method for Ohm::Set.
26
25
  #
27
26
  # Granted it's not the _ideal_ way, the drawbacks are
28
27
  # outweighed by the simplicity and performance of this
29
28
  # approach versus other monkey-patching techniques.
30
29
  class Set
31
- def initialize(key, namespace, model)
32
- @key = key
33
- @namespace = namespace
30
+ def initialize(model, namespace, key)
34
31
  @model = model
35
-
36
- extend model::DefinedScopes if defined?(model::DefinedScopes)
37
- end
38
- end
39
-
40
- class MultiSet
41
- def initialize(namespace, model, command)
42
32
  @namespace = namespace
43
- @model = model
44
- @command = command
33
+ @key = key
45
34
 
46
35
  extend model::DefinedScopes if defined?(model::DefinedScopes)
47
36
  end
@@ -71,7 +71,7 @@ module Ohm
71
71
 
72
72
  module ClassMethods
73
73
  def deleted
74
- Set.new(key[:deleted], key, self)
74
+ Set.new(self, key, key[:deleted])
75
75
  end
76
76
 
77
77
  def exists?(id)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "ohm-contrib"
3
- s.version = "2.0.1"
3
+ s.version = "2.2.0"
4
4
  s.summary = %{A collection of decoupled drop-in modules for Ohm.}
5
5
  s.description = %{Includes a couple of core functions such as callbacks, timestamping, typecasting and lots of generic validation routines.}
6
6
  s.author = "Cyril David"
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
 
11
11
  s.files = `git ls-files`.split("\n")
12
12
 
13
- s.add_dependency "ohm", "~> 2.0"
13
+ s.add_dependency "ohm", "~> 2.2"
14
14
 
15
15
  s.add_development_dependency "cutest", "~> 1.2"
16
16
  s.add_development_dependency "iconv", "~> 1.0"
@@ -35,7 +35,7 @@ test "allows custom methods for the defined scopes" do
35
35
  comment = Comment.create(status: "approved")
36
36
  post.comments.add(comment)
37
37
 
38
- assert post.comments.approved.is_a?(Ohm::MultiSet)
38
+ assert post.comments.approved.is_a?(Ohm::Set)
39
39
  assert post.comments.approved.include?(comment)
40
40
  end
41
41
 
@@ -44,7 +44,7 @@ test "allows custom methods to be included from a module" do
44
44
  comment = Comment.create(status: "rejected")
45
45
  post.comments.add(comment)
46
46
 
47
- assert post.comments.rejected.is_a?(Ohm::MultiSet)
47
+ assert post.comments.rejected.is_a?(Ohm::Set)
48
48
  assert post.comments.rejected.include?(comment)
49
49
  end
50
50
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohm-contrib
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril David
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-17 00:00:00.000000000 Z
11
+ date: 2015-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ohm
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cutest
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  version: '0'
120
120
  requirements: []
121
121
  rubyforge_project:
122
- rubygems_version: 2.2.2
122
+ rubygems_version: 2.4.5
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: A collection of decoupled drop-in modules for Ohm.