money-heuristics 0.1.1 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fd6f8fe869d3de62f041b8f153daf6a079672408
4
- data.tar.gz: 479cfda0313b62954f8aa77354d3b04c96f611f6
2
+ SHA256:
3
+ metadata.gz: 43353ad87ea39e31b2e4a3278a59e7d47b303a7209480db6a6bd08db180326ac
4
+ data.tar.gz: 6588ecd66f5bf131f7352ff0d4f74955c7395de2763e222f95d70b85ce67674e
5
5
  SHA512:
6
- metadata.gz: 1ebb83436fc9ec044eb5670b1e2623e78f5df926770ad4cb898d618cc2eafd147c10fe0a27ea4e30cbd3752f828bd3608f7ac3e18e9d185f1a404444c48427c5
7
- data.tar.gz: 843fdc6279c9239bcdb159646341d4ce807e43d731e380888696a0dc594bfce76d6cc9053c8e1341b35f5615151d0d7fcb7a6a6181916e2c81a263ea228f6852
6
+ metadata.gz: e7a87e77124733d3bd59b79f83d2fe7aada1867b829bbaa475bc47fd5190b9ffccc697633579af570b01668ed75232281402c7796bb718ae33795a81de645ea7
7
+ data.tar.gz: efba2e13e679b0e3775b4213206d8b6bc63d0962a6862d66a21459a7a48caad3eb4a16aad063c766ebd65d2d014c72b76ee7ef4b534520db2566191974dfd15c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 1.0.0
6
+
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
+
3
10
  ## 0.1.1
4
11
 
5
12
  - Bumped money dependency to >= 6.9.0
data/LICENSE CHANGED
@@ -1,23 +1,23 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
3
  Copyright (c) 2005 Tobias Lutke
4
4
  Copyright (c) 2008 Phusion
5
+ Copyright (c) 2025 Shane Emmons
5
6
 
6
- Permission is hereby granted, free of charge, to any person obtaining
7
- a copy of this software and associated documentation files (the
8
- "Software"), to deal in the Software without restriction, including
9
- without limitation the rights to use, copy, modify, merge, publish,
10
- distribute, sublicense, and/or sell copies of the Software, and to
11
- permit persons to whom the Software is furnished to do so, subject to
12
- the following conditions:
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
13
 
14
- The above copyright notice and this permission notice shall be
15
- included in all copies or substantial portions of the Software.
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
16
 
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
data/README.md CHANGED
@@ -4,9 +4,8 @@ This is a module for heuristic analysis of the string input for the
4
4
  [money gem](https://github.com/RubyMoney/money). It was formerly part of the gem.
5
5
 
6
6
  [![Gem Version](https://badge.fury.io/rb/money-heuristics.svg)](https://rubygems.org/gems/money-heuristics)
7
- [![Build Status](https://travis-ci.org/RubyMoney/money-heuristics.svg?branch=master)](https://travis-ci.org/RubyMoney/money-heuristics)
8
- [![Coverage Status](https://coveralls.io/repos/RubyMoney/money-heuristics/badge.svg?branch=master)](https://coveralls.io/github/RubyMoney/money-heuristics?branch=master)
9
- [![License](https://img.shields.io/github/license/RubyMoney/money-heuristics.svg)](https://opensource.org/licenses/MIT)
7
+ [![Ruby](https://github.com/RubyMoney/money-heuristics/actions/workflows/ruby.yml/badge.svg)](https://github.com/RubyMoney/money-heuristics/actions/workflows/ruby.yml)
8
+ [![License](https://img.shields.io/github/license/RubyMoney/money-heuristics.svg)](https://opensource.org/license/MIT)
10
9
 
11
10
  ## Installation
12
11
 
@@ -1,21 +1,22 @@
1
1
  module MoneyHeuristics
2
2
  class Analyzer
3
3
  attr_reader :search_tree, :words
4
- attr_accessor :str, :currencies
4
+ attr_accessor :str, :currencies, :methods
5
5
 
6
6
  def initialize(str, search_tree)
7
7
  @str = (str || '').dup
8
8
  @search_tree = search_tree
9
9
  @currencies = []
10
+ @methods = { iso_code: :search_by_iso_code,
11
+ symbol: :search_by_symbol,
12
+ name: :search_by_name }
10
13
  end
11
14
 
12
- def process
15
+ def process(filters)
13
16
  format
14
17
  return [] if str.empty?
15
18
 
16
- search_by_symbol
17
- search_by_iso_code
18
- search_by_name
19
+ filter_methods(filters).each { |method| send(method) }
19
20
 
20
21
  prepare_reply
21
22
  end
@@ -80,5 +81,13 @@ module MoneyHeuristics
80
81
  codes.sort!
81
82
  codes
82
83
  end
84
+
85
+ def filter_methods(filters)
86
+ filtered = methods.values_at(*filters).compact
87
+
88
+ return methods.values if filtered.empty?
89
+
90
+ filtered
91
+ end
83
92
  end
84
93
  end
@@ -10,10 +10,10 @@ module MoneyHeuristics
10
10
  # currency in an entire sentence
11
11
  #
12
12
  # Returns: Array (matched results)
13
- def analyze(str)
13
+ def analyze(str, filters: [])
14
14
  @_heuristics_search_tree ||= MoneyHeuristics::SearchTree.new(table).build
15
15
 
16
- return MoneyHeuristics::Analyzer.new(str, @_heuristics_search_tree).process
16
+ return MoneyHeuristics::Analyzer.new(str, @_heuristics_search_tree).process(filters)
17
17
  end
18
18
  end
19
19
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module MoneyHeuristics
2
- VERSION = '0.1.1'
4
+ VERSION = '1.0.0'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'money/currency'
2
4
 
3
5
  require 'money-heuristics/string'
@@ -1,4 +1,6 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path("lib", __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
 
4
6
  require "money-heuristics/version"
@@ -8,22 +10,24 @@ Gem::Specification.new do |s|
8
10
  s.version = MoneyHeuristics::VERSION
9
11
  s.platform = Gem::Platform::RUBY
10
12
  s.authors = ['Shane Emmons', 'Anthony Dmitriyev']
11
- s.email = ['shane@emmons.io']
13
+ s.email = ['shane@emmons.io', 'anthony.dmitriyev@gmail.com']
12
14
  s.homepage = 'https://rubymoney.github.io/money-heuristics'
13
- s.summary = 'Heuristic module for for the money gem'
14
- s.description = 'This is a module for heuristic analysis of the string input for the money gem. It was formerly part of the gem.'
15
+ s.summary = 'Heuristic module for the money gem'
16
+ s.description = 'Heuristic module for analyzing currency information from strings for the money gem. It was formerly part of the money gem.'
15
17
  s.license = 'MIT'
16
18
 
17
- s.add_dependency 'money', '>= 6.9.0'
18
19
  s.add_dependency 'sixarm_ruby_unaccent', ['>= 1.1.1', '< 2']
20
+ s.add_dependency 'money', '~> 7.0'
19
21
 
20
- s.add_development_dependency "bundler", "~> 1.3"
21
- s.add_development_dependency "rake"
22
- s.add_development_dependency "rspec", "~> 3.4.0"
23
- s.add_development_dependency "yard", "~> 0.8"
22
+ s.required_ruby_version = ">= 3.1"
24
23
 
25
- s.files = `git ls-files`.split($/)
26
- s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
27
- s.test_files = s.files.grep(%r{^(test|spec|features)/})
24
+ s.files = `git ls-files -z -- lib/* CHANGELOG.md LICENSE money-heuristics.gemspec README.md`.split("\x0")
28
25
  s.require_paths = ["lib"]
26
+
27
+ if s.respond_to?(:metadata)
28
+ s.metadata["changelog_uri"] = "https://github.com/RubyMoney/money-heuristics/blob/main/CHANGELOG.md"
29
+ s.metadata["source_code_uri"] = "https://github.com/RubyMoney/money-heuristics/"
30
+ s.metadata["bug_tracker_uri"] = "https://github.com/RubyMoney/money-heuristics/issues"
31
+ s.metadata["rubygems_mfa_required"] = "true"
32
+ end
29
33
  end
metadata CHANGED
@@ -1,30 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: money-heuristics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.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: 2017-12-12 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: money
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: 6.9.0
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- version: 6.9.0
28
13
  - !ruby/object:Gem::Dependency
29
14
  name: sixarm_ruby_unaccent
30
15
  requirement: !ruby/object:Gem::Requirement
@@ -46,79 +31,31 @@ dependencies:
46
31
  - !ruby/object:Gem::Version
47
32
  version: '2'
48
33
  - !ruby/object:Gem::Dependency
49
- name: bundler
50
- requirement: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.3'
55
- type: :development
56
- prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.3'
62
- - !ruby/object:Gem::Dependency
63
- name: rake
64
- requirement: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- type: :development
70
- prerelease: false
71
- version_requirements: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- - !ruby/object:Gem::Dependency
77
- name: rspec
78
- requirement: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 3.4.0
83
- type: :development
84
- prerelease: false
85
- version_requirements: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 3.4.0
90
- - !ruby/object:Gem::Dependency
91
- name: yard
34
+ name: money
92
35
  requirement: !ruby/object:Gem::Requirement
93
36
  requirements:
94
37
  - - "~>"
95
38
  - !ruby/object:Gem::Version
96
- version: '0.8'
97
- type: :development
39
+ version: '7.0'
40
+ type: :runtime
98
41
  prerelease: false
99
42
  version_requirements: !ruby/object:Gem::Requirement
100
43
  requirements:
101
44
  - - "~>"
102
45
  - !ruby/object:Gem::Version
103
- version: '0.8'
104
- description: This is a module for heuristic analysis of the string input for the money
105
- gem. It was formerly part of the gem.
46
+ version: '7.0'
47
+ description: Heuristic module for analyzing currency information from strings for
48
+ the money gem. It was formerly part of the money gem.
106
49
  email:
107
50
  - shane@emmons.io
51
+ - anthony.dmitriyev@gmail.com
108
52
  executables: []
109
53
  extensions: []
110
54
  extra_rdoc_files: []
111
55
  files:
112
- - ".coveralls.yml"
113
- - ".gitignore"
114
- - ".rspec"
115
- - ".travis.yml"
116
56
  - CHANGELOG.md
117
- - CONTRIBUTING.md
118
- - Gemfile
119
57
  - LICENSE
120
58
  - README.md
121
- - Rakefile
122
59
  - lib/money-heuristics.rb
123
60
  - lib/money-heuristics/analyzer.rb
124
61
  - lib/money-heuristics/heuristics.rb
@@ -126,13 +63,14 @@ files:
126
63
  - lib/money-heuristics/string.rb
127
64
  - lib/money-heuristics/version.rb
128
65
  - money-heuristics.gemspec
129
- - spec/heuristics_spec.rb
130
- - spec/spec_helper.rb
131
66
  homepage: https://rubymoney.github.io/money-heuristics
132
67
  licenses:
133
68
  - MIT
134
- metadata: {}
135
- post_install_message:
69
+ metadata:
70
+ changelog_uri: https://github.com/RubyMoney/money-heuristics/blob/main/CHANGELOG.md
71
+ source_code_uri: https://github.com/RubyMoney/money-heuristics/
72
+ bug_tracker_uri: https://github.com/RubyMoney/money-heuristics/issues
73
+ rubygems_mfa_required: 'true'
136
74
  rdoc_options: []
137
75
  require_paths:
138
76
  - lib
@@ -140,18 +78,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
78
  requirements:
141
79
  - - ">="
142
80
  - !ruby/object:Gem::Version
143
- version: '0'
81
+ version: '3.1'
144
82
  required_rubygems_version: !ruby/object:Gem::Requirement
145
83
  requirements:
146
84
  - - ">="
147
85
  - !ruby/object:Gem::Version
148
86
  version: '0'
149
87
  requirements: []
150
- rubyforge_project:
151
- rubygems_version: 2.6.8
152
- signing_key:
88
+ rubygems_version: 4.0.0
153
89
  specification_version: 4
154
- summary: Heuristic module for for the money gem
155
- test_files:
156
- - spec/heuristics_spec.rb
157
- - spec/spec_helper.rb
90
+ summary: Heuristic module for the money gem
91
+ test_files: []
data/.coveralls.yml DELETED
@@ -1 +0,0 @@
1
- repo_token: m7vyhHNz7HTqdYSL90YbygyYNMQ2JO9E2
data/.gitignore DELETED
@@ -1,23 +0,0 @@
1
- # Bundler
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
5
- bin/
6
-
7
- # Rubinius
8
- *.rbc
9
-
10
- # YARD
11
- .yardoc
12
- yardoc/
13
- doc/
14
-
15
- # Project
16
- .rbenv-version
17
- .rbx
18
- .rvmrc
19
- .ruby-version
20
- .ruby-gemset
21
-
22
- # Spec artifacts
23
- /coverage
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --require spec_helper
data/.travis.yml DELETED
@@ -1,25 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- rvm:
4
- - 2.0.0
5
- - 2.1.10
6
- - 2.2.5
7
- - 2.3.1
8
- - 2.4.0
9
- - rbx-2
10
- - jruby-9.0.5.0
11
- - jruby-9.1.2.0
12
- - ruby-head
13
- - jruby-head
14
- matrix:
15
- allow_failures:
16
- - rvm: ruby-head
17
- - rvm: jruby-head
18
- - rvm: rbx-2
19
- fast_finish: true
20
- script: bundle exec rspec spec
21
- notifications:
22
- email:
23
- - semmons99@gmail.com
24
- - andreas@aloop.org
25
- - weppos@weppos.net
data/CONTRIBUTING.md DELETED
@@ -1,17 +0,0 @@
1
- # Contribution Guidelines
2
-
3
- ## Steps
4
-
5
- 1. Fork [the repo](https://github.com/RubyMoney/money-heuristics)
6
- 2. Grab dependencies: `bundle install`
7
- 3. Make sure everything is working: `bundle exec rake spec`
8
- 4. Make your changes
9
- 5. Test your changes
10
- 5. Create a Pull Request
11
- 6. Celebrate!!!!!
12
-
13
- ## Notes
14
-
15
- When contributing, please make sure to update the CHANGELOG and AUTHORS files
16
- when you submit your pull request. Upon merging of your first pull request,
17
- you will be given commit access to the repository.
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'coveralls', '>= 0.8.20', :require => false
4
- gem 'pry', :require => false
5
-
6
- gemspec
data/Rakefile DELETED
@@ -1,17 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/clean"
3
- require "rspec/core/rake_task"
4
-
5
- CLOBBER.include('doc', '.yardoc')
6
-
7
- require "yard"
8
-
9
- YARD::Rake::YardocTask.new do |t|
10
- t.options << "--files" << "CHANGELOG.md,LICENSE"
11
- end
12
-
13
- RSpec::Core::RakeTask.new(:spec) do |t|
14
- t.fail_on_error = false
15
- end
16
-
17
- task default: :spec
@@ -1,162 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe MoneyHeuristics do
4
- describe "#analyze_string" do
5
- let(:it) { Money::Currency }
6
-
7
- it "is not affected by blank characters and numbers" do
8
- expect(it.analyze('123')).to eq []
9
- expect(it.analyze('\n123 \t')).to eq []
10
- end
11
-
12
- it "returns nothing when given nothing" do
13
- expect(it.analyze('')).to eq []
14
- expect(it.analyze(nil)).to eq []
15
- end
16
-
17
- it "finds a currency by use of its symbol" do
18
- expect(it.analyze('zł')).to eq ['PLN']
19
- end
20
-
21
- it "is not affected by trailing dot" do
22
- expect(it.analyze('zł.')).to eq ['PLN']
23
- end
24
-
25
- it "finds match even if has numbers after" do
26
- expect(it.analyze('zł 123')).to eq ['PLN']
27
- end
28
-
29
- it "finds match even if has numbers before" do
30
- expect(it.analyze('123 zł')).to eq ['PLN']
31
- end
32
-
33
- it "find match even if symbol is next to number" do
34
- expect(it.analyze('300zł')).to eq ['PLN']
35
- end
36
-
37
- it "finds match even if has numbers with delimiters" do
38
- expect(it.analyze('zł 123,000.50')).to eq ['PLN']
39
- expect(it.analyze('zł123,000.50')).to eq ['PLN']
40
- end
41
-
42
- it "finds currencies with dots in symbols" do
43
- expect(it.analyze('L.E.')).to eq ['EGP']
44
- end
45
-
46
- it "finds by name" do
47
- expect(it.analyze('1900 bulgarian lev')).to eq ['BGN']
48
- expect(it.analyze('Swedish Krona')).to eq ['SEK']
49
- end
50
-
51
- it "Finds several currencies when several match" do
52
- r = it.analyze('$400')
53
- expect(r).to include("ARS")
54
- expect(r).to include("USD")
55
- expect(r).to include("NZD")
56
-
57
- r = it.analyze('9000 £')
58
- expect(r).to include("GBP")
59
- expect(r).to include("SHP")
60
- expect(r).to include("SYP")
61
- end
62
-
63
- it "should use alternate symbols" do
64
- expect(it.analyze('US$')).to eq ['USD']
65
- end
66
-
67
- it "finds a currency by use of its iso code" do
68
- expect(it.analyze('USD 200')).to eq ['USD']
69
- end
70
-
71
- it "finds currencies in the middle of a sentence!" do
72
- expect(it.analyze('It would be nice to have 10000 Albanian lek by tomorrow!')).to eq ['ALL']
73
- end
74
-
75
- it "finds several currencies in the same text!" do
76
- expect(it.analyze("10EUR is less than 100:- but really, I want US$1")).to eq ['EUR', 'SEK', 'USD']
77
- end
78
-
79
- it "find currencies with normal characters in name using unaccent" do
80
- expect(it.analyze("10 Nicaraguan Cordoba")).to eq ["NIO"]
81
- end
82
-
83
- it "find currencies with special characters in name using unaccent" do
84
- expect(it.analyze("10 Nicaraguan Córdoba")).to eq ["NIO"]
85
- end
86
-
87
- it "find currencies with special symbols using unaccent" do
88
- expect(it.analyze("ل.س")).not_to eq []
89
- expect(it.analyze("R₣")).not_to eq []
90
- expect(it.analyze("ரூ")).not_to eq []
91
- expect(it.analyze("රු")).not_to eq []
92
- expect(it.analyze("сом")).not_to eq []
93
- expect(it.analyze("圓")).not_to eq []
94
- expect(it.analyze("円")).not_to eq []
95
- expect(it.analyze("৳")).not_to eq []
96
- expect(it.analyze("૱")).not_to eq []
97
- expect(it.analyze("௹")).not_to eq []
98
- expect(it.analyze("रु")).not_to eq []
99
- expect(it.analyze("ש״ח")).not_to eq []
100
- expect(it.analyze("元")).not_to eq []
101
- expect(it.analyze("¢")).not_to eq []
102
- expect(it.analyze("£")).not_to eq []
103
- expect(it.analyze("€")).not_to eq []
104
- expect(it.analyze("¥")).not_to eq []
105
- expect(it.analyze("د.إ")).not_to eq []
106
- expect(it.analyze("؋")).not_to eq []
107
- expect(it.analyze("դր.")).not_to eq []
108
- expect(it.analyze("ƒ")).not_to eq []
109
- expect(it.analyze("₼")).not_to eq []
110
- expect(it.analyze("৳")).not_to eq []
111
- expect(it.analyze("лв")).not_to eq []
112
- expect(it.analyze("лев")).not_to eq []
113
- expect(it.analyze("дин")).not_to eq []
114
- expect(it.analyze("ب.د")).not_to eq []
115
- expect(it.analyze("₡")).not_to eq []
116
- expect(it.analyze("Kč")).not_to eq []
117
- expect(it.analyze("د.ج")).not_to eq []
118
- expect(it.analyze("ج.م")).not_to eq []
119
- expect(it.analyze("ლ")).not_to eq []
120
- expect(it.analyze("₵")).not_to eq []
121
- expect(it.analyze("₪")).not_to eq []
122
- expect(it.analyze("₹")).not_to eq []
123
- expect(it.analyze("ع.د")).not_to eq []
124
- expect(it.analyze("﷼")).not_to eq []
125
- expect(it.analyze("د.ا")).not_to eq []
126
- expect(it.analyze("៛")).not_to eq []
127
- expect(it.analyze("₩")).not_to eq []
128
- expect(it.analyze("د.ك")).not_to eq []
129
- expect(it.analyze("₸")).not_to eq []
130
- expect(it.analyze("₭")).not_to eq []
131
- expect(it.analyze("ل.ل")).not_to eq []
132
- expect(it.analyze("₨")).not_to eq []
133
- expect(it.analyze("ل.د")).not_to eq []
134
- expect(it.analyze("د.م.")).not_to eq []
135
- expect(it.analyze("ден")).not_to eq []
136
- expect(it.analyze("₮")).not_to eq []
137
- expect(it.analyze("₦")).not_to eq []
138
- expect(it.analyze("C$")).not_to eq []
139
- expect(it.analyze("ر.ع.")).not_to eq []
140
- expect(it.analyze("₱")).not_to eq []
141
- expect(it.analyze("zł")).not_to eq []
142
- expect(it.analyze("₲")).not_to eq []
143
- expect(it.analyze("ر.ق")).not_to eq []
144
- expect(it.analyze("РСД")).not_to eq []
145
- expect(it.analyze("₽")).not_to eq []
146
- expect(it.analyze("ر.س")).not_to eq []
147
- expect(it.analyze("฿")).not_to eq []
148
- expect(it.analyze("د.ت")).not_to eq []
149
- expect(it.analyze("T$")).not_to eq []
150
- expect(it.analyze("₺")).not_to eq []
151
- expect(it.analyze("₴")).not_to eq []
152
- expect(it.analyze("₫")).not_to eq []
153
- expect(it.analyze("B⃦")).not_to eq []
154
- expect(it.analyze("₤")).not_to eq []
155
- expect(it.analyze("ރ")).not_to eq []
156
- end
157
-
158
- it "should function with unicode characters" do
159
- expect(it.analyze("10 դր.")).to eq ["AMD"]
160
- end
161
- end
162
- end
data/spec/spec_helper.rb DELETED
@@ -1,13 +0,0 @@
1
- require 'coveralls'
2
- Coveralls.wear!
3
-
4
- $LOAD_PATH.unshift File.dirname(__FILE__)
5
-
6
- require 'rspec'
7
- require 'money-heuristics'
8
-
9
- RSpec.configure do |c|
10
- c.order = :random
11
- c.filter_run :focus
12
- c.run_all_when_everything_filtered = true
13
- end