i18n_lazy_scope 0.0.2 → 0.0.3

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: f5e67ec5de312b21a673e53902fff73d8c84e530
4
- data.tar.gz: 1aff50f53d882e35d29f4ee010a103888a96d864
3
+ metadata.gz: 18f90e57b24abf6b4891a68967366415def5e64b
4
+ data.tar.gz: fd2fb05699dfdb18f12e28083348cbb398962138
5
5
  SHA512:
6
- metadata.gz: c4690adadb569a8b6934dc8ee65a447f286d1fe58fe5a4e5762b4c74e59eed64094a0c6d8690f22cdc1739a7a0b847870e86f75885abc545bc1612dd2812422a
7
- data.tar.gz: 129fee9d22594e02023389a934e7e34417da4e260ce2f558a2a9841617054688ca1345570ccaca611cd6ed54d6445673ab437dd1d3de3283a333e123980cbfb0
6
+ metadata.gz: 55e7b010ad2a2a504c89cefa0e4c34c3b230bd5da39e6f91e10630b8389b8ab8f6350f922dd913ab6e2967d0187d9394c859dac5f3fc167045707b72c0c20b19
7
+ data.tar.gz: 450537099d921b4b3d050c6a60dcc44cfa24e7a2d9133c3cb3027bb0316bc4d2d3316dd27dae721227f3ff96565370b414f5955f9da0061ec60148980c2eddd5
@@ -1,10 +1,6 @@
1
1
  module I18nLazyScope::ActionView
2
2
  module Helper
3
- def t_scoped(key, **args)
4
- t(key, scope: lazy_scope(key), **args)
5
- end
6
-
7
- def lazy_scope(key)
3
+ def lazy_scope
8
4
  [:views, view_path]
9
5
  end
10
6
 
@@ -14,7 +10,7 @@ module I18nLazyScope::ActionView
14
10
  if @virtual_path
15
11
  @virtual_path.gsub(%r{/_?}, ".")
16
12
  else
17
- raise "Cannot use t(#{key.inspect}) lazy lookup because path is not available"
13
+ raise "Cannot use lazy lookup because template path is not available"
18
14
  end
19
15
  end
20
16
  end
@@ -20,6 +20,7 @@ module I18nLazyScope
20
20
  end
21
21
 
22
22
  ActiveSupport.on_load(:action_view) do
23
+ include I18nLazyScope::Helper
23
24
  include I18nLazyScope::ActionView::Helper
24
25
  end
25
26
  end
@@ -1,3 +1,3 @@
1
1
  module I18nLazyScope
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -2,6 +2,7 @@ require "spec_helper"
2
2
 
3
3
  class FakeView
4
4
  include I18nLazyScope::ActionView::Helper
5
+ include I18nLazyScope::Helper
5
6
 
6
7
  def initialize
7
8
  @virtual_path = 'users.show.user_profile'
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,9 @@
1
- require "i18n_lazy_scope/helper"
2
1
  require "i18n_lazy_scope/action_controller/helper"
3
2
  require "i18n_lazy_scope/action_mailer/helper"
4
3
  require "i18n_lazy_scope/action_view/helper"
5
4
 
5
+ require "i18n_lazy_scope/helper"
6
+
6
7
  require "i18n"
7
8
 
8
9
  RSpec.configure do |config|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_lazy_scope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohamad El-Husseini