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 +4 -4
- data/README.md +1 -1
- data/lib/monetize.rb +5 -14
- data/lib/monetize/version.rb +1 -1
- data/monetize.gemspec +2 -1
- data/spec/monetize_spec.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3016c91bf1aa9cc8935b6ff90d63b5f886579e20
|
4
|
+
data.tar.gz: 3463374e680a5ba4250cb21e058e40bd614de7f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec525402630b198a11a1a1b885187144a51bc8d0f0af483d4de39d8efba2ea0ec34fc83b6c5bef3605cd196f8cca133e30d8249de86f23a34ea462fa07ce516f
|
7
|
+
data.tar.gz: ab52dca85db03bade6db75296bfa418e0a9038901326fa27477e56f0e39f54cc8743aa054a98f9fb6c647f01e608a050a1472a60501164658823ac3e47dc99c8
|
data/README.md
CHANGED
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
|
-
#
|
15
|
-
|
16
|
-
|
17
|
-
|
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)
|
data/lib/monetize/version.rb
CHANGED
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.
|
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"
|
data/spec/monetize_spec.rb
CHANGED
@@ -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.
|
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-
|
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: :
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|