tracker-application 0.0.12 → 0.0.13

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed91fca9f7da8eec19e68011a5ec04652eb4b6f5
4
- data.tar.gz: 301282ad7d3227a229b9d5e034d966559c142fa3
3
+ metadata.gz: 8fd7e0194ee05c990a6906700ad5851e66deccd7
4
+ data.tar.gz: 83109bcfab5e93ff847b5dd4eaca290829ed6c6b
5
5
  SHA512:
6
- metadata.gz: 3b1f5bfd90b68ae1055a59bda40358cc8c0e38804b64d77d78ef213c224e4e6bef9394ec41a8f9baee8679b46ae7e19f5494259f0d0b1c9cc237f4bbbde3c2fa
7
- data.tar.gz: 21306c29bbe54513478124108e5e47dc4bd969f5abb32f4e79d4b560a8e3ace16b0eb2e49a4a9ca23049339f6d75c7896b0c215f8c56e8e7753f260cf44034bf
6
+ metadata.gz: 2896a987fc4dd5bbcee8291371dfb8852c257c058cdd130dc08985bbcf5636e18da4b2f24eb580de064a5388ba8594990d9e9d5170ac46bdf2f549f64e334ebf
7
+ data.tar.gz: 4ee2783a8e390074d503af615cd18b5e5754f52eb5317ee3983a856f2eee30464d07919b81b9929480444b2539796c8c42407c92f68a92059ecfc0eb0fd15c5f
@@ -12,6 +12,13 @@ require "tracker/application/load_started_stories"
12
12
  require "tracker/application/load_finished_stories"
13
13
  require "tracker/application/load_closed_stories"
14
14
  require "tracker/application/load_stories_list"
15
+ require "tracker/application/start_story"
16
+ require "tracker/application/finish_story"
17
+ require "tracker/application/close_story"
18
+ require "tracker/application/unstart_story"
19
+ require "tracker/application/unfinish_story"
20
+ require "tracker/application/unclose_story"
21
+ require "tracker/application/reset_story"
15
22
 
16
23
  module Tracker
17
24
  module Application
@@ -0,0 +1,15 @@
1
+ require 'interactor'
2
+
3
+ module Tracker
4
+ module Application
5
+ class CloseStory
6
+ include Interactor
7
+
8
+ def perform
9
+ story_id = context[:story_id]
10
+
11
+ Tracker.pg[:stories].where(id: story_id).update(closed_at: Sequel::CURRENT_TIMESTAMP)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ require 'interactor'
2
+
3
+ module Tracker
4
+ module Application
5
+ class FinishStory
6
+ include Interactor
7
+
8
+ def perform
9
+ story_id = context[:story_id]
10
+
11
+ Tracker.pg[:stories].where(id: story_id).update(finished_at: Sequel::CURRENT_TIMESTAMP)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -21,4 +21,4 @@ module Tracker
21
21
  end
22
22
  end
23
23
  end
24
- end
24
+ end
@@ -0,0 +1,15 @@
1
+ require 'interactor'
2
+
3
+ module Tracker
4
+ module Application
5
+ class ResetStory
6
+ include Interactor::Organizer
7
+
8
+ organize [
9
+ UnstartStory,
10
+ UnfinishStory,
11
+ UncloseStory
12
+ ]
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ require 'interactor'
2
+
3
+ module Tracker
4
+ module Application
5
+ class StartStory
6
+ include Interactor
7
+
8
+ def perform
9
+ story_id = context[:story_id]
10
+
11
+ Tracker.pg[:stories].where(id: story_id).update(started_at: Sequel::CURRENT_TIMESTAMP)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ require 'interactor'
2
+
3
+ module Tracker
4
+ module Application
5
+ class UncloseStory
6
+ include Interactor
7
+
8
+ def perform
9
+ story_id = context[:story_id]
10
+
11
+ Tracker.pg[:stories].where(id: story_id).update(closed_at: nil)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ require 'interactor'
2
+
3
+ module Tracker
4
+ module Application
5
+ class UnfinishStory
6
+ include Interactor
7
+
8
+ def perform
9
+ story_id = context[:story_id]
10
+
11
+ Tracker.pg[:stories].where(id: story_id).update(finished_at: nil)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ require 'interactor'
2
+
3
+ module Tracker
4
+ module Application
5
+ class UnstartStory
6
+ include Interactor
7
+
8
+ def perform
9
+ story_id = context[:story_id]
10
+
11
+ Tracker.pg[:stories].where(id: story_id).update(started_at: nil)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  module Tracker
2
2
  module Application
3
- VERSION = "0.0.12"
3
+ VERSION = "0.0.13"
4
4
  end
5
5
  end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ module Tracker
4
+ module Application
5
+ describe CloseStory do
6
+ let!(:story_id) { Tracker.pg[:stories].insert(title: 'Story to Close') }
7
+ subject { CloseStory.perform(story_id: story_id) }
8
+
9
+ def story_closed_at
10
+ Tracker.pg[:stories][id: story_id][:closed_at]
11
+ end
12
+
13
+ specify { expect(->{subject}).to change{story_closed_at}.from(nil) }
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ module Tracker
4
+ module Application
5
+ describe FinishStory do
6
+ let!(:story_id) { Tracker.pg[:stories].insert(title: 'Story to Finish') }
7
+ subject { FinishStory.perform(story_id: story_id) }
8
+
9
+ def story_finished_at
10
+ Tracker.pg[:stories][id: story_id][:finished_at]
11
+ end
12
+
13
+ specify { expect(->{subject}).to change{story_finished_at}.from(nil) }
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ module Tracker
4
+ module Application
5
+ describe ResetStory do
6
+ before do
7
+ allow(UnstartStory).to receive(:perform).and_return(double(success?: true))
8
+ allow(UnfinishStory).to receive(:perform).and_return(double(success?: true))
9
+ allow(UncloseStory).to receive(:perform).and_return(double(success?: true))
10
+ end
11
+
12
+ subject { ResetStory.perform({}) }
13
+
14
+ specify do
15
+ subject
16
+ expect(UnstartStory).to have_received(:perform)
17
+ end
18
+
19
+ specify do
20
+ subject
21
+ expect(UnfinishStory).to have_received(:perform)
22
+ end
23
+
24
+ specify do
25
+ subject
26
+ expect(UncloseStory).to have_received(:perform)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ module Tracker
4
+ module Application
5
+ describe StartStory do
6
+ let!(:story_id) { Tracker.pg[:stories].insert(title: 'Story to Start') }
7
+ subject { StartStory.perform(story_id: story_id) }
8
+
9
+ def story_started_at
10
+ Tracker.pg[:stories][id: story_id][:started_at]
11
+ end
12
+
13
+ specify { expect(->{subject}).to change{story_started_at}.from(nil) }
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ module Tracker
4
+ module Application
5
+ describe UncloseStory do
6
+ let!(:story_id) do
7
+ Tracker.pg[:stories].insert(
8
+ title: 'Story to Start',
9
+ closed_at: Sequel::CURRENT_TIMESTAMP
10
+ )
11
+ end
12
+
13
+ subject { UncloseStory.perform(story_id: story_id) }
14
+
15
+ def story_closed_at
16
+ Tracker.pg[:stories][id: story_id][:closed_at]
17
+ end
18
+
19
+ specify { expect(->{subject}).to change{story_closed_at}.to(nil) }
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ module Tracker
4
+ module Application
5
+ describe UnfinishStory do
6
+ let!(:story_id) do
7
+ Tracker.pg[:stories].insert(
8
+ title: 'Story to Start',
9
+ finished_at: Sequel::CURRENT_TIMESTAMP
10
+ )
11
+ end
12
+
13
+ subject { UnfinishStory.perform(story_id: story_id) }
14
+
15
+ def story_finished_at
16
+ Tracker.pg[:stories][id: story_id][:finished_at]
17
+ end
18
+
19
+ specify { expect(->{subject}).to change{story_finished_at}.to(nil) }
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ module Tracker
4
+ module Application
5
+ describe UnstartStory do
6
+ let!(:story_id) do
7
+ Tracker.pg[:stories].insert(
8
+ title: 'Story to Start',
9
+ started_at: Sequel::CURRENT_TIMESTAMP
10
+ )
11
+ end
12
+
13
+ subject { UnstartStory.perform(story_id: story_id) }
14
+
15
+ def story_started_at
16
+ Tracker.pg[:stories][id: story_id][:started_at]
17
+ end
18
+
19
+ specify { expect(->{subject}).to change{story_started_at}.to(nil) }
20
+ end
21
+ end
22
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracker-application
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Bergstein
@@ -121,8 +121,10 @@ files:
121
121
  - README.md
122
122
  - Rakefile
123
123
  - lib/tracker/application.rb
124
+ - lib/tracker/application/close_story.rb
124
125
  - lib/tracker/application/create_story.rb
125
126
  - lib/tracker/application/create_story_story.rb
127
+ - lib/tracker/application/finish_story.rb
126
128
  - lib/tracker/application/load_blocked_stories.rb
127
129
  - lib/tracker/application/load_closed_stories.rb
128
130
  - lib/tracker/application/load_epic_stories.rb
@@ -134,9 +136,16 @@ files:
134
136
  - lib/tracker/application/load_story_parent_story_stories.rb
135
137
  - lib/tracker/application/load_story_story.rb
136
138
  - lib/tracker/application/load_unblocked_stories.rb
139
+ - lib/tracker/application/reset_story.rb
140
+ - lib/tracker/application/start_story.rb
141
+ - lib/tracker/application/unclose_story.rb
142
+ - lib/tracker/application/unfinish_story.rb
143
+ - lib/tracker/application/unstart_story.rb
137
144
  - lib/tracker/application/version.rb
145
+ - spec/close_story_spec.rb
138
146
  - spec/create_story_spec.rb
139
147
  - spec/create_story_story_spec.rb
148
+ - spec/finish_story_spec.rb
140
149
  - spec/load_blocked_stories_spec.rb
141
150
  - spec/load_closed_stories_spec.rb
142
151
  - spec/load_epic_stories_spec.rb
@@ -148,7 +157,12 @@ files:
148
157
  - spec/load_story_spec.rb
149
158
  - spec/load_story_story_spec.rb
150
159
  - spec/load_unblocked_stories_spec.rb
160
+ - spec/reset_story_spec.rb
151
161
  - spec/spec_helper.rb
162
+ - spec/start_story_spec.rb
163
+ - spec/unclose_story_spec.rb
164
+ - spec/unfinish_story_spec.rb
165
+ - spec/unstart_story_spec.rb
152
166
  - tracker-application.gemspec
153
167
  homepage: ''
154
168
  licenses:
@@ -175,8 +189,10 @@ signing_key:
175
189
  specification_version: 4
176
190
  summary: ''
177
191
  test_files:
192
+ - spec/close_story_spec.rb
178
193
  - spec/create_story_spec.rb
179
194
  - spec/create_story_story_spec.rb
195
+ - spec/finish_story_spec.rb
180
196
  - spec/load_blocked_stories_spec.rb
181
197
  - spec/load_closed_stories_spec.rb
182
198
  - spec/load_epic_stories_spec.rb
@@ -188,4 +204,9 @@ test_files:
188
204
  - spec/load_story_spec.rb
189
205
  - spec/load_story_story_spec.rb
190
206
  - spec/load_unblocked_stories_spec.rb
207
+ - spec/reset_story_spec.rb
191
208
  - spec/spec_helper.rb
209
+ - spec/start_story_spec.rb
210
+ - spec/unclose_story_spec.rb
211
+ - spec/unfinish_story_spec.rb
212
+ - spec/unstart_story_spec.rb