snowy_owl 0.4.0 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71d6cff44bdadfc1ea858206eba483efec48c9e6
4
- data.tar.gz: 304217feb2b8cae915c93d6f5ce14a3d239720d7
3
+ metadata.gz: a17e305cf3d3c8c253549bd44a3bc5ff484d73b3
4
+ data.tar.gz: e940a73a1538d64d5bb47f4ae8789f7f846b7dbd
5
5
  SHA512:
6
- metadata.gz: 6b7c610de9073b5e29096c93da35d94e90c9e3a4c25f903c16175601052683ca7779d4ee0d76f66bc642e06e9586571831e2c3f540b67aa745d3bb654c728486
7
- data.tar.gz: 30ac7a23c7de9256763bce2003cdba4bacf29f80935fa5c7254dc12a047bf14fdb5cb57b4d70cabf653f8ad44eb40766c86ddbab4268232fbd30567673cba50e
6
+ metadata.gz: a6b1477c5107a5c413b17c4936b8b96fad520d26f70363db75deeffa1996833c22dab4afe299d92b3541f400209bbf5f5e325c7580421dc1da077fa6f9c5cdb6
7
+ data.tar.gz: ec070f6c826e7b69404954a4d70a58053b0baf3dad80f6846e84aa5d375ad364f6cc2994f1ab17d193e3b01cc25cee7da07ee8b5c4d5636e85832fce9662e3c1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snowy_owl (0.4.0)
4
+ snowy_owl (0.4.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -10,7 +10,11 @@ module SnowyOwl
10
10
  plots_range = expression.match /(.*)(\.{2})(.*)/
11
11
  if plots_range.nil?
12
12
  scope = expression.split("\n")
13
- candidate_plots.select { |plot| scope.include?(plot['plot_name']) || scope.include?(plot['digest']) }
13
+ candidate_plots.select do |plot|
14
+ in_scope = scope.include?(plot['plot_name']) || scope.include?(plot['digest'])
15
+ plot['is_recovering'] = in_scope
16
+ in_scope
17
+ end
14
18
  else
15
19
  sequence_run_from_starting_point candidate_plots, plots_range
16
20
  end
@@ -25,7 +29,10 @@ module SnowyOwl
25
29
  plot_name = plot['plot_name']
26
30
  plot_digest = plot['digest']
27
31
  in_scope = true if plot_name == starting_point || plot_digest == starting_point
28
- acc << plot if in_scope
32
+ if in_scope
33
+ plot['is_recovering'] = acc.size == 0
34
+ acc << plot
35
+ end
29
36
  in_scope = false if plot_name == ending_point || plot_digest == ending_point
30
37
  end
31
38
  end
@@ -37,7 +44,8 @@ module SnowyOwl
37
44
  candidate_plots.each do |plot|
38
45
  plot_name = plot['plot_name']
39
46
  digest = plot['digest']
40
- SnowyOwl::Persist.recover_state digest if SnowyOwl.is_recovering
47
+ is_recovering = plot['is_recovering']
48
+ SnowyOwl::Persist.recover_state digest if SnowyOwl.is_recovering && is_recovering
41
49
  SnowyOwl::Persist.persist_state digest if SnowyOwl.is_persisting
42
50
  instance_exec plot_name, &SnowyOwl::Plots.plot(plot_name)
43
51
  end
@@ -31,7 +31,8 @@ module SnowyOwl
31
31
 
32
32
  before do |plot|
33
33
  digest = plot.metadata[:digest]
34
- SnowyOwl::Persist.recover_state digest if SnowyOwl.is_recovering
34
+ is_recovering = plot.metadata[:is_recovering]
35
+ SnowyOwl::Persist.recover_state digest if SnowyOwl.is_recovering && is_recovering
35
36
  SnowyOwl::Persist.persist_state digest if SnowyOwl.is_persisting
36
37
  end
37
38
 
@@ -45,7 +46,8 @@ module SnowyOwl
45
46
  candidate_plots.each do |plot|
46
47
  plot_name = plot['plot_name']
47
48
  digest = plot['digest']
48
- it_behaves_like plot_name, digest: digest
49
+ is_recovering = plot['is_recovering']
50
+ it_behaves_like plot_name, digest: digest, is_recovering: is_recovering
49
51
  end
50
52
  end
51
53
  end
@@ -1,3 +1,3 @@
1
1
  module SnowyOwl
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snowy_owl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yi Han
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-04 00:00:00.000000000 Z
11
+ date: 2017-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler