dub_thee 1.0.1 → 2.0.0
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/README.md +6 -12
- data/Rakefile +1 -20
- data/lib/dub_thee/version.rb +1 -1
- data/lib/dub_thee.rb +13 -13
- metadata +10 -40
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: de1f33a0da20c01beec728de48819ff8594bb77dbc388491424c14c4d132745b
|
|
4
|
+
data.tar.gz: e9555f31237f2a3f2a148df1a2bc813a2a0caa3838e61e8b6122f3761911f737
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 108578d881677fb5f1bb6012e682b878018ebf8a8257d1a2f81425ebb6beaa7df8803dd09664ce0d722bb24ae9f9a24830e02da0ad931ee49befef5fbb9f62e7
|
|
7
|
+
data.tar.gz: b94579254b1c7e0406ee1b6b577afeecafad54fe9127d65014bfd9574ae02ac41826db1bd9d775edcfc864e1f12adaea2ed4429b08ae48e2acdb5e8c6a658e09
|
data/README.md
CHANGED
|
@@ -30,7 +30,7 @@ The "app/views/home/index.html.erb" view will automatically be titled
|
|
|
30
30
|
|
|
31
31
|
The `page_title` helper fetches the title via `I18n.t`, using the
|
|
32
32
|
controller name and action name to make up the translation key. Any
|
|
33
|
-
action name is allowed, however "create", "update", and "
|
|
33
|
+
action name is allowed, however "create", "update", and "destroy" are
|
|
34
34
|
special-cased to instead fetch the titles of their render-on-failure
|
|
35
35
|
counterparts: "new", "edit", and "show", respectively.
|
|
36
36
|
|
|
@@ -114,19 +114,13 @@ own profile. Else, it will be equivalent to `"#{@user[:name]}"`.
|
|
|
114
114
|
|
|
115
115
|
## Installation
|
|
116
116
|
|
|
117
|
-
Add
|
|
118
|
-
|
|
119
|
-
```ruby
|
|
120
|
-
gem "dub_thee"
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
Then execute:
|
|
117
|
+
Add the gem to your Gemfile:
|
|
124
118
|
|
|
125
119
|
```bash
|
|
126
|
-
$ bundle
|
|
120
|
+
$ bundle add dub_thee
|
|
127
121
|
```
|
|
128
122
|
|
|
129
|
-
And
|
|
123
|
+
And run the install generator:
|
|
130
124
|
|
|
131
125
|
```bash
|
|
132
126
|
$ rails generate dub_thee:install
|
|
@@ -135,9 +129,9 @@ $ rails generate dub_thee:install
|
|
|
135
129
|
|
|
136
130
|
## Contributing
|
|
137
131
|
|
|
138
|
-
Run `
|
|
132
|
+
Run `bin/test` to run the tests.
|
|
139
133
|
|
|
140
134
|
|
|
141
135
|
## License
|
|
142
136
|
|
|
143
|
-
[MIT License](
|
|
137
|
+
[MIT License](MIT-LICENSE)
|
data/Rakefile
CHANGED
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
require 'bundler/setup'
|
|
3
|
-
rescue LoadError
|
|
4
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
require 'yard'
|
|
8
|
-
|
|
9
|
-
YARD::Rake::YardocTask.new(:doc) do |t|
|
|
10
|
-
end
|
|
1
|
+
require 'bundler/setup'
|
|
11
2
|
|
|
12
3
|
require 'bundler/gem_tasks'
|
|
13
|
-
|
|
14
|
-
require 'rake/testtask'
|
|
15
|
-
|
|
16
|
-
Rake::TestTask.new(:test) do |t|
|
|
17
|
-
t.libs << 'test'
|
|
18
|
-
t.test_files = FileList['test/**/*_test.rb'].exclude('test/tmp/**/*')
|
|
19
|
-
t.verbose = false
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
task default: :test
|
data/lib/dub_thee/version.rb
CHANGED
data/lib/dub_thee.rb
CHANGED
|
@@ -15,22 +15,22 @@ module DubThee::PageTitleHelper
|
|
|
15
15
|
# @!visibility private
|
|
16
16
|
I18N_RESERVED_OPTIONS = I18n::RESERVED_KEYS.index_by(&:itself)
|
|
17
17
|
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
# controllers, the namespace is included as part of +controller_name
|
|
23
|
-
#
|
|
18
|
+
# Retrieves the current page's title via +I18n.t+. Translation keys
|
|
19
|
+
# are derived from the current controller and action. Specifically,
|
|
20
|
+
# the keys +"page_title.#{controller_name}.#{action_name}"+ and
|
|
21
|
+
# +"page_title.#{action_name}"+ are tried. For namespaced
|
|
22
|
+
# controllers, the namespace is included as part of +controller_name+,
|
|
23
|
+
# dot-separated.
|
|
24
24
|
#
|
|
25
|
-
# I18n string interpolation is supported using the view's
|
|
26
|
-
# variables. Additionally, the +titleize+'d controller name
|
|
27
|
-
# singular and plural form
|
|
28
|
-
# +singular+ and +plural+, respectively.
|
|
25
|
+
# I18n string interpolation is supported using the view's instance
|
|
26
|
+
# variables. Additionally, the +titleize+'d controller name is
|
|
27
|
+
# available in both singular and plural form via the interpolation
|
|
28
|
+
# keys +singular+ and +plural+, respectively.
|
|
29
29
|
#
|
|
30
30
|
# This method is memoized to +@page_title+, and can be invoked
|
|
31
31
|
# multiple times without additional cost. This also allows views to
|
|
32
|
-
#
|
|
33
|
-
#
|
|
32
|
+
# bypass I18n title lookup, if necessary, by assigning to the
|
|
33
|
+
# +@page_title+ variable.
|
|
34
34
|
#
|
|
35
35
|
# @return [String]
|
|
36
36
|
def page_title
|
|
@@ -45,7 +45,7 @@ module DubThee::PageTitleHelper
|
|
|
45
45
|
options[:singular] = options[:plural].singularize
|
|
46
46
|
options[:default] = :"page_title.#{action_part}"
|
|
47
47
|
|
|
48
|
-
@page_title = I18n.t("page_title.#{controller_part}.#{action_part}", options)
|
|
48
|
+
@page_title = I18n.t("page_title.#{controller_part}.#{action_part}", **options)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dub_thee
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jonathan Hefner
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rails
|
|
@@ -16,14 +15,14 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
18
|
+
version: '8.1'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
25
|
+
version: '8.1'
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
27
|
name: i18n-interpolate_nested
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -38,37 +37,8 @@ dependencies:
|
|
|
38
37
|
- - "~>"
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
39
|
version: '1.0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: sqlite3
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - ">="
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - ">="
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '0'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: yard
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - "~>"
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0.9'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - "~>"
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0.9'
|
|
69
|
-
description:
|
|
70
40
|
email:
|
|
71
|
-
- jonathan
|
|
41
|
+
- jonathan@hefner.pro
|
|
72
42
|
executables: []
|
|
73
43
|
extensions: []
|
|
74
44
|
extra_rdoc_files: []
|
|
@@ -84,8 +54,9 @@ files:
|
|
|
84
54
|
homepage: https://github.com/jonathanhefner/dub_thee
|
|
85
55
|
licenses:
|
|
86
56
|
- MIT
|
|
87
|
-
metadata:
|
|
88
|
-
|
|
57
|
+
metadata:
|
|
58
|
+
source_code_uri: https://github.com/jonathanhefner/dub_thee
|
|
59
|
+
changelog_uri: https://github.com/jonathanhefner/dub_thee/blob/master/CHANGELOG.md
|
|
89
60
|
rdoc_options: []
|
|
90
61
|
require_paths:
|
|
91
62
|
- lib
|
|
@@ -93,15 +64,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
93
64
|
requirements:
|
|
94
65
|
- - ">="
|
|
95
66
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: '
|
|
67
|
+
version: '3.4'
|
|
97
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
69
|
requirements:
|
|
99
70
|
- - ">="
|
|
100
71
|
- !ruby/object:Gem::Version
|
|
101
72
|
version: '0'
|
|
102
73
|
requirements: []
|
|
103
|
-
rubygems_version:
|
|
104
|
-
signing_key:
|
|
74
|
+
rubygems_version: 4.0.10
|
|
105
75
|
specification_version: 4
|
|
106
76
|
summary: Rails page titles via I18n
|
|
107
77
|
test_files: []
|