titler 1.0.1 → 1.0.2
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 +4 -4
- data/app/helpers/titler/titler_helper.rb +5 -1
- data/lib/titler/version.rb +1 -1
- data/spec/helpers/titler_helper_spec.rb +12 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c43dc59a7c6a456b57ac2591a7b1d35523469576
|
4
|
+
data.tar.gz: f3cc8dab91660b15b7bcb98afb3cde69b30baa51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28840a45714aad76b6448e1fa64c23c4259d4c76b1e9e8138ab48c86a2c37f8a5661be05169ef4786ba25870d91bcfff61264cf22b92c5f5ce7badf15718453b
|
7
|
+
data.tar.gz: d88993d46d775bfdcbbdb64442d9b76d631fb08bfe6f2a2cef12c119ed01055a952528a1001957372358def9d84caa9aa1cbf7d404ad2967058dbd2f66fbc2b8
|
@@ -56,7 +56,11 @@ module Titler
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def delimiter
|
59
|
-
@i18n.exists?('titler.delimiter')
|
59
|
+
if @i18n.exists?('titler.delimiter') && @i18n.t('titler.delimiter').present?
|
60
|
+
@i18n.t('titler.delimiter')
|
61
|
+
else
|
62
|
+
@configuration.delimiter
|
63
|
+
end
|
60
64
|
end
|
61
65
|
|
62
66
|
def app_name
|
data/lib/titler/version.rb
CHANGED
@@ -44,7 +44,16 @@ describe Titler::TitlerHelper do
|
|
44
44
|
expect(titler_helper.titler).to eq(expected_title)
|
45
45
|
end
|
46
46
|
|
47
|
-
it '(2)
|
47
|
+
it '(2) used config delimiter if i18n.t is blank' do
|
48
|
+
controller = MockController.new
|
49
|
+
stub_rails(controller, 'production', nil)
|
50
|
+
load_translations({ delimiter: '' })
|
51
|
+
|
52
|
+
expected_title = "#{env_prefix}#{controller.controller_name.titleize} #{controller.action_name.titleize} - #{app_name}"
|
53
|
+
expect(titler_helper.titler).to eq(expected_title)
|
54
|
+
end
|
55
|
+
|
56
|
+
it '(3) adds app name to defaults' do
|
48
57
|
controller = MockController.new
|
49
58
|
stub_rails(controller, 'production', nil)
|
50
59
|
load_translations({ app_name: 'Test App' })
|
@@ -53,7 +62,7 @@ describe Titler::TitlerHelper do
|
|
53
62
|
expect(titler_helper.titler).to eq(expected_title)
|
54
63
|
end
|
55
64
|
|
56
|
-
it '(
|
65
|
+
it '(4) uses default app name if i18n.t is blank' do
|
57
66
|
controller = MockController.new
|
58
67
|
stub_rails(controller, 'production', nil)
|
59
68
|
load_translations({ app_name: '' })
|
@@ -62,7 +71,7 @@ describe Titler::TitlerHelper do
|
|
62
71
|
expect(titler_helper.titler).to eq(expected_title)
|
63
72
|
end
|
64
73
|
|
65
|
-
it '(
|
74
|
+
it '(5) adds tagline to defaults' do
|
66
75
|
controller = MockController.new
|
67
76
|
stub_rails(controller, 'production', nil)
|
68
77
|
load_translations({ app_tagline: 'All the News' })
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: titler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Travis Pierce
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-07-
|
12
|
+
date: 2017-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|