ygoprodeck 1.0.9 → 1.2.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 +4 -4
- data/.gitignore +2 -1
- data/.rubocop.yml +69 -0
- data/Gemfile +4 -1
- data/README.md +26 -8
- data/Rakefile +4 -4
- data/examples/banlist.rb +1 -0
- data/examples/search.rb +1 -2
- data/examples/search_fuzzy.rb +25 -26
- data/lib/ygoprodeck/errors.rb +3 -3
- data/lib/ygoprodeck/search/all_card.rb +2 -2
- data/lib/ygoprodeck/search/archetype.rb +26 -30
- data/lib/ygoprodeck/search/banlist.rb +76 -38
- data/lib/ygoprodeck/search/card_sets.rb +21 -28
- data/lib/ygoprodeck/search/check_db_version.rb +24 -33
- data/lib/ygoprodeck/search/client/endpoint.rb +7 -8
- data/lib/ygoprodeck/search/client/image_gapis.rb +17 -16
- data/lib/ygoprodeck/search/fuzzy_name.rb +21 -20
- data/lib/ygoprodeck/search/id.rb +3 -3
- data/lib/ygoprodeck/search/list.rb +34 -47
- data/lib/ygoprodeck/search/match.rb +8 -8
- data/lib/ygoprodeck/search/name.rb +21 -22
- data/lib/ygoprodeck/search/random.rb +19 -20
- data/lib/ygoprodeck/version.rb +3 -3
- data/lib/ygoprodeck.rb +10 -10
- data/spec/check_db_spec.rb +4 -5
- data/ygoprodeck.gemspec +17 -17
- metadata +6 -8
- data/.prettierrc +0 -7
- data/bin/console +0 -14
- data/package.json +0 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 38c1e28c30e9912a0d3f532d69d0bb19f13496041c7aefa4722d57bb461dc3d6
|
|
4
|
+
data.tar.gz: a701b1fcfc477cfe6d4c6444efdc94d790e22ec0b45ba3079205da8e0cb557c7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 585feb7a99dd8cc41a84b69132a698261ecd78a3c13dadfd1b37e9557a436b6a16703d0a9291ea11de23b4fd4dd68d0efa72a7a91dd947b659a5644c93f7bdcf
|
|
7
|
+
data.tar.gz: 8e67e92b923bf9d172175cd709b6eb1390ca9f52f67ff89a114ae8d06a14998dddac336ce15b20190810a6c4c83e369664179f1cd98512ad5f0a8154a47740c8
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
require:
|
|
2
|
+
- rubocop-performance
|
|
3
|
+
|
|
4
|
+
AllCops:
|
|
5
|
+
Include:
|
|
6
|
+
- "**/*.rb"
|
|
7
|
+
- "**/*.rake"
|
|
8
|
+
- "."
|
|
9
|
+
Exclude:
|
|
10
|
+
- "vendor/**/*"
|
|
11
|
+
- "db/schema.rb"
|
|
12
|
+
- Gemfile
|
|
13
|
+
- Rakefile
|
|
14
|
+
- "*.gemspec"
|
|
15
|
+
NewCops: enable
|
|
16
|
+
|
|
17
|
+
Performance:
|
|
18
|
+
Enabled: true
|
|
19
|
+
|
|
20
|
+
Layout/LineLength:
|
|
21
|
+
Enabled: false
|
|
22
|
+
|
|
23
|
+
Style/BlockDelimiters:
|
|
24
|
+
Enabled: false
|
|
25
|
+
|
|
26
|
+
Lint/AmbiguousBlockAssociation:
|
|
27
|
+
Enabled: false
|
|
28
|
+
|
|
29
|
+
Metrics/BlockLength:
|
|
30
|
+
Enabled: false
|
|
31
|
+
|
|
32
|
+
Layout/HeredocIndentation:
|
|
33
|
+
Enabled: false
|
|
34
|
+
|
|
35
|
+
Metrics/ClassLength:
|
|
36
|
+
Enabled: false
|
|
37
|
+
|
|
38
|
+
Metrics/MethodLength:
|
|
39
|
+
Enabled: false
|
|
40
|
+
|
|
41
|
+
Metrics/ParameterLists:
|
|
42
|
+
Enabled: false
|
|
43
|
+
|
|
44
|
+
Metrics/AbcSize:
|
|
45
|
+
Enabled: false
|
|
46
|
+
|
|
47
|
+
Metrics/PerceivedComplexity:
|
|
48
|
+
Enabled: false
|
|
49
|
+
|
|
50
|
+
Metrics/CyclomaticComplexity:
|
|
51
|
+
Enabled: false
|
|
52
|
+
|
|
53
|
+
Style/HashEachMethods:
|
|
54
|
+
Enabled: true
|
|
55
|
+
|
|
56
|
+
Style/HashTransformKeys:
|
|
57
|
+
Enabled: false
|
|
58
|
+
|
|
59
|
+
Style/HashTransformValues:
|
|
60
|
+
Enabled: false
|
|
61
|
+
|
|
62
|
+
Style/FrozenStringLiteralComment:
|
|
63
|
+
Enabled: false
|
|
64
|
+
|
|
65
|
+
Style/Documentation:
|
|
66
|
+
Enabled: false
|
|
67
|
+
|
|
68
|
+
Style/StringLiterals:
|
|
69
|
+
Enabled: false
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -29,66 +29,78 @@ Or install it yourself as:
|
|
|
29
29
|
require 'ygoprodeck'
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
|
|
33
32
|
Search card by id :
|
|
33
|
+
|
|
34
34
|
```ruby
|
|
35
35
|
Ygoprodeck::ID.is(*id)
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
Search card by name :
|
|
39
|
+
|
|
39
40
|
```ruby
|
|
40
41
|
Ygoprodeck::Name.is(*name)
|
|
41
42
|
```
|
|
42
43
|
|
|
43
|
-
search card by name (use method fuzzy) :
|
|
44
|
+
search card by name (use method fuzzy) :
|
|
45
|
+
|
|
44
46
|
```ruby
|
|
45
47
|
Ygoprodeck::Fname.is(*name)
|
|
46
48
|
```
|
|
47
49
|
|
|
48
50
|
Search list card by name:
|
|
51
|
+
|
|
49
52
|
```ruby
|
|
50
53
|
Ygoprodeck::List.is(*name)
|
|
51
54
|
```
|
|
52
55
|
|
|
53
56
|
Search Archtype by name:
|
|
57
|
+
|
|
54
58
|
```ruby
|
|
55
59
|
Ygoprodeck::Archetype.is(*name)
|
|
56
60
|
```
|
|
57
61
|
|
|
58
62
|
Matching card by name :
|
|
63
|
+
|
|
59
64
|
```ruby
|
|
60
65
|
Ygoprodeck::Match.is(*name)
|
|
61
66
|
```
|
|
62
67
|
|
|
63
68
|
Random card :
|
|
69
|
+
|
|
64
70
|
```ruby
|
|
65
71
|
Ygoprodeck::Card.random
|
|
66
72
|
```
|
|
67
73
|
|
|
68
74
|
All card sets :
|
|
75
|
+
|
|
69
76
|
```ruby
|
|
70
77
|
Ygoprodeck::Card.sets
|
|
71
78
|
```
|
|
72
79
|
|
|
73
|
-
Banlist (TCG, OCG, GOAT) :
|
|
80
|
+
Banlist (MasterDuel, TCG, OCG, GOAT) :
|
|
81
|
+
|
|
74
82
|
```ruby
|
|
83
|
+
Ygoprodeck::Banlist.md
|
|
75
84
|
Ygoprodeck::Banlist.tcg
|
|
76
85
|
Ygoprodeck::Banlist.ocg
|
|
77
86
|
Ygoprodeck::Banlist.goat
|
|
78
87
|
```
|
|
79
88
|
|
|
80
89
|
Check Database Version :
|
|
90
|
+
|
|
81
91
|
```ruby
|
|
82
92
|
Ygoprodeck::CheckDbVer.info
|
|
83
93
|
```
|
|
84
94
|
|
|
85
|
-
|
|
95
|
+
Image card :
|
|
96
|
+
|
|
86
97
|
```ruby
|
|
87
98
|
yugi = Ygoprodeck::Fname.is(*name)
|
|
88
99
|
Ygoprodeck::Image.is(yugi['id'])
|
|
89
100
|
```
|
|
90
101
|
|
|
91
|
-
|
|
102
|
+
Cropped Image card (Art) :
|
|
103
|
+
|
|
92
104
|
```ruby
|
|
93
105
|
yugi = Ygoprodeck::Fname.is(*name)
|
|
94
106
|
Ygoprodeck::Image_small.is(yugi['id'])
|
|
@@ -96,12 +108,14 @@ Ygoprodeck::Image_small.is(yugi['id'])
|
|
|
96
108
|
|
|
97
109
|
or look [examples](https://github.com/whdzera/ygoprodeck/blob/master/examples)
|
|
98
110
|
|
|
99
|
-
#### Noted
|
|
111
|
+
#### Noted
|
|
112
|
+
|
|
100
113
|
Rate Limiting on the API is enabled. The rate limit is 20 requests per 1 second
|
|
101
114
|
|
|
102
115
|
#### Response Information
|
|
103
116
|
|
|
104
117
|
##### Monster Cards
|
|
118
|
+
|
|
105
119
|
- id - ID or Passocde of the card.
|
|
106
120
|
- name - Name of the card.
|
|
107
121
|
- type - The type of card you are viewing (Normal Monster, Effect Monster, Synchro Monster, etc).
|
|
@@ -132,15 +146,19 @@ Rate Limiting on the API is enabled. The rate limit is 20 requests per 1 second
|
|
|
132
146
|
## Development
|
|
133
147
|
|
|
134
148
|
#### Unit Test
|
|
149
|
+
|
|
135
150
|
```
|
|
136
|
-
rake spec
|
|
151
|
+
rake spec
|
|
137
152
|
```
|
|
138
153
|
|
|
139
154
|
## Contributing
|
|
155
|
+
|
|
140
156
|
Fork and Pull Request to contibuting https://github.com/whdzera/ygoprodeck .
|
|
141
157
|
|
|
142
158
|
## License
|
|
159
|
+
|
|
143
160
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
144
161
|
|
|
145
162
|
## Code of Conduct
|
|
146
|
-
|
|
163
|
+
|
|
164
|
+
Everyone interacting in the Ygoprodeck project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/whdzera/ygoprodeck/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
1
|
+
require 'bundler/gem_tasks'
|
|
2
|
+
require 'rspec/core/rake_task'
|
|
3
3
|
|
|
4
4
|
RSpec::Core::RakeTask.new(:spec) do |t|
|
|
5
|
-
t.pattern =
|
|
6
|
-
t.rspec_opts =
|
|
5
|
+
t.pattern = 'spec/**/*_spec.rb'
|
|
6
|
+
t.rspec_opts = '--format documentation'
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
task default: :spec
|
data/examples/banlist.rb
CHANGED
data/examples/search.rb
CHANGED
|
@@ -3,8 +3,7 @@ require "ygoprodeck"
|
|
|
3
3
|
# yugi is example, you free to change name card
|
|
4
4
|
yugi = Ygoprodeck::Name.is("dark magician") # example I wanna search 'dark magician' using fuzzy search
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
when yugi == nil
|
|
6
|
+
if yugi.nil?
|
|
8
7
|
puts "Card not found"
|
|
9
8
|
else
|
|
10
9
|
puts yugi # => get all information of dark magician (name,id,level,attr,atk,def,etc)
|
data/examples/search_fuzzy.rb
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
require "ygoprodeck"
|
|
2
|
-
|
|
3
|
-
# yugi is example, you free to change name card
|
|
4
|
-
yugi = Ygoprodeck::Fname.is("dark magician") # example I wanna search 'dark magician' using fuzzy search
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
puts yugi["
|
|
16
|
-
puts yugi["
|
|
17
|
-
puts yugi["
|
|
18
|
-
puts yugi["
|
|
19
|
-
puts yugi["
|
|
20
|
-
puts yugi["
|
|
21
|
-
puts yugi["
|
|
22
|
-
puts yugi["
|
|
23
|
-
puts yugi["
|
|
24
|
-
puts Ygoprodeck::
|
|
25
|
-
|
|
26
|
-
end
|
|
1
|
+
require "ygoprodeck"
|
|
2
|
+
|
|
3
|
+
# yugi is example, you free to change name card
|
|
4
|
+
yugi = Ygoprodeck::Fname.is("dark magician") # example I wanna search 'dark magician' using fuzzy search
|
|
5
|
+
|
|
6
|
+
if yugi.nil?
|
|
7
|
+
puts "Card not found"
|
|
8
|
+
else
|
|
9
|
+
puts yugi # => get all information of dark magician (name,id,level,attr,atk,def,etc)
|
|
10
|
+
|
|
11
|
+
puts "#" * 10
|
|
12
|
+
|
|
13
|
+
# => get specific information of dark magician
|
|
14
|
+
puts yugi["id"]
|
|
15
|
+
puts yugi["name"]
|
|
16
|
+
puts yugi["attribute"]
|
|
17
|
+
puts yugi["type"]
|
|
18
|
+
puts yugi["race"]
|
|
19
|
+
puts yugi["level"]
|
|
20
|
+
puts yugi["desc"]
|
|
21
|
+
puts yugi["atk"]
|
|
22
|
+
puts yugi["def"]
|
|
23
|
+
puts Ygoprodeck::Image.is(yugi["id"]) # => use id from yugi['id'] to get dark magician image
|
|
24
|
+
puts Ygoprodeck::Image_small.is(yugi["id"]) # => small version
|
|
25
|
+
end
|
data/lib/ygoprodeck/errors.rb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module Ygoprodeck
|
|
2
|
-
class Error < StandardError; end
|
|
3
|
-
end
|
|
1
|
+
module Ygoprodeck
|
|
2
|
+
class Error < StandardError; end
|
|
3
|
+
end
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
2
|
-
# sorry I did't created get all card, because you need 2 days to get all card
|
|
1
|
+
#
|
|
2
|
+
# sorry I did't created get all card, because you need 2 days to get all card
|
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
module Ygoprodeck
|
|
2
|
-
class Archetype
|
|
3
|
-
attr_reader :archetype
|
|
4
|
-
|
|
5
|
-
def self.is(archetype)
|
|
6
|
-
url =
|
|
7
|
-
"#{Ygoprodeck::Endpoint.is}cardinfo.php?archetype=#{URI.encode_www_form_component(archetype)}"
|
|
8
|
-
uri = URI(url)
|
|
9
|
-
|
|
10
|
-
begin
|
|
11
|
-
response = Net::HTTP.get(uri)
|
|
12
|
-
load = JSON.parse(response)
|
|
13
|
-
|
|
14
|
-
if load["data"].nil? || load["data"].empty?
|
|
15
|
-
{
|
|
16
|
-
"error" => "No card matching your query was found in the database."
|
|
17
|
-
}
|
|
18
|
-
else
|
|
19
|
-
load["data"]
|
|
20
|
-
end
|
|
21
|
-
rescue
|
|
22
|
-
{ "error" => "
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
1
|
+
module Ygoprodeck
|
|
2
|
+
class Archetype
|
|
3
|
+
attr_reader :archetype
|
|
4
|
+
|
|
5
|
+
def self.is(archetype)
|
|
6
|
+
url =
|
|
7
|
+
"#{Ygoprodeck::Endpoint.is}cardinfo.php?archetype=#{URI.encode_www_form_component(archetype)}&format=genesys&misc=yes"
|
|
8
|
+
uri = URI(url)
|
|
9
|
+
|
|
10
|
+
begin
|
|
11
|
+
response = Net::HTTP.get(uri)
|
|
12
|
+
load = JSON.parse(response)
|
|
13
|
+
|
|
14
|
+
if load["data"].nil? || load["data"].empty?
|
|
15
|
+
{
|
|
16
|
+
"error" => "No card matching your query was found in the database."
|
|
17
|
+
}
|
|
18
|
+
else
|
|
19
|
+
load["data"]
|
|
20
|
+
end
|
|
21
|
+
rescue StandardError
|
|
22
|
+
{ "error" => "Something went wrong" }
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -1,38 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
require 'net/http'
|
|
2
|
+
require 'json'
|
|
3
|
+
require 'uri'
|
|
4
|
+
|
|
5
|
+
module Ygoprodeck
|
|
6
|
+
class Banlist
|
|
7
|
+
API_BASE = 'https://ygoprodeck.com/api/banlist'.freeze
|
|
8
|
+
|
|
9
|
+
def self.fetch_banlist(format)
|
|
10
|
+
url = "#{Ygoprodeck::Endpoint.is}cardinfo.php?banlist=#{format}"
|
|
11
|
+
uri = URI(url)
|
|
12
|
+
|
|
13
|
+
begin
|
|
14
|
+
response = Net::HTTP.get(uri)
|
|
15
|
+
load = JSON.parse(response)
|
|
16
|
+
|
|
17
|
+
if load.has_key?('error')
|
|
18
|
+
{ 'error' => load['error'] }
|
|
19
|
+
else
|
|
20
|
+
load
|
|
21
|
+
end
|
|
22
|
+
rescue JSON::ParserError
|
|
23
|
+
{ 'error' => 'Failed to parse JSON response' }
|
|
24
|
+
rescue SocketError
|
|
25
|
+
{ 'error' => 'Network connection error' }
|
|
26
|
+
rescue StandardError => e
|
|
27
|
+
{ 'error' => "An unexpected error occurred: #{e.message}" }
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.tcg
|
|
32
|
+
fetch_banlist('tcg')
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.ocg
|
|
36
|
+
fetch_banlist('ocg')
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def self.goat
|
|
40
|
+
fetch_banlist('goat')
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def self.md
|
|
44
|
+
dates_uri = URI("#{API_BASE}/getBanListDates.php")
|
|
45
|
+
dates_res = Net::HTTP.get(dates_uri)
|
|
46
|
+
dates = JSON.parse(dates_res)
|
|
47
|
+
|
|
48
|
+
master_duel_dates = dates.select { |d| d['type'] == 'Master Duel' }
|
|
49
|
+
return { 'error' => 'No Master Duel dates found' } if master_duel_dates.empty?
|
|
50
|
+
|
|
51
|
+
latest_date = master_duel_dates.map { |d| d['date'] }.max
|
|
52
|
+
|
|
53
|
+
list_uri = URI("#{API_BASE}/getBanList.php?list=Master%20Duel&date=#{latest_date}")
|
|
54
|
+
req = Net::HTTP::Get.new(list_uri)
|
|
55
|
+
req['User-Agent'] = 'Mozilla/5.0'
|
|
56
|
+
|
|
57
|
+
res = Net::HTTP.start(list_uri.host, list_uri.port, use_ssl: true) do |http|
|
|
58
|
+
http.request(req)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
load = JSON.parse(res.body)
|
|
62
|
+
|
|
63
|
+
if load.is_a?(Hash) && load.key?('error')
|
|
64
|
+
{ 'error' => load['error'] }
|
|
65
|
+
else
|
|
66
|
+
load
|
|
67
|
+
end
|
|
68
|
+
rescue JSON::ParserError
|
|
69
|
+
{ 'error' => 'Failed to parse JSON response' }
|
|
70
|
+
rescue SocketError
|
|
71
|
+
{ 'error' => 'Network connection error' }
|
|
72
|
+
rescue StandardError => e
|
|
73
|
+
{ 'error' => "An unexpected error occurred: #{e.message}" }
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
module Ygoprodeck
|
|
2
|
-
class Card
|
|
3
|
-
def self.sets
|
|
4
|
-
url = "https://db.ygoprodeck.com/api/v7/cardsets.php"
|
|
5
|
-
uri = URI(url)
|
|
6
|
-
|
|
7
|
-
begin
|
|
8
|
-
response = Net::HTTP.get(uri)
|
|
9
|
-
load = JSON.parse(response)
|
|
10
|
-
|
|
11
|
-
if load.is_a?(Hash) && load.has_key?('error')
|
|
12
|
-
{ 'error' => load['error'] }
|
|
13
|
-
else
|
|
14
|
-
load
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{ 'error' => 'Request timed out' }
|
|
23
|
-
rescue StandardError => e
|
|
24
|
-
{ 'error' => "An unexpected error occurred: #{e.message}" }
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
1
|
+
module Ygoprodeck
|
|
2
|
+
class Card
|
|
3
|
+
def self.sets
|
|
4
|
+
url = "https://db.ygoprodeck.com/api/v7/cardsets.php"
|
|
5
|
+
uri = URI(url)
|
|
6
|
+
|
|
7
|
+
begin
|
|
8
|
+
response = Net::HTTP.get(uri)
|
|
9
|
+
load = JSON.parse(response)
|
|
10
|
+
|
|
11
|
+
if load.is_a?(Hash) && load.has_key?('error')
|
|
12
|
+
{ 'error' => load['error'] }
|
|
13
|
+
else
|
|
14
|
+
load
|
|
15
|
+
end
|
|
16
|
+
rescue StandardError => e
|
|
17
|
+
{ 'error' => "An unexpected error occurred: #{e.message}" }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -1,33 +1,24 @@
|
|
|
1
|
-
module Ygoprodeck
|
|
2
|
-
class CheckDbVer
|
|
3
|
-
def self.info
|
|
4
|
-
url = "https://db.ygoprodeck.com/api/v7/checkDBVer.php"
|
|
5
|
-
uri = URI(url)
|
|
6
|
-
|
|
7
|
-
begin
|
|
8
|
-
response = Net::HTTP.get_response(uri)
|
|
9
|
-
|
|
10
|
-
unless response.is_a?(Net::HTTPSuccess)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
load
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{ 'error' => 'Network connection error' }
|
|
26
|
-
rescue Net::ReadTimeout => e
|
|
27
|
-
{ 'error' => 'Request timed out' }
|
|
28
|
-
rescue StandardError => e
|
|
29
|
-
{ 'error' => "An unexpected error occurred: #{e.message}" }
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
1
|
+
module Ygoprodeck
|
|
2
|
+
class CheckDbVer
|
|
3
|
+
def self.info
|
|
4
|
+
url = "https://db.ygoprodeck.com/api/v7/checkDBVer.php"
|
|
5
|
+
uri = URI(url)
|
|
6
|
+
|
|
7
|
+
begin
|
|
8
|
+
response = Net::HTTP.get_response(uri)
|
|
9
|
+
|
|
10
|
+
return { 'error' => "HTTP request failed with status code: #{response.code}" } unless response.is_a?(Net::HTTPSuccess)
|
|
11
|
+
|
|
12
|
+
load = JSON.parse(response.body)
|
|
13
|
+
|
|
14
|
+
if load.is_a?(Hash) && load.has_key?('error')
|
|
15
|
+
{ 'error' => load['error'] }
|
|
16
|
+
else
|
|
17
|
+
load
|
|
18
|
+
end
|
|
19
|
+
rescue StandardError => e
|
|
20
|
+
{ 'error' => "An unexpected error occurred: #{e.message}" }
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
end
|
|
1
|
+
module Ygoprodeck
|
|
2
|
+
class Endpoint
|
|
3
|
+
def self.is
|
|
4
|
+
"https://db.ygoprodeck.com/api/v7/"
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
end
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
end
|
|
1
|
+
module Ygoprodeck
|
|
2
|
+
class Image
|
|
3
|
+
attr_reader :image_by_id
|
|
4
|
+
|
|
5
|
+
def self.is(image_by_id)
|
|
6
|
+
"https://images.ygoprodeck.com/images/cards/#{image_by_id}.jpg"
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class Image_small
|
|
11
|
+
attr_reader :image_small_by_id
|
|
12
|
+
|
|
13
|
+
def self.is(image_small_by_id)
|
|
14
|
+
"https://images.ygoprodeck.com/images/cards_cropped/#{image_small_by_id}.jpg"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
module Ygoprodeck
|
|
2
|
-
class Fname
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
load["data"][
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
end
|
|
1
|
+
module Ygoprodeck
|
|
2
|
+
class Fname
|
|
3
|
+
attr_reader :f_name
|
|
4
|
+
|
|
5
|
+
def self.is(f_name)
|
|
6
|
+
url = "#{Ygoprodeck::Endpoint.is}cardinfo.php?fname=#{URI.encode_www_form_component(f_name)}&format=genesys&misc=yes"
|
|
7
|
+
uri = URI(url)
|
|
8
|
+
|
|
9
|
+
begin
|
|
10
|
+
response = Net::HTTP.get(uri)
|
|
11
|
+
load = JSON.parse(response)
|
|
12
|
+
|
|
13
|
+
return nil if load["data"].nil? || load["data"].empty?
|
|
14
|
+
|
|
15
|
+
load["data"][0]
|
|
16
|
+
rescue StandardError
|
|
17
|
+
{ "error" => "Something went wrong" }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
data/lib/ygoprodeck/search/id.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Ygoprodeck
|
|
2
2
|
class ID
|
|
3
3
|
def self.is(id)
|
|
4
|
-
url = "#{Ygoprodeck::Endpoint.is}cardinfo.php?id=#{
|
|
4
|
+
url = "#{Ygoprodeck::Endpoint.is}cardinfo.php?id=#{id}"
|
|
5
5
|
uri = URI(url)
|
|
6
6
|
|
|
7
7
|
begin
|
|
@@ -11,8 +11,8 @@ module Ygoprodeck
|
|
|
11
11
|
return nil if load["data"].nil? || load["data"].empty?
|
|
12
12
|
|
|
13
13
|
load["data"][0]
|
|
14
|
-
rescue
|
|
15
|
-
|
|
14
|
+
rescue StandardError
|
|
15
|
+
{ "error" => "Something went wrong" }
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
end
|
|
@@ -1,47 +1,34 @@
|
|
|
1
|
-
module Ygoprodeck
|
|
2
|
-
class List
|
|
3
|
-
attr_reader :list
|
|
4
|
-
|
|
5
|
-
def self.is(list)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{ 'error' => 'Failed to parse JSON response' }
|
|
36
|
-
rescue Net::OpenTimeout => e
|
|
37
|
-
{ 'error' => 'Connection timed out' }
|
|
38
|
-
rescue Net::ReadTimeout => e
|
|
39
|
-
{ 'error' => 'Request timed out' }
|
|
40
|
-
rescue SocketError => e
|
|
41
|
-
{ 'error' => 'Network connection error' }
|
|
42
|
-
rescue StandardError => e
|
|
43
|
-
{ 'error' => "An unexpected error occurred: #{e.message}" }
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
1
|
+
module Ygoprodeck
|
|
2
|
+
class List
|
|
3
|
+
attr_reader :list
|
|
4
|
+
|
|
5
|
+
def self.is(list)
|
|
6
|
+
# Encode query parameter to handle special characters properly
|
|
7
|
+
url = "#{Ygoprodeck::Endpoint.is}cardinfo.php?fname=#{URI.encode_www_form_component(list)}&format=genesys&misc=yes"
|
|
8
|
+
uri = URI(url)
|
|
9
|
+
|
|
10
|
+
# Use timeout to prevent hanging on slow connections
|
|
11
|
+
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https', open_timeout: 10, read_timeout: 10) do |http|
|
|
12
|
+
http.get(uri.request_uri)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Check HTTP status code first
|
|
16
|
+
case response
|
|
17
|
+
when Net::HTTPSuccess
|
|
18
|
+
load = JSON.parse(response.body)
|
|
19
|
+
|
|
20
|
+
if load.has_key?('error')
|
|
21
|
+
{ 'error' => load['error'] }
|
|
22
|
+
elsif load['data'].nil? || load['data'].empty?
|
|
23
|
+
{ 'error' => 'No card matching your query was found in the database.' }
|
|
24
|
+
else
|
|
25
|
+
load['data']
|
|
26
|
+
end
|
|
27
|
+
else
|
|
28
|
+
{ 'error' => "HTTP request failed with status code: #{response.code}" }
|
|
29
|
+
end
|
|
30
|
+
rescue StandardError => e
|
|
31
|
+
{ 'error' => "An unexpected error occurred: #{e.message}" }
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Ygoprodeck
|
|
2
2
|
class Match
|
|
3
3
|
def self.normalize(text)
|
|
4
|
-
text.downcase.gsub(/[^a-z0-9\s
|
|
4
|
+
text.downcase.gsub(/[^a-z0-9\s-]/, '').strip
|
|
5
5
|
end
|
|
6
6
|
|
|
7
7
|
def self.is(name_card)
|
|
@@ -13,23 +13,23 @@ module Ygoprodeck
|
|
|
13
13
|
|
|
14
14
|
substring_matches = names.select { |name| normalize(name).include?(normalized_input) }
|
|
15
15
|
|
|
16
|
-
if
|
|
17
|
-
best_match = substring_matches.min_by { |name| normalize(name).length }
|
|
18
|
-
else
|
|
16
|
+
if substring_matches.empty?
|
|
19
17
|
word_matches = names.select do |name|
|
|
20
18
|
name_words = normalize(name).split
|
|
21
19
|
input_words.all? { |word| name_words.any? { |nw| nw.include?(word) } }
|
|
22
20
|
end
|
|
23
21
|
|
|
24
|
-
if
|
|
25
|
-
best_match = word_matches.min_by { |name| normalize(name).length }
|
|
26
|
-
else
|
|
22
|
+
if word_matches.empty?
|
|
27
23
|
matcher = Levenshtein.new(normalized_input)
|
|
28
24
|
best_match = names.min_by { |name| matcher.match(normalize(name)) }
|
|
25
|
+
else
|
|
26
|
+
best_match = word_matches.min_by { |name| normalize(name).length }
|
|
29
27
|
end
|
|
28
|
+
else
|
|
29
|
+
best_match = substring_matches.min_by { |name| normalize(name).length }
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
best_match
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
|
-
end
|
|
35
|
+
end
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
module Ygoprodeck
|
|
2
|
-
class Name
|
|
3
|
-
attr_reader :name
|
|
4
|
-
|
|
5
|
-
def self.is(name)
|
|
6
|
-
url = "#{Ygoprodeck::Endpoint.is}cardinfo.php?name=#{URI.encode_www_form_component(name)}"
|
|
7
|
-
uri = URI(url)
|
|
8
|
-
|
|
9
|
-
begin
|
|
10
|
-
response = Net::HTTP.get(uri)
|
|
11
|
-
load = JSON.parse(response)
|
|
12
|
-
|
|
13
|
-
return nil if load["data"].nil? || load["data"].empty?
|
|
14
|
-
|
|
15
|
-
load["data"][0]
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
end
|
|
1
|
+
module Ygoprodeck
|
|
2
|
+
class Name
|
|
3
|
+
attr_reader :name
|
|
4
|
+
|
|
5
|
+
def self.is(name)
|
|
6
|
+
url = "#{Ygoprodeck::Endpoint.is}cardinfo.php?name=#{URI.encode_www_form_component(name)}&format=genesys&misc=yes"
|
|
7
|
+
uri = URI(url)
|
|
8
|
+
|
|
9
|
+
begin
|
|
10
|
+
response = Net::HTTP.get(uri)
|
|
11
|
+
load = JSON.parse(response)
|
|
12
|
+
|
|
13
|
+
return nil if load["data"].nil? || load["data"].empty?
|
|
14
|
+
|
|
15
|
+
load["data"][0]
|
|
16
|
+
rescue StandardError
|
|
17
|
+
{ "error" => "Something went wrong" }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
module Ygoprodeck
|
|
2
|
-
class Card
|
|
3
|
-
def self.random
|
|
4
|
-
url = "https://db.ygoprodeck.com/api/v7/cardinfo.php?num=1&offset=0&sort=random&cachebust"
|
|
5
|
-
uri = URI(url)
|
|
6
|
-
|
|
7
|
-
begin
|
|
8
|
-
response = Net::HTTP.get(uri)
|
|
9
|
-
load = JSON.parse(response)
|
|
10
|
-
|
|
11
|
-
return nil if load["data"].nil? || load["data"].empty?
|
|
12
|
-
|
|
13
|
-
load["data"][0]
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
end
|
|
1
|
+
module Ygoprodeck
|
|
2
|
+
class Card
|
|
3
|
+
def self.random
|
|
4
|
+
url = "https://db.ygoprodeck.com/api/v7/cardinfo.php?num=1&offset=0&sort=random&cachebust&format=genesys&misc=yes"
|
|
5
|
+
uri = URI(url)
|
|
6
|
+
|
|
7
|
+
begin
|
|
8
|
+
response = Net::HTTP.get(uri)
|
|
9
|
+
load = JSON.parse(response)
|
|
10
|
+
|
|
11
|
+
return nil if load["data"].nil? || load["data"].empty?
|
|
12
|
+
|
|
13
|
+
load["data"][0]
|
|
14
|
+
rescue StandardError
|
|
15
|
+
{ "error" => "Something went wrong" }
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
data/lib/ygoprodeck/version.rb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module Ygoprodeck
|
|
2
|
-
VERSION = "1.
|
|
3
|
-
end
|
|
1
|
+
module Ygoprodeck
|
|
2
|
+
VERSION = "1.2.1".freeze
|
|
3
|
+
end
|
data/lib/ygoprodeck.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
require "open-uri"
|
|
2
|
-
require "net/http"
|
|
3
|
-
require "json"
|
|
4
|
-
require "amatch"
|
|
5
|
-
include Amatch
|
|
6
|
-
|
|
7
|
-
Dir[File.join(__dir__, "ygoprodeck/**/*.rb")].sort.each { |f| require f }
|
|
8
|
-
|
|
9
|
-
module Ygoprodeck
|
|
10
|
-
end
|
|
1
|
+
require "open-uri"
|
|
2
|
+
require "net/http"
|
|
3
|
+
require "json"
|
|
4
|
+
require "amatch"
|
|
5
|
+
include Amatch
|
|
6
|
+
|
|
7
|
+
Dir[File.join(__dir__, "ygoprodeck/**/*.rb")].sort.each { |f| require f }
|
|
8
|
+
|
|
9
|
+
module Ygoprodeck
|
|
10
|
+
end
|
data/spec/check_db_spec.rb
CHANGED
data/ygoprodeck.gemspec
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
lib = File.expand_path(
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
|
-
require
|
|
3
|
+
require 'ygoprodeck/version'
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name =
|
|
6
|
+
spec.name = 'ygoprodeck'
|
|
7
7
|
spec.version = Ygoprodeck::VERSION
|
|
8
|
-
spec.authors = [
|
|
9
|
-
spec.email = [
|
|
8
|
+
spec.authors = ['Rokhimin Wahid']
|
|
9
|
+
spec.email = ['whdzera@gmail.com']
|
|
10
10
|
spec.summary = "ygoprodeck API wrapper for search yugioh's card"
|
|
11
|
-
spec.description =
|
|
12
|
-
spec.homepage =
|
|
13
|
-
spec.license =
|
|
11
|
+
spec.description = 'ygoprodeck API wrapper for search yugioh card'
|
|
12
|
+
spec.homepage = 'http://github.com/whdzera/ygoprodeck'
|
|
13
|
+
spec.license = 'MIT'
|
|
14
14
|
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0")
|
|
16
|
-
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
17
16
|
spec.executables =
|
|
18
17
|
`git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
|
19
|
-
spec.require_paths = [
|
|
18
|
+
spec.require_paths = ['lib']
|
|
20
19
|
|
|
21
|
-
spec.required_ruby_version =
|
|
20
|
+
spec.required_ruby_version = '>= 2.0.0'
|
|
22
21
|
|
|
23
|
-
spec.add_dependency
|
|
24
|
-
spec.add_development_dependency
|
|
25
|
-
spec.add_development_dependency
|
|
26
|
-
spec.add_development_dependency
|
|
27
|
-
spec.add_development_dependency
|
|
28
|
-
spec.add_development_dependency
|
|
22
|
+
spec.add_dependency 'amatch', '~> 0.4.1'
|
|
23
|
+
spec.add_development_dependency 'bundler', '~> 2.5.23'
|
|
24
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
|
25
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
26
|
+
spec.add_development_dependency 'rspec-prof', '~> 0.0.7'
|
|
27
|
+
spec.add_development_dependency 'syntax_tree', '6.2.0'
|
|
28
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
29
29
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ygoprodeck
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rokhimin Wahid
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: amatch
|
|
@@ -97,21 +97,19 @@ description: ygoprodeck API wrapper for search yugioh card
|
|
|
97
97
|
email:
|
|
98
98
|
- whdzera@gmail.com
|
|
99
99
|
executables:
|
|
100
|
-
- console
|
|
101
100
|
- setup
|
|
102
101
|
extensions: []
|
|
103
102
|
extra_rdoc_files: []
|
|
104
103
|
files:
|
|
105
104
|
- ".github/workflows/ruby.yml"
|
|
106
105
|
- ".gitignore"
|
|
107
|
-
- ".prettierrc"
|
|
108
106
|
- ".rspec"
|
|
107
|
+
- ".rubocop.yml"
|
|
109
108
|
- CODE_OF_CONDUCT.md
|
|
110
109
|
- Gemfile
|
|
111
110
|
- LICENSE.txt
|
|
112
111
|
- README.md
|
|
113
112
|
- Rakefile
|
|
114
|
-
- bin/console
|
|
115
113
|
- bin/setup
|
|
116
114
|
- examples/archetype.rb
|
|
117
115
|
- examples/banlist.rb
|
|
@@ -140,7 +138,6 @@ files:
|
|
|
140
138
|
- lib/ygoprodeck/search/name.rb
|
|
141
139
|
- lib/ygoprodeck/search/random.rb
|
|
142
140
|
- lib/ygoprodeck/version.rb
|
|
143
|
-
- package.json
|
|
144
141
|
- spec/archetype_spec.rb
|
|
145
142
|
- spec/banlist_spec.rb
|
|
146
143
|
- spec/cardsets_spec.rb
|
|
@@ -158,7 +155,8 @@ files:
|
|
|
158
155
|
homepage: http://github.com/whdzera/ygoprodeck
|
|
159
156
|
licenses:
|
|
160
157
|
- MIT
|
|
161
|
-
metadata:
|
|
158
|
+
metadata:
|
|
159
|
+
rubygems_mfa_required: 'true'
|
|
162
160
|
rdoc_options: []
|
|
163
161
|
require_paths:
|
|
164
162
|
- lib
|
|
@@ -173,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
173
171
|
- !ruby/object:Gem::Version
|
|
174
172
|
version: '0'
|
|
175
173
|
requirements: []
|
|
176
|
-
rubygems_version:
|
|
174
|
+
rubygems_version: 4.0.1
|
|
177
175
|
specification_version: 4
|
|
178
176
|
summary: ygoprodeck API wrapper for search yugioh's card
|
|
179
177
|
test_files: []
|
data/.prettierrc
DELETED
data/bin/console
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
require "ygoprodeck"
|
|
5
|
-
|
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
-
|
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
-
# require "pry"
|
|
11
|
-
# Pry.start
|
|
12
|
-
|
|
13
|
-
require "irb"
|
|
14
|
-
IRB.start(__FILE__)
|
data/package.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ygoprodeck",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "\r [](https://rubygems.org/gems/ygoprodeck)\r [](https://rubygems.org/gems/ygoprodeck)\r [](https://opensource.org/licenses/MIT)",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"directories": {
|
|
7
|
-
"example": "examples",
|
|
8
|
-
"lib": "lib"
|
|
9
|
-
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [],
|
|
14
|
-
"author": "",
|
|
15
|
-
"license": "ISC",
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@prettier/plugin-ruby": "^4.0.4",
|
|
18
|
-
"prettier": "^3.5.3"
|
|
19
|
-
}
|
|
20
|
-
}
|