nomo 0.0.21 → 0.0.22

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.
data/lib/nomo/model.rb CHANGED
@@ -19,13 +19,8 @@ module Nomo
19
19
  page.modify
20
20
  end
21
21
 
22
- if !options.has_key?(:callbacks) || options[:callbacks] == true
23
- after_commit modify_page_method, options
24
- after_touch modify_page_method, options
25
- elsif options[:callbacks].is_a?(Array)
26
- after_commit modify_page_method, options if options[:callbacks].include?(:commit)
27
- after_touch modify_page_method, options if options[:callbacks].include?(:touch)
28
- end
22
+ after_commit modify_page_method, options[:after_commit] unless options[:after_commit].eql?(false)
23
+ after_touch modify_page_method, options[:after_touch] unless options[:after_touch].eql?(false)
29
24
  end
30
25
 
31
26
  def modifies_page(association, name, options = {})
@@ -43,13 +38,8 @@ module Nomo
43
38
  page.modify
44
39
  end
45
40
 
46
- if !options.has_key?(:callbacks) || options[:callbacks] == true
47
- after_commit modify_association_page_method, options
48
- after_touch modify_association_page_method, options
49
- elsif options[:callbacks].is_a?(Array)
50
- after_commit modify_association_page_method, options if options[:callbacks].include?(:commit)
51
- after_touch modify_association_page_method, options if options[:callbacks].include?(:touch)
52
- end
41
+ after_commit modify_association_page_method, options[:after_commit] unless options[:after_commit].eql?(false)
42
+ after_touch modify_association_page_method, options[:after_touch] unless options[:after_touch].eql?(false)
53
43
  end
54
44
 
55
45
  def modifies_pages(association, name, options = {})
@@ -65,13 +55,8 @@ module Nomo
65
55
  end
66
56
  end
67
57
 
68
- if !options.has_key?(:callbacks) || options[:callbacks] == true
69
- after_commit modify_association_pages_method, options
70
- after_touch modify_association_pages_method, options
71
- elsif options[:callbacks].is_a?(Array)
72
- after_commit modify_association_pages_method, options if options[:callbacks].include?(:commit)
73
- after_touch modify_association_pages_method, options if options[:callbacks].include?(:touch)
74
- end
58
+ after_commit modify_association_pages_method, options[:after_commit] unless options[:after_commit].eql?(false)
59
+ after_touch modify_association_pages_method, options[:after_touch] unless options[:after_touch].eql?(false)
75
60
  end
76
61
  end
77
62
  end
data/lib/nomo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nomo
2
- VERSION = "0.0.21"
2
+ VERSION = "0.0.22"
3
3
  end
data/lib/nomo.rb CHANGED
@@ -25,7 +25,7 @@ module Nomo
25
25
  #
26
26
  # Eaxmple:
27
27
  # { unless: lambda {|record| record.previous_changes.empty? } }
28
- attr_accessor :default_options
28
+ attr_writer :default_options
29
29
 
30
30
  ##
31
31
  # Accepts:
@@ -63,6 +63,10 @@ module Nomo
63
63
  @redis ||= self.redis = Redis.respond_to?(:connect) ? Redis.connect : 'localhost:6379'
64
64
  end
65
65
 
66
+ def default_options
67
+ @default_options || {}
68
+ end
69
+
66
70
  def log
67
71
  ::Rails.logger
68
72
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nomo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-07-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
16
- requirement: &70282400310200 !ruby/object:Gem::Requirement
16
+ requirement: &70309919183920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70282400310200
24
+ version_requirements: *70309919183920
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: redis-namespace
27
- requirement: &70282400309420 !ruby/object:Gem::Requirement
27
+ requirement: &70309919182520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70282400309420
35
+ version_requirements: *70309919182520
36
36
  description: 304 Not Modified Headers made easy.
37
37
  email:
38
38
  - sausman@stackd.com