tater 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tater.rb +1 -0
  3. data/test/tater_test.rb +6 -2
  4. metadata +33 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fcee8d4b1aa16306c1ca8b0ce013e2210a317a05b4c3b466a37203600fb90237
4
- data.tar.gz: a00686eebe67c2c0e8cb92c6d0c82c45664cacddc17111f6f4fcb6f539439841
3
+ metadata.gz: d41ee7aa6cc55a97ad00ee6b96ccbb6127344f9b3e85c4cf3b162f72f3d115d8
4
+ data.tar.gz: 2fe1b6c5aff5fdfcc48dbd8212ddbbf0903f9af071c42ff1178c1f20752f536a
5
5
  SHA512:
6
- metadata.gz: 4157223bbd415daaf23d494aea0c16a42708d92629119b8c1f3071bf424dfa29775aac52b136af669fe5b24b17c4f521271f76921f3c7d04da8c15921227ee7d
7
- data.tar.gz: 29ab82f420856629db3c559594fa0bf8a6abb8b5bc24295913528945cfb823f80eb3646b616ae749ad88d4b457229fd5b6005d50bc9b6aece52617152313c457
6
+ metadata.gz: d686b81192264e1f78f17c0decf0ac3811582e0fe464d2f5f44281481351abca8bd3906fe218a2ae9309a3d84177382f5de7348f63ae3967b7d2af2dc452bcb6
7
+ data.tar.gz: 942fd8b6a433b65778f3d7a78f07a8d99c902c5483eec105e0c75689d40db7d0664170963e514d5e78928450b6c0499dce8c3afd63f0eaded6d9843cf3e703a8
@@ -51,6 +51,7 @@ class Tater
51
51
  # @return [String]
52
52
  def self.interpolate(string, options = {})
53
53
  return string unless string.is_a?(String)
54
+ return string if options.empty?
54
55
 
55
56
  format(string, options)
56
57
  end
@@ -31,11 +31,15 @@ describe Tater do
31
31
  assert_equal 'this thing', Tater::Utils.interpolate('this %{what}', what: 'thing')
32
32
  end
33
33
 
34
- it 'raises a KeyError when an argument is missing' do
34
+ it 'raises a KeyError when an argument is missing (but options are passed)' do
35
35
  assert_raises(KeyError) do
36
- Tater::Utils.interpolate('this %{what}')
36
+ Tater::Utils.interpolate('this %{what}', nope: 'thing')
37
37
  end
38
38
  end
39
+
40
+ it 'returns the string unchanged when options are empty (does not raise a KeyError)' do
41
+ assert_equal 'this %{what}', Tater::Utils.interpolate('this %{what}')
42
+ end
39
43
  end
40
44
 
41
45
  describe '#string_from_numeric' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tater
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Lecklider
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-18 00:00:00.000000000 Z
11
+ date: 2020-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rubocop
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +52,20 @@ dependencies:
38
52
  - - ">="
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-performance
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
41
69
  description: Minimal internationalization and localization library.
42
70
  email:
43
71
  - evan@lecklider.com
@@ -74,13 +102,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
102
  - !ruby/object:Gem::Version
75
103
  version: '2.0'
76
104
  requirements: []
77
- rubygems_version: 3.0.4
105
+ rubygems_version: 3.1.4
78
106
  signing_key:
79
107
  specification_version: 4
80
108
  summary: Minimal internationalization and localization library.
81
109
  test_files:
82
- - test/fixtures/messages/more.yml
83
110
  - test/fixtures/ruby.rb
84
- - test/fixtures/fixtures.yml
85
111
  - test/fixtures/another.yml
112
+ - test/fixtures/fixtures.yml
113
+ - test/fixtures/messages/more.yml
86
114
  - test/tater_test.rb