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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9afaa1c87c03098a84a69fa10354183eb3390c19
4
- data.tar.gz: f6163adcfc53bd99ed6b02aa49e444fe3bf670c4
3
+ metadata.gz: c43dc59a7c6a456b57ac2591a7b1d35523469576
4
+ data.tar.gz: f3cc8dab91660b15b7bcb98afb3cde69b30baa51
5
5
  SHA512:
6
- metadata.gz: 7bcaa580ac6f62dd93621407efe8f7381264bb6e5ae89fa9cb788de6785111c15536554ec3d2820e1aa777aa11006fdea38239ab038e62302643700562c23383
7
- data.tar.gz: 3f7c9be5579e0bf88670b48523dfacbeca81f9d1da3c38882a04baf82102d46769423101f8a04969a143cd51211e6642ef94ac5093e0f1f2d091c26da2172c5e
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') ? @i18n.t('titler.delimiter') : @configuration.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
@@ -1,3 +1,3 @@
1
1
  module Titler
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
@@ -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) adds app name to defaults' do
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 '(3) uses default app name if i18n.t is blank' do
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 '(4) adds tagline to defaults' do
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.1
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-14 00:00:00.000000000 Z
12
+ date: 2017-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails