stamp-l10n 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fda01dd55be5569287bc960fbc585cf55d07e720
4
- data.tar.gz: e152739aa11bcf2061760ba15321550cbd9af580
3
+ metadata.gz: dad29458441c0d0e70deee7613cf83465212d4ae
4
+ data.tar.gz: 046881bb1bd8388a48a32132555a5a3c1a451a70
5
5
  SHA512:
6
- metadata.gz: 2c3043a3f47c3a519bd4dd673c2d33707434bda7c8f4d654e648bebeab5474305d446f53740315c4f5ec25505a2b987a896b60b613a1cdf83229dccd0b654662
7
- data.tar.gz: d0fad2be32f5ea005f7cdce40e04b3141d83571a112749e13e9262fff9f16a53b97cd186d256dae397121ddfcfe76728c5353d838473bf17aeb787a12dbd9f58
6
+ metadata.gz: 44766c82cd8ce8ed652ccba8a7cbf16de3c6cb69505bcd1f2dac23ad5b9d935621479efb68a678a1a0f986046f2d71292a88ce80d1b8f7b49ea9419489973918
7
+ data.tar.gz: a9e2fbb86902b7c491f8149f6f74a107d09f8169cb3ce81a88ff2f55f01b34320ec26a8c737a3863bce886f251ef6359078b4a850b2c844fa77d098cb53c8845
@@ -0,0 +1,19 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.1] - 2017-02-22
10
+ ### Changed
11
+ - Memoize default `stamp` under the same key as :en `locale_stamp`
12
+ - Cleanup monkey patching to not redefine `Stamp` if it's not defined
13
+
14
+ ## 0.1.0 - 2017-02-22
15
+ ### Added
16
+ - Initial release
17
+
18
+ [Unreleased]: https://github.com/TandaHQ/stamp-l10n/compare/v0.1.1...HEAD
19
+ [0.1.1]: https://github.com/TandaHQ/stamp-l10n/compare/v0.1.0...v0.1.1
@@ -7,26 +7,10 @@ require 'stamp-l10n/translator_extension'
7
7
  require 'stamp-l10n/emitters/am_pm_extension'
8
8
  require 'stamp-l10n/emitters/lookup_extension'
9
9
 
10
- module Stamp
11
- prepend StampL10n::StampExtension
10
+ ::Stamp.include StampL10n::StampExtension
11
+ ::Stamp::Translator.include StampL10n::TranslatorExtension
12
+ ::Stamp::Emitters::AmPm.extend StampL10n::Emitters::AmPmExtension::ClassMethods
13
+ ::Stamp::Emitters::Lookup.extend StampL10n::Emitters::LookupExtension::ClassMethods
12
14
 
13
- class Translator
14
- prepend StampL10n::TranslatorExtension
15
- end
16
-
17
- module Emitters
18
- class AmPm
19
- class << self
20
- prepend StampL10n::Emitters::AmPmExtension::ClassMethods
21
- end
22
- end
23
- class Lookup
24
- class << self
25
- prepend StampL10n::Emitters::LookupExtension::ClassMethods
26
- end
27
- end
28
- end
29
- end
30
-
31
- Date.send(:include, Stamp)
32
- Time.send(:include, Stamp)
15
+ Date.include Stamp
16
+ Time.include Stamp
@@ -15,13 +15,13 @@ module StampL10n
15
15
  def memoize_stamp_emitters(example)
16
16
  @@memoized_stamp_emitters ||= {} # rubocop:disable Style/ClassVars
17
17
  @@memoized_stamp_emitters[example] ||= {}
18
- @@memoized_stamp_emitters[example][nil] ||= stamp_emitters(example)
18
+ @@memoized_stamp_emitters[example][:en] ||= stamp_emitters(example)
19
19
  end
20
20
 
21
21
  def memoize_locale_stamp_emitters(example, locale = I18n.locale)
22
22
  @@memoized_stamp_emitters ||= {} # rubocop:disable Style/ClassVars
23
23
  @@memoized_stamp_emitters[example] ||= {}
24
- @@memoized_stamp_emitters[example][locale] ||= locale_stamp_emitters(example, locale)
24
+ @@memoized_stamp_emitters[example][locale.to_sym] ||= locale_stamp_emitters(example, locale)
25
25
  end
26
26
  end
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module StampL10n
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stamp-l10n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Allie
@@ -101,22 +101,16 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - ".gitignore"
105
- - ".rspec"
106
- - ".rubocop.yml"
107
- - ".travis.yml"
104
+ - CHANGELOG.md
108
105
  - CODE_OF_CONDUCT.md
109
- - Gemfile
110
106
  - LICENSE.txt
111
107
  - README.md
112
- - Rakefile
113
108
  - lib/stamp-l10n.rb
114
109
  - lib/stamp-l10n/emitters/am_pm_extension.rb
115
110
  - lib/stamp-l10n/emitters/lookup_extension.rb
116
111
  - lib/stamp-l10n/stamp_extension.rb
117
112
  - lib/stamp-l10n/translator_extension.rb
118
113
  - lib/stamp-l10n/version.rb
119
- - stamp-l10n.gemspec
120
114
  homepage: https://github.com/tandahq/stamp-l10n
121
115
  licenses:
122
116
  - MIT
@@ -137,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
131
  version: '0'
138
132
  requirements: []
139
133
  rubyforge_project:
140
- rubygems_version: 2.6.8
134
+ rubygems_version: 2.5.1
141
135
  signing_key:
142
136
  specification_version: 4
143
137
  summary: Uses Rails Internationalization to bring stamp to all locales.
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
@@ -1,20 +0,0 @@
1
- AllCops:
2
- DisplayCopNames: true
3
- ExtraDetails: true
4
- TargetRubyVersion: 2.2
5
-
6
- Metrics/LineLength:
7
- Max: 120
8
-
9
- Style/Documentation:
10
- Enabled: false
11
-
12
- Style/FileName:
13
- Exclude:
14
- - 'lib/stamp-l10n.rb'
15
-
16
- Metrics/MethodLength:
17
- Max: 50
18
-
19
- Metrics/AbcSize:
20
- Max: 20
@@ -1,7 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1.10
4
- - 2.2.6
5
- - 2.3.3
6
- - 2.4.0
7
- - ruby-head
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in stamp-l10n.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env rake
2
- require 'bundler/gem_tasks'
3
- require 'rspec/core/rake_task'
4
-
5
- RSpec::Core::RakeTask.new(:spec)
6
-
7
- task default: :spec
@@ -1,28 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'stamp-l10n/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'stamp-l10n'
8
- spec.version = StampL10n::VERSION
9
- spec.authors = ['Dave Allie']
10
- spec.email = ['dave@tanda.co']
11
-
12
- spec.summary = 'Uses Rails Internationalization to bring stamp to all locales.'
13
- spec.description = 'Uses Rails Internationalization to bring stamp to all locales.'
14
- spec.homepage = 'https://github.com/tandahq/stamp-l10n'
15
- spec.license = 'MIT'
16
-
17
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
- f.match(%r{^(test|spec|features|locale)/})
19
- end
20
- spec.require_paths = ['lib']
21
-
22
- spec.add_development_dependency 'bundler', '~> 1.14'
23
- spec.add_development_dependency 'rake', '~> 10.0'
24
- spec.add_development_dependency 'rubocop', '~> 0.47.0'
25
- spec.add_development_dependency 'rspec'
26
- spec.add_dependency 'stamp', '= 0.6.0'
27
- spec.add_dependency 'i18n'
28
- end