nofxx-pyradise 0.0.2 → 0.0.3
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.
- data/VERSION +1 -1
- data/lib/pyradise.rb +4 -4
- data/lib/stores.yml +12 -1
- data/pyradise.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/lib/pyradise.rb
CHANGED
@@ -64,7 +64,7 @@ module Pyradise
|
|
64
64
|
txt.each_line do |l|
|
65
65
|
sid, name, price = l.split(del)
|
66
66
|
next unless price
|
67
|
-
products << { :sid => sid.strip, :name => name.strip, :price => price.to_i }
|
67
|
+
products << { :sid => sid.strip, :name => name.strip.gsub(/\.{2,}/, ""), :price => price.to_i }
|
68
68
|
end
|
69
69
|
products
|
70
70
|
end
|
@@ -100,11 +100,11 @@ module Pyradise
|
|
100
100
|
elsif !prod = Product.first(:sid => sid.to_i)
|
101
101
|
puts "Product not found."
|
102
102
|
else
|
103
|
-
w = terminal_size[0] -
|
103
|
+
w = terminal_size[0] - 20
|
104
104
|
prices = prod.prices
|
105
|
-
max = prices.values.max
|
105
|
+
max = prices.values.max.to_f
|
106
106
|
prices.keys.sort.each do |k|
|
107
|
-
rel = "=" * (prices[k] *
|
107
|
+
rel = "=" * (prices[k] / max * w)
|
108
108
|
puts "#{Time.at(k).strftime('%M/%d')} #{rel}| #{prices[k]}"
|
109
109
|
end
|
110
110
|
end
|
data/lib/stores.yml
CHANGED
@@ -6,4 +6,15 @@
|
|
6
6
|
:nave:
|
7
7
|
:url: http://www.navenet.com
|
8
8
|
:txt: http://www.navenet.com/gerartxt.aspx
|
9
|
-
:delimiter: !ruby/regexp /\s{3,}/
|
9
|
+
:delimiter: !ruby/regexp /\s{3,}/
|
10
|
+
:nova:
|
11
|
+
:url: http://www.novadvance.com.br
|
12
|
+
:txt: http://www.novadvance.com.br/database/lista/lista.txt
|
13
|
+
:delimiter: !ruby/regexp /\s{3,}/
|
14
|
+
:albor:
|
15
|
+
:url: http://www.alboradainfo.com
|
16
|
+
:txt: http://www.alboradainfo.com/lista/lista_alborada.txt
|
17
|
+
:delimiter: !ruby/regexp /\s{3,}/
|
18
|
+
|
19
|
+
# TODO
|
20
|
+
# http://www.icompy.com/upload/precios/200907251505270.lista.txt
|
data/pyradise.gemspec
CHANGED