localize_multi_digit 4.0.1 → 4.0.4

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.
@@ -2,7 +2,6 @@ class LocalizeMultiDigitGenerator < Rails::Generators::Base
2
2
  source_root(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  def copy_initializer
5
- copy_file 'localize_multi_digit.rb', 'config/initializers/localize_multi_digit.rb'
6
- copy_file 'localized_digits.yml', 'config/locales/localized_digits.yml'
5
+ copy_file 'localized_digits.yml', 'config/locales/localized_digits.yml'
7
6
  end
8
7
  end
@@ -1,8 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
- #
4
- # Fixnum, Float, String, Date, Time and DateTime class will be extended by this module
5
- #
6
3
  module LocalizeMultiDigit
7
4
  def to_ld
8
5
  item = self
@@ -32,10 +29,16 @@ module LocalizedDigits
32
29
  require 'yaml'
33
30
  class Base
34
31
  def initialize
35
- @digits = YAML.load_file("#{Rails.root}/config/locales/localized_digits.yml") rescue YAML.load_file(File.dirname(__FILE__) + '/generators/localized_digits.yml')
32
+ @digits = YAML.load_file("config/locales/localized_digits.yml") rescue YAML.load_file(File.dirname(__FILE__) + '/generators/localized_digits.yml')
36
33
  end
37
34
  def get_localized_digits
38
35
  @digits
39
36
  end
40
37
  end
41
38
  end
39
+
40
+ $ld = LocalizedDigits::Base.new()
41
+
42
+ [String, Fixnum, Float, Date, Time,NilClass].each do |item|
43
+ item.send(:include, LocalizeMultiDigit)
44
+ end
@@ -6,11 +6,6 @@ require File.expand_path(File.dirname(__FILE__) + '/../lib/localize_multi_digit.
6
6
 
7
7
  class LocalizeMultiDigitTest < Test::Unit::TestCase
8
8
 
9
- $ld = LocalizedDigits::Base.new()
10
- [String, Fixnum, Float, Date, Time,NilClass].each do |item|
11
- item.send(:include, LocalizeMultiDigit)
12
- end
13
-
14
9
  def test_should_work_for_empty_and_nil_value
15
10
  I18n.locale = :en
16
11
  assert_equal '', ''.to_ld
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localize_multi_digit
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -18,7 +18,6 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - lib/localize_multi_digit.rb
21
- - lib/generators/localize_multi_digit.rb
22
21
  - lib/generators/localize_multi_digit_generator.rb
23
22
  - lib/generators/localized_digits.yml
24
23
  - Rakefile
@@ -1,5 +0,0 @@
1
- $ld = LocalizedDigits::Base.new()
2
-
3
- [String, Fixnum, Float, Date, Time, ActiveSupport::TimeWithZone,NilClass].each do |item|
4
- item.send(:include, LocalizeMultiDigit)
5
- end