dragoman 0.0.4 → 0.0.5

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: a9d284280585fe102dc101b978b9eb3194ba4e72
4
- data.tar.gz: 8f885d7a7852916080ae9983b5a0d861bb7e66eb
3
+ metadata.gz: 9176bc2a1292393a0ad653775c5f827fd0f33b59
4
+ data.tar.gz: f9008090cb542228780baa0dc9b3b3e5fc2531ed
5
5
  SHA512:
6
- metadata.gz: 61f5f7db87f1b6d1d35ad7a443a72798772125cbd46b8a7c16dc0f8a2d2e6e6d9e040ebac4ecfdd56d6de507ae6a266080a50c40ef94d96039e2faf04fe025ce
7
- data.tar.gz: e55e7db55755babacabcf2d44f53b265ef0e3e5838088a997ec403ab0c46d452b448b3b07a0a07fc6af4d2f77d1158c476f7ab53f6dbcfa8120019c1dffb843f
6
+ metadata.gz: 3c0f0b8c7e3f1c96113a626bbd82f7bfeecb981ead880df5416d075d7040df349cc9d160f37d17dc56cdaeddbe95e9490e5d9c2ff78cfaf7485d82f7073c43cd
7
+ data.tar.gz: a2fb03a087f317b468486ba140f54e29af9af9aec1dbb8d1911b781fc132aa1dbddfeec08092a2812a5529e88ae9802cd7495462154b06431a70db57eb516199
@@ -7,7 +7,8 @@ module Dragoman
7
7
  end
8
8
 
9
9
  def visit_LITERAL node
10
- I18n.t node, scope: :routes, default: node.to_s, locale: @locale
10
+ translation = I18n.t node, scope: :routes, default: node.to_s, locale: @locale
11
+ translation.present? ? translation : node
11
12
  end
12
13
 
13
14
  end
@@ -1,3 +1,3 @@
1
1
  module Dragoman
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -32,6 +32,10 @@ Dummy::Application.routes.draw do
32
32
  resources :drivers, :only => [:show], shallow: true
33
33
  end
34
34
  end
35
+
36
+ # route with blank translation
37
+ get 'music' => 'application#index'
38
+
35
39
  end
36
40
 
37
41
  end
@@ -17,4 +17,5 @@ nl:
17
17
  drivers: bestuurders
18
18
  fast: snelle
19
19
  cars: autos
20
+ music: ""
20
21
 
@@ -69,6 +69,10 @@ describe 'routes' do
69
69
  expect(driver_en_path(3)).to eq '/fast/drivers/3'
70
70
  end
71
71
 
72
+ it 'skips blank translations' do
73
+ expect(music_nl_path).to eq '/music'
74
+ end
75
+
72
76
  describe 'adds untranslated path helpers' do
73
77
  it 'uses the I18n locale' do
74
78
  I18n.locale = :nl
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dragoman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pieter Visser