drpedia_lite 0.0.20 → 0.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Builder.rb +4 -0
- data/lib/RawReader.rb +25 -1
- data/lib/Validator.rb +10 -0
- data/lib/input/input.txt +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1098fcbc72b315ae70e2da0c3b7d106b7383907
|
4
|
+
data.tar.gz: a9ffdf450fcc34cab92047ad8c82c05b29aa0843
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7159a184ef700b069b5572d2ec1bbf176856f2cf717958a8987cf6ea13d1b65a522bf1db3dac2fcf88c3273bb50ea46ea964c801a3b534709b6b50b0b6359dce
|
7
|
+
data.tar.gz: 761a9988464b198b0a41dfb6412b7e75da4d21a2170db6ad418da55aea20d105104e9335a4fdc517625cc44f518a3815129cc44ca44cf9ddfcc7e56256f7c8af
|
data/lib/Builder.rb
CHANGED
@@ -16,6 +16,8 @@ class Builder
|
|
16
16
|
strain_stats: raw_reader.strain_stats,
|
17
17
|
strain_specs: raw_reader.strain_specs,
|
18
18
|
profession_concentrations: raw_reader.profession_concentrations,
|
19
|
+
profession_concentration_hierarchy: raw_reader.profession_concentration_hierarchy,
|
20
|
+
profession_concentration_group: raw_reader.profession_concentration_group,
|
19
21
|
profession_advanced: raw_reader.profession_advanced,
|
20
22
|
skill_counters: raw_reader.skill_counters,
|
21
23
|
skill_countered: raw_reader.skill_countered
|
@@ -31,6 +33,8 @@ class Builder
|
|
31
33
|
File.open(File.join(base_output_path, 'strain_stats.json'), 'w') { |f| f.write raw_reader.strain_stats.to_json }
|
32
34
|
File.open(File.join(base_output_path, 'strain_specs.json'), 'w') { |f| f.write raw_reader.strain_specs.to_json }
|
33
35
|
File.open(File.join(base_output_path, 'profession_concentrations.json'), 'w') { |f| f.write raw_reader.profession_concentrations.to_json }
|
36
|
+
File.open(File.join(base_output_path, 'profession_concentration_hierarchy.json'), 'w') { |f| f.write raw_reader.profession_concentration_hierarchy.to_json }
|
37
|
+
File.open(File.join(base_output_path, 'profession_concentration_group.json'), 'w') { |f| f.write raw_reader.profession_concentration_group.to_json }
|
34
38
|
File.open(File.join(base_output_path, 'profession_advanced.json'), 'w') { |f| f.write raw_reader.profession_advanced.to_json }
|
35
39
|
File.open(File.join(base_output_path, 'skill_counters.json'), 'w') { |f| f.write raw_reader.skill_counters.to_json }
|
36
40
|
File.open(File.join(base_output_path, 'skill_countered.json'), 'w') { |f| f.write raw_reader.skill_countered.to_json }
|
data/lib/RawReader.rb
CHANGED
@@ -4,6 +4,7 @@ class RawReader
|
|
4
4
|
attr_reader :skill_list, :skill_cat, :skill_group, :advanced_cat, :concentration_cat,
|
5
5
|
:strains, :strain_restrictions, :strain_stats, :strain_specs,
|
6
6
|
:professions, :profession_concentrations, :profession_advanced,
|
7
|
+
:profession_concentration_hierarchy, :profession_concentration_group,
|
7
8
|
:skill_counters, :skill_countered
|
8
9
|
|
9
10
|
STATE_TRANSITION = {
|
@@ -11,7 +12,9 @@ class RawReader
|
|
11
12
|
:innate => { pattern: /== Disadvantage Skill ==/, next: :strain_disadv },
|
12
13
|
:strain_disadv => { pattern: /== Innate Skill Prerequisite ==/, next: :innate_preq },
|
13
14
|
:innate_preq => { pattern: /== Profession Concentration ==/, next: :prof_concent },
|
14
|
-
:prof_concent => { pattern: /==
|
15
|
+
:prof_concent => { pattern: /== Concentration Hierarchy ==/, next: :prof_hierarc },
|
16
|
+
:prof_hierarc => { pattern: /== Concentration Group ==/, next: :conc_group },
|
17
|
+
:conc_group => { pattern: /== Profession Concentration Skills ==/, next: :conc_skills },
|
15
18
|
:conc_skills => { pattern: /== Advanced Profession ==/, next: :adv_prof },
|
16
19
|
:adv_prof => { pattern: /== Advanced Profession Skills ==/, next: :adv_skills },
|
17
20
|
:adv_skills => { pattern: /== Strain Profession Restriction ==/, next: :strain_rtrs },
|
@@ -41,6 +44,8 @@ class RawReader
|
|
41
44
|
@professions = Set.new
|
42
45
|
@profession_concentrations = Hash.new
|
43
46
|
@profession_advanced = Hash.new
|
47
|
+
@profession_concentration_hierarchy = Hash.new
|
48
|
+
@profession_concentration_group = Hash.new
|
44
49
|
|
45
50
|
@mutiline_state = nil
|
46
51
|
|
@@ -61,6 +66,7 @@ class RawReader
|
|
61
66
|
#ap @concentration_cat
|
62
67
|
# ap @skill_counters
|
63
68
|
# ap @skill_countered
|
69
|
+
# ap @profession_concentration_group
|
64
70
|
end
|
65
71
|
|
66
72
|
private
|
@@ -110,6 +116,8 @@ private
|
|
110
116
|
when :strain_disadv then process_innate_skills line: line, disadvantage: true
|
111
117
|
when :innate_preq then process_innate_preqs line: line
|
112
118
|
when :prof_concent then process_profession_concentration line: line
|
119
|
+
when :prof_hierarc then process_profession_concentration_hierarchy line: line
|
120
|
+
when :conc_group then process_profession_concentration_group line: line
|
113
121
|
when :conc_skills then process_profession_concentration_skills line: line
|
114
122
|
when :adv_prof then process_advanced_professions line: line
|
115
123
|
when :adv_skills then process_profession_skills line: line, profession: profession, type: :advanced
|
@@ -165,6 +173,22 @@ private
|
|
165
173
|
end
|
166
174
|
end
|
167
175
|
|
176
|
+
def process_profession_concentration_hierarchy line:
|
177
|
+
clusters = line.split(/:/)
|
178
|
+
right_cluster = clusters[1].split(/\,/)
|
179
|
+
|
180
|
+
right_cluster.each do |prof|
|
181
|
+
@profession_concentration_hierarchy[prof.strip.to_sym] = clusters[0].strip.to_sym
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
def process_profession_concentration_group line:
|
186
|
+
clusters = line.split(/:/)
|
187
|
+
right_cluster = clusters[1].split(/\,/)
|
188
|
+
|
189
|
+
@profession_concentration_group[clusters[0].strip.to_sym] = right_cluster.collect { |x| x.strip.to_sym }
|
190
|
+
end
|
191
|
+
|
168
192
|
def process_profession_concentration_skills line:
|
169
193
|
clusters = line.split(/:/)
|
170
194
|
|
data/lib/Validator.rb
CHANGED
@@ -12,6 +12,8 @@ class Validator
|
|
12
12
|
strain_stats:,
|
13
13
|
strain_specs:,
|
14
14
|
profession_concentrations:,
|
15
|
+
profession_concentration_hierarchy:,
|
16
|
+
profession_concentration_group:,
|
15
17
|
profession_advanced:,
|
16
18
|
skill_counters:,
|
17
19
|
skill_countered:
|
@@ -25,6 +27,7 @@ class Validator
|
|
25
27
|
@strain_stats = strain_stats
|
26
28
|
@strain_specs = strain_specs
|
27
29
|
@profession_concentrations = profession_concentrations
|
30
|
+
@profession_concentration_hierarchy = profession_concentration_hierarchy
|
28
31
|
@profession_advanced = profession_advanced
|
29
32
|
@skill_counters = skill_counters
|
30
33
|
@skill_countered = skill_countered
|
@@ -43,6 +46,7 @@ class Validator
|
|
43
46
|
validate_stats
|
44
47
|
validate_strain_specs
|
45
48
|
validate_profession_concentrations
|
49
|
+
validate_profession_concentration_hierarchy
|
46
50
|
validate_profession_advanced
|
47
51
|
validate_non_duplicate_skill_codes
|
48
52
|
validate_skill_counters cat: @skill_counters
|
@@ -59,6 +63,12 @@ private
|
|
59
63
|
assert(@profession_advanced.length > 0)
|
60
64
|
end
|
61
65
|
|
66
|
+
def validate_profession_concentration_hierarchy
|
67
|
+
@profession_concentration_hierarchy.each do |prof, pc|
|
68
|
+
is_in_profession?(prof)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
62
72
|
def validate_non_empty
|
63
73
|
assert(@skill_list.length > 0, "Empty skill list")
|
64
74
|
assert(@skill_cat.length > 0, "Empty processed skills")
|
data/lib/input/input.txt
CHANGED
@@ -48,6 +48,16 @@ Agility Combatant, Ranged Combatant, Short Range Combatant: Assassin, Guard, Gun
|
|
48
48
|
Civil Servant, Socialite, Resource Manager: Caravan Driver, Charlatan, Doctor, Entertainer, Gambler, Hookup, Merchant, Politician, Priest, Publican, Ring Leader, Sawbones, Scoundrel, Spy, Teacher, Thief
|
49
49
|
Consumable Producer, Quality Producer, Quantity Producer: Cook, Distiller, Engineer, Mad Scientist, Printer, Scavenger, Tinker
|
50
50
|
|
51
|
+
== Concentration Hierarchy ==
|
52
|
+
Combat: Assassin, Guard, Gun Slinger, Hunter, Martial Artist, Officer, Primitive, Pugilist, Sniper, Soldier, Thug
|
53
|
+
Society: Caravan Driver, Charlatan, Doctor, Entertainer, Gambler, Hook-Up, Merchant, Politician, Priest, Publican, Ring Leader, Sawbones, Scoundrel, Spy, Teacher, Thief
|
54
|
+
Production: Cook, Distiller, Engineer, Mad Scientist, Printer, Scavenger, Tinker
|
55
|
+
|
56
|
+
== Concentration Group ==
|
57
|
+
Combat: Agility Combatant, Ranged Combatant, Short Range Combatant
|
58
|
+
Civilized Society: Civil Servant, Sociality, Resource Manager
|
59
|
+
Crafting and Production: Consumable Producer, Quality Producer, Quantity Producer
|
60
|
+
|
51
61
|
== Profession Concentration Skills ==
|
52
62
|
Agility Combatant: Close The Distance, Disengage, Keen Eyes
|
53
63
|
Ranged Combatant: Heavy Ordnance, Reloading is Stupid, Improvised Thrown Weapon
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drpedia_lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gloria Budiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Extracts skills, strains, profession, and requirement trees into JSON
|
14
14
|
email: wahyu.g@gmail.com
|