numbers_in_words 0.2.0 → 0.5.1
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 +7 -0
- data/.codeclimate.yml +14 -0
- data/.gitignore +2 -0
- data/.rspec +2 -0
- data/.rubocop.yml +58 -0
- data/.travis.yml +15 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +50 -26
- data/README.md +20 -70
- data/Rakefile +3 -1
- data/bin/spec +2 -0
- data/lib/numbers_in_words.rb +49 -15
- data/lib/numbers_in_words/duck_punch.rb +12 -8
- data/lib/numbers_in_words/exceptional_numbers.rb +115 -0
- data/lib/numbers_in_words/fraction.rb +136 -0
- data/lib/numbers_in_words/number_group.rb +34 -25
- data/lib/numbers_in_words/parsing/fraction_parsing.rb +34 -0
- data/lib/numbers_in_words/parsing/number_parser.rb +98 -0
- data/lib/numbers_in_words/parsing/pair_parsing.rb +64 -0
- data/lib/numbers_in_words/parsing/parse_fractions.rb +45 -0
- data/lib/numbers_in_words/parsing/parse_individual_number.rb +68 -0
- data/lib/numbers_in_words/parsing/parse_status.rb +17 -0
- data/lib/numbers_in_words/parsing/special.rb +67 -0
- data/lib/numbers_in_words/parsing/to_number.rb +77 -0
- data/lib/numbers_in_words/powers_of_ten.rb +49 -0
- data/lib/numbers_in_words/to_word.rb +78 -13
- data/lib/numbers_in_words/version.rb +3 -1
- data/lib/numbers_in_words/writer.rb +69 -0
- data/numbers_in_words.gemspec +15 -14
- data/spec/exceptional_numbers_spec.rb +26 -0
- data/spec/fraction_spec.rb +152 -0
- data/spec/fractions_spec.rb +31 -0
- data/spec/non_monkey_patch_spec.rb +51 -0
- data/spec/number_group_spec.rb +12 -12
- data/spec/number_parser_spec.rb +31 -0
- data/spec/numbers_in_words_spec.rb +74 -54
- data/spec/numerical_strings_spec.rb +35 -0
- data/spec/spec_helper.rb +24 -0
- data/spec/to_word_spec.rb +18 -0
- data/spec/words_in_numbers_spec.rb +135 -117
- data/spec/writer_spec.rb +26 -0
- data/spec/years_spec.rb +27 -0
- metadata +61 -59
- data/lib/numbers_in_words/english/constants.rb +0 -93
- data/lib/numbers_in_words/english/language_writer_english.rb +0 -107
- data/lib/numbers_in_words/language_writer.rb +0 -31
- data/lib/numbers_in_words/number_parser.rb +0 -81
- data/lib/numbers_in_words/to_number.rb +0 -82
- data/spec/language_writer_spec.rb +0 -23
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require './spec/spec_helper'
|
4
|
+
|
5
|
+
describe NumbersInWords do
|
6
|
+
it 'recognizes numerical strings' do
|
7
|
+
arr = %w[8 56 100 5789 3435356]
|
8
|
+
arr.each { |s| expect(s.in_numbers).to eql(s.to_f) }
|
9
|
+
end
|
10
|
+
|
11
|
+
MIXED = {
|
12
|
+
'19 hundred' => 1_900,
|
13
|
+
'20 thousand' => 20_000,
|
14
|
+
'100 million' => 100_000_000,
|
15
|
+
'7 billion' => 7_000_000_000,
|
16
|
+
'42 trillion' => 42_000_000_000_000,
|
17
|
+
'20 thousand and 4' => 20_004
|
18
|
+
}.freeze
|
19
|
+
|
20
|
+
MIXED.each do |k, v|
|
21
|
+
it do
|
22
|
+
expect(k.in_numbers).to eql(v)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
PENDING_MIXED = {
|
27
|
+
'19 zero five' => 1_905
|
28
|
+
}.freeze
|
29
|
+
|
30
|
+
PENDING_MIXED.each do |k, v|
|
31
|
+
pending do
|
32
|
+
expect(k.in_numbers).to eql(v)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,2 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
if ENV['CC_TEST_REPORTER_ID']
|
4
|
+
require 'simplecov'
|
5
|
+
SimpleCov.start
|
6
|
+
end
|
7
|
+
|
8
|
+
unless Kernel.method_defined?(:silence_warnings)
|
9
|
+
module Kernel
|
10
|
+
def silence_warnings
|
11
|
+
with_warnings(nil) { yield }
|
12
|
+
end
|
13
|
+
|
14
|
+
def with_warnings(flag)
|
15
|
+
old_verbose = $VERBOSE
|
16
|
+
$VERBOSE = flag
|
17
|
+
yield
|
18
|
+
ensure
|
19
|
+
$VERBOSE = old_verbose
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
1
24
|
require 'numbers_in_words'
|
2
25
|
require 'numbers_in_words/duck_punch'
|
26
|
+
require 'byebug'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe NumbersInWords::ToWord do
|
4
|
+
let(:number) { 2_111 }
|
5
|
+
let(:writer) { described_class.new(number) }
|
6
|
+
|
7
|
+
describe '#in_words' do
|
8
|
+
let(:number) { 99 }
|
9
|
+
|
10
|
+
subject do
|
11
|
+
writer.in_words
|
12
|
+
end
|
13
|
+
|
14
|
+
it do
|
15
|
+
expect(subject).to eq 'ninety-nine'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,134 +1,152 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require './spec/spec_helper'
|
2
4
|
|
3
|
-
describe
|
4
|
-
it
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
describe NumbersInWords::StringExtension do # rubocop: disable Metrics/BlockLength
|
6
|
+
it 'should do the digits 0-10' do
|
7
|
+
expect('zero'.in_numbers).to eq(0)
|
8
|
+
expect('one'.in_numbers).to eq(1)
|
9
|
+
expect('two'.in_numbers).to eq(2)
|
10
|
+
expect('three'.in_numbers).to eq(3)
|
11
|
+
expect('four'.in_numbers).to eq(4)
|
12
|
+
expect('five'.in_numbers).to eq(5)
|
13
|
+
expect('six'.in_numbers).to eq(6)
|
14
|
+
expect('seven'.in_numbers).to eq(7)
|
15
|
+
expect('eight'.in_numbers).to eq(8)
|
16
|
+
expect('nine'.in_numbers).to eq(9)
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should handle numbers for which there is one word' do
|
20
|
+
expect('ten'.in_numbers).to eq(10)
|
21
|
+
expect('eleven'.in_numbers).to eq(11)
|
22
|
+
expect('twelve'.in_numbers).to eq(12)
|
23
|
+
expect('thirteen'.in_numbers).to eq(13)
|
24
|
+
expect('fourteen'.in_numbers).to eq(14)
|
25
|
+
expect('fifteen'.in_numbers).to eq(15)
|
26
|
+
expect('sixteen'.in_numbers).to eq(16)
|
27
|
+
expect('seventeen'.in_numbers).to eq(17)
|
28
|
+
expect('eighteen'.in_numbers).to eq(18)
|
29
|
+
expect('nineteen'.in_numbers).to eq(19)
|
30
|
+
expect('twenty'.in_numbers).to eq(20)
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should handle two word numbers up to 100' do
|
34
|
+
expect('twenty-one'.in_numbers).to eq(21)
|
35
|
+
expect('twenty-two'.in_numbers).to eq(22)
|
36
|
+
expect('twenty-three'.in_numbers).to eq(23)
|
37
|
+
expect('twenty-four'.in_numbers).to eq(24)
|
38
|
+
expect('twenty-five'.in_numbers).to eq(25)
|
39
|
+
expect('twenty-six'.in_numbers).to eq(26)
|
40
|
+
expect('twenty-seven'.in_numbers).to eq(27)
|
41
|
+
expect('twenty-eight'.in_numbers).to eq(28)
|
42
|
+
expect('seventy-six'.in_numbers).to eq(76)
|
43
|
+
expect('ninety-nine'.in_numbers).to eq(99)
|
15
44
|
end
|
16
45
|
|
17
|
-
it
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
"seventeen" .in_numbers.should == 17
|
26
|
-
"eighteen" .in_numbers.should == 18
|
27
|
-
"nineteen" .in_numbers.should == 19
|
28
|
-
"twenty" .in_numbers.should == 20
|
46
|
+
it 'should handle hundreds' do
|
47
|
+
expect('one hundred'.in_numbers).to eq(100)
|
48
|
+
expect('two hundred'.in_numbers).to eq(200)
|
49
|
+
expect('three hundred'.in_numbers).to eq(300)
|
50
|
+
expect('nine hundred'.in_numbers).to eq(900)
|
51
|
+
expect('one hundred and seventy six'.in_numbers).to eq(176)
|
52
|
+
expect('one hundred and seventy nine'.in_numbers).to eq(179)
|
53
|
+
expect('nine hundred and ninety nine'.in_numbers).to eq(999)
|
29
54
|
end
|
30
55
|
|
31
|
-
it
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
56
|
+
it 'should handle unusual hundreds' do
|
57
|
+
expect('eleven hundred'.in_numbers).to eq(1100)
|
58
|
+
expect('twelve hundred'.in_numbers).to eq(1200)
|
59
|
+
expect('thirteen hundred'.in_numbers).to eq(1300)
|
60
|
+
expect('fifteen hundred'.in_numbers).to eq(1500)
|
61
|
+
expect('nineteen hundred'.in_numbers).to eq(1900)
|
62
|
+
end
|
63
|
+
it 'should handle thousands' do
|
64
|
+
expect('two thousand and one'.in_numbers).to eq(2001)
|
65
|
+
expect('one thousand'.in_numbers).to eq(1000)
|
66
|
+
expect('two thousand'.in_numbers).to eq(2000)
|
67
|
+
expect('three thousand'.in_numbers).to eq(3000)
|
68
|
+
expect('nine thousand'.in_numbers).to eq(9000)
|
69
|
+
expect('nine thousand two hundred'.in_numbers).to eq(9200)
|
70
|
+
expect('nine thousand two hundred and seven'.in_numbers).to eq(9207)
|
71
|
+
expect('nine thousand two hundred and ninety seven'.in_numbers).to eq(9297)
|
42
72
|
end
|
43
73
|
|
44
|
-
it
|
45
|
-
|
46
|
-
|
47
|
-
"three hundred" .in_numbers.should == 300
|
48
|
-
"nine hundred" .in_numbers.should == 900
|
49
|
-
"one hundred and seventy six" .in_numbers.should == 176
|
50
|
-
"one hundred and seventy nine" .in_numbers.should == 179
|
51
|
-
"nine hundred and ninety nine" .in_numbers.should == 999
|
74
|
+
it 'handles numbers that begin with a instead of one', :aggregate_failures do
|
75
|
+
expect('a thousand six hundred'.in_numbers).to eq(1600)
|
76
|
+
expect('a thousand six hundred and fifty-five'.in_numbers).to eq(1655)
|
52
77
|
end
|
53
78
|
|
54
|
-
it
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
79
|
+
it 'should handle larger numbers' do
|
80
|
+
expect('one million'.in_numbers).to eq(1_000_000)
|
81
|
+
expect('two googol five billion and seventy six'.in_numbers).to eq(2 * 10**100 + 5 * 10**9 + 76)
|
82
|
+
expect('thirty seven million'.in_numbers).to eq(37 * 10**6)
|
83
|
+
expect('twenty six googol'.in_numbers).to eq(26 * 10**100)
|
84
|
+
end
|
60
85
|
|
86
|
+
it 'should handle numbers in hundreds of thousands etc' do
|
87
|
+
expect('nine hundred thousand'.in_numbers).to eq(900_000)
|
88
|
+
expect('three hundred and fifty seven thousand'.in_numbers).to eq(357_000)
|
89
|
+
expect('five million three hundred and fifty seven thousand'.in_numbers).to eq(5_357_000)
|
90
|
+
expect('nine hundred and ninety nine trillion'.in_numbers).to eq(999 * 10**12)
|
91
|
+
end
|
92
|
+
it 'should handle negative numbers' do
|
93
|
+
expect('minus one'.in_numbers).to eq(-1)
|
94
|
+
expect('minus two googol'.in_numbers).to eq(-2 * 10**100)
|
95
|
+
expect('minus nine hundred and ninety nine trillion'.in_numbers).to eq(-999 * 10**12)
|
61
96
|
end
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
"three
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
end
|
98
|
-
|
99
|
-
it "should handle decimal points" do
|
100
|
-
"one point one" .in_numbers .should == 1.1
|
101
|
-
|
102
|
-
"zero point seven six five three four" .in_numbers .should == 0.76534
|
103
|
-
"one trillion point six" .in_numbers .should == 10**12 + 0.6
|
104
|
-
|
105
|
-
long_number = <<-NUMBER
|
106
|
-
nine duotrigintillion seven hundred and seventy seven untrigintillion
|
107
|
-
fifty nine trigintillion one hundred and sixty novemvigintillion
|
108
|
-
eight hundred and six octovigintillion seven hundred and thirty six
|
109
|
-
septenvigintillion four hundred and seventy one sexvigintillion
|
110
|
-
nine hundred and seventy quinvigintillion six hundred and thirty two
|
111
|
-
quattuorvigintillion eight hundred and twenty seven trevigintillion
|
112
|
-
eight hundred and thirty six duovigintillion nine hundred and fifty
|
113
|
-
two unvigintillion seven hundred and ten vigintillion eight hundred and one
|
114
|
-
novemdecillion nine hundred and forty eight octodecillion seven hundred
|
115
|
-
and five septendecillion six hundred and eighty three sexdecillion
|
116
|
-
one hundred and six quindecillion seven hundred and seven quattuordecillion
|
117
|
-
seven hundred and fifty seven tredecillion four hundred and twenty six
|
118
|
-
duodecillion seven hundred and ninety five undecillion seven hundred
|
119
|
-
and forty six decillion eight hundred and thirteen nonillion one hundred
|
120
|
-
and twenty seven octillion four hundred and sixty five septillion two
|
121
|
-
hundred and thirty seven sextillion one hundred and thirty nine
|
122
|
-
quintillion one hundred and fifty three quadrillion forty six
|
123
|
-
trillion seven hundred and fifty two billion eight hundred and three
|
124
|
-
million ninety three thousand seven hundred and ninety one point
|
125
|
-
eight nine five six four three two one eight nine five six seven eight
|
97
|
+
|
98
|
+
it 'should ignore punctuation and capitalisation' do
|
99
|
+
expect('Minus one'.in_numbers).to eq(-1)
|
100
|
+
expect('FIVE Million, three hundred and fifty-seVen Thousand'.in_numbers).to eq(5_357_000)
|
101
|
+
expect("FIVE,,./';';';[] Million, three hundred and fifty-seVen Thousand".in_numbers).to eq(5_357_000)
|
102
|
+
end
|
103
|
+
|
104
|
+
it 'should handle decimal points' do # rubocop: disable Metrics/BlockLength
|
105
|
+
expect('one point one'.in_numbers).to eq(1.1)
|
106
|
+
|
107
|
+
expect('zero point seven six five three four'.in_numbers).to eq(0.76534)
|
108
|
+
expect('one trillion point six'.in_numbers).to eq(10**12 + 0.6)
|
109
|
+
|
110
|
+
long_number = <<~NUMBER
|
111
|
+
nine duotrigintillion seven hundred and seventy seven untrigintillion
|
112
|
+
fifty nine trigintillion one hundred and sixty novemvigintillion
|
113
|
+
eight hundred and six octovigintillion seven hundred and thirty six
|
114
|
+
septenvigintillion four hundred and seventy one sexvigintillion
|
115
|
+
nine hundred and seventy quinvigintillion six hundred and thirty two
|
116
|
+
quattuorvigintillion eight hundred and twenty seven trevigintillion
|
117
|
+
eight hundred and thirty six duovigintillion nine hundred and fifty
|
118
|
+
two unvigintillion seven hundred and ten vigintillion eight hundred and one
|
119
|
+
novemdecillion nine hundred and forty eight octodecillion seven hundred
|
120
|
+
and five septendecillion six hundred and eighty three sexdecillion
|
121
|
+
one hundred and six quindecillion seven hundred and seven quattuordecillion
|
122
|
+
seven hundred and fifty seven tredecillion four hundred and twenty six
|
123
|
+
duodecillion seven hundred and ninety five undecillion seven hundred
|
124
|
+
and forty six decillion eight hundred and thirteen nonillion one hundred
|
125
|
+
and twenty seven octillion four hundred and sixty five septillion two
|
126
|
+
hundred and thirty seven sextillion one hundred and thirty nine
|
127
|
+
quintillion one hundred and fifty three quadrillion forty six
|
128
|
+
trillion seven hundred and fifty two billion eight hundred and three
|
129
|
+
million ninety three thousand seven hundred and ninety one point
|
130
|
+
eight nine five six four three two one eight nine five six seven eight
|
126
131
|
NUMBER
|
127
|
-
long_number.in_numbers.should ==
|
128
|
-
9777059160806736471970632827836952710801948705683106707757426795746813127465237139153046752803093791.89564321895678
|
129
132
|
|
130
|
-
|
131
|
-
|
133
|
+
# rubocop: disable Metrics/LineLength
|
134
|
+
expect(long_number.in_numbers).to eq(
|
135
|
+
9_777_059_160_806_736_471_970_632_827_836_952_710_801_948_705_683_106_707_757_426_795_746_813_127_465_237_139_153_046_752_803_093_791.89564321895678
|
136
|
+
)
|
137
|
+
# rubocop: enable Metrics/LineLength
|
138
|
+
|
139
|
+
expect('seventy five point eight four three two seven six nine four five one eight'
|
140
|
+
.in_numbers).to eq(75.84327694518)
|
132
141
|
end
|
133
142
|
|
143
|
+
it 'should handle years notation' do
|
144
|
+
expect('fifteen sixteen'.in_numbers).to eq(1516)
|
145
|
+
expect('eighty five sixteen'.in_numbers).to eq(8516)
|
146
|
+
expect('nineteen ninety six'.in_numbers).to eq(1996)
|
147
|
+
expect('forty nine ninety eight forty seven seventy nine'.in_numbers).to eq(49_984_779)
|
148
|
+
expect('fifteen sixteen'.in_numbers).to eq(1516)
|
149
|
+
expect('fifteen sixteen seven'.in_numbers).to eq(15_167)
|
150
|
+
expect('fifteen sixteen seventeen'.in_numbers).to eq(151_617)
|
151
|
+
end
|
134
152
|
end
|
data/spec/writer_spec.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe NumbersInWords::Writer do
|
4
|
+
let(:number) { 2_111 }
|
5
|
+
let(:writer) { described_class.new(number) }
|
6
|
+
|
7
|
+
it 'should display numbers grouped' do
|
8
|
+
count = 0
|
9
|
+
|
10
|
+
writer.group_words(3) do |power, name, digits|
|
11
|
+
case count
|
12
|
+
when 0
|
13
|
+
expect(power).to eq(3)
|
14
|
+
expect(name).to eq('thousand')
|
15
|
+
expect(digits).to eq(2)
|
16
|
+
when 1
|
17
|
+
expect(power).to eq(0)
|
18
|
+
expect(name).to eq('one')
|
19
|
+
expect(digits).to eq(111)
|
20
|
+
end
|
21
|
+
count += 1
|
22
|
+
end
|
23
|
+
|
24
|
+
expect(count).to eq 2
|
25
|
+
end
|
26
|
+
end
|
data/spec/years_spec.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require './spec/spec_helper'
|
4
|
+
|
5
|
+
describe NumbersInWords::NumericExtension do
|
6
|
+
YEARS = {
|
7
|
+
'thirteen hundred' => 13_00,
|
8
|
+
'twenty-two hundred' => 22_00,
|
9
|
+
'twenty-two hundred and five' => 22_05,
|
10
|
+
'fifteen sixteen seventeen' => 151_617,
|
11
|
+
'forty-nine ninety-eight forty-seven seventy-nine' => 49_984_779,
|
12
|
+
'one fifty' => 150,
|
13
|
+
'two fifty' => 250,
|
14
|
+
'three fifty' => 350,
|
15
|
+
'one point fifty-six fifty-seven' => 1.5657,
|
16
|
+
'one three forty-seven' => 1347,
|
17
|
+
'one three five-point forty-seven' => 135.47,
|
18
|
+
'one ten sixty-three' => 11_063,
|
19
|
+
'one nineteen ten oh five' => 1_191_005
|
20
|
+
}.freeze
|
21
|
+
|
22
|
+
YEARS.each do |k, v|
|
23
|
+
it do
|
24
|
+
expect(k.in_numbers).to eql(v)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,127 +1,129 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: numbers_in_words
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.2.0
|
4
|
+
version: 0.5.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Mark Burns
|
8
|
+
- Dimid Duchovny
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-08-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
|
16
|
-
version_requirements: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
name: activesupport
|
23
|
-
prerelease: false
|
15
|
+
name: rspec
|
24
16
|
requirement: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
17
|
requirements:
|
27
|
-
- -
|
18
|
+
- - "~>"
|
28
19
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
30
|
-
- !ruby/object:Gem::Dependency
|
20
|
+
version: 3.4.0
|
31
21
|
type: :development
|
22
|
+
prerelease: false
|
32
23
|
version_requirements: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
24
|
requirements:
|
35
|
-
- -
|
25
|
+
- - "~>"
|
36
26
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
38
|
-
|
39
|
-
|
27
|
+
version: 3.4.0
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rubocop
|
40
30
|
requirement: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
31
|
requirements:
|
43
|
-
- -
|
32
|
+
- - ">="
|
44
33
|
- !ruby/object:Gem::Version
|
45
34
|
version: '0'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
35
|
type: :development
|
48
|
-
version_requirements: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
name: debugger
|
55
36
|
prerelease: false
|
56
|
-
|
57
|
-
none: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
38
|
requirements:
|
59
|
-
- -
|
39
|
+
- - ">="
|
60
40
|
- !ruby/object:Gem::Version
|
61
41
|
version: '0'
|
62
|
-
description:
|
42
|
+
description: convert written numbers into Integers and vice-versa
|
63
43
|
email:
|
64
44
|
- markthedeveloper@gmail.com
|
65
|
-
|
45
|
+
- dimidd@gmail.com
|
46
|
+
executables:
|
47
|
+
- spec
|
66
48
|
extensions: []
|
67
49
|
extra_rdoc_files: []
|
68
50
|
files:
|
69
|
-
- .
|
51
|
+
- ".codeclimate.yml"
|
52
|
+
- ".gitignore"
|
53
|
+
- ".rspec"
|
54
|
+
- ".rubocop.yml"
|
55
|
+
- ".travis.yml"
|
70
56
|
- Gemfile
|
71
57
|
- Gemfile.lock
|
72
58
|
- LICENSE.txt
|
73
59
|
- README.md
|
74
60
|
- Rakefile
|
61
|
+
- bin/spec
|
75
62
|
- lib/numbers_in_words.rb
|
76
63
|
- lib/numbers_in_words/duck_punch.rb
|
77
|
-
- lib/numbers_in_words/
|
78
|
-
- lib/numbers_in_words/
|
79
|
-
- lib/numbers_in_words/language_writer.rb
|
64
|
+
- lib/numbers_in_words/exceptional_numbers.rb
|
65
|
+
- lib/numbers_in_words/fraction.rb
|
80
66
|
- lib/numbers_in_words/number_group.rb
|
81
|
-
- lib/numbers_in_words/
|
82
|
-
- lib/numbers_in_words/
|
67
|
+
- lib/numbers_in_words/parsing/fraction_parsing.rb
|
68
|
+
- lib/numbers_in_words/parsing/number_parser.rb
|
69
|
+
- lib/numbers_in_words/parsing/pair_parsing.rb
|
70
|
+
- lib/numbers_in_words/parsing/parse_fractions.rb
|
71
|
+
- lib/numbers_in_words/parsing/parse_individual_number.rb
|
72
|
+
- lib/numbers_in_words/parsing/parse_status.rb
|
73
|
+
- lib/numbers_in_words/parsing/special.rb
|
74
|
+
- lib/numbers_in_words/parsing/to_number.rb
|
75
|
+
- lib/numbers_in_words/powers_of_ten.rb
|
83
76
|
- lib/numbers_in_words/to_word.rb
|
84
77
|
- lib/numbers_in_words/version.rb
|
78
|
+
- lib/numbers_in_words/writer.rb
|
85
79
|
- numbers_in_words.gemspec
|
86
|
-
- spec/
|
80
|
+
- spec/exceptional_numbers_spec.rb
|
81
|
+
- spec/fraction_spec.rb
|
82
|
+
- spec/fractions_spec.rb
|
83
|
+
- spec/non_monkey_patch_spec.rb
|
87
84
|
- spec/number_group_spec.rb
|
85
|
+
- spec/number_parser_spec.rb
|
88
86
|
- spec/numbers_in_words_spec.rb
|
87
|
+
- spec/numerical_strings_spec.rb
|
89
88
|
- spec/spec_helper.rb
|
89
|
+
- spec/to_word_spec.rb
|
90
90
|
- spec/words_in_numbers_spec.rb
|
91
|
+
- spec/writer_spec.rb
|
92
|
+
- spec/years_spec.rb
|
91
93
|
homepage: http://github.com/markburns/numbers_in_words
|
92
94
|
licenses: []
|
95
|
+
metadata: {}
|
93
96
|
post_install_message:
|
94
97
|
rdoc_options: []
|
95
98
|
require_paths:
|
96
99
|
- lib
|
97
100
|
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
101
|
requirements:
|
100
|
-
- -
|
102
|
+
- - ">="
|
101
103
|
- !ruby/object:Gem::Version
|
102
|
-
segments:
|
103
|
-
- 0
|
104
|
-
hash: -1513551754306869579
|
105
104
|
version: '0'
|
106
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
-
none: false
|
108
106
|
requirements:
|
109
|
-
- -
|
107
|
+
- - ">="
|
110
108
|
- !ruby/object:Gem::Version
|
111
|
-
segments:
|
112
|
-
- 0
|
113
|
-
hash: -1513551754306869579
|
114
109
|
version: '0'
|
115
110
|
requirements: []
|
116
|
-
|
117
|
-
rubygems_version: 1.8.23
|
111
|
+
rubygems_version: 3.0.3
|
118
112
|
signing_key:
|
119
|
-
specification_version:
|
120
|
-
summary:
|
121
|
-
point eight"
|
113
|
+
specification_version: 4
|
114
|
+
summary: 'Example: NumbersInWords.in_words(123) # => "one hundred and twenty three",
|
115
|
+
NumbersInWords.in_numbers("seventy-five point eight") # = > 75.8'
|
122
116
|
test_files:
|
123
|
-
- spec/
|
117
|
+
- spec/exceptional_numbers_spec.rb
|
118
|
+
- spec/fraction_spec.rb
|
119
|
+
- spec/fractions_spec.rb
|
120
|
+
- spec/non_monkey_patch_spec.rb
|
124
121
|
- spec/number_group_spec.rb
|
122
|
+
- spec/number_parser_spec.rb
|
125
123
|
- spec/numbers_in_words_spec.rb
|
124
|
+
- spec/numerical_strings_spec.rb
|
126
125
|
- spec/spec_helper.rb
|
126
|
+
- spec/to_word_spec.rb
|
127
127
|
- spec/words_in_numbers_spec.rb
|
128
|
+
- spec/writer_spec.rb
|
129
|
+
- spec/years_spec.rb
|