monetize 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29bbd459e6a5ca4859d29dfd06e765d0754c7cbf
4
- data.tar.gz: 0d6c7d1c29653c72eccabbece1574c86f101a35a
3
+ metadata.gz: 3016c91bf1aa9cc8935b6ff90d63b5f886579e20
4
+ data.tar.gz: 3463374e680a5ba4250cb21e058e40bd614de7f8
5
5
  SHA512:
6
- metadata.gz: ce48a27d786e25445ab82b19fde3147f372c81737416a136c9dcabe91e5a3f2193d51187cbc12be4595f2dea27f4a644a6be445ccb004cde7116e15fa7866271
7
- data.tar.gz: e522dc3d0fcb618a677498d97828e0193d4a7fff5ec32766c6bd07df5600d6ded008b77f841d1b0b9d9cd4f5ab4bdf6e74ee1bb13829add041ce4efbb1ef5c78
6
+ metadata.gz: ec525402630b198a11a1a1b885187144a51bc8d0f0af483d4de39d8efba2ea0ec34fc83b6c5bef3605cd196f8cca133e30d8249de86f23a34ea462fa07ce516f
7
+ data.tar.gz: ab52dca85db03bade6db75296bfa418e0a9038901326fa27477e56f0e39f54cc8743aa054a98f9fb6c647f01e608a050a1472a60501164658823ac3e47dc99c8
data/README.md CHANGED
@@ -38,7 +38,7 @@ Optionally, enable the ability to assume the currency from a passed symbol.
38
38
  ```ruby
39
39
  Monetize.assume_from_symbol = true
40
40
 
41
- "100".to_money == Money.new(100_00, "USD")
41
+ "$100".to_money == Money.new(100_00, "USD")
42
42
  ```
43
43
 
44
44
  ## Contributing
data/lib/monetize.rb CHANGED
@@ -4,21 +4,12 @@ require "money"
4
4
  require "monetize/version"
5
5
 
6
6
  module Monetize
7
- # Determine if the currency can be assumed from a passed symbol.
8
- #
9
- # @return [Boolean] Defaults to false.
10
- def self.assume_from_symbol
11
- @assume_from_symbol
12
- end
13
7
 
14
- # Use this to enable the ability to assume the currency from a passed
15
- # symbol.
16
- #
17
- # @param value [Boolean]
18
- #
19
- # @return nothing.
20
- def self.assume_from_symbol= value
21
- @assume_from_symbol = value
8
+ # Class methods
9
+ class << self
10
+ # @attr_accessor [true, false] assume_from_symbol Use this to enable the
11
+ # ability to assume the currency from a passed symbol
12
+ attr_accessor :assume_from_symbol
22
13
  end
23
14
 
24
15
  def self.parse(input, currency = Money.default_currency)
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Monetize
4
- VERSION = "0.1.4"
4
+ VERSION = "0.2.0"
5
5
  end
data/monetize.gemspec CHANGED
@@ -18,7 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "money", "~> 6.1.0.beta1"
21
+ spec.add_dependency "money", "~> 6.1.0.beta1"
22
+
22
23
  spec.add_development_dependency "bundler", "~> 1.3"
23
24
  spec.add_development_dependency "rake"
24
25
  spec.add_development_dependency "rspec", "~> 3.0.0.beta1"
@@ -25,6 +25,10 @@ describe Monetize do
25
25
  Monetize.assume_from_symbol = true
26
26
  end
27
27
 
28
+ after do
29
+ Monetize.assume_from_symbol = false
30
+ end
31
+
28
32
  it "parses formatted inputs with the currency passed as a symbol" do
29
33
  original_currency = Money.default_currency
30
34
  Money.default_currency = "EUR"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monetize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Emmons
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-02 00:00:00.000000000 Z
11
+ date: 2014-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: money
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 6.1.0.beta1
20
- type: :development
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements: