snowy_owl 0.3.0 → 0.4.0
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 +4 -4
- data/Gemfile.lock +1 -1
- data/Rakefile +1 -0
- data/lib/snowy_owl/plays.rb +7 -4
- data/lib/snowy_owl/tasks.rb +20 -0
- data/lib/snowy_owl/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71d6cff44bdadfc1ea858206eba483efec48c9e6
|
4
|
+
data.tar.gz: 304217feb2b8cae915c93d6f5ce14a3d239720d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b7c610de9073b5e29096c93da35d94e90c9e3a4c25f903c16175601052683ca7779d4ee0d76f66bc642e06e9586571831e2c3f540b67aa745d3bb654c728486
|
7
|
+
data.tar.gz: 30ac7a23c7de9256763bce2003cdba4bacf29f80935fa5c7254dc12a047bf14fdb5cb57b4d70cabf653f8ad44eb40766c86ddbab4268232fbd30567673cba50e
|
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
data/lib/snowy_owl/plays.rb
CHANGED
@@ -22,13 +22,16 @@ module SnowyOwl
|
|
22
22
|
def build_plays(candidate_play_books)
|
23
23
|
@play_hash = {}
|
24
24
|
@starting_node = nil
|
25
|
-
candidate_play_books.each
|
26
|
-
candidate_plots = YAML.load_file(play_book)
|
27
|
-
generate_full_path_digest(candidate_plots)
|
28
|
-
end
|
25
|
+
candidate_play_books.each { |play_book| generate_digest_for_play_book play_book }
|
29
26
|
generate_deep_first_plays
|
30
27
|
end
|
31
28
|
|
29
|
+
def generate_digest_for_play_book play_book
|
30
|
+
@play_hash ||= {}
|
31
|
+
candidate_plots = YAML.load_file(play_book)
|
32
|
+
generate_full_path_digest(candidate_plots)
|
33
|
+
end
|
34
|
+
|
32
35
|
def generate_deep_first_plays
|
33
36
|
plays = []
|
34
37
|
deep_stack = [@starting_node.digest]
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require_relative '../snowy_owl'
|
3
|
+
|
4
|
+
namespace :snowy_owl do
|
5
|
+
desc 'generate digest for entire play books'
|
6
|
+
task :generate_digest, [:play_book] do |task, args|
|
7
|
+
play_book = args[:play_book]
|
8
|
+
candidate_plots = SnowyOwl::Plays.generate_digest_for_play_book play_book
|
9
|
+
output_result = candidate_plots.map do |plot|
|
10
|
+
res = { 'plot_name' => plot['plot_name'],
|
11
|
+
'digest' => plot['digest'],
|
12
|
+
}
|
13
|
+
res['parent'] = plot['parent'] if !plot['parent'].nil? && !plot['parent'].empty?
|
14
|
+
res
|
15
|
+
end
|
16
|
+
File.open(play_book, 'w+') do |file|
|
17
|
+
file.write output_result.to_yaml
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/snowy_owl/version.rb
CHANGED
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
|
+
version: 0.4.0
|
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-
|
11
|
+
date: 2017-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- lib/snowy_owl/rspec.rb
|
112
112
|
- lib/snowy_owl/rspec/rerun.rb
|
113
113
|
- lib/snowy_owl/support.rb
|
114
|
+
- lib/snowy_owl/tasks.rb
|
114
115
|
- lib/snowy_owl/version.rb
|
115
116
|
- snowy_owl.gemspec
|
116
117
|
homepage: https://github.com/hanystudy/snowy_owl
|