numbers_and_words 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +8 -8
  2. data/README.rdoc +7 -2
  3. data/lib/numbers_and_words/core_ext/array.rb +1 -1
  4. data/lib/numbers_and_words/i18n/locales/numbers.en-GB.yml +55 -0
  5. data/lib/numbers_and_words/strategies/array_joiner.rb +5 -13
  6. data/lib/numbers_and_words/strategies/array_joiner/languages.rb +27 -0
  7. data/lib/numbers_and_words/strategies/array_joiner/languages/base.rb +24 -0
  8. data/lib/numbers_and_words/strategies/array_joiner/languages/en.rb +10 -0
  9. data/lib/numbers_and_words/strategies/array_joiner/languages/en_gb.rb +17 -0
  10. data/lib/numbers_and_words/strategies/array_joiner/languages/families/base.rb +24 -0
  11. data/lib/numbers_and_words/strategies/array_joiner/languages/hu.rb +10 -0
  12. data/lib/numbers_and_words/strategies/array_joiner/languages/ru.rb +10 -0
  13. data/lib/numbers_and_words/strategies/array_joiner/languages/ua.rb +10 -0
  14. data/lib/numbers_and_words/strategies/figures_converter/decorators.rb +2 -1
  15. data/lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb +3 -3
  16. data/lib/numbers_and_words/strategies/figures_converter/decorators/en_gb.rb +3 -0
  17. data/lib/numbers_and_words/strategies/figures_converter/decorators/en_gb/base.rb +12 -0
  18. data/lib/numbers_and_words/strategies/figures_converter/decorators/en_gb/fractional.rb +27 -0
  19. data/lib/numbers_and_words/strategies/figures_converter/decorators/en_gb/integral.rb +12 -0
  20. data/lib/numbers_and_words/strategies/figures_converter/languages.rb +2 -1
  21. data/lib/numbers_and_words/strategies/figures_converter/languages/en_gb.rb +10 -0
  22. data/lib/numbers_and_words/strategies/figures_converter/options.rb +2 -1
  23. data/lib/numbers_and_words/strategies/figures_converter/options/en_gb.rb +4 -0
  24. data/lib/numbers_and_words/strategies/figures_converter/options/en_gb/hundreds_with_union.rb +12 -0
  25. data/lib/numbers_and_words/strategies/figures_converter/options/en_gb/ordinal.rb +12 -0
  26. data/lib/numbers_and_words/strategies/figures_converter/options/en_gb/remove_hyphen.rb +12 -0
  27. data/lib/numbers_and_words/strategies/figures_converter/options/en_gb/remove_zero.rb +12 -0
  28. data/lib/numbers_and_words/strategies/figures_converter/options/hu.rb +1 -1
  29. data/lib/numbers_and_words/strategies/figures_converter/options/ru.rb +1 -1
  30. data/lib/numbers_and_words/strategies/figures_converter/options/ua.rb +1 -1
  31. data/lib/numbers_and_words/translations.rb +6 -1
  32. data/lib/numbers_and_words/translations/en_gb.rb +6 -0
  33. data/lib/numbers_and_words/version.rb +1 -1
  34. data/lib/numbers_and_words/wrappers/float.rb +1 -1
  35. metadata +22 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWMwNTZhNWNiNTg4YmY1ZTVjZTMyNzg3YzJlMmY5ZmUwM2JjNTc2YQ==
4
+ NDgyNjU0NDljYTg3YzBkZDZlNGNlYmFmM2Q5YWJiYTBjYmYyYTc4NQ==
5
5
  data.tar.gz: !binary |-
6
- NTUyODhiODdlMjVkYjk3YTQxYzllM2JkZWU3YWE3MTdkY2JlZGNmYQ==
6
+ YjVhYmQzYjNiOTViNGZiM2I3NWZlYmU3MzdlOWRlZmI1MDkxOTRkOQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZDVlNTU0MTM0YTJjNGUzZmIyMWUwOGZjNGRjNjI0OWU2YmZhOTY4ZjU0MGI3
10
- YjYxN2FhYzQ1NzRkOTAxOGExZTg3ZTNkZTlkNzJmYjA1ODFkMGI4YmRiN2Yw
11
- NjVkYzQzZTBlODE1MGE4OTU1YmVjNDYzMGU2ZDhiMTIwNTFhZGQ=
9
+ MzgxYTE2YWJmNzc3MzE5Y2Y2NGE0YzliNzRmZTA5YjgzNDVmNTFiZWE2YzM3
10
+ NWI5OTY0NzlmNDUwNTAxNWIyYmY1ZjljNDNiMzI1ZmNiZDhkMjc1ZGM3Zjdk
11
+ MmI3YzU1ODlhNmY5MDU3ZWRlNWFhZjk2YWIzNzhlYmZkOGQ3OWE=
12
12
  data.tar.gz: !binary |-
13
- NTdjMDA1YmVlNDZiMGViNWFlYzA0ZGUxZWUzNzUwZjEzZDJjOTNkYjY1ZGFm
14
- NDUwNjk0ZDlhOWMxNTk0NDY0NDYzOWI3YTMwNmM1MDFkNjlmNTUwYTliNjRj
15
- NzcwNzViZDA1NWNlZDRkZjQ3YzgyMjkyN2E4ZDFlYTQ2NGQ4NTA=
13
+ NDM0NDRlMjg4ZmYzNzg0ZDg4Njg4YWM4YTBkN2NhNTYzY2RiNDIwZDBiZGM4
14
+ Njc5YjkyMTVhOGQ1MjgxYzlmMjIwNzBhOGJiZmIyNmI4Y2ZiZTAwNWYxYTcw
15
+ ZmYwYmM5YTBlOTc5MWYxOTg3YmM5YzQ5YTU3NDA3YzE5ZWY3MzQ=
@@ -4,7 +4,7 @@
4
4
  {<img src="https://gemnasium.com/kslazarev/numbers_and_words.png" alt="Dependency Status" />}[https://gemnasium.com/kslazarev/numbers_and_words]
5
5
  {<img src="https://codeclimate.com/github/kslazarev/numbers_and_words.png" />}[https://codeclimate.com/github/kslazarev/numbers_and_words]
6
6
  {<img src="https://secure.travis-ci.org/kslazarev/numbers_and_words.png" />}[http://travis-ci.org/kslazarev/numbers_and_words]
7
- {<img src="https://coveralls.io/repos/kslazarev/numbers_and_words/badge.png?branch=development" alt="Coverage Status" />}[https://coveralls.io/r/kslazarev/numbers_and_words]
7
+ {<img src="https://coveralls.io/repos/kslazarev/numbers_and_words/badge.png" alt="Coverage Status" />}[https://coveralls.io/r/kslazarev/numbers_and_words]
8
8
 
9
9
  Convert numbers to words using the I18n library.
10
10
 
@@ -26,6 +26,7 @@ Számok betűvel írva az I18n könyvtár segítségével.
26
26
  * Italiano**
27
27
  * Nederlands**
28
28
  * Swedish**
29
+ * English (British)**
29
30
 
30
31
  ** Experimental
31
32
 
@@ -130,10 +131,11 @@ Számok betűvel írva az I18n könyvtár segítségével.
130
131
  => "двадцать одна целая и семьдесят семь сотых"
131
132
  => "двадцять одна цiла i сiмдесят сiм сотих"
132
133
  => "huszonegy egész hetvenhét század"
134
+ => "twenty-one point seven seven"
133
135
 
134
136
  == Language options / Языковые опции
135
137
 
136
- * English
138
+ * English / British
137
139
 
138
140
  Ordinal form: (ordinal: [true || false])
139
141
 
@@ -155,6 +157,9 @@ Számok betűvel írva az I18n könyvtár segítségével.
155
157
  I18n.with_locale(:en) { 0.7.to_words remove_zero: true }
156
158
  => "seven tenths"
157
159
 
160
+ I18n.with_locale(:en) { [0.1, 0.31, 0.12].to_words remove_zero: true }
161
+ => ["one tenth", "thirty-one hundredths", "twelve hundredths"]
162
+
158
163
  * Russian
159
164
 
160
165
  Change gender form: (gender: [:female || :male || :neuter])
@@ -1,6 +1,6 @@
1
1
  class Array
2
2
  def to_words options = {}
3
- map &:to_words
3
+ map{|element| element.to_words options}
4
4
  end
5
5
 
6
6
  def to_figures
@@ -0,0 +1,55 @@
1
+ en-GB:
2
+ numbers:
3
+ ones: [zero, one, two, three, four, five, six, seven, eight, nine]
4
+ teens: [ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen]
5
+ tens: [zero, ten, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety]
6
+ hundreds: hundred
7
+ mega: [ones, thousand, million, billion, trillion, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion]
8
+ ordinal:
9
+ ones: [zeroth, first, second, third, fourth, fifth, sixth, seventh, eighth, ninth]
10
+ teens: [tenth, eleventh, twelfth, thirteenth, fourteenth, fifteenth, sixteenth, seventeenth, eighteenth, nineteenth]
11
+ tens: [zeroth, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth]
12
+ hundreds: hundredth
13
+ mega: [zeroth, thousandth, millionth, billionth, trillionth, quadrillionth, quintillionth, sextillionth, septillionth, octillionth, nonillionth, decillionth]
14
+ fraction_separator: and
15
+ micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths]
16
+ tenths:
17
+ one: tenth
18
+ other: tenths
19
+ hundredths:
20
+ one: hundredth
21
+ other: hundredths
22
+ thousandths:
23
+ one: thousandth
24
+ other: thousandths
25
+ millionths:
26
+ one: millionth
27
+ other: millionths
28
+ billionths:
29
+ one: billionth
30
+ other: billionths
31
+ trillionths:
32
+ one: trillionth
33
+ other: trillionths
34
+ quadrillionths:
35
+ one: quadrillionth
36
+ other: quadrillionths
37
+ quintillionths:
38
+ one: quintillionth
39
+ other: quintillionths
40
+ sextillionths:
41
+ one: sextillionth
42
+ other: sextillionths
43
+ septillionths:
44
+ one: septillionth
45
+ other: septillionths
46
+ octillionths:
47
+ one: octillionth
48
+ other: octillionths
49
+ nonillionths:
50
+ one: nonillionth
51
+ other: nonillionths
52
+ decillionths:
53
+ one: decillionth
54
+ other: decillionths
55
+ union: point
@@ -1,29 +1,21 @@
1
+ require 'numbers_and_words/strategies/array_joiner/languages'
2
+
1
3
  module NumbersAndWords
2
4
  module Strategies
3
5
  module ArrayJoiner
4
6
  class Base
5
7
 
6
- attr_accessor :options, :elements
8
+ attr_accessor :options, :elements, :translations, :language
7
9
 
8
10
  def initialize elements, options = {}
9
11
  @elements = elements
10
12
  @options = options
11
13
  @translations = Translations.factory
14
+ @language = Languages.factory(self)
12
15
  end
13
16
 
14
17
  def run
15
- around { elements.join union_separator }
16
- end
17
-
18
- private
19
-
20
- def union_separator
21
- separator = options[:union_separator] || @translations.union || ''
22
- " #{separator} " if separator.present?
23
- end
24
-
25
- def around
26
- yield
18
+ language.join
27
19
  end
28
20
  end
29
21
  end
@@ -0,0 +1,27 @@
1
+ require 'numbers_and_words/strategies/array_joiner/languages/families/base'
2
+
3
+ require 'numbers_and_words/strategies/array_joiner/languages/base'
4
+
5
+ require 'numbers_and_words/strategies/array_joiner/languages/en'
6
+ require 'numbers_and_words/strategies/array_joiner/languages/en_gb'
7
+ require 'numbers_and_words/strategies/array_joiner/languages/hu'
8
+ require 'numbers_and_words/strategies/array_joiner/languages/ru'
9
+ require 'numbers_and_words/strategies/array_joiner/languages/ua'
10
+
11
+ module NumbersAndWords
12
+ module Strategies
13
+ module ArrayJoiner
14
+ module Languages
15
+ class << self
16
+ def factory strategy
17
+ "#{name}::#{language_class_name}".constantize.new strategy
18
+ end
19
+
20
+ def language_class_name
21
+ ::I18n.locale.to_s.titleize.gsub ' ', ''
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,24 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module ArrayJoiner
4
+ module Languages
5
+ class Base
6
+ include Languages::Families::Base
7
+
8
+ attr_accessor :strategy, :elements, :translations, :strings, :options
9
+
10
+ def initialize strategy
11
+ @strategy = strategy
12
+ @elements = strategy.elements
13
+ @translations = strategy.translations
14
+ @options = strategy.options
15
+ end
16
+
17
+ def join
18
+ elements_logic
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,10 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module ArrayJoiner
4
+ module Languages
5
+ class En < Base
6
+ end
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,17 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module ArrayJoiner
4
+ module Languages
5
+ class EnGb < Base
6
+ def elements_logic
7
+ @elements.join union_element
8
+ end
9
+
10
+ def union_element
11
+ @elements.first.blank? ? "#{union_separator} " : super
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,24 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module ArrayJoiner
4
+ module Languages
5
+ module Families
6
+ module Base
7
+
8
+ def elements_logic
9
+ @elements.first.blank? ? @elements.last : @elements.join(union_element)
10
+ end
11
+
12
+ def union_element
13
+ union_separator.present? ? " #{union_separator} " : ' '
14
+ end
15
+
16
+ def union_separator
17
+ options[:union_separator] || @translations.union || ''
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,10 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module ArrayJoiner
4
+ module Languages
5
+ class Hu < Base
6
+ end
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module ArrayJoiner
4
+ module Languages
5
+ class Ru < Base
6
+ end
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module ArrayJoiner
4
+ module Languages
5
+ class Ua < Base
6
+ end
7
+ end
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,6 @@
1
1
  require 'numbers_and_words/strategies/figures_converter/decorators/base'
2
2
  require 'numbers_and_words/strategies/figures_converter/decorators/en'
3
+ require 'numbers_and_words/strategies/figures_converter/decorators/en_gb'
3
4
  require 'numbers_and_words/strategies/figures_converter/decorators/ru'
4
5
  require 'numbers_and_words/strategies/figures_converter/decorators/hu'
5
6
  require 'numbers_and_words/strategies/figures_converter/decorators/ua'
@@ -30,7 +31,7 @@ module NumbersAndWords
30
31
  end
31
32
 
32
33
  def language_class_name
33
- ::I18n.locale.to_s.titleize.gsub ' ', '::'
34
+ ::I18n.locale.to_s.titleize.gsub ' ', ''
34
35
  end
35
36
  end
36
37
  end
@@ -12,15 +12,15 @@ module NumbersAndWords
12
12
  private
13
13
 
14
14
  def fraction_significance
15
- @strategy.translations.micros full_fraction.fraction_capacity, figures.reverse.join.to_i
15
+ @strategy.translations.micros full_fraction.fraction_capacity, figures.join.to_i
16
16
  end
17
17
 
18
18
  def full_fraction
19
- (0..zero_length).inject(figures.clone) { |result, el| result.unshift '0' }.to_figures
19
+ (0..zero_length).inject(figures.clone) { |result, el| result.unshift 0 }.to_figures
20
20
  end
21
21
 
22
22
  def figures
23
- @strategy.figures
23
+ @strategy.figures.reverse
24
24
  end
25
25
 
26
26
  def zero_length
@@ -0,0 +1,3 @@
1
+ require 'numbers_and_words/strategies/figures_converter/decorators/en_gb/base'
2
+ require 'numbers_and_words/strategies/figures_converter/decorators/en_gb/fractional'
3
+ require 'numbers_and_words/strategies/figures_converter/decorators/en_gb/integral'
@@ -0,0 +1,12 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Decorators
5
+ module EnGb
6
+ class Base < En::Base
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,27 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Decorators
5
+ module EnGb
6
+ class Fractional < En::Fractional
7
+ SHIFT_ZERO_LENGTH = 1
8
+
9
+ def run
10
+ fraction_to_digits
11
+ end
12
+
13
+ private
14
+
15
+ def fraction_to_digits
16
+ full_fraction.to_a.to_words.join ' '
17
+ end
18
+
19
+ def zero_length
20
+ super - SHIFT_ZERO_LENGTH
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,12 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Decorators
5
+ module EnGb
6
+ class Integral < En::Integral
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -6,6 +6,7 @@ require 'numbers_and_words/strategies/figures_converter/languages/base'
6
6
  require 'numbers_and_words/strategies/figures_converter/languages/families/latin'
7
7
 
8
8
  require 'numbers_and_words/strategies/figures_converter/languages/en'
9
+ require 'numbers_and_words/strategies/figures_converter/languages/en_gb'
9
10
  require 'numbers_and_words/strategies/figures_converter/languages/fr'
10
11
  require 'numbers_and_words/strategies/figures_converter/languages/hu'
11
12
  require 'numbers_and_words/strategies/figures_converter/languages/se'
@@ -30,7 +31,7 @@ module NumbersAndWords
30
31
  end
31
32
 
32
33
  def language_class_name
33
- ::I18n.locale.to_s.titleize.gsub ' ', '::'
34
+ ::I18n.locale.to_s.titleize.gsub ' ', ''
34
35
  end
35
36
  end
36
37
  end
@@ -0,0 +1,10 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Languages
5
+ class EnGb < En
6
+ end
7
+ end
8
+ end
9
+ end
10
+ end
@@ -1,4 +1,5 @@
1
1
  require 'numbers_and_words/strategies/figures_converter/options/en'
2
+ require 'numbers_and_words/strategies/figures_converter/options/en_gb'
2
3
  require 'numbers_and_words/strategies/figures_converter/options/ru'
3
4
  require 'numbers_and_words/strategies/figures_converter/options/ua'
4
5
  require 'numbers_and_words/strategies/figures_converter/options/hu'
@@ -28,7 +29,7 @@ module NumbersAndWords
28
29
  end
29
30
 
30
31
  def language_class_name
31
- ::I18n.locale.to_s.titleize.gsub ' ', '::'
32
+ ::I18n.locale.to_s.titleize.gsub ' ', ''
32
33
  end
33
34
 
34
35
  def module_name
@@ -0,0 +1,4 @@
1
+ require 'numbers_and_words/strategies/figures_converter/options/en_gb/hundreds_with_union'
2
+ require 'numbers_and_words/strategies/figures_converter/options/en_gb/remove_hyphen'
3
+ require 'numbers_and_words/strategies/figures_converter/options/en_gb/ordinal'
4
+ require 'numbers_and_words/strategies/figures_converter/options/en_gb/remove_zero'
@@ -0,0 +1,12 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Options
5
+ module EnGb
6
+ class HundredsWithUnion < En::HundredsWithUnion
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Options
5
+ module EnGb
6
+ class Ordinal < En::Ordinal
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Options
5
+ module EnGb
6
+ class RemoveHyphen < En::RemoveHyphen
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Options
5
+ module EnGb
6
+ class RemoveZero < En::RemoveZero
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1 +1 @@
1
- require 'numbers_and_words/strategies/figures_converter/options/hu/ordinal'
1
+ require 'numbers_and_words/strategies/figures_converter/options/hu/ordinal'
@@ -1 +1 @@
1
- require 'numbers_and_words/strategies/figures_converter/options/ru/gender'
1
+ require 'numbers_and_words/strategies/figures_converter/options/ru/gender'
@@ -1 +1 @@
1
- require 'numbers_and_words/strategies/figures_converter/options/ua/gender'
1
+ require 'numbers_and_words/strategies/figures_converter/options/ua/gender'
@@ -5,6 +5,7 @@ require 'numbers_and_words/translations/families/latin'
5
5
  require 'numbers_and_words/translations/extensions/fraction_significance'
6
6
  require 'numbers_and_words/translations/ru'
7
7
  require 'numbers_and_words/translations/en'
8
+ require 'numbers_and_words/translations/en_gb'
8
9
  require 'numbers_and_words/translations/ua'
9
10
  require 'numbers_and_words/translations/tr'
10
11
  require 'numbers_and_words/translations/fr'
@@ -18,7 +19,11 @@ module NumbersAndWords
18
19
  module Translations
19
20
  class << self
20
21
  def factory
21
- "NumbersAndWords::Translations::#{::I18n.locale.to_s.titleize}".constantize.new
22
+ "#{name}::#{language_class_name}".constantize.new
23
+ end
24
+
25
+ def language_class_name
26
+ ::I18n.locale.to_s.titleize.gsub ' ', ''
22
27
  end
23
28
  end
24
29
  end
@@ -0,0 +1,6 @@
1
+ module NumbersAndWords
2
+ module Translations
3
+ class EnGb < En
4
+ end
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module NumbersAndWords
2
- VERSION = '0.6.1'
2
+ VERSION = '0.7.0'
3
3
  end
@@ -9,7 +9,7 @@ module NumbersAndWords
9
9
 
10
10
  def to_words options = {}
11
11
  words = []
12
- words << integral_part_with(options) if integral_part_with(options).present?
12
+ words << integral_part_with(options)
13
13
  words << fractional_part_with(options) unless fractional_part_is_nil?
14
14
  NumbersAndWords::WordsArray.new(words).join options
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numbers_and_words
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Lazarev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-11 00:00:00.000000000 Z
11
+ date: 2013-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -86,6 +86,7 @@ files:
86
86
  - lib/numbers_and_words/helper_classes/words_array.rb
87
87
  - lib/numbers_and_words/i18n.rb
88
88
  - lib/numbers_and_words/i18n/initialization.rb
89
+ - lib/numbers_and_words/i18n/locales/numbers.en-GB.yml
89
90
  - lib/numbers_and_words/i18n/locales/numbers.en.yml
90
91
  - lib/numbers_and_words/i18n/locales/numbers.es.yml
91
92
  - lib/numbers_and_words/i18n/locales/numbers.fr.yml
@@ -104,6 +105,14 @@ files:
104
105
  - lib/numbers_and_words/i18n/plurals/ua.rb
105
106
  - lib/numbers_and_words/strategies.rb
106
107
  - lib/numbers_and_words/strategies/array_joiner.rb
108
+ - lib/numbers_and_words/strategies/array_joiner/languages.rb
109
+ - lib/numbers_and_words/strategies/array_joiner/languages/base.rb
110
+ - lib/numbers_and_words/strategies/array_joiner/languages/en.rb
111
+ - lib/numbers_and_words/strategies/array_joiner/languages/en_gb.rb
112
+ - lib/numbers_and_words/strategies/array_joiner/languages/families/base.rb
113
+ - lib/numbers_and_words/strategies/array_joiner/languages/hu.rb
114
+ - lib/numbers_and_words/strategies/array_joiner/languages/ru.rb
115
+ - lib/numbers_and_words/strategies/array_joiner/languages/ua.rb
107
116
  - lib/numbers_and_words/strategies/figures_converter.rb
108
117
  - lib/numbers_and_words/strategies/figures_converter/decorators.rb
109
118
  - lib/numbers_and_words/strategies/figures_converter/decorators/base.rb
@@ -111,6 +120,10 @@ files:
111
120
  - lib/numbers_and_words/strategies/figures_converter/decorators/en/base.rb
112
121
  - lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb
113
122
  - lib/numbers_and_words/strategies/figures_converter/decorators/en/integral.rb
123
+ - lib/numbers_and_words/strategies/figures_converter/decorators/en_gb.rb
124
+ - lib/numbers_and_words/strategies/figures_converter/decorators/en_gb/base.rb
125
+ - lib/numbers_and_words/strategies/figures_converter/decorators/en_gb/fractional.rb
126
+ - lib/numbers_and_words/strategies/figures_converter/decorators/en_gb/integral.rb
114
127
  - lib/numbers_and_words/strategies/figures_converter/decorators/hu.rb
115
128
  - lib/numbers_and_words/strategies/figures_converter/decorators/hu/base.rb
116
129
  - lib/numbers_and_words/strategies/figures_converter/decorators/hu/fractional.rb
@@ -126,6 +139,7 @@ files:
126
139
  - lib/numbers_and_words/strategies/figures_converter/languages.rb
127
140
  - lib/numbers_and_words/strategies/figures_converter/languages/base.rb
128
141
  - lib/numbers_and_words/strategies/figures_converter/languages/en.rb
142
+ - lib/numbers_and_words/strategies/figures_converter/languages/en_gb.rb
129
143
  - lib/numbers_and_words/strategies/figures_converter/languages/es.rb
130
144
  - lib/numbers_and_words/strategies/figures_converter/languages/families/base.rb
131
145
  - lib/numbers_and_words/strategies/figures_converter/languages/families/cyrillic.rb
@@ -145,6 +159,11 @@ files:
145
159
  - lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb
146
160
  - lib/numbers_and_words/strategies/figures_converter/options/en/remove_hyphen.rb
147
161
  - lib/numbers_and_words/strategies/figures_converter/options/en/remove_zero.rb
162
+ - lib/numbers_and_words/strategies/figures_converter/options/en_gb.rb
163
+ - lib/numbers_and_words/strategies/figures_converter/options/en_gb/hundreds_with_union.rb
164
+ - lib/numbers_and_words/strategies/figures_converter/options/en_gb/ordinal.rb
165
+ - lib/numbers_and_words/strategies/figures_converter/options/en_gb/remove_hyphen.rb
166
+ - lib/numbers_and_words/strategies/figures_converter/options/en_gb/remove_zero.rb
148
167
  - lib/numbers_and_words/strategies/figures_converter/options/hu.rb
149
168
  - lib/numbers_and_words/strategies/figures_converter/options/hu/ordinal.rb
150
169
  - lib/numbers_and_words/strategies/figures_converter/options/ru.rb
@@ -154,6 +173,7 @@ files:
154
173
  - lib/numbers_and_words/translations.rb
155
174
  - lib/numbers_and_words/translations/base.rb
156
175
  - lib/numbers_and_words/translations/en.rb
176
+ - lib/numbers_and_words/translations/en_gb.rb
157
177
  - lib/numbers_and_words/translations/es.rb
158
178
  - lib/numbers_and_words/translations/extensions/fraction_significance.rb
159
179
  - lib/numbers_and_words/translations/families/base.rb