magic_tcg_finder 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/magic_tcg_finder/command_line_interface.rb +2 -23
- data/lib/magic_tcg_finder/scraper.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c36da613c5c213603aee5581d3d5571538dc377
|
4
|
+
data.tar.gz: a5ae5d40fb08989e4c5c4998099bc73ca44de5aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41fdaad9ba5e0f0064461cb07b9a18fc24ab8378da685689f9b5e2380fbb6b6b7cc02d27532ea2bd229b4bae11869472ee319f7e9e67016faf85008c262b9e0e
|
7
|
+
data.tar.gz: b063fba2b8e93387fbc081bc0e9eebce3634a6afeacfb46a02338b858dd2059b9e2712533aab5567f43120e82ef19868189d5d61317a5824530ce174b553d045
|
@@ -72,39 +72,18 @@ class CommandLine
|
|
72
72
|
cost = cost.gsub(/\{\d\}/) { |match| match.colorize(:light_black) }
|
73
73
|
end
|
74
74
|
|
75
|
-
def colorize_identity(card)
|
76
|
-
color = card.color
|
77
|
-
|
78
|
-
case color
|
79
|
-
when "White"
|
80
|
-
card.color.colorize(:light_yellow)
|
81
|
-
when "Blue"
|
82
|
-
card.color.colorize(:light_cyan)
|
83
|
-
when "Black"
|
84
|
-
card.color.colorize(:magenta)
|
85
|
-
when "Red"
|
86
|
-
card.color.colorize(:red)
|
87
|
-
when "Green"
|
88
|
-
card.color.colorize(:green)
|
89
|
-
when "Multicolor"
|
90
|
-
card.color.colorize(:yellow)
|
91
|
-
else
|
92
|
-
card.color.colorize(:light_black)
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
75
|
def load_card(input)
|
97
76
|
chosen_card = Card.all[input - 1]
|
98
77
|
load_attributes(chosen_card) if chosen_card.rules_text.nil?
|
99
78
|
puts "#{chosen_card.name} - #{colorize_cost(chosen_card.cost)}"
|
100
79
|
puts ""
|
101
|
-
puts "Color Identity: #{
|
80
|
+
puts "Color Identity: #{chosen_card.color}"
|
102
81
|
puts "Type: #{chosen_card.card_type}"
|
103
82
|
puts "Rarity: #{chosen_card.rarity}"
|
104
83
|
puts ""
|
105
84
|
puts "#{colorize_cost(chosen_card.rules_text)}"
|
106
85
|
puts "#{chosen_card.flavor_text}"
|
107
|
-
puts "#{chosen_card.combat_stats}"
|
86
|
+
puts "#{chosen_card.combat_stats}"
|
108
87
|
puts ""
|
109
88
|
puts "Appears in the following set(s): #{chosen_card.sets.join(', ')}"
|
110
89
|
puts ""
|
@@ -49,9 +49,9 @@ class Scraper
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def self.color_finder(cost)
|
52
|
-
colors = {'{W}' =>'White','{U}' => 'Blue','{B}' => 'Black','{R}' => 'Red','{G}' => 'Green'}
|
52
|
+
colors = {'{W}' =>'White'.colorize(:light_yellow),'{U}' => 'Blue'.colorize(:light_cyan),'{B}' => 'Black'.colorize(:magenta),'{R}' => 'Red'.colorize(:red),'{G}' => 'Green'.colorize(:green)}
|
53
53
|
matches = 0
|
54
|
-
color_identity = "Colorless"
|
54
|
+
color_identity = "Colorless".colorize(:light_black)
|
55
55
|
#Not all cards have a casting cost
|
56
56
|
return color_identity if cost.nil?
|
57
57
|
|
@@ -64,7 +64,7 @@ class Scraper
|
|
64
64
|
|
65
65
|
|
66
66
|
if matches > 1
|
67
|
-
"Multicolor"
|
67
|
+
"Multicolor".colorize(:yellow)
|
68
68
|
else
|
69
69
|
color_identity
|
70
70
|
end
|