oakdex-pokemon 0.0.7 → 0.0.8
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/lib/oakdex/pokemon.rb +4 -0
- data/lib/oakdex/pokemon/import.rb +2 -3
- data/lib/oakdex/pokemon/version.rb +1 -1
- 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: 8c02e42da558ccaa157023610180fd9a4ff76a31
|
|
4
|
+
data.tar.gz: 2261f64dd5da5ff8e6b1607e80afe2524ede7b41
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d871277239b2563dbd99c991f71c78394c6bb6128fd115650e26461f8fbfec9093ec61bcc57ad5be33374ebf2a1835ecf53c30d94d4d73ca392b532145341f0
|
|
7
|
+
data.tar.gz: af2df952ee119c85f40c8111c11603de07eea88c8139a4802dce1175b68dc19048aa33f27fec21cc006c1d83f97bcf671b3c3a1916cd29ef4cb88a816ba92967
|
data/lib/oakdex/pokemon.rb
CHANGED
|
@@ -22,6 +22,10 @@ module Oakdex
|
|
|
22
22
|
|
|
23
23
|
attr_accessor :trainer
|
|
24
24
|
|
|
25
|
+
def self.root
|
|
26
|
+
File.expand_path '../../../', __FILE__
|
|
27
|
+
end
|
|
28
|
+
|
|
25
29
|
def self.create(species_name, options = {})
|
|
26
30
|
species = Oakdex::Pokedex::Pokemon.find!(species_name)
|
|
27
31
|
Factory.create(species, options)
|
|
@@ -6,10 +6,9 @@ module Oakdex
|
|
|
6
6
|
class Pokemon
|
|
7
7
|
# Imports and validates pokemon
|
|
8
8
|
class Import
|
|
9
|
-
SCHEMA_PATH = './lib/oakdex/pokemon/schema.json'.freeze
|
|
10
|
-
|
|
11
9
|
def self.schema
|
|
12
|
-
|
|
10
|
+
schema_path = File.join Oakdex::Pokemon.root, 'lib', 'oakdex', 'pokemon', 'schema.json'
|
|
11
|
+
@schema ||= File.read(File.expand_path(schema_path))
|
|
13
12
|
end
|
|
14
13
|
|
|
15
14
|
def initialize(data)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oakdex-pokemon
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jalyna Schroeder
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-03-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: oakdex-pokedex
|