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 CHANGED
@@ -1 +1 @@
1
- 0.0.2
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] - 50
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] * 100 / max)
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{pyradise}
5
- s.version = "0.0.2"
5
+ s.version = "0.0.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Marcos Piccinini"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nofxx-pyradise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos Piccinini