page_title 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +57 -71
- data/README.md +12 -0
- data/lib/page_title.rb +4 -0
- data/lib/page_title/version.rb +1 -1
- data/page_title.gemspec +0 -1
- data/spec/page_title_spec.rb +8 -0
- metadata +19 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 215dc2d630f1b4e71a4d2e3e1ca19d5f2a69dcae
|
4
|
+
data.tar.gz: 60a2cd8a0ad272528fcc7df82f7c9be5730cea1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 958b5197893b578fcdef3c35ed2ed59d7fd073747cf2c5b214846e5d8eab76dca56c98efeb1ceab19771c671486e1819f2cc81f5600641864a105758bee30b3e
|
7
|
+
data.tar.gz: 7a6512b2644acde0ec5f762293e2bd834d04ca0bb4d208f1a29f0e7ba59917f3f938cff783621322038caa1adcc350662267488bc976271fa8989a46b71924ad
|
data/Gemfile.lock
CHANGED
@@ -1,117 +1,104 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
page_title (0.0.
|
4
|
+
page_title (0.0.4)
|
5
5
|
rails
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionmailer (4.
|
11
|
-
actionpack (= 4.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
actionmailer (4.1.1)
|
11
|
+
actionpack (= 4.1.1)
|
12
|
+
actionview (= 4.1.1)
|
13
|
+
mail (~> 2.5.4)
|
14
|
+
actionpack (4.1.1)
|
15
|
+
actionview (= 4.1.1)
|
16
|
+
activesupport (= 4.1.1)
|
17
17
|
rack (~> 1.5.2)
|
18
18
|
rack-test (~> 0.6.2)
|
19
|
-
|
20
|
-
activesupport (= 4.
|
21
|
-
builder (~> 3.1
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
19
|
+
actionview (4.1.1)
|
20
|
+
activesupport (= 4.1.1)
|
21
|
+
builder (~> 3.1)
|
22
|
+
erubis (~> 2.7.0)
|
23
|
+
activemodel (4.1.1)
|
24
|
+
activesupport (= 4.1.1)
|
25
|
+
builder (~> 3.1)
|
26
|
+
activerecord (4.1.1)
|
27
|
+
activemodel (= 4.1.1)
|
28
|
+
activesupport (= 4.1.1)
|
29
|
+
arel (~> 5.0.0)
|
30
|
+
activesupport (4.1.1)
|
31
|
+
i18n (~> 0.6, >= 0.6.9)
|
32
|
+
json (~> 1.7, >= 1.7.7)
|
33
|
+
minitest (~> 5.1)
|
32
34
|
thread_safe (~> 0.1)
|
33
|
-
tzinfo (~>
|
34
|
-
arel (
|
35
|
-
|
36
|
-
|
37
|
-
builder (3.1.4)
|
38
|
-
coderay (1.0.9)
|
39
|
-
diff-lcs (1.2.4)
|
35
|
+
tzinfo (~> 1.1)
|
36
|
+
arel (5.0.1.20140414130214)
|
37
|
+
builder (3.2.2)
|
38
|
+
diff-lcs (1.2.5)
|
40
39
|
erubis (2.7.0)
|
41
40
|
hike (1.2.3)
|
42
|
-
i18n (0.6.
|
41
|
+
i18n (0.6.9)
|
42
|
+
json (1.8.1)
|
43
43
|
mail (2.5.4)
|
44
44
|
mime-types (~> 1.16)
|
45
45
|
treetop (~> 1.4.8)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
polyglot (0.3.3)
|
51
|
-
pry (0.9.12.2)
|
52
|
-
coderay (~> 1.0.5)
|
53
|
-
method_source (~> 0.8)
|
54
|
-
slop (~> 3.4)
|
55
|
-
pry-meta (0.0.5)
|
56
|
-
awesome_print
|
57
|
-
pry
|
58
|
-
pry-nav
|
59
|
-
pry-remote
|
60
|
-
pry-nav (0.2.3)
|
61
|
-
pry (~> 0.9.10)
|
62
|
-
pry-remote (0.1.7)
|
63
|
-
pry (~> 0.9)
|
64
|
-
slop (~> 3.0)
|
46
|
+
mime-types (1.25.1)
|
47
|
+
minitest (5.3.4)
|
48
|
+
multi_json (1.10.0)
|
49
|
+
polyglot (0.3.4)
|
65
50
|
rack (1.5.2)
|
66
51
|
rack-test (0.6.2)
|
67
52
|
rack (>= 1.0)
|
68
|
-
rails (4.
|
69
|
-
actionmailer (= 4.
|
70
|
-
actionpack (= 4.
|
71
|
-
|
72
|
-
|
53
|
+
rails (4.1.1)
|
54
|
+
actionmailer (= 4.1.1)
|
55
|
+
actionpack (= 4.1.1)
|
56
|
+
actionview (= 4.1.1)
|
57
|
+
activemodel (= 4.1.1)
|
58
|
+
activerecord (= 4.1.1)
|
59
|
+
activesupport (= 4.1.1)
|
73
60
|
bundler (>= 1.3.0, < 2.0)
|
74
|
-
railties (= 4.
|
75
|
-
sprockets-rails (~> 2.0
|
76
|
-
railties (4.
|
77
|
-
actionpack (= 4.
|
78
|
-
activesupport (= 4.
|
61
|
+
railties (= 4.1.1)
|
62
|
+
sprockets-rails (~> 2.0)
|
63
|
+
railties (4.1.1)
|
64
|
+
actionpack (= 4.1.1)
|
65
|
+
activesupport (= 4.1.1)
|
79
66
|
rake (>= 0.8.7)
|
80
67
|
thor (>= 0.18.1, < 2.0)
|
81
|
-
rake (10.
|
68
|
+
rake (10.3.2)
|
82
69
|
rspec (2.14.1)
|
83
70
|
rspec-core (~> 2.14.0)
|
84
71
|
rspec-expectations (~> 2.14.0)
|
85
72
|
rspec-mocks (~> 2.14.0)
|
86
|
-
rspec-core (2.14.
|
87
|
-
rspec-expectations (2.14.
|
73
|
+
rspec-core (2.14.8)
|
74
|
+
rspec-expectations (2.14.5)
|
88
75
|
diff-lcs (>= 1.1.3, < 2.0)
|
89
|
-
rspec-mocks (2.14.
|
90
|
-
rspec-rails (2.14.
|
76
|
+
rspec-mocks (2.14.6)
|
77
|
+
rspec-rails (2.14.2)
|
91
78
|
actionpack (>= 3.0)
|
79
|
+
activemodel (>= 3.0)
|
92
80
|
activesupport (>= 3.0)
|
93
81
|
railties (>= 3.0)
|
94
82
|
rspec-core (~> 2.14.0)
|
95
83
|
rspec-expectations (~> 2.14.0)
|
96
84
|
rspec-mocks (~> 2.14.0)
|
97
|
-
|
98
|
-
sprockets (2.10.0)
|
85
|
+
sprockets (2.12.1)
|
99
86
|
hike (~> 1.2)
|
100
87
|
multi_json (~> 1.0)
|
101
88
|
rack (~> 1.0)
|
102
89
|
tilt (~> 1.1, != 1.3.0)
|
103
|
-
sprockets-rails (2.
|
90
|
+
sprockets-rails (2.1.3)
|
104
91
|
actionpack (>= 3.0)
|
105
92
|
activesupport (>= 3.0)
|
106
93
|
sprockets (~> 2.8)
|
107
|
-
thor (0.
|
108
|
-
thread_safe (0.
|
109
|
-
atomic
|
94
|
+
thor (0.19.1)
|
95
|
+
thread_safe (0.3.3)
|
110
96
|
tilt (1.4.1)
|
111
97
|
treetop (1.4.15)
|
112
98
|
polyglot
|
113
99
|
polyglot (>= 0.3.1)
|
114
|
-
tzinfo (
|
100
|
+
tzinfo (1.1.0)
|
101
|
+
thread_safe (~> 0.1)
|
115
102
|
|
116
103
|
PLATFORMS
|
117
104
|
ruby
|
@@ -119,7 +106,6 @@ PLATFORMS
|
|
119
106
|
DEPENDENCIES
|
120
107
|
bundler
|
121
108
|
page_title!
|
122
|
-
pry-meta
|
123
109
|
rake
|
124
110
|
rspec
|
125
111
|
rspec-rails
|
data/README.md
CHANGED
@@ -24,6 +24,12 @@ You can use this on your layout file to display the page title:
|
|
24
24
|
<%= page_title %>
|
25
25
|
```
|
26
26
|
|
27
|
+
To ignore the base translation, use `page_title.simple`.
|
28
|
+
|
29
|
+
```erb
|
30
|
+
<%= page_title.simple %>
|
31
|
+
```
|
32
|
+
|
27
33
|
The page title will be inferred from the controller and action names. For an action `SiteController#index` you'll the following translate scope:
|
28
34
|
|
29
35
|
```yaml
|
@@ -77,6 +83,12 @@ class AdminController < ActionController::Base
|
|
77
83
|
end
|
78
84
|
```
|
79
85
|
|
86
|
+
We detect the following action aliases:
|
87
|
+
|
88
|
+
* Action `create` points to `new`
|
89
|
+
* Action `update` points to `edit`
|
90
|
+
* Action `destroy` points to `remove`
|
91
|
+
|
80
92
|
## Contributing
|
81
93
|
|
82
94
|
1. Fork it
|
data/lib/page_title.rb
CHANGED
data/lib/page_title/version.rb
CHANGED
data/page_title.gemspec
CHANGED
data/spec/page_title_spec.rb
CHANGED
@@ -11,6 +11,14 @@ describe PageTitle do
|
|
11
11
|
it { expect(page_title.to_s).to eql("TITLE") }
|
12
12
|
end
|
13
13
|
|
14
|
+
context "ignoring base translation" do
|
15
|
+
set_controller "site", "index"
|
16
|
+
set_translations "titles.site.index" => "TITLE",
|
17
|
+
"titles.base" => "%{title} - SITE"
|
18
|
+
|
19
|
+
it { expect(page_title.simple).to eql("TITLE") }
|
20
|
+
end
|
21
|
+
|
14
22
|
context "namespace controller name" do
|
15
23
|
set_controller "admin/site", "index"
|
16
24
|
set_translations "titles.admin.site.index" => "TITLE",
|
metadata
CHANGED
@@ -1,97 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: page_title
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: pry-meta
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - '>='
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - '>='
|
80
|
+
- - ">="
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: '0'
|
97
83
|
description: Set the page title on Rails apps
|
@@ -101,9 +87,9 @@ executables: []
|
|
101
87
|
extensions: []
|
102
88
|
extra_rdoc_files: []
|
103
89
|
files:
|
104
|
-
- .gitignore
|
105
|
-
- .rspec
|
106
|
-
- .travis.yml
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- ".travis.yml"
|
107
93
|
- Gemfile
|
108
94
|
- Gemfile.lock
|
109
95
|
- LICENSE.txt
|
@@ -168,17 +154,17 @@ require_paths:
|
|
168
154
|
- lib
|
169
155
|
required_ruby_version: !ruby/object:Gem::Requirement
|
170
156
|
requirements:
|
171
|
-
- -
|
157
|
+
- - ">="
|
172
158
|
- !ruby/object:Gem::Version
|
173
159
|
version: '0'
|
174
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
161
|
requirements:
|
176
|
-
- -
|
162
|
+
- - ">="
|
177
163
|
- !ruby/object:Gem::Version
|
178
164
|
version: '0'
|
179
165
|
requirements: []
|
180
166
|
rubyforge_project:
|
181
|
-
rubygems_version: 2.
|
167
|
+
rubygems_version: 2.2.2
|
182
168
|
signing_key:
|
183
169
|
specification_version: 4
|
184
170
|
summary: Set the page title on Rails apps
|
@@ -227,3 +213,4 @@ test_files:
|
|
227
213
|
- spec/spec_helper.rb
|
228
214
|
- spec/support/controllers.rb
|
229
215
|
- spec/support/helpers.rb
|
216
|
+
has_rdoc:
|