titler 1.0.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c43dc59a7c6a456b57ac2591a7b1d35523469576
4
- data.tar.gz: f3cc8dab91660b15b7bcb98afb3cde69b30baa51
3
+ metadata.gz: 6231f26788ed6ae209baac9d5c0fa05cea518aee
4
+ data.tar.gz: 4b1b61a0a7298fe8d71e2b451a6e7f3450f50b33
5
5
  SHA512:
6
- metadata.gz: 28840a45714aad76b6448e1fa64c23c4259d4c76b1e9e8138ab48c86a2c37f8a5661be05169ef4786ba25870d91bcfff61264cf22b92c5f5ce7badf15718453b
7
- data.tar.gz: d88993d46d775bfdcbbdb64442d9b76d631fb08bfe6f2a2cef12c119ed01055a952528a1001957372358def9d84caa9aa1cbf7d404ad2967058dbd2f66fbc2b8
6
+ metadata.gz: 14ab3d7d132f3c5e5c00749a2f1a5bb09da0c5b6bef95cff0b31e51733feeee205d5107b990eff7d576364be470d19543b1e394792deadab76f962fc1923d554
7
+ data.tar.gz: a756c6dd401e263a48ac76c46904af2f8310295b82f652e17b5b6f35ff1af1126c2f2890fde06e6ac628030bd33740b30917464dead50cb942e2b8776c840b9d
data/README.md CHANGED
@@ -99,7 +99,12 @@ There is a [titler_demo](https://github.com/roberttravispierce/titler_demo) demo
99
99
 
100
100
  ## <a name="customize"></a>How do I customize it?
101
101
 
102
- I'm working on a generator to add a config initializer and i18n locale file. In the meantime you can add the files to change your defaults (see the [titler_demo](https://github.com/roberttravispierce/titler_demo) demonstration app for an example):
102
+
103
+ Customize titler settings for your app by running the generator:
104
+ ```console
105
+ rails generate titler:install
106
+ ```
107
+ This will generate two files to give you customization options (see the [titler_demo](https://github.com/roberttravispierce/titler_demo) demonstration app for an example):
103
108
 
104
109
  *app/config/locales/titler.en.yml*
105
110
  ```yaml
@@ -114,12 +119,15 @@ en:
114
119
  *app/config/initializers/titler.rb*
115
120
  ```ruby
116
121
  Titler.configure do |config|
117
- config.use_env_prefix = true
118
- config.delimiter = ' - '
119
- config.app_name_position = 'append' # append, prepend, none
120
- config.use_app_tagline = true
121
- config.admin_name = 'Admin'
122
- config.admin_controller = AdminController
122
+ # See titler gem README.md (https://github.com/roberttravispierce/titler)
123
+ # for details on these configuration options. Uncomment and change to use:
124
+ #
125
+ # config.use_env_prefix = true
126
+ # config.delimiter = ' - '
127
+ # config.app_name_position = 'append' # append, prepend, none
128
+ # config.use_app_tagline = true
129
+ # config.admin_name = 'Admin'
130
+ # config.admin_controller = AdminController
123
131
  end
124
132
  ```
125
133
 
@@ -4,11 +4,17 @@ module Titler
4
4
  module Generators
5
5
  class InstallGenerator < Rails::Generators::Base
6
6
  source_root File.expand_path('../templates', __FILE__)
7
+ desc "Creates Titler initializer and i18n for your application"
7
8
 
8
- def create_titler_initializer
9
- copy_file 'titler.rb', 'config/initializers/titler.rb'
9
+ def copy_initializer
10
+ template 'titler.rb', 'config/initializers/titler.rb'
11
+ puts "Initializer install complete."
10
12
  end
11
13
 
14
+ def copy_i18n
15
+ template 'titler.en.yml', 'config/locales/titler.en.yml'
16
+ puts "Localization install complete."
17
+ end
12
18
  end
13
19
  end
14
20
  end
@@ -0,0 +1,6 @@
1
+ ---
2
+ en:
3
+ titler:
4
+ app_name: ''
5
+ app_tagline: ''
6
+ delimiter: ''
@@ -1,8 +1,11 @@
1
1
  Titler.configure do |config|
2
- config.use_env_prefix = true
3
- config.delimiter = ' - '
4
- config.app_name_position = 'append' # append, prepend, none
5
- config.use_app_tagline = true
6
- config.admin_name = 'Admin'
7
- config.admin_controller = AdminController
2
+ # See titler gem README.md (https://github.com/roberttravispierce/titler)
3
+ # for details on these configuration options. Uncomment and change to use:
4
+ #
5
+ # config.use_env_prefix = true
6
+ # config.delimiter = ' - '
7
+ # config.app_name_position = 'append' # append, prepend, none
8
+ # config.use_app_tagline = true
9
+ # config.admin_name = 'Admin'
10
+ # config.admin_controller = AdminController
8
11
  end
@@ -1,3 +1,3 @@
1
1
  module Titler
2
- VERSION = '1.0.2'
2
+ VERSION = '1.2.0'
3
3
  end
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.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Travis Pierce
@@ -246,6 +246,7 @@ files:
246
246
  - config/initializers/titler.rb
247
247
  - config/locales/titler.en.yml
248
248
  - lib/generators/titler/install/install_generator.rb
249
+ - lib/generators/titler/install/templates/titler.en.yml
249
250
  - lib/generators/titler/install/templates/titler.rb
250
251
  - lib/generators/titler/locales/locales_generator.rb
251
252
  - lib/titler.rb