rails_currency 1.0 → 1.1

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.
File without changes
data/Manifest.txt CHANGED
@@ -1,9 +1,9 @@
1
+ AUTHOR
1
2
  History.txt
2
3
  Manifest.txt
3
4
  README.txt
4
5
  Rakefile
5
- lib/rcurrency.rb
6
- lib/rcurrency/constants.rb
7
- lib/rcurrency/convertor.rb
8
- lib/rcurrency/updater.rb
6
+ lib/rails_currency.rb
7
+ lib/rails_currency/constants.rb
8
+ lib/rails_currency/convertor.rb
9
9
  test/ts_convertor.rb
data/README.txt CHANGED
@@ -3,13 +3,13 @@ A ruby lib to real time convert among different currencies.
3
3
 
4
4
  == Install
5
5
 
6
- gem install -l rcurrency-1.0.gem
6
+ gem install -l rails_currency-1.0.gem
7
7
 
8
8
  == Usage
9
9
 
10
10
  {{{
11
- require "rcurrency"
12
- result = RCurrency::Convertor.convert(100, "CNY", "USD")
11
+ require "rails_currency"
12
+ result = RailsCurrency::Convertor.convert(100, "CNY", "USD")
13
13
  }}}
14
14
 
15
15
  == Available Currency List
@@ -97,3 +97,28 @@ USD 'United States Dollars'
97
97
  VEF 'Venezuela Bolivares Fuertes'
98
98
  VND 'Vietnam Dong'
99
99
  }}}
100
+
101
+ == LICENSE
102
+
103
+ (The MIT License)
104
+
105
+ Copyright (c) 2008 Naveen Joshi
106
+
107
+ Permission is hereby granted, free of charge, to any person obtaining
108
+ a copy of this software and associated documentation files (the
109
+ 'Software'), to deal in the Software without restriction, including
110
+ without limitation the rights to use, copy, modify, merge, publish,
111
+ distribute, sublicense, and/or sell copies of the Software, and to
112
+ permit persons to whom the Software is furnished to do so, subject to
113
+ the following conditions:
114
+
115
+ The above copyright notice and this permission notice shall be
116
+ included in all copies or substantial portions of the Software.
117
+
118
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
119
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
120
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
121
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
122
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
123
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
124
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'hoe'
3
3
 
4
- Hoe.new('rails_currency', '1.0') do |p|
4
+ Hoe.new('rails_currency', '1.1') do |p|
5
5
  p.author = 'Naveen Joshi'
6
6
  p.email = 'joshinav@gmail.com'
7
7
  p.url = ''
@@ -1,4 +1,4 @@
1
- module RCurrency
1
+ module RailsCurrency
2
2
  module Constants
3
3
  CurrencyUrl = "http://www.xe.com/ucc/convert.cgi"
4
4
  Params = {"User-Agent"=>"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9", "Connection"=>"Keep-Alive", "Keep-Alive"=>"30"}
@@ -9,17 +9,17 @@ rescue LoadError
9
9
  require 'hpricot'
10
10
  end
11
11
 
12
- module RCurrency
13
- class RCurrencyError < StandardError
12
+ module RailsCurrency
13
+ class RailsCurrencyError < StandardError
14
14
  end
15
15
 
16
- class InvalidAmountError < RCurrencyError
16
+ class InvalidAmountError < RailsCurrencyError
17
17
  end
18
18
 
19
- class UnknownCurrencyError < RCurrencyError
19
+ class UnknownCurrencyError < RailsCurrencyError
20
20
  end
21
21
 
22
- class ServerTimeoutError < RCurrencyError
22
+ class ServerTimeoutError < RailsCurrencyError
23
23
  end
24
24
 
25
25
  class Convertor
@@ -0,0 +1,6 @@
1
+ require File.dirname(__FILE__) + "/rails_currency/convertor"
2
+ require File.dirname(__FILE__) + "/rails_currency/constants"
3
+
4
+ RailsCurrency::Convertor.class_eval do
5
+ extend RailsCurrency::Constants
6
+ end
data/test/ts_convertor.rb CHANGED
@@ -1,20 +1,20 @@
1
1
  $:.unshift File.expand_path(File.dirname(__FILE__) + "/../lib")
2
2
 
3
3
  require 'test/unit'
4
- require 'rcurrency'
4
+ require 'rails_currency'
5
5
 
6
6
  class RCurrencyTest < Test::Unit::TestCase
7
7
  def test_convert
8
- assert_kind_of Numeric, RCurrency::Convertor.convert(100, "CNY", "USD")
8
+ assert_kind_of Numeric, RailsCurrency::Convertor.convert(100, "CNY", "USD")
9
9
  end
10
10
 
11
11
  def test_invalid_convert
12
- assert_raise RCurrency::InvalidAmountError do
13
- RCurrency::Convertor.convert("100", "CNY", "USD")
12
+ assert_raise RailsCurrency::InvalidAmountError do
13
+ RailsCurrency::Convertor.convert("100", "CNY", "USD")
14
14
  end
15
15
 
16
- assert_raise RCurrency::UnknownCurrencyError do
17
- RCurrency::Convertor.convert(100, "CNY", "ABC")
16
+ assert_raise RailsCurrency::UnknownCurrencyError do
17
+ RailsCurrency::Convertor.convert(100, "CNY", "ABC")
18
18
  end
19
19
  end
20
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_currency
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.0"
4
+ version: "1.1"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naveen Joshi
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-12 00:00:00 +08:00
12
+ date: 2008-02-13 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -32,14 +32,14 @@ extra_rdoc_files:
32
32
  - Manifest.txt
33
33
  - README.txt
34
34
  files:
35
+ - AUTHOR
35
36
  - History.txt
36
37
  - Manifest.txt
37
38
  - README.txt
38
39
  - Rakefile
39
- - lib/rcurrency.rb
40
- - lib/rcurrency/constants.rb
41
- - lib/rcurrency/convertor.rb
42
- - lib/rcurrency/updater.rb
40
+ - lib/rails_currency.rb
41
+ - lib/rails_currency/constants.rb
42
+ - lib/rails_currency/convertor.rb
43
43
  - test/ts_convertor.rb
44
44
  has_rdoc: true
45
45
  homepage:
data/lib/rcurrency.rb DELETED
@@ -1,7 +0,0 @@
1
- require File.dirname(__FILE__) + "/rcurrency/convertor"
2
- require File.dirname(__FILE__) + "/rcurrency/constants"
3
- require File.dirname(__FILE__) + "/rcurrency/updater"
4
-
5
- RCurrency::Convertor.class_eval do
6
- extend RCurrency::Constants
7
- end