tamiyo 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tamiyo.rb +10 -0
- data/lib/tamiyo/cockatrice_db_sink.rb +5 -6
- data/lib/tamiyo/data_store.rb +27 -155
- data/lib/tamiyo/default_data.rb +155 -0
- data/lib/tamiyo/sets.rb +14 -0
- data/lib/tamiyo/version.rb +1 -1
- data/lib/tamiyo/yaml/yaml_helper.rb +13 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9a4830a9859afcba9035ce3defb78b6e8378bf5
|
4
|
+
data.tar.gz: 33970adda5c138a5e6acfe37507573ae90d78100
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5ab665d41dea84def8882ba64d124369207596e517e39991c873a65f14b67463ab9fe25e7f3301f8f511c173fd2fc42b489af3f523a4fd1f3c076302b961adb
|
7
|
+
data.tar.gz: eeb2d88c134bfb99cd1c32e0d0569337e5b2627975eeea42c2da3563407284b8783a01bf5662b0eac0ddf32171f79dc56bc8f9ae0209e35f1e8a418793f3dd8b
|
data/lib/tamiyo.rb
CHANGED
@@ -23,6 +23,16 @@ opts = Slop.new help: true do
|
|
23
23
|
Tamiyo::ExportAllChain.create.pump
|
24
24
|
end
|
25
25
|
end
|
26
|
+
|
27
|
+
command 'add-set' do
|
28
|
+
run do |opts, args|
|
29
|
+
require 'tamiyo/sets'
|
30
|
+
abbr = args.shift.upcase
|
31
|
+
name = args.join(' ')
|
32
|
+
puts "Adding set #{abbr} => #{name}"
|
33
|
+
Tamiyo::Sets.add_custom_set abbr, name
|
34
|
+
end
|
35
|
+
end
|
26
36
|
end
|
27
37
|
|
28
38
|
opts.parse
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'nokogiri'
|
2
2
|
require 'tamiyo/process'
|
3
3
|
require 'tamiyo/data_store'
|
4
4
|
|
@@ -55,8 +55,7 @@ module Tamiyo
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def first_cost_of(card)
|
58
|
-
|
59
|
-
cost.is_a?(Array) ? cost.first : cost
|
58
|
+
[*card.cost].first
|
60
59
|
end
|
61
60
|
|
62
61
|
def row_of(card)
|
@@ -70,10 +69,10 @@ module Tamiyo
|
|
70
69
|
|
71
70
|
def adjusted_text_of(card)
|
72
71
|
text = card.text
|
73
|
-
if card.cost.
|
72
|
+
if card.cost.is_a? Array
|
74
73
|
first, second = card.cost
|
75
|
-
text = "Mana cost: #{first}\n"
|
76
|
-
text
|
74
|
+
text = "Mana cost: #{first}\n#{text}"
|
75
|
+
text.sub!(/---\n/) { |m| m << "Mana cost: #{second}\n" }
|
77
76
|
end
|
78
77
|
text
|
79
78
|
end
|
data/lib/tamiyo/data_store.rb
CHANGED
@@ -1,165 +1,37 @@
|
|
1
1
|
require 'fileutils'
|
2
|
+
require 'tamiyo/yaml/yaml_helper'
|
2
3
|
|
3
4
|
module Tamiyo
|
4
|
-
|
5
|
-
|
5
|
+
class DataStore
|
6
|
+
include YamlHelper
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@data_dir = ensure_tamiyo_data_dir
|
10
|
+
@custom_sets_path = path_for 'custom_sets.yaml'
|
11
|
+
end
|
12
|
+
|
13
|
+
def ensure_tamiyo_data_dir
|
6
14
|
data_dir = File.join Dir.home, '.tamiyo'
|
7
15
|
FileUtils.mkpath data_dir
|
8
|
-
|
16
|
+
data_dir
|
17
|
+
end
|
18
|
+
|
19
|
+
def path_for(file_name)
|
20
|
+
File.join @data_dir, file_name
|
21
|
+
end
|
22
|
+
|
23
|
+
def load_custom_sets
|
24
|
+
File.exists?(@custom_sets_path) ? begin
|
25
|
+
File.open(@custom_sets_path, 'r') do |f|
|
26
|
+
yaml_from f.read
|
27
|
+
end
|
28
|
+
end : {}
|
9
29
|
end
|
10
30
|
|
11
|
-
def
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
'LEB' => 'Limited Edition Beta',
|
16
|
-
'ARN' => 'Arabian Nights',
|
17
|
-
'2ED' => 'Unlimited Edition',
|
18
|
-
'ATQ' => 'Antiquities',
|
19
|
-
'3ED' => 'Revised Edition',
|
20
|
-
'LEG' => 'Legends',
|
21
|
-
'DRK' => 'The Dark',
|
22
|
-
'FEM' => 'Fallen Empires',
|
23
|
-
'4ED' => 'Fourth Edition',
|
24
|
-
'ICE' => 'Ice Age',
|
25
|
-
'CHR' => 'Chronicles',
|
26
|
-
'HML' => 'Homelands',
|
27
|
-
'ALL' => 'Alliances',
|
28
|
-
'MIR' => 'Mirage',
|
29
|
-
'VIS' => 'Visions',
|
30
|
-
'5ED' => 'Fifth Edition',
|
31
|
-
'WTH' => 'Weatherlight',
|
32
|
-
'POR' => 'Portal',
|
33
|
-
'VG' => 'Vanguard',
|
34
|
-
'TMP' => 'Tempest',
|
35
|
-
'STH' => 'Stronghold',
|
36
|
-
'EXO' => 'Exodus',
|
37
|
-
'P02' => 'Portal Second Age',
|
38
|
-
'UGL' => 'Unglued',
|
39
|
-
'USG' => 'Urza''s Saga',
|
40
|
-
'ULG' => 'Urza''s Legacy',
|
41
|
-
'6ED' => 'Classic Sixth Edition',
|
42
|
-
'UDS' => 'Urza''s Destiny',
|
43
|
-
'PTK' => 'Portal Three Kingdoms',
|
44
|
-
'S99' => 'Starter 1999',
|
45
|
-
'MMQ' => 'Mercadian Masques',
|
46
|
-
'BRB' => 'Battle Royale Box Set',
|
47
|
-
'NMS' => 'Nemesis',
|
48
|
-
'PCY' => 'Prophecy',
|
49
|
-
'S00' => 'Starter 2000',
|
50
|
-
'INV' => 'Invasion',
|
51
|
-
'BTD' => 'Beatdown Box Set',
|
52
|
-
'PLS' => 'Planeshift',
|
53
|
-
'7ED' => 'Seventh Edition',
|
54
|
-
'APC' => 'Apocalypse',
|
55
|
-
'ODY' => 'Odyssey',
|
56
|
-
'TOR' => 'Torment',
|
57
|
-
'JUD' => 'Judgment',
|
58
|
-
'ONS' => 'Onslaught',
|
59
|
-
'LGN' => 'Legions',
|
60
|
-
'SCG' => 'Scourge',
|
61
|
-
'8ED' => 'Eighth Edition',
|
62
|
-
'MRD' => 'Mirrodin',
|
63
|
-
'DST' => 'Darksteel',
|
64
|
-
'5DN' => 'Fifth Dawn',
|
65
|
-
'CHK' => 'Champions of Kamigawa',
|
66
|
-
'UNH' => 'Unhinged',
|
67
|
-
'BOK' => 'Betrayers of Kamigawa',
|
68
|
-
'SOK' => 'Saviors of Kamigawa',
|
69
|
-
'9ED' => 'Ninth Edition',
|
70
|
-
'RAV' => 'Ravnica: City of Guilds',
|
71
|
-
'GPT' => 'Guildpact',
|
72
|
-
'DIS' => 'Dissension',
|
73
|
-
'CSP' => 'Coldsnap',
|
74
|
-
'TSB' => 'Time Spiral "Timeshifted"',
|
75
|
-
'TSP' => 'Time Spiral',
|
76
|
-
'PLC' => 'Planar Chaos',
|
77
|
-
'FUT' => 'Future Sight',
|
78
|
-
'10E' => 'Tenth Edition',
|
79
|
-
'LRW' => 'Lorwyn',
|
80
|
-
'MED' => 'Masters Edition',
|
81
|
-
'EVG' => 'Duel Decks: Elves vs. Goblins',
|
82
|
-
'MOR' => 'Morningtide',
|
83
|
-
'SHM' => 'Shadowmoor',
|
84
|
-
'EVE' => 'Eventide',
|
85
|
-
'DRB' => 'From the Vault: Dragons',
|
86
|
-
'ME2' => 'Masters Edition II',
|
87
|
-
'ALA' => 'Shards of Alara',
|
88
|
-
'DD2' => 'Duel Decks: Jace vs. Chandra',
|
89
|
-
'CON' => 'Conflux',
|
90
|
-
'ARB' => 'Alara Reborn',
|
91
|
-
'DDC' => 'Duel Decks: Divine vs. Demonic',
|
92
|
-
'M10' => 'Magic 2010',
|
93
|
-
'V09' => 'From the Vault: Exiled',
|
94
|
-
'HOP' => 'Planechase',
|
95
|
-
'ME3' => 'Masters Edition III',
|
96
|
-
'ZEN' => 'Zendikar',
|
97
|
-
'DDD' => 'Duel Decks: Garruk vs. Liliana',
|
98
|
-
'PDS' => 'Premium Deck Series: Slivers',
|
99
|
-
'WWK' => 'Worldwake',
|
100
|
-
'DDE' => 'Duel Decks: Phyrexia vs. the Coalition',
|
101
|
-
'ROE' => 'Rise of the Eldrazi',
|
102
|
-
'ARC' => 'Archenemy',
|
103
|
-
'M11' => 'Magic 2011',
|
104
|
-
'V10' => 'From the Vault: Relics',
|
105
|
-
'DDF' => 'Duel Decks: Elspeth vs. Tezzeret',
|
106
|
-
'SOM' => 'Scars of Mirrodin',
|
107
|
-
'PFL' => 'Premium Deck Series: Fire and Lightning',
|
108
|
-
'ME4' => 'Masters Edition IV',
|
109
|
-
'MBS' => 'Mirrodin Besieged',
|
110
|
-
'DDG' => 'Duel Decks: Knights vs. Dragons',
|
111
|
-
'NPH' => 'New Phyrexia',
|
112
|
-
'CMD' => 'Magic: The Gathering-Commander',
|
113
|
-
'M12' => 'Magic 2012',
|
114
|
-
'DDH' => 'Duel Decks: Ajani vs. Nicol Bolas',
|
115
|
-
'V11' => 'From the Vault: Legends',
|
116
|
-
'ISD' => 'Innistrad',
|
117
|
-
'GRV' => 'Premium Deck Series: Graveborn',
|
118
|
-
'DKA' => 'Dark Ascension',
|
119
|
-
'DDI' => 'Duel Decks: Venser vs. Koth',
|
120
|
-
'AVR' => 'Avacyn Restored',
|
121
|
-
'PC2' => 'Planechase 2012 Edition',
|
122
|
-
'M13' => 'Magic 2013',
|
123
|
-
'V12' => 'From the Vault: Realms',
|
124
|
-
'DDJ' => 'Duel Decks: Izzet vs. Golgari',
|
125
|
-
'RTR' => 'Return to Ravnica',
|
126
|
-
'CMA' => 'Commander''s Arsenal',
|
127
|
-
'GTC' => 'Gatecrash',
|
128
|
-
'DDK' => 'Duel Decks: Sorin vs. Tibalt',
|
129
|
-
'DGM' => 'Dragon''s Maze',
|
130
|
-
'MMA' => 'Modern Masters',
|
131
|
-
'M14' => 'Magic 2014',
|
132
|
-
'V13' => 'From the Vault: Twenty',
|
133
|
-
'DDL' => 'Duel Decks: Heroes vs. Monsters',
|
134
|
-
'THS' => 'Theros',
|
135
|
-
'C13' => 'Commander 2013'},
|
136
|
-
'blocks' =>
|
137
|
-
{['ICE', 'Ice-Age'] => ['ICE', 'ALL', 'CSP'],
|
138
|
-
['MIR', 'Mirage'] => ['MIR', 'VIS', 'WTH'],
|
139
|
-
['TMP', 'Tempest', 'Rath'] => ['TMP', 'STH', 'EXO'],
|
140
|
-
['USG', 'Urza', 'Artifacts'] => ['USG', 'ULG', 'UDS'],
|
141
|
-
['MMQ', 'Masques', 'Masquerade'] => ['MMQ', 'NEM', 'PCY'],
|
142
|
-
['INV', 'Invasion'] => ['INV', 'PLS', 'APC'],
|
143
|
-
['ODY', 'Odyssey'] => ['ODY', 'TOR', 'JUD'],
|
144
|
-
['ONS', 'Onslaught'] => ['ONS', 'LGN', 'SCG'],
|
145
|
-
['MRD', 'Mirrodin'] => ['MRD', 'DST', '5DN'],
|
146
|
-
['CHK', 'Kamigawa'] => ['CHK', 'BOK', 'SOK'],
|
147
|
-
['RAV', 'Ravnica'] => ['RAV', 'GPT', 'DIS'],
|
148
|
-
['TSP', 'Time-Spiral'] => ['TSP', 'TSB', 'PLC', 'FUT'],
|
149
|
-
['LRW', 'Lorwyn'] => ['LRW', 'MOR'],
|
150
|
-
['SHM', 'Shadowmoor'] => ['SHM', 'EVE'],
|
151
|
-
['ALA', 'Alara'] => ['ALA', 'CON', 'ARB'],
|
152
|
-
['ZEN', 'Zendikar'] => ['ZEN', 'WWK', 'ROE'],
|
153
|
-
['SOM', 'Scars-of-Mirrodin'] => ['SOM', 'MBS', 'NPH'],
|
154
|
-
['ISD', 'Innistrad'] => ['ISD', 'DKA', 'AVR'],
|
155
|
-
['RTR', 'Return-to-Ravnica'] => ['RTR', 'GTC', 'DGM'],
|
156
|
-
['THS', 'Theros'] => ['THS']},
|
157
|
-
'formats' =>
|
158
|
-
{'Standard' => ['M14', 'RTR-block', 'THS-block'],
|
159
|
-
'Modern' => ['8ED', '9ED', '10E', 'M10', 'M11', 'M12', 'M13', 'MMA', 'CSP',
|
160
|
-
'MRD-block', 'CHK-block', 'RAV-block', 'TSP-block', 'LRW-block',
|
161
|
-
'SHM-block', 'ALA-block', 'ZEN-block', 'SOM-block', 'ISD-block', 'Standard']}
|
162
|
-
}
|
31
|
+
def persist_custom_sets(data)
|
32
|
+
File.open(@custom_sets_path, 'w') do |f|
|
33
|
+
f.write yaml_of data
|
34
|
+
end
|
163
35
|
end
|
164
36
|
end
|
165
37
|
end
|
@@ -0,0 +1,155 @@
|
|
1
|
+
module DefaultData
|
2
|
+
def self.sets
|
3
|
+
{'sets' => {
|
4
|
+
'PSG' => 'Promo set for Gatherer',
|
5
|
+
'LEA' => 'Limited Edition Alpha',
|
6
|
+
'LEB' => 'Limited Edition Beta',
|
7
|
+
'ARN' => 'Arabian Nights',
|
8
|
+
'2ED' => 'Unlimited Edition',
|
9
|
+
'ATQ' => 'Antiquities',
|
10
|
+
'3ED' => 'Revised Edition',
|
11
|
+
'LEG' => 'Legends',
|
12
|
+
'DRK' => 'The Dark',
|
13
|
+
'FEM' => 'Fallen Empires',
|
14
|
+
'4ED' => 'Fourth Edition',
|
15
|
+
'ICE' => 'Ice Age',
|
16
|
+
'CHR' => 'Chronicles',
|
17
|
+
'HML' => 'Homelands',
|
18
|
+
'ALL' => 'Alliances',
|
19
|
+
'MIR' => 'Mirage',
|
20
|
+
'VIS' => 'Visions',
|
21
|
+
'5ED' => 'Fifth Edition',
|
22
|
+
'WTH' => 'Weatherlight',
|
23
|
+
'POR' => 'Portal',
|
24
|
+
'VG' => 'Vanguard',
|
25
|
+
'TMP' => 'Tempest',
|
26
|
+
'STH' => 'Stronghold',
|
27
|
+
'EXO' => 'Exodus',
|
28
|
+
'P02' => 'Portal Second Age',
|
29
|
+
'UGL' => 'Unglued',
|
30
|
+
'USG' => 'Urza''s Saga',
|
31
|
+
'ULG' => 'Urza''s Legacy',
|
32
|
+
'6ED' => 'Classic Sixth Edition',
|
33
|
+
'UDS' => 'Urza''s Destiny',
|
34
|
+
'PTK' => 'Portal Three Kingdoms',
|
35
|
+
'S99' => 'Starter 1999',
|
36
|
+
'MMQ' => 'Mercadian Masques',
|
37
|
+
'BRB' => 'Battle Royale Box Set',
|
38
|
+
'NMS' => 'Nemesis',
|
39
|
+
'PCY' => 'Prophecy',
|
40
|
+
'S00' => 'Starter 2000',
|
41
|
+
'INV' => 'Invasion',
|
42
|
+
'BTD' => 'Beatdown Box Set',
|
43
|
+
'PLS' => 'Planeshift',
|
44
|
+
'7ED' => 'Seventh Edition',
|
45
|
+
'APC' => 'Apocalypse',
|
46
|
+
'ODY' => 'Odyssey',
|
47
|
+
'TOR' => 'Torment',
|
48
|
+
'JUD' => 'Judgment',
|
49
|
+
'ONS' => 'Onslaught',
|
50
|
+
'LGN' => 'Legions',
|
51
|
+
'SCG' => 'Scourge',
|
52
|
+
'8ED' => 'Eighth Edition',
|
53
|
+
'MRD' => 'Mirrodin',
|
54
|
+
'DST' => 'Darksteel',
|
55
|
+
'5DN' => 'Fifth Dawn',
|
56
|
+
'CHK' => 'Champions of Kamigawa',
|
57
|
+
'UNH' => 'Unhinged',
|
58
|
+
'BOK' => 'Betrayers of Kamigawa',
|
59
|
+
'SOK' => 'Saviors of Kamigawa',
|
60
|
+
'9ED' => 'Ninth Edition',
|
61
|
+
'RAV' => 'Ravnica: City of Guilds',
|
62
|
+
'GPT' => 'Guildpact',
|
63
|
+
'DIS' => 'Dissension',
|
64
|
+
'CSP' => 'Coldsnap',
|
65
|
+
'TSB' => 'Time Spiral "Timeshifted"',
|
66
|
+
'TSP' => 'Time Spiral',
|
67
|
+
'PLC' => 'Planar Chaos',
|
68
|
+
'FUT' => 'Future Sight',
|
69
|
+
'10E' => 'Tenth Edition',
|
70
|
+
'LRW' => 'Lorwyn',
|
71
|
+
'MED' => 'Masters Edition',
|
72
|
+
'EVG' => 'Duel Decks: Elves vs. Goblins',
|
73
|
+
'MOR' => 'Morningtide',
|
74
|
+
'SHM' => 'Shadowmoor',
|
75
|
+
'EVE' => 'Eventide',
|
76
|
+
'DRB' => 'From the Vault: Dragons',
|
77
|
+
'ME2' => 'Masters Edition II',
|
78
|
+
'ALA' => 'Shards of Alara',
|
79
|
+
'DD2' => 'Duel Decks: Jace vs. Chandra',
|
80
|
+
'CON' => 'Conflux',
|
81
|
+
'ARB' => 'Alara Reborn',
|
82
|
+
'DDC' => 'Duel Decks: Divine vs. Demonic',
|
83
|
+
'M10' => 'Magic 2010',
|
84
|
+
'V09' => 'From the Vault: Exiled',
|
85
|
+
'HOP' => 'Planechase',
|
86
|
+
'ME3' => 'Masters Edition III',
|
87
|
+
'ZEN' => 'Zendikar',
|
88
|
+
'DDD' => 'Duel Decks: Garruk vs. Liliana',
|
89
|
+
'PDS' => 'Premium Deck Series: Slivers',
|
90
|
+
'WWK' => 'Worldwake',
|
91
|
+
'DDE' => 'Duel Decks: Phyrexia vs. the Coalition',
|
92
|
+
'ROE' => 'Rise of the Eldrazi',
|
93
|
+
'ARC' => 'Archenemy',
|
94
|
+
'M11' => 'Magic 2011',
|
95
|
+
'V10' => 'From the Vault: Relics',
|
96
|
+
'DDF' => 'Duel Decks: Elspeth vs. Tezzeret',
|
97
|
+
'SOM' => 'Scars of Mirrodin',
|
98
|
+
'PFL' => 'Premium Deck Series: Fire and Lightning',
|
99
|
+
'ME4' => 'Masters Edition IV',
|
100
|
+
'MBS' => 'Mirrodin Besieged',
|
101
|
+
'DDG' => 'Duel Decks: Knights vs. Dragons',
|
102
|
+
'NPH' => 'New Phyrexia',
|
103
|
+
'CMD' => 'Magic: The Gathering-Commander',
|
104
|
+
'M12' => 'Magic 2012',
|
105
|
+
'DDH' => 'Duel Decks: Ajani vs. Nicol Bolas',
|
106
|
+
'V11' => 'From the Vault: Legends',
|
107
|
+
'ISD' => 'Innistrad',
|
108
|
+
'GRV' => 'Premium Deck Series: Graveborn',
|
109
|
+
'DKA' => 'Dark Ascension',
|
110
|
+
'DDI' => 'Duel Decks: Venser vs. Koth',
|
111
|
+
'AVR' => 'Avacyn Restored',
|
112
|
+
'PC2' => 'Planechase 2012 Edition',
|
113
|
+
'M13' => 'Magic 2013',
|
114
|
+
'V12' => 'From the Vault: Realms',
|
115
|
+
'DDJ' => 'Duel Decks: Izzet vs. Golgari',
|
116
|
+
'RTR' => 'Return to Ravnica',
|
117
|
+
'CMA' => 'Commander''s Arsenal',
|
118
|
+
'GTC' => 'Gatecrash',
|
119
|
+
'DDK' => 'Duel Decks: Sorin vs. Tibalt',
|
120
|
+
'DGM' => 'Dragon''s Maze',
|
121
|
+
'MMA' => 'Modern Masters',
|
122
|
+
'M14' => 'Magic 2014',
|
123
|
+
'V13' => 'From the Vault: Twenty',
|
124
|
+
'DDL' => 'Duel Decks: Heroes vs. Monsters',
|
125
|
+
'THS' => 'Theros',
|
126
|
+
'C13' => 'Commander 2013'},
|
127
|
+
'blocks' => {
|
128
|
+
['ICE', 'Ice-Age'] => ['ICE', 'ALL', 'CSP'],
|
129
|
+
['MIR', 'Mirage'] => ['MIR', 'VIS', 'WTH'],
|
130
|
+
['TMP', 'Tempest', 'Rath'] => ['TMP', 'STH', 'EXO'],
|
131
|
+
['USG', 'Urza', 'Artifacts'] => ['USG', 'ULG', 'UDS'],
|
132
|
+
['MMQ', 'Masques', 'Masquerade'] => ['MMQ', 'NEM', 'PCY'],
|
133
|
+
['INV', 'Invasion'] => ['INV', 'PLS', 'APC'],
|
134
|
+
['ODY', 'Odyssey'] => ['ODY', 'TOR', 'JUD'],
|
135
|
+
['ONS', 'Onslaught'] => ['ONS', 'LGN', 'SCG'],
|
136
|
+
['MRD', 'Mirrodin'] => ['MRD', 'DST', '5DN'],
|
137
|
+
['CHK', 'Kamigawa'] => ['CHK', 'BOK', 'SOK'],
|
138
|
+
['RAV', 'Ravnica'] => ['RAV', 'GPT', 'DIS'],
|
139
|
+
['TSP', 'Time-Spiral'] => ['TSP', 'TSB', 'PLC', 'FUT'],
|
140
|
+
['LRW', 'Lorwyn'] => ['LRW', 'MOR'],
|
141
|
+
['SHM', 'Shadowmoor'] => ['SHM', 'EVE'],
|
142
|
+
['ALA', 'Alara'] => ['ALA', 'CON', 'ARB'],
|
143
|
+
['ZEN', 'Zendikar'] => ['ZEN', 'WWK', 'ROE'],
|
144
|
+
['SOM', 'Scars-of-Mirrodin'] => ['SOM', 'MBS', 'NPH'],
|
145
|
+
['ISD', 'Innistrad'] => ['ISD', 'DKA', 'AVR'],
|
146
|
+
['RTR', 'Return-to-Ravnica'] => ['RTR', 'GTC', 'DGM'],
|
147
|
+
['THS', 'Theros'] => ['THS']},
|
148
|
+
'formats' => {
|
149
|
+
'Standard' => ['M14', 'RTR-block', 'THS-block'],
|
150
|
+
'Modern' => ['8ED', '9ED', '10E', 'M10', 'M11', 'M12', 'M13', 'MMA', 'CSP',
|
151
|
+
'MRD-block', 'CHK-block', 'RAV-block', 'TSP-block', 'LRW-block', 'SHM-block',
|
152
|
+
'ALA-block', 'ZEN-block', 'SOM-block', 'ISD-block', 'Standard']}
|
153
|
+
}
|
154
|
+
end
|
155
|
+
end
|
data/lib/tamiyo/sets.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'tamiyo/data_store'
|
2
|
+
require 'tamiyo/yaml/yaml_helper'
|
3
|
+
|
4
|
+
module Tamiyo
|
5
|
+
class Sets
|
6
|
+
def self.add_custom_set abbr, name
|
7
|
+
@store ||= DataStore.new
|
8
|
+
data = @store.load_custom_sets
|
9
|
+
data['sets'] ||= {}
|
10
|
+
data['sets'].store abbr, name
|
11
|
+
@store.persist_custom_sets data
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/tamiyo/version.rb
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
|
3
3
|
module Tamiyo
|
4
|
+
module YamlHelper
|
5
|
+
def yaml_from(data)
|
6
|
+
YAML.load data
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
module YamlHelper
|
11
|
+
def yaml_of(obj)
|
12
|
+
YAML.dump obj
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
4
16
|
module YamlHelper
|
5
17
|
def setup_yaml_emitter_for(file)
|
6
18
|
@emit = YAML::Emitter.new file
|
@@ -67,7 +79,7 @@ module Tamiyo
|
|
67
79
|
@emit.scalar value, nil, nil, false, true, YAML::Nodes::Scalar::LITERAL
|
68
80
|
end
|
69
81
|
end
|
70
|
-
|
82
|
+
|
71
83
|
module YamlHelper
|
72
84
|
def yaml_event_stream_for(file)
|
73
85
|
queue = Queue.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tamiyo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Norling
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- lib/tamiyo/card.rb
|
58
58
|
- lib/tamiyo/cockatrice_db_sink.rb
|
59
59
|
- lib/tamiyo/data_store.rb
|
60
|
+
- lib/tamiyo/default_data.rb
|
60
61
|
- lib/tamiyo/dummy_scrape.rb
|
61
62
|
- lib/tamiyo/dummy_scrape_chain.rb
|
62
63
|
- lib/tamiyo/export_all_chain.rb
|
@@ -64,6 +65,7 @@ files:
|
|
64
65
|
- lib/tamiyo/gatherer_scrape_chain.rb
|
65
66
|
- lib/tamiyo/process.rb
|
66
67
|
- lib/tamiyo/scrape_parser.rb
|
68
|
+
- lib/tamiyo/sets.rb
|
67
69
|
- lib/tamiyo/value.rb
|
68
70
|
- lib/tamiyo/version.rb
|
69
71
|
- lib/tamiyo/yaml/yaml_helper.rb
|
@@ -90,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
92
|
version: '0'
|
91
93
|
requirements: []
|
92
94
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.2.0
|
94
96
|
signing_key:
|
95
97
|
specification_version: 4
|
96
98
|
summary: Import/manage Cockatrice's card database
|