livery 0.2.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: a4376e5c7d1405dadf06cadaec945198934e89cfc14c4174b733d090997e4642
4
- data.tar.gz: b8e5851416f68c68db929caac0a37317c0aadbe42b3293f6d8f806e6970104b3
3
+ metadata.gz: b8ea0e2a383393333730f59724889091ff024f68d05024d66f8ec4b078218080
4
+ data.tar.gz: 3242d234a6f4581f01cc459fd02436fe5c8c023660db7c133960c4c5cd2518c9
5
5
  SHA512:
6
- metadata.gz: 8bf641aecf3d12f80bddcc64d70f6713ec611aa104b4b0517169bc5fafc2ce691671c79b5ee571ebe38dd844301f3294607503e4dba0bd3f7e391b1d45d77253
7
- data.tar.gz: e957e505db44c852a157d1fadb5722aeb76285cdb6e23fa21e0fb1ae01e3b186ec2b3b550cab3093e05e458f876a48a70b749f239ee6f9cbaaaac6f6f3c0b4b8
6
+ metadata.gz: d7d96dffc76aadc1cf0ecdee484ba7b11a865358f3941a4cf952c7d8d63e8b2d55354df47306d3b793f3f48e97eb1ae4ba86211f2c8a753c0b8c21ca32de98a2
7
+ data.tar.gz: e92eef44415d478af404ffab4bfdd210b9c08df25acb2c08350d7346c5a345611f6d9528b563e05a3a893f8e5ab8dcf6e967cec1d2323a958db2402fa43bd33a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- livery (0.2.0)
4
+ livery (0.3.0)
5
5
  activesupport (>= 5.1)
6
6
  i18n (>= 0.7, < 2)
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- livery (0.1.0)
4
+ livery (0.3.0)
5
5
  activesupport (>= 5.1)
6
6
  i18n (>= 0.7, < 2)
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- livery (0.1.0)
4
+ livery (0.3.0)
5
5
  activesupport (>= 5.1)
6
6
  i18n (>= 0.7, < 2)
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- livery (0.1.0)
4
+ livery (0.3.0)
5
5
  activesupport (>= 5.1)
6
6
  i18n (>= 0.7, < 2)
7
7
 
@@ -75,11 +75,11 @@ module Livery
75
75
  end
76
76
 
77
77
  def t(*args)
78
- I18n.t(ActiveSupport::Inflector.underscore(self.class.name) + args.shift, *args)
78
+ I18n.t(resolve_i18n_path(args.shift), *args)
79
79
  end
80
80
 
81
81
  def t!(*args)
82
- I18n.t!(ActiveSupport::Inflector.underscore(self.class.name) + args.shift, *args)
82
+ I18n.t!(resolve_i18n_path(args.shift), *args)
83
83
  end
84
84
 
85
85
  def to_model
@@ -89,5 +89,15 @@ module Livery
89
89
  def to_param(*args)
90
90
  @resource.to_param(*args)
91
91
  end
92
+
93
+ private
94
+
95
+ def resolve_i18n_path(key)
96
+ if key[0] != '.'
97
+ key
98
+ else
99
+ ActiveSupport::Inflector.underscore(self.class.name).tr('/', '.') + key
100
+ end
101
+ end
92
102
  end
93
103
  end
@@ -1,3 +1,3 @@
1
1
  module Livery
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hoy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2019-07-19 00:00:00.000000000 Z
13
+ date: 2020-01-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -154,8 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  requirements: []
157
- rubyforge_project:
158
- rubygems_version: 2.7.3
157
+ rubygems_version: 3.0.3
159
158
  signing_key:
160
159
  specification_version: 4
161
160
  summary: A library for presenter objects for use in Rails.