monetize 1.13.0 → 2.0.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/LICENSE +1 -1
- data/README.md +3 -15
- data/lib/monetize/collection.rb +0 -2
- data/lib/monetize/core_extensions/hash.rb +0 -2
- data/lib/monetize/core_extensions/numeric.rb +0 -2
- data/lib/monetize/core_extensions/string.rb +0 -2
- data/lib/monetize/core_extensions/symbol.rb +0 -2
- data/lib/monetize/core_extensions.rb +0 -2
- data/lib/monetize/parser.rb +9 -15
- data/lib/monetize/version.rb +1 -3
- data/lib/monetize.rb +2 -11
- data/monetize.gemspec +23 -25
- metadata +8 -64
- data/.github/workflows/ruby.yml +0 -34
- data/.gitignore +0 -18
- data/.rubocop.yml +0 -32
- data/CONTRIBUTING.md +0 -20
- data/Gemfile +0 -13
- data/Rakefile +0 -18
- data/spec/core_extensions_spec.rb +0 -261
- data/spec/monetize_spec.rb +0 -633
- data/spec/spec_helper.rb +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 77ba1cf94643805ce15012361fda9aaadf3d029483b7c5e557dae4a0cd220c2f
|
|
4
|
+
data.tar.gz: 8b9d5c77362a24cb9483d2cd02a0f35e5382a289c0eaacc8e44716408ef2a228
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 528b67577977e7fb1300cac86a086cc16d9a1941bb93270ed913b83c898b35b3c853583113ece518aeee68f099c0d5ee03bf559a68dffbabc4ed52aa3aaefdce
|
|
7
|
+
data.tar.gz: d64891590b9c964dc7324f57e45262471922be81248914f8c4430649a9ee17a23e019ae99171762d27b07c1888db51d23f0be580cc0977fd0fa069e3aa7a6563
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 2.0.0
|
|
6
|
+
- **Breaking change**: Remove deprecated `Monetize.extract_cents`.
|
|
7
|
+
- **Breaking change**: Update Money gem dependency to ~> 7.0. See the [Money 7.0 upgrading guide](https://github.com/RubyMoney/money/blob/main/UPGRADING-7.0.md)
|
|
8
|
+
- **Breaking change**: Drop support for Ruby < 3.1
|
|
9
|
+
- Fix parsing multiple delimeters in the amount, after BigDecimal updates
|
|
10
|
+
- Fix unused variable `possible_major` Ruby warning.
|
|
11
|
+
|
|
12
|
+
## 1.13.0
|
|
13
|
+
- **Breaking change**: check ISO currency code validity when parsing strings with `to_money`
|
|
14
|
+
- Adds `expect_whole_subunits` option when fractional subunits are expected
|
|
15
|
+
- Add MYR, IDR, SGD, HKD, TWD, and PHP symbol to currency conversion
|
|
16
|
+
|
|
3
17
|
## 1.12.0
|
|
4
18
|
- Update `to_money` to match money-rails to_hash.
|
|
5
19
|
|
data/LICENSE
CHANGED
data/README.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# Monetize
|
|
2
2
|
|
|
3
3
|
[](http://badge.fury.io/rb/monetize)
|
|
4
|
-
[](https://codeclimate.com/github/RubyMoney/monetize)
|
|
6
|
-
[](https://gemnasium.com/RubyMoney/monetize)
|
|
4
|
+
[](https://github.com/RubyMoney/monetize/actions/workflows/ruby.yml)
|
|
7
5
|
[](http://opensource.org/licenses/MIT)
|
|
8
6
|
|
|
9
7
|
A library for converting various objects into `Money` objects.
|
|
@@ -28,16 +26,6 @@ Monetize.parse("GBP 100") == Money.new(100_00, "GBP")
|
|
|
28
26
|
"100".to_money == Money.new(100_00, "USD")
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
`parse` will return `nil` if it is unable to parse the input. Use `parse!` instead if you want a `Monetize::Error` (or one of the subclasses) to be raised instead:
|
|
32
|
-
|
|
33
|
-
```ruby
|
|
34
|
-
>> Monetize.parse('OMG 100')
|
|
35
|
-
=> nil
|
|
36
|
-
|
|
37
|
-
>> Monetize.parse!('OMG 100')
|
|
38
|
-
Monetize::ParseError: Unknown currency 'omg'
|
|
39
|
-
```
|
|
40
|
-
|
|
41
29
|
Optionally, enable the ability to assume the currency from a passed symbol. Otherwise, currency symbols will be ignored, and USD used as the default currency:
|
|
42
30
|
|
|
43
31
|
```ruby
|
|
@@ -49,7 +37,7 @@ Monetize.parse("£100") == Money.new(100_00, "GBP")
|
|
|
49
37
|
"€100".to_money == Money.new(100_00, "EUR")
|
|
50
38
|
```
|
|
51
39
|
|
|
52
|
-
Parsing can be improved where the input is not expected to contain
|
|
40
|
+
Parsing can be improved where the input is not expected to contain fractional subunits.
|
|
53
41
|
To do this, set `Monetize.expect_whole_subunits = true`
|
|
54
42
|
|
|
55
43
|
```ruby
|
|
@@ -60,7 +48,7 @@ Monetize.parse('EUR 10,000') == Money.new(10_000_00, "EUR")
|
|
|
60
48
|
```
|
|
61
49
|
|
|
62
50
|
Why does this work? If we expect fractional subunits then the parser will treat a single
|
|
63
|
-
delimiter as a decimal marker if it matches the currency's decimal marker. But often
|
|
51
|
+
delimiter as a decimal marker if it matches the currency's decimal marker. But often
|
|
64
52
|
this is not the case - a European site will show $10.000 because that's the local format.
|
|
65
53
|
As a human, if this was a stock ticker we might expect fractional cents. If it's a retail price we know it's actually an incorrect thousands separator.
|
|
66
54
|
|
data/lib/monetize/collection.rb
CHANGED
data/lib/monetize/parser.rb
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
1
|
module Monetize
|
|
4
2
|
class Parser
|
|
5
3
|
CURRENCY_SYMBOLS = {
|
|
@@ -31,6 +29,7 @@ module Monetize
|
|
|
31
29
|
'₱' => 'PHP',
|
|
32
30
|
}
|
|
33
31
|
|
|
32
|
+
CURRENCY_SYMBOL_REGEX = /(?<![A-Z])(#{CURRENCY_SYMBOLS.keys.map { |key| Regexp.escape(key) }.join('|')})(?![A-Z])/i
|
|
34
33
|
MULTIPLIER_SUFFIXES = { 'K' => 3, 'M' => 6, 'B' => 9, 'T' => 12 }
|
|
35
34
|
MULTIPLIER_SUFFIXES.default = 0
|
|
36
35
|
MULTIPLIER_REGEXP = Regexp.new(format('^(.*?\d)(%s)\b([^\d]*)$', MULTIPLIER_SUFFIXES.keys.join('|')), 'i')
|
|
@@ -79,8 +78,9 @@ module Monetize
|
|
|
79
78
|
computed_currency = nil unless Monetize::Parser::CURRENCY_SYMBOLS.value?(computed_currency)
|
|
80
79
|
computed_currency ||= compute_currency if assume_from_symbol?
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
found = computed_currency || fallback_currency || Money.default_currency
|
|
82
|
+
raise Money::Currency::UnknownCurrency unless found
|
|
83
|
+
found
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
def assume_from_symbol?
|
|
@@ -100,7 +100,7 @@ module Monetize
|
|
|
100
100
|
end
|
|
101
101
|
|
|
102
102
|
def compute_currency
|
|
103
|
-
match = input.match(
|
|
103
|
+
match = input.match(CURRENCY_SYMBOL_REGEX)
|
|
104
104
|
CURRENCY_SYMBOLS[match.to_s] if match
|
|
105
105
|
end
|
|
106
106
|
|
|
@@ -126,7 +126,7 @@ module Monetize
|
|
|
126
126
|
|
|
127
127
|
def extract_major_minor_with_single_delimiter(num, currency, delimiter)
|
|
128
128
|
if expect_whole_subunits?
|
|
129
|
-
|
|
129
|
+
_possible_major, possible_minor = split_major_minor(num, delimiter)
|
|
130
130
|
if minor_has_correct_dp_for_currency_subunit?(possible_minor, currency)
|
|
131
131
|
split_major_minor(num, delimiter)
|
|
132
132
|
else
|
|
@@ -179,17 +179,11 @@ module Monetize
|
|
|
179
179
|
result
|
|
180
180
|
end
|
|
181
181
|
|
|
182
|
-
def regex_safe_symbols
|
|
183
|
-
CURRENCY_SYMBOLS.keys.map { |key| Regexp.escape(key) }.join('|')
|
|
184
|
-
end
|
|
185
|
-
|
|
186
182
|
def split_major_minor(num, delimiter)
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
end
|
|
183
|
+
splits = num.split(delimiter)
|
|
184
|
+
fail ParseError, 'Invalid amount (multiple delimiters)' if splits.length > 2
|
|
190
185
|
|
|
191
|
-
|
|
192
|
-
/(?<![A-Z])(#{regex_safe_symbols})(?![A-Z])/i
|
|
186
|
+
[splits[0], splits[1] || '00']
|
|
193
187
|
end
|
|
194
188
|
end
|
|
195
189
|
end
|
data/lib/monetize/version.rb
CHANGED
data/lib/monetize.rb
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
1
|
require 'money'
|
|
4
2
|
require 'monetize/core_extensions'
|
|
5
3
|
require 'monetize/errors'
|
|
@@ -21,8 +19,8 @@ module Monetize
|
|
|
21
19
|
attr_accessor :enforce_currency_delimiters
|
|
22
20
|
|
|
23
21
|
|
|
24
|
-
# Where this set to true, the behavior for parsing thousands separators is changed to
|
|
25
|
-
# expect that eg. €10.000 is EUR 10 000 and not EUR 10.000 - it's incredibly rare when parsing
|
|
22
|
+
# Where this set to true, the behavior for parsing thousands separators is changed to
|
|
23
|
+
# expect that eg. €10.000 is EUR 10 000 and not EUR 10.000 - it's incredibly rare when parsing
|
|
26
24
|
# human text that we're dealing with fractions of cents.
|
|
27
25
|
attr_accessor :expect_whole_subunits
|
|
28
26
|
|
|
@@ -70,12 +68,5 @@ module Monetize
|
|
|
70
68
|
fail ArgumentError, "'value' should be a type of Numeric" unless value.is_a?(Numeric)
|
|
71
69
|
Money.from_amount(value, currency)
|
|
72
70
|
end
|
|
73
|
-
|
|
74
|
-
def extract_cents(input, currency = Money.default_currency)
|
|
75
|
-
warn '[DEPRECATION] Monetize.extract_cents is deprecated. Use Monetize.parse().cents'
|
|
76
|
-
|
|
77
|
-
money = parse(input, currency)
|
|
78
|
-
money.cents if money
|
|
79
|
-
end
|
|
80
71
|
end
|
|
81
72
|
end
|
data/monetize.gemspec
CHANGED
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require
|
|
5
|
-
require 'English'
|
|
5
|
+
require "monetize/version"
|
|
6
6
|
|
|
7
|
-
Gem::Specification.new do |
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
Gem::Specification.new do |s|
|
|
8
|
+
s.name = "monetize"
|
|
9
|
+
s.version = Monetize::VERSION
|
|
10
|
+
s.platform = Gem::Platform::RUBY
|
|
11
|
+
s.authors = ["Shane Emmons", "Anthony Dmitriyev"]
|
|
12
|
+
s.email = ["shane@emmons.io", "anthony.dmitriyev@gmail.com"]
|
|
13
|
+
s.homepage = "https://github.com/RubyMoney/monetize"
|
|
14
|
+
s.summary = "A library for converting various objects into `Money` objects."
|
|
15
|
+
s.description = "A library for converting various objects into `Money` objects."
|
|
16
|
+
s.license = "MIT"
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
19
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
20
|
-
spec.require_paths = ['lib']
|
|
18
|
+
s.add_dependency "money", "~> 7.0"
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
s.required_ruby_version = ">= 3.1"
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
22
|
+
s.files = `git ls-files -z -- lib/* CHANGELOG.md LICENSE monetize.gemspec README.md`.split("\x0")
|
|
23
|
+
s.require_paths = ["lib"]
|
|
27
24
|
|
|
28
|
-
if
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
if s.respond_to?(:metadata)
|
|
26
|
+
s.metadata["changelog_uri"] = "https://github.com/RubyMoney/monetize/blob/master/CHANGELOG.md"
|
|
27
|
+
s.metadata["source_code_uri"] = "https://github.com/RubyMoney/monetize/"
|
|
28
|
+
s.metadata["bug_tracker_uri"] = "https://github.com/RubyMoney/monetize/issues"
|
|
29
|
+
s.metadata["rubygems_mfa_required"] = "true"
|
|
32
30
|
end
|
|
33
31
|
end
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: monetize
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shane Emmons
|
|
8
8
|
- Anthony Dmitriyev
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: money
|
|
@@ -17,56 +16,14 @@ dependencies:
|
|
|
17
16
|
requirements:
|
|
18
17
|
- - "~>"
|
|
19
18
|
- !ruby/object:Gem::Version
|
|
20
|
-
version: '
|
|
19
|
+
version: '7.0'
|
|
21
20
|
type: :runtime
|
|
22
21
|
prerelease: false
|
|
23
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
23
|
requirements:
|
|
25
24
|
- - "~>"
|
|
26
25
|
- !ruby/object:Gem::Version
|
|
27
|
-
version: '
|
|
28
|
-
- !ruby/object:Gem::Dependency
|
|
29
|
-
name: bundler
|
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
|
31
|
-
requirements:
|
|
32
|
-
- - ">="
|
|
33
|
-
- !ruby/object:Gem::Version
|
|
34
|
-
version: '0'
|
|
35
|
-
type: :development
|
|
36
|
-
prerelease: false
|
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
38
|
-
requirements:
|
|
39
|
-
- - ">="
|
|
40
|
-
- !ruby/object:Gem::Version
|
|
41
|
-
version: '0'
|
|
42
|
-
- !ruby/object:Gem::Dependency
|
|
43
|
-
name: rake
|
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
|
45
|
-
requirements:
|
|
46
|
-
- - "~>"
|
|
47
|
-
- !ruby/object:Gem::Version
|
|
48
|
-
version: '10.2'
|
|
49
|
-
type: :development
|
|
50
|
-
prerelease: false
|
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
52
|
-
requirements:
|
|
53
|
-
- - "~>"
|
|
54
|
-
- !ruby/object:Gem::Version
|
|
55
|
-
version: '10.2'
|
|
56
|
-
- !ruby/object:Gem::Dependency
|
|
57
|
-
name: rspec
|
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
|
59
|
-
requirements:
|
|
60
|
-
- - "~>"
|
|
61
|
-
- !ruby/object:Gem::Version
|
|
62
|
-
version: '3.0'
|
|
63
|
-
type: :development
|
|
64
|
-
prerelease: false
|
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
66
|
-
requirements:
|
|
67
|
-
- - "~>"
|
|
68
|
-
- !ruby/object:Gem::Version
|
|
69
|
-
version: '3.0'
|
|
26
|
+
version: '7.0'
|
|
70
27
|
description: A library for converting various objects into `Money` objects.
|
|
71
28
|
email:
|
|
72
29
|
- shane@emmons.io
|
|
@@ -75,15 +32,9 @@ executables: []
|
|
|
75
32
|
extensions: []
|
|
76
33
|
extra_rdoc_files: []
|
|
77
34
|
files:
|
|
78
|
-
- ".github/workflows/ruby.yml"
|
|
79
|
-
- ".gitignore"
|
|
80
|
-
- ".rubocop.yml"
|
|
81
35
|
- CHANGELOG.md
|
|
82
|
-
- CONTRIBUTING.md
|
|
83
|
-
- Gemfile
|
|
84
36
|
- LICENSE
|
|
85
37
|
- README.md
|
|
86
|
-
- Rakefile
|
|
87
38
|
- lib/monetize.rb
|
|
88
39
|
- lib/monetize/collection.rb
|
|
89
40
|
- lib/monetize/core_extensions.rb
|
|
@@ -96,9 +47,6 @@ files:
|
|
|
96
47
|
- lib/monetize/parser.rb
|
|
97
48
|
- lib/monetize/version.rb
|
|
98
49
|
- monetize.gemspec
|
|
99
|
-
- spec/core_extensions_spec.rb
|
|
100
|
-
- spec/monetize_spec.rb
|
|
101
|
-
- spec/spec_helper.rb
|
|
102
50
|
homepage: https://github.com/RubyMoney/monetize
|
|
103
51
|
licenses:
|
|
104
52
|
- MIT
|
|
@@ -106,7 +54,7 @@ metadata:
|
|
|
106
54
|
changelog_uri: https://github.com/RubyMoney/monetize/blob/master/CHANGELOG.md
|
|
107
55
|
source_code_uri: https://github.com/RubyMoney/monetize/
|
|
108
56
|
bug_tracker_uri: https://github.com/RubyMoney/monetize/issues
|
|
109
|
-
|
|
57
|
+
rubygems_mfa_required: 'true'
|
|
110
58
|
rdoc_options: []
|
|
111
59
|
require_paths:
|
|
112
60
|
- lib
|
|
@@ -114,18 +62,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
114
62
|
requirements:
|
|
115
63
|
- - ">="
|
|
116
64
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: '
|
|
65
|
+
version: '3.1'
|
|
118
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
67
|
requirements:
|
|
120
68
|
- - ">="
|
|
121
69
|
- !ruby/object:Gem::Version
|
|
122
70
|
version: '0'
|
|
123
71
|
requirements: []
|
|
124
|
-
rubygems_version:
|
|
125
|
-
signing_key:
|
|
72
|
+
rubygems_version: 4.0.0
|
|
126
73
|
specification_version: 4
|
|
127
74
|
summary: A library for converting various objects into `Money` objects.
|
|
128
|
-
test_files:
|
|
129
|
-
- spec/core_extensions_spec.rb
|
|
130
|
-
- spec/monetize_spec.rb
|
|
131
|
-
- spec/spec_helper.rb
|
|
75
|
+
test_files: []
|
data/.github/workflows/ruby.yml
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# This workflow uses actions that are not certified by GitHub.
|
|
2
|
-
# They are provided by a third-party and are governed by
|
|
3
|
-
# separate terms of service, privacy policy, and support
|
|
4
|
-
# documentation.
|
|
5
|
-
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
|
6
|
-
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
|
7
|
-
|
|
8
|
-
name: Ruby
|
|
9
|
-
|
|
10
|
-
on:
|
|
11
|
-
push:
|
|
12
|
-
branches: [ main ]
|
|
13
|
-
pull_request:
|
|
14
|
-
branches: [ main ]
|
|
15
|
-
|
|
16
|
-
jobs:
|
|
17
|
-
test:
|
|
18
|
-
|
|
19
|
-
runs-on: ubuntu-latest
|
|
20
|
-
strategy:
|
|
21
|
-
matrix:
|
|
22
|
-
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
|
|
23
|
-
|
|
24
|
-
steps:
|
|
25
|
-
- uses: actions/checkout@v3
|
|
26
|
-
- name: Set up Ruby
|
|
27
|
-
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
|
28
|
-
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
|
29
|
-
uses: ruby/setup-ruby@v1
|
|
30
|
-
with:
|
|
31
|
-
ruby-version: ${{ matrix.ruby-version }}
|
|
32
|
-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
33
|
-
- name: Run tests
|
|
34
|
-
run: bundle exec rspec spec
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
Documentation:
|
|
2
|
-
Enabled: false
|
|
3
|
-
Metrics/AbcSize:
|
|
4
|
-
Enabled: false
|
|
5
|
-
Metrics/ClassLength:
|
|
6
|
-
Enabled: false
|
|
7
|
-
Metrics/MethodLength:
|
|
8
|
-
Enabled: false
|
|
9
|
-
Metrics/ModuleLength:
|
|
10
|
-
Enabled: false
|
|
11
|
-
Style/AndOr:
|
|
12
|
-
Enabled: false
|
|
13
|
-
Style/ClassAndModuleChildren:
|
|
14
|
-
Enabled: false
|
|
15
|
-
Style/PerlBackrefs:
|
|
16
|
-
Enabled: false
|
|
17
|
-
|
|
18
|
-
Style/CollectionMethods:
|
|
19
|
-
Enabled: yes
|
|
20
|
-
Lint/LiteralInInterpolation:
|
|
21
|
-
Enabled: yes
|
|
22
|
-
|
|
23
|
-
Metrics/LineLength:
|
|
24
|
-
Max: 120
|
|
25
|
-
Metrics/ParameterLists:
|
|
26
|
-
CountKeywordArgs: false
|
|
27
|
-
Style/DotPosition:
|
|
28
|
-
EnforcedStyle: trailing
|
|
29
|
-
Style/EmptyElse:
|
|
30
|
-
EnforcedStyle: empty
|
|
31
|
-
Style/SpaceInsideHashLiteralBraces:
|
|
32
|
-
EnforcedStyle: no_space
|
data/CONTRIBUTING.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# Contribution Guidelines
|
|
2
|
-
|
|
3
|
-
## Steps
|
|
4
|
-
|
|
5
|
-
1. Fork [the repo](https://github.com/RubyMoney/monetize)
|
|
6
|
-
2. Grab dependencies: `bundle install`
|
|
7
|
-
3. Make sure everything is working: `bundle exec rspec spec`
|
|
8
|
-
4. Create your feature branch (`git checkout -b my-new-feature`)
|
|
9
|
-
5. Make your changes
|
|
10
|
-
6. Test your changes
|
|
11
|
-
7. Commit your changes (`git commit -am 'Add some feature'`)
|
|
12
|
-
8. Push to the branch (`git push origin my-new-feature`)
|
|
13
|
-
9. Create a Pull Request
|
|
14
|
-
10. Celebrate!!!!!
|
|
15
|
-
|
|
16
|
-
## Notes
|
|
17
|
-
|
|
18
|
-
When contributing, please make sure to update the [CHANGELOG.md](CHANGELOG.md) when you submit
|
|
19
|
-
your pull request. Upon merging of your first pull request, you will be
|
|
20
|
-
given commit access to the repository.
|
data/Gemfile
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
# JSON and I18n gem no longer supports ruby < 2.0.0
|
|
4
|
-
if defined?(JRUBY_VERSION)
|
|
5
|
-
gem 'json'
|
|
6
|
-
elsif RUBY_VERSION =~ /^1/
|
|
7
|
-
gem 'json', '~> 1.8.3'
|
|
8
|
-
gem 'tins', '~> 1.6.0'
|
|
9
|
-
gem 'term-ansicolor', '~> 1.3.0'
|
|
10
|
-
gem 'i18n', '~> 0.9'
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
gemspec
|
data/Rakefile
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
require 'bundler/gem_tasks'
|
|
2
|
-
require 'rspec/core/rake_task'
|
|
3
|
-
|
|
4
|
-
task default: :spec
|
|
5
|
-
|
|
6
|
-
RSpec::Core::RakeTask.new
|
|
7
|
-
|
|
8
|
-
task :environment do
|
|
9
|
-
require_relative 'lib/monetize'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
desc 'Start a console with library loaded'
|
|
13
|
-
task console: :environment do
|
|
14
|
-
require 'irb'
|
|
15
|
-
require 'irb/completion'
|
|
16
|
-
ARGV.clear
|
|
17
|
-
IRB.start
|
|
18
|
-
end
|