p2e_builder 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Archivist.rb +30 -2
- data/lib/Builder.rb +9 -1
- data/lib/p2e_builder/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1501696b816571e26d08801a002677164625b59a291fb22ebfa64b34ac79104d
|
4
|
+
data.tar.gz: 5b53c900b2420361c38b58d458608c3bfa321b69bf7883e28357ce39a4542c9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7944d9bb6638cbafd41bbff8673fd9908751ae67fc1d6425d2f68a7402bcc860c7047fa129b6a122b7cc527f1c24e47f3d06c6aaf6caac6230b9fd58e8778036
|
7
|
+
data.tar.gz: 34c865a3f0bd8b579756464c4317cb5c3adf686c8240fee3543a3fb1ef24dcef2173d4b5223e75cfc8547b664b2a5610d1611ced6e66802db6beb13d326133fb
|
data/lib/Archivist.rb
CHANGED
@@ -7,7 +7,13 @@ class Archivist
|
|
7
7
|
attr_reader :ancestries, :backgrounds, :classes
|
8
8
|
|
9
9
|
@@source = "https://2e.aonprd.com/"
|
10
|
+
|
11
|
+
@@ance_parser = /Ability Boosts(Str.+|Dex.+|Con.+|Int.+|Wis.+|Cha.+)(Str.+|Dex.+|Con.+|Int.+|Wis.+|Cha.+)FreeAbility Flaw\(s\)(Str.+|Dex.+|Con.+|Int.+|Wis.+|Cha.+)Languages/
|
10
12
|
|
13
|
+
@@back_parser = /be to (Str.+|Dex.+|Con.+|Int.+|Wis.+|Cha.+) or (Str.+|Dex.+|Con.+|Int.+|Wis.+|Cha.+), and one/
|
14
|
+
|
15
|
+
@@clas_parser = /(STR\w+|DEX\w+|CON\w+|INT\w+|WIS\w+|CHA\w+)/
|
16
|
+
|
11
17
|
def page_finder(aspect)
|
12
18
|
Nokogiri::HTML(open(@@source+aspect.to_s.capitalize+'.aspx'))
|
13
19
|
end
|
@@ -31,7 +37,6 @@ class Archivist
|
|
31
37
|
def summarize(option, aspect) # => grabs flavor blurb
|
32
38
|
page = "https://2e.aonprd.com/"+self.send("#{aspect}")[option]
|
33
39
|
blurb = Nokogiri::HTML(open(page))
|
34
|
-
#binding.pry
|
35
40
|
if page.include?("Backgrounds")
|
36
41
|
puts blurb.text.match(/pg. 6\d(.+)Choose/)[1]
|
37
42
|
else
|
@@ -39,9 +44,32 @@ class Archivist
|
|
39
44
|
end
|
40
45
|
end
|
41
46
|
|
47
|
+
def ance_stats(option, aspect) # => grabs stats from ancestry
|
48
|
+
page = "https://2e.aonprd.com/"+self.send("#{aspect}")[option]
|
49
|
+
blurb = Nokogiri::HTML(open(page))
|
50
|
+
blurb.text.match(@@ance_parser)
|
51
|
+
end
|
52
|
+
|
53
|
+
def back_stats(option, aspect) # => grabs stats from background
|
54
|
+
page = "https://2e.aonprd.com/"+self.send("#{aspect}")[option]
|
55
|
+
blurb = Nokogiri::HTML(open(page))
|
56
|
+
blurb.text.match(@@back_parser)
|
57
|
+
end
|
58
|
+
|
59
|
+
def clas_stats(option, aspect) # => grabs stats from class
|
60
|
+
page = "https://2e.aonprd.com/"+self.send("#{aspect}")[option]
|
61
|
+
blurb = Nokogiri::HTML(open(page))
|
62
|
+
binding.pry
|
63
|
+
blurb.css("b")[2].text.match(@@clas_parser)
|
64
|
+
end
|
65
|
+
|
42
66
|
def confirm(option, aspect)
|
43
67
|
return true if self.send("#{aspect}").include?(option)
|
44
68
|
puts "Choose from the list of #{aspect} above."
|
45
69
|
end
|
46
70
|
|
47
|
-
end
|
71
|
+
end
|
72
|
+
|
73
|
+
#Archivist.new.ance_stats("Dwarf", :ancestries)
|
74
|
+
|
75
|
+
#binding.pry
|
data/lib/Builder.rb
CHANGED
@@ -2,7 +2,7 @@ require_relative 'Archivist.rb'
|
|
2
2
|
|
3
3
|
class Builder
|
4
4
|
|
5
|
-
attr_accessor :name, :ancestries, :backgrounds, :classes, :description
|
5
|
+
attr_accessor :name, :ancestries, :backgrounds, :classes, :description, :statistics
|
6
6
|
|
7
7
|
@@all = []
|
8
8
|
|
@@ -10,6 +10,14 @@ class Builder
|
|
10
10
|
@name = name
|
11
11
|
@description = ""
|
12
12
|
@@all << self
|
13
|
+
@statistics = {
|
14
|
+
str: 10,
|
15
|
+
dex: 10,
|
16
|
+
con: 10,
|
17
|
+
int: 10,
|
18
|
+
wis: 10,
|
19
|
+
cha: 10
|
20
|
+
}
|
13
21
|
end
|
14
22
|
|
15
23
|
def writer
|
data/lib/p2e_builder/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: p2e_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kalmegati
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|