currencies 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,7 +1,17 @@
1
- *.sw?
2
- .DS_Store
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
3
9
  coverage
4
- rdoc
10
+ doc/
11
+ lib/bundler/man
5
12
  pkg
6
- .rake_tasks~
7
- .bundle/
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm ruby@currencies
1
+ rvm use ruby-1.9.3@currencies --create
data/Gemfile CHANGED
@@ -1,6 +1,5 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
+ gem "rake"
2
3
 
3
- gem 'jeweler', '=1.4.0'
4
- gem 'rspec', '=1.3.1'
5
-
6
- # /* vim: set filetype=ruby : */
4
+ # Specify your gem's dependencies in currencies.gemspec
5
+ gemspec
@@ -1,20 +1,28 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ currencies (0.4.1)
5
+
1
6
  GEM
2
- remote: http://rubygems.org/
7
+ remote: https://rubygems.org/
3
8
  specs:
4
- gemcutter (0.6.1)
5
- git (1.2.5)
6
- jeweler (1.4.0)
7
- gemcutter (>= 0.1.0)
8
- git (>= 1.2.5)
9
- rubyforge (>= 2.0.0)
10
- json_pure (1.4.6)
11
- rspec (1.3.1)
12
- rubyforge (2.0.4)
13
- json_pure (>= 1.1.7)
9
+ diff-lcs (1.1.3)
10
+ rake (0.9.2.2)
11
+ rspec (2.10.0)
12
+ rspec-core (~> 2.10.0)
13
+ rspec-expectations (~> 2.10.0)
14
+ rspec-mocks (~> 2.10.0)
15
+ rspec-core (2.10.0)
16
+ rspec-expectations (2.10.0)
17
+ diff-lcs (~> 1.1.3)
18
+ rspec-mocks (2.10.1)
19
+ yard (0.8.1)
14
20
 
15
21
  PLATFORMS
16
22
  ruby
17
23
 
18
24
  DEPENDENCIES
19
- jeweler (= 1.4.0)
20
- rspec (= 1.3.1)
25
+ currencies!
26
+ rake
27
+ rspec
28
+ yard
data/LICENSE CHANGED
@@ -1,4 +1,6 @@
1
- Copyright (c) 2009 hexorx
1
+ Copyright (c) 2012 hexorx
2
+
3
+ MIT License
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person obtaining
4
6
  a copy of this software and associated documentation files (the
@@ -65,7 +65,7 @@ Defaults
65
65
 
66
66
  You can set the base currency by using the *base_currency* class method. This defaults to 'USD'.
67
67
 
68
- ISO4217::Currency.base_currency => 'GBP'
68
+ ISO4217::Currency.base_currency = 'GBP'
69
69
 
70
70
  The exchange rate is either set manually or if nil looked up on Yahoo Finance and cached. If you want to disable looking up the currency set the *import_exchange_rates* class method to false.
71
71
 
data/Rakefile CHANGED
@@ -1,43 +1,12 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "currencies"
8
- gem.summary = %Q{Simple gem for working with currencies. It is extracted from the countries gem and contains all the currency information in the ISO 4217 standard.}
9
- gem.description = %Q{If you are tracking any kind of assets the currencies gem is for you. It contains every currency in the ISO 4217 standard and allows you to add your own as well. So if you decide to take sparkly buttons as a form of payment you can use currencies to display the shiny button unicode symbol ☼ (disclaimer: ☼ may not look like a shiny button to everyone.) when used with something like the money gem. Speaking of the money gem, currencies gives you an ExchangeBank that the money gem can use to convert from one currency to another. There are plans to have ExchangeRate provider plugin system. Right now the rates are either set manually or pulled from Yahoo Finance.}
10
- gem.email = "hexorx@gmail.com"
11
- gem.homepage = "http://github.com/hexorx/currencies"
12
- gem.authors = ["hexorx"]
13
- gem.add_development_dependency "rspec"
14
- gem.add_development_dependency "yard"
15
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
- end
17
- Jeweler::GemcutterTasks.new
18
- rescue LoadError
19
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
20
- end
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
21
3
 
22
- require 'spec/rake/spectask'
23
- Spec::Rake::SpecTask.new(:spec) do |spec|
24
- spec.libs << 'lib' << 'spec'
25
- spec.spec_files = FileList['spec/**/*_spec.rb']
26
- end
4
+ require 'rake'
5
+ require 'rspec/core/rake_task'
27
6
 
28
- Spec::Rake::SpecTask.new(:rcov) do |spec|
29
- spec.libs << 'lib' << 'spec'
30
- spec.pattern = 'spec/**/*_spec.rb'
31
- spec.rcov = true
7
+ desc "Run all examples"
8
+ RSpec::Core::RakeTask.new(:spec) do |t|
9
+ t.rspec_opts = %w[--color]
32
10
  end
33
11
 
34
- task :default => :spec
35
-
36
- begin
37
- require 'yard'
38
- YARD::Rake::YardocTask.new
39
- rescue LoadError
40
- task :yardoc do
41
- abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
42
- end
43
- end
12
+ task :default => [:spec]
@@ -1,67 +1,20 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
1
  # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/currencies/version', __FILE__)
5
3
 
6
- Gem::Specification.new do |s|
7
- s.name = %q{currencies}
8
- s.version = "0.4.0"
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["hexorx", "pr0d1r2"]
6
+ gem.email = ["hexorx@gmail.com", "pr0d1r2@gmail.com"]
7
+ gem.description = %q{If you are tracking any kind of assets the currencies gem is for you. It contains every currency in the ISO 4217 standard and allows you to add your own as well. So if you decide to take sparkly buttons as a form of payment you can use currencies to display the shiny button unicode symbol ☼ (disclaimer: ☼ may not look like a shiny button to everyone.) when used with something like the money gem. Speaking of the money gem, currencies gives you an ExchangeBank that the money gem can use to convert from one currency to another. There are plans to have ExchangeRate provider plugin system. Right now the rates are either set manually or pulled from Yahoo Finance.}
8
+ gem.summary = %q{Simple gem for working with currencies. It is extracted from the countries gem and contains all the currency information in the ISO 4217 standard.}
9
+ gem.homepage = "http://github.com/hexorx/currencies"
9
10
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["hexorx"]
12
- s.date = %q{2011-02-07}
13
- s.description = %q{If you are tracking any kind of assets the currencies gem is for you. It contains every currency in the ISO 4217 standard and allows you to add your own as well. So if you decide to take sparkly buttons as a form of payment you can use currencies to display the shiny button unicode symbol ☼ (disclaimer: ☼ may not look like a shiny button to everyone.) when used with something like the money gem. Speaking of the money gem, currencies gives you an ExchangeBank that the money gem can use to convert from one currency to another. There are plans to have ExchangeRate provider plugin system. Right now the rates are either set manually or pulled from Yahoo Finance.}
14
- s.email = %q{hexorx@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.markdown"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".gitignore",
22
- ".rvmrc",
23
- "Gemfile",
24
- "Gemfile.lock",
25
- "LICENSE",
26
- "README.markdown",
27
- "Rakefile",
28
- "VERSION",
29
- "currencies.gemspec",
30
- "lib/currencies.rb",
31
- "lib/currencies/currency.rb",
32
- "lib/currencies/exchange_bank.rb",
33
- "lib/currencies/extentions.rb",
34
- "lib/data/iso4217.yaml",
35
- "lib/iso4217.rb",
36
- "spec/currency_spec.rb",
37
- "spec/exchange_bank_spec.rb",
38
- "spec/spec_helper.rb"
39
- ]
40
- s.homepage = %q{http://github.com/hexorx/currencies}
41
- s.rdoc_options = ["--charset=UTF-8"]
42
- s.require_paths = ["lib"]
43
- s.rubygems_version = %q{1.3.7}
44
- s.summary = %q{Simple gem for working with currencies. It is extracted from the countries gem and contains all the currency information in the ISO 4217 standard.}
45
- s.test_files = [
46
- "spec/currency_spec.rb",
47
- "spec/exchange_bank_spec.rb",
48
- "spec/spec_helper.rb"
49
- ]
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "currencies"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Currencies::VERSION
50
17
 
51
- if s.respond_to? :specification_version then
52
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
53
- s.specification_version = 3
54
-
55
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
56
- s.add_development_dependency(%q<rspec>, [">= 0"])
57
- s.add_development_dependency(%q<yard>, [">= 0"])
58
- else
59
- s.add_dependency(%q<rspec>, [">= 0"])
60
- s.add_dependency(%q<yard>, [">= 0"])
61
- end
62
- else
63
- s.add_dependency(%q<rspec>, [">= 0"])
64
- s.add_dependency(%q<yard>, [">= 0"])
65
- end
18
+ gem.add_development_dependency "rspec"
19
+ gem.add_development_dependency "yard"
66
20
  end
67
-
@@ -1,4 +1,4 @@
1
- $LOAD_PATH << File.expand_path(File.dirname(__FILE__))
1
+ require "currencies/version"
2
2
 
3
3
  require 'iso4217'
4
4
 
@@ -0,0 +1,3 @@
1
+ module Currencies
2
+ VERSION = "0.4.1"
3
+ end
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
4
 
3
5
  describe ISO4217::Currency do
@@ -5,7 +7,7 @@ describe ISO4217::Currency do
5
7
  @usd = ISO4217::Currency.from_code(:USD)
6
8
  @gbp = ISO4217::Currency.from_code(:GBP)
7
9
  end
8
-
10
+
9
11
  it 'should return code' do
10
12
  @usd.code.should == 'USD'
11
13
  @gbp.code.should == 'GBP'
@@ -14,7 +16,7 @@ describe ISO4217::Currency do
14
16
  @usd['code'].should == 'USD'
15
17
  @gbp['code'].should == 'GBP'
16
18
  end
17
-
19
+
18
20
  it 'should return symbol' do
19
21
  @usd.symbol.should == '$'
20
22
  @gbp.symbol.should == '£'
@@ -23,7 +25,7 @@ describe ISO4217::Currency do
23
25
  @usd['symbol'].should == '$'
24
26
  @gbp['symbol'].should == '£'
25
27
  end
26
-
28
+
27
29
  it 'should return name' do
28
30
  @usd.name.should == 'Dollars'
29
31
  @gbp.name.should == 'Pounds'
@@ -32,33 +34,33 @@ describe ISO4217::Currency do
32
34
  @usd['name'].should == 'Dollars'
33
35
  @gbp['name'].should == 'Pounds'
34
36
  end
35
-
37
+
36
38
  describe 'from_code' do
37
39
  it 'should return new Currency instance when passed iso4217 currency code' do
38
40
  ISO4217::Currency.from_code('USD').should be_a(ISO4217::Currency)
39
41
  end
40
-
42
+
41
43
  it 'should return a currency with the same code' do
42
44
  ISO4217::Currency.from_code('USD').code.should == 'USD'
43
45
  ISO4217::Currency.from_code('GBP').code.should == 'GBP'
44
46
  end
45
-
47
+
46
48
  it 'should accept symbol' do
47
49
  ISO4217::Currency.from_code(:USD).code.should == 'USD'
48
50
  ISO4217::Currency.from_code(:GBP).code.should == 'GBP'
49
51
  end
50
-
52
+
51
53
  it 'should work with lower case' do
52
54
  ISO4217::Currency.from_code('usd').code.should == 'USD'
53
55
  ISO4217::Currency.from_code('gbp').code.should == 'GBP'
54
56
  end
55
57
  end
56
-
58
+
57
59
  describe 'exchange_rate' do
58
60
  it 'should return a float' do
59
61
  ISO4217::Currency.from_code('GBP').exchange_rate.should be_a(Float)
60
62
  end
61
-
63
+
62
64
  it 'should have an exchange rate of 1.0 for the base currency' do
63
65
  ISO4217::Currency.from_code(ISO4217::Currency.base_currency).exchange_rate.should == 1.0
64
66
  end
@@ -1,9 +1 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__))
2
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
1
  require 'iso4217'
4
- require 'spec'
5
- require 'spec/autorun'
6
-
7
- Spec::Runner.configure do |config|
8
-
9
- end
metadata CHANGED
@@ -1,61 +1,65 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: currencies
3
- version: !ruby/object:Gem::Version
4
- hash: 15
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 4
9
- - 0
10
- version: 0.4.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.1
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - hexorx
9
+ - pr0d1r2
14
10
  autorequire:
15
11
  bindir: bin
16
12
  cert_chain: []
17
-
18
- date: 2011-02-07 00:00:00 -07:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
13
+ date: 2013-05-11 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
22
16
  name: rspec
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
25
18
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
33
23
  type: :development
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: yard
37
24
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
31
+ - !ruby/object:Gem::Dependency
32
+ name: yard
33
+ requirement: !ruby/object:Gem::Requirement
39
34
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
47
39
  type: :development
48
- version_requirements: *id002
49
- description: "If you are tracking any kind of assets the currencies gem is for you. It contains every currency in the ISO 4217 standard and allows you to add your own as well. So if you decide to take sparkly buttons as a form of payment you can use currencies to display the shiny button unicode symbol \xE2\x98\xBC (disclaimer: \xE2\x98\xBC may not look like a shiny button to everyone.) when used with something like the money gem. Speaking of the money gem, currencies gives you an ExchangeBank that the money gem can use to convert from one currency to another. There are plans to have ExchangeRate provider plugin system. Right now the rates are either set manually or pulled from Yahoo Finance."
50
- email: hexorx@gmail.com
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ description: ! 'If you are tracking any kind of assets the currencies gem is for you.
48
+ It contains every currency in the ISO 4217 standard and allows you to add your own
49
+ as well. So if you decide to take sparkly buttons as a form of payment you can use
50
+ currencies to display the shiny button unicode symbol ☼ (disclaimer: ☼ may not look
51
+ like a shiny button to everyone.) when used with something like the money gem. Speaking
52
+ of the money gem, currencies gives you an ExchangeBank that the money gem can use
53
+ to convert from one currency to another. There are plans to have ExchangeRate provider
54
+ plugin system. Right now the rates are either set manually or pulled from Yahoo
55
+ Finance.'
56
+ email:
57
+ - hexorx@gmail.com
58
+ - pr0d1r2@gmail.com
51
59
  executables: []
52
-
53
60
  extensions: []
54
-
55
- extra_rdoc_files:
56
- - LICENSE
57
- - README.markdown
58
- files:
61
+ extra_rdoc_files: []
62
+ files:
59
63
  - .document
60
64
  - .gitignore
61
65
  - .rvmrc
@@ -64,52 +68,50 @@ files:
64
68
  - LICENSE
65
69
  - README.markdown
66
70
  - Rakefile
67
- - VERSION
68
71
  - currencies.gemspec
69
72
  - lib/currencies.rb
70
73
  - lib/currencies/currency.rb
71
74
  - lib/currencies/exchange_bank.rb
72
75
  - lib/currencies/extentions.rb
76
+ - lib/currencies/version.rb
73
77
  - lib/data/iso4217.yaml
74
78
  - lib/iso4217.rb
75
79
  - spec/currency_spec.rb
76
80
  - spec/exchange_bank_spec.rb
77
81
  - spec/spec_helper.rb
78
- has_rdoc: true
79
82
  homepage: http://github.com/hexorx/currencies
80
83
  licenses: []
81
-
82
84
  post_install_message:
83
- rdoc_options:
84
- - --charset=UTF-8
85
- require_paths:
85
+ rdoc_options: []
86
+ require_paths:
86
87
  - lib
87
- required_ruby_version: !ruby/object:Gem::Requirement
88
+ required_ruby_version: !ruby/object:Gem::Requirement
88
89
  none: false
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- hash: 3
93
- segments:
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ segments:
94
95
  - 0
95
- version: "0"
96
- required_rubygems_version: !ruby/object:Gem::Requirement
96
+ hash: -3014364688897172461
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
98
  none: false
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- hash: 3
102
- segments:
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ segments:
103
104
  - 0
104
- version: "0"
105
+ hash: -3014364688897172461
105
106
  requirements: []
106
-
107
107
  rubyforge_project:
108
- rubygems_version: 1.3.7
108
+ rubygems_version: 1.8.23
109
109
  signing_key:
110
110
  specification_version: 3
111
- summary: Simple gem for working with currencies. It is extracted from the countries gem and contains all the currency information in the ISO 4217 standard.
112
- test_files:
111
+ summary: Simple gem for working with currencies. It is extracted from the countries
112
+ gem and contains all the currency information in the ISO 4217 standard.
113
+ test_files:
113
114
  - spec/currency_spec.rb
114
115
  - spec/exchange_bank_spec.rb
115
116
  - spec/spec_helper.rb
117
+ has_rdoc:
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.4.0