pyradise 0.3.1 → 0.3.2

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/pyradise.rb +23 -19
  3. data/pyradise.gemspec +4 -4
  4. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
data/lib/pyradise.rb CHANGED
@@ -4,31 +4,35 @@ require 'sequel'
4
4
  module Pyradise
5
5
 
6
6
  HOME = ENV['HOME'] + "/.pyradise"
7
- #TODO: def init
8
7
  DB = Sequel.connect("sqlite://#{HOME}/py.sqlite3")
8
+ Defaults = {:rate => 1, :tax => 1.3, :order => :price, :lang => :en_us}
9
+ Options = Defaults.merge(YAML.load(File.new(HOME + "/conf.yml")))
10
+
9
11
  def locale
10
12
  `locale | grep LANG`.scan(/LANG=(.*)\./)[0][0].downcase rescue "en_us"
11
13
  end
12
14
 
13
- unless File.exists? HOME
14
- FileUtils.mkdir_p HOME
15
- conf = open(HOME + "/conf.yml", "wb")
16
- conf.write(":rate: 1.8 # dollar conversion rate\n")
17
- conf.write(":tax: 1.3 # transport tax\n")
18
- conf.write(":lang: #{locale} # program language\n")
19
- conf.close
20
- end
15
+ def self.start
16
+ unless File.exists? HOME
17
+ FileUtils.mkdir_p HOME
18
+ conf = open(HOME + "/conf.yml", "wb")
19
+ conf.write(":rate: 1.8 # dollar conversion rate\n")
20
+ conf.write(":tax: 1.3 # transport tax\n")
21
+ conf.write(":lang: #{locale} # program language\n")
22
+ conf.close
23
+ end
21
24
 
22
- # require 'pyradise/stat'
23
- unless DB.table_exists? :products
24
- require 'pyradise/migrate'
25
- CreatePyradise.apply DB, :up
26
- end
27
- Defaults = {:rate => 1, :tax => 1.3, :order => :price, :lang => :en_us}
28
- Options = Defaults.merge(YAML.load(File.new(HOME + "/conf.yml")))
25
+ # require 'pyradise/stat'
26
+ unless DB.table_exists? :products
27
+ require 'pyradise/migrate'
28
+ CreatePyradise.apply DB, :up
29
+ end
29
30
 
30
- require 'pyradise/product'
31
- require 'pyradise/i18n'
32
- require 'pyradise/cli'
31
+ require 'pyradise/product'
32
+ require 'pyradise/i18n'
33
+ require 'pyradise/cli'
34
+ end
33
35
 
34
36
  end
37
+
38
+ Pyradise.start
data/pyradise.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pyradise}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Marcos Piccinini"]
12
- s.date = %q{2009-12-28}
12
+ s.date = %q{2009-12-30}
13
13
  s.default_executable = %q{pyradise}
14
14
  s.email = %q{x@nofxx.com}
15
15
  s.executables = ["pyradise"]
@@ -43,9 +43,9 @@ Gem::Specification.new do |s|
43
43
  s.rubygems_version = %q{1.3.5}
44
44
  s.summary = %q{Paraguay gem!}
45
45
  s.test_files = [
46
- "spec/spec_helper.rb",
46
+ "spec/pyradise/product_spec.rb",
47
47
  "spec/pyradise_spec.rb",
48
- "spec/pyradise/product_spec.rb"
48
+ "spec/spec_helper.rb"
49
49
  ]
50
50
 
51
51
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pyradise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos Piccinini
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-28 00:00:00 -02:00
12
+ date: 2009-12-30 00:00:00 -02:00
13
13
  default_executable: pyradise
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -79,6 +79,6 @@ signing_key:
79
79
  specification_version: 3
80
80
  summary: Paraguay gem!
81
81
  test_files:
82
- - spec/spec_helper.rb
83
- - spec/pyradise_spec.rb
84
82
  - spec/pyradise/product_spec.rb
83
+ - spec/pyradise_spec.rb
84
+ - spec/spec_helper.rb