couch_scheduler 0.2.0 → 0.2.1

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -17,12 +17,12 @@ Feature: Scheduling
17
17
 
18
18
  When I set "start" to now:
19
19
  """
20
- @article.start = Time.now
20
+ @article.start = Time.now.to_date
21
21
  """
22
22
 
23
23
  And I set "end" to a day from now:
24
24
  """
25
- @article.end = 1.day.from_now
25
+ @article.end = 1.day.from_now.to_date
26
26
  """
27
27
 
28
28
  Then I should be able to save my document:
@@ -46,12 +46,12 @@ Feature: Scheduling
46
46
 
47
47
  When I set "start" to now:
48
48
  """
49
- @article.start = Time.now
49
+ @article.start = Time.now.to_date
50
50
  """
51
51
 
52
52
  And I set "end" to yesterday:
53
53
  """
54
- @article.end = 1.day.ago
54
+ @article.end = 1.day.ago.to_date
55
55
  """
56
56
 
57
57
  Then I should not be able to save my document:
@@ -75,12 +75,12 @@ Feature: Scheduling
75
75
 
76
76
  When I set "start" to now:
77
77
  """
78
- @article.start = Time.now
78
+ @article.start = Time.now.to_date
79
79
  """
80
80
 
81
81
  And I set "end" to tomorrow:
82
82
  """
83
- @article.end = 1.day.from_now
83
+ @article.end = 1.day.from_now.to_date
84
84
  """
85
85
 
86
86
  Then "within_schedule?" should return true on my instance:
@@ -111,7 +111,7 @@ Feature: Scheduling
111
111
 
112
112
  When I set "start" to now:
113
113
  """
114
- @article.start = Time.now
114
+ @article.start = Time.now.to_date
115
115
  """
116
116
 
117
117
  Then "within_schedule?" should return true on my instance:
@@ -144,7 +144,7 @@ Feature: Scheduling
144
144
 
145
145
  When I set "end" to tomorrow:
146
146
  """
147
- @article.end = 1.day.from_now
147
+ @article.end = 1.day.from_now.to_date
148
148
  """
149
149
 
150
150
  Then "within_schedule?" should return true on my instance:
@@ -2,6 +2,5 @@ require 'couch_view'
2
2
  require 'couch_scheduler/map'
3
3
  require 'couch_scheduler/couch_visible_integration'
4
4
  require 'couch_scheduler/couch_publish_integration'
5
- require 'couch_scheduler/couch_publish_and_couch_visible_integration'
6
5
  require 'couch_scheduler/couch_scheduler'
7
6
  require 'couch_scheduler/conditions'
@@ -9,4 +9,3 @@ module CouchScheduler
9
9
  end
10
10
  end
11
11
  end
12
-
@@ -9,18 +9,17 @@ module CouchScheduler
9
9
  base.validate :validate_start_and_end
10
10
  base.extend ClassMethods
11
11
 
12
- if defined?(CouchVisible) && base.ancestors.include?(CouchVisible) && defined?(CouchPublish) && base.ancestors.include?(CouchPublish)
13
- base.send :include, CouchVisibleCouchPublishIntegration
14
- elsif defined?(CouchPublish) && base.ancestors.include?(CouchPublish)
12
+ base.couch_view :within_couch_schedule do
13
+ map CouchScheduler::Map
14
+ end
15
+
16
+ if defined?(CouchPublish) && base.ancestors.include?(CouchPublish)
15
17
  base.send :include, CouchPublishIntegration
16
- elsif defined?(CouchVisible) && base.ancestors.include?(CouchVisible)
18
+ end
19
+
20
+ if defined?(CouchVisible) && base.ancestors.include?(CouchVisible)
17
21
  base.send :include, CouchVisibleIntegration
18
- else
19
- base.couch_view :within_couch_schedule do
20
- map CouchScheduler::Map
21
- end
22
22
  end
23
-
24
23
  end
25
24
 
26
25
  module ClassMethods
@@ -45,8 +44,8 @@ module CouchScheduler
45
44
  start_valid = true
46
45
  end_valid = true
47
46
 
48
- start_valid = Time.now >= self.start if self.start
49
- end_valid = Time.now < self.end if self.end
47
+ start_valid = Time.now.to_date >= self.start if self.start
48
+ end_valid = Time.now.to_date < self.end if self.end
50
49
 
51
50
  start_valid && end_valid
52
51
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couch_scheduler
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Parker
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-17 00:00:00 Z
18
+ date: 2011-08-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: cucumber
@@ -127,12 +127,12 @@ dependencies:
127
127
  requirements:
128
128
  - - ~>
129
129
  - !ruby/object:Gem::Version
130
- hash: 27
130
+ hash: 25
131
131
  segments:
132
132
  - 0
133
133
  - 0
134
- - 2
135
- version: 0.0.2
134
+ - 3
135
+ version: 0.0.3
136
136
  type: :runtime
137
137
  version_requirements: *id008
138
138
  description: Create a publishing system that allows you to schedule your documents for publication.
@@ -145,7 +145,6 @@ extra_rdoc_files: []
145
145
 
146
146
  files:
147
147
  - lib/couch_scheduler/conditions.rb
148
- - lib/couch_scheduler/couch_publish_and_couch_visible_integration.rb
149
148
  - lib/couch_scheduler/couch_publish_integration.rb
150
149
  - lib/couch_scheduler/couch_scheduler.rb
151
150
  - lib/couch_scheduler/couch_visible_integration.rb
@@ -1,11 +0,0 @@
1
- module CouchScheduler
2
- module CouchVisibleCouchPublishIntegration
3
- def self.included(base)
4
- base.couch_view :within_couch_schedule do
5
- map CouchScheduler::Map do
6
- conditions ::Published, ::Unpublished, ::Hidden, ::Shown
7
- end
8
- end
9
- end
10
- end
11
- end