Module: Tamiyo::DataStore

Included in:
CockatriceDbSink, Yaml::YamlSink, Yaml::YamlSource
Defined in:
lib/tamiyo/data_store.rb

Instance Method Summary collapse

Instance Method Details

#default_set_dataObject



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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/tamiyo/data_store.rb', line 11

def default_set_data
  {'sets' =>
    {'PSG' => 'Promo set for Gatherer',
     'LEA' => 'Limited Edition Alpha',
     'LEB' => 'Limited Edition Beta',
     'ARN' => 'Arabian Nights',
     '2ED' => 'Unlimited Edition',
     'ATQ' => 'Antiquities',
     '3ED' => 'Revised Edition',
     'LEG' => 'Legends',
     'DRK' => 'The Dark',
     'FEM' => 'Fallen Empires',
     '4ED' => 'Fourth Edition',
     'ICE' => 'Ice Age',
     'CHR' => 'Chronicles',
     'HML' => 'Homelands',
     'ALL' => 'Alliances',
     'MIR' => 'Mirage',
     'VIS' => 'Visions',
     '5ED' => 'Fifth Edition',
     'WTH' => 'Weatherlight',
     'POR' => 'Portal',
     'VG' => 'Vanguard',
     'TMP' => 'Tempest',
     'STH' => 'Stronghold',
     'EXO' => 'Exodus',
     'P02' => 'Portal Second Age',
     'UGL' => 'Unglued',
     'USG' => 'Urza''s Saga',
     'ULG' => 'Urza''s Legacy',
     '6ED' => 'Classic Sixth Edition',
     'UDS' => 'Urza''s Destiny',
     'PTK' => 'Portal Three Kingdoms',
     'S99' => 'Starter 1999',
     'MMQ' => 'Mercadian Masques',
     'BRB' => 'Battle Royale Box Set',
     'NMS' => 'Nemesis',
     'PCY' => 'Prophecy',
     'S00' => 'Starter 2000',
     'INV' => 'Invasion',
     'BTD' => 'Beatdown Box Set',
     'PLS' => 'Planeshift',
     '7ED' => 'Seventh Edition',
     'APC' => 'Apocalypse',
     'ODY' => 'Odyssey',
     'TOR' => 'Torment',
     'JUD' => 'Judgment',
     'ONS' => 'Onslaught',
     'LGN' => 'Legions',
     'SCG' => 'Scourge',
     '8ED' => 'Eighth Edition',
     'MRD' => 'Mirrodin',
     'DST' => 'Darksteel',
     '5DN' => 'Fifth Dawn',
     'CHK' => 'Champions of Kamigawa',
     'UNH' => 'Unhinged',
     'BOK' => 'Betrayers of Kamigawa',
     'SOK' => 'Saviors of Kamigawa',
     '9ED' => 'Ninth Edition',
     'RAV' => 'Ravnica: City of Guilds',
     'GPT' => 'Guildpact',
     'DIS' => 'Dissension',
     'CSP' => 'Coldsnap',
     'TSB' => 'Time Spiral "Timeshifted"',
     'TSP' => 'Time Spiral',
     'PLC' => 'Planar Chaos',
     'FUT' => 'Future Sight',
     '10E' => 'Tenth Edition',
     'LRW' => 'Lorwyn',
     'MED' => 'Masters Edition',
     'EVG' => 'Duel Decks: Elves vs. Goblins',
     'MOR' => 'Morningtide',
     'SHM' => 'Shadowmoor',
     'EVE' => 'Eventide',
     'DRB' => 'From the Vault: Dragons',
     'ME2' => 'Masters Edition II',
     'ALA' => 'Shards of Alara',
     'DD2' => 'Duel Decks: Jace vs. Chandra',
     'CON' => 'Conflux',
     'ARB' => 'Alara Reborn',
     'DDC' => 'Duel Decks: Divine vs. Demonic',
     'M10' => 'Magic 2010',
     'V09' => 'From the Vault: Exiled',
     'HOP' => 'Planechase',
     'ME3' => 'Masters Edition III',
     'ZEN' => 'Zendikar',
     'DDD' => 'Duel Decks: Garruk vs. Liliana',
     'PDS' => 'Premium Deck Series: Slivers',
     'WWK' => 'Worldwake',
     'DDE' => 'Duel Decks: Phyrexia vs. the Coalition',
     'ROE' => 'Rise of the Eldrazi',
     'ARC' => 'Archenemy',
     'M11' => 'Magic 2011',
     'V10' => 'From the Vault: Relics',
     'DDF' => 'Duel Decks: Elspeth vs. Tezzeret',
     'SOM' => 'Scars of Mirrodin',
     'PFL' => 'Premium Deck Series: Fire and Lightning',
     'ME4' => 'Masters Edition IV',
     'MBS' => 'Mirrodin Besieged',
     'DDG' => 'Duel Decks: Knights vs. Dragons',
     'NPH' => 'New Phyrexia',
     'CMD' => 'Magic: The Gathering-Commander',
     'M12' => 'Magic 2012',
     'DDH' => 'Duel Decks: Ajani vs. Nicol Bolas',
     'V11' => 'From the Vault: Legends',
     'ISD' => 'Innistrad',
     'GRV' => 'Premium Deck Series: Graveborn',
     'DKA' => 'Dark Ascension',
     'DDI' => 'Duel Decks: Venser vs. Koth',
     'AVR' => 'Avacyn Restored',
     'PC2' => 'Planechase 2012 Edition',
     'M13' => 'Magic 2013',
     'V12' => 'From the Vault: Realms',
     'DDJ' => 'Duel Decks: Izzet vs. Golgari',
     'RTR' => 'Return to Ravnica',
     'CMA' => 'Commander''s Arsenal',
     'GTC' => 'Gatecrash',
     'DDK' => 'Duel Decks: Sorin vs. Tibalt',
     'DGM' => 'Dragon''s Maze',
     'MMA' => 'Modern Masters',
     'M14' => 'Magic 2014',
     'V13' => 'From the Vault: Twenty',
     'DDL' => 'Duel Decks: Heroes vs. Monsters',
     'THS' => 'Theros',
     'C13' => 'Commander 2013'},
   'blocks' =>
     {['ICE', 'Ice-Age'] => ['ICE', 'ALL', 'CSP'],
      ['MIR', 'Mirage'] => ['MIR', 'VIS', 'WTH'],
      ['TMP', 'Tempest', 'Rath'] => ['TMP', 'STH', 'EXO'],
      ['USG', 'Urza', 'Artifacts'] => ['USG', 'ULG', 'UDS'],
      ['MMQ', 'Masques', 'Masquerade'] => ['MMQ', 'NEM', 'PCY'],
      ['INV', 'Invasion'] => ['INV', 'PLS', 'APC'],
      ['ODY', 'Odyssey'] => ['ODY', 'TOR', 'JUD'],
      ['ONS', 'Onslaught'] => ['ONS', 'LGN', 'SCG'],
      ['MRD', 'Mirrodin'] => ['MRD', 'DST', '5DN'],
      ['CHK', 'Kamigawa'] => ['CHK', 'BOK', 'SOK'],
      ['RAV', 'Ravnica'] => ['RAV', 'GPT', 'DIS'],
      ['TSP', 'Time-Spiral'] => ['TSP', 'TSB', 'PLC', 'FUT'],
      ['LRW', 'Lorwyn'] => ['LRW', 'MOR'],
      ['SHM', 'Shadowmoor'] => ['SHM', 'EVE'],
      ['ALA', 'Alara'] => ['ALA', 'CON', 'ARB'],
      ['ZEN', 'Zendikar'] => ['ZEN', 'WWK', 'ROE'],
      ['SOM', 'Scars-of-Mirrodin'] => ['SOM', 'MBS', 'NPH'],
      ['ISD', 'Innistrad'] => ['ISD', 'DKA', 'AVR'],
      ['RTR', 'Return-to-Ravnica'] => ['RTR', 'GTC', 'DGM'],
      ['THS', 'Theros'] => ['THS']},
   'formats' =>
     {'Standard' => ['M14', 'RTR-block', 'THS-block'],
      'Modern' => ['8ED', '9ED', '10E', 'M10', 'M11', 'M12', 'M13', 'MMA', 'CSP',
        'MRD-block', 'CHK-block', 'RAV-block', 'TSP-block', 'LRW-block',
        'SHM-block', 'ALA-block', 'ZEN-block', 'SOM-block', 'ISD-block', 'Standard']}
  }
end

#provide_path_for(file_name) ⇒ Object



5
6
7
8
9
# File 'lib/tamiyo/data_store.rb', line 5

def provide_path_for(file_name)
  data_dir = File.join Dir.home, '.tamiyo'
  FileUtils.mkpath data_dir
  File.join data_dir, file_name
end