evil-front 0.3.3 → 0.3.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dac3af1ab6c5c7d20ff843a7f619e8dab0bc72eb
|
4
|
+
data.tar.gz: 7226a706f77f65f141318c5b09a262fbb808f17a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51c3c41d498002ff1c054f76be6145a12d493d620e2b6f8af8d4c5e2856dd6cfc9be13238fc8fd1680dc94a6760e82f4c1e75741f6195c2b46d3eef427f1e969
|
7
|
+
data.tar.gz: 087caae7b5b4d34f5ac2b0c653350d02d5fcd50cb30e0e780c12596a59f0d7b3781be8dfd9a3eedbe1d582524307ebe0dd47511be5b1d8453252c8ca5d4e467f
|
data/ChangeLog.md
CHANGED
@@ -7,7 +7,15 @@ module EvilFront::Helpers
|
|
7
7
|
# You can set subtitles (order will be reversed):
|
8
8
|
#
|
9
9
|
# - title 'FAQ', 'Ask'
|
10
|
+
#
|
11
|
+
# By default `title_tag` will add site name to page title. You can show only
|
12
|
+
# page title by `no_site` option:
|
13
|
+
#
|
14
|
+
# - title 'Site Home', no_site: true
|
10
15
|
def title(*titles)
|
16
|
+
options = titles.extract_options!
|
17
|
+
@evil_front_no_site_in_title = true if options[:no_site]
|
18
|
+
|
11
19
|
@evil_front_titles ||= []
|
12
20
|
@evil_front_titles += titles
|
13
21
|
end
|
@@ -17,11 +17,14 @@ module EvilFront::Helpers
|
|
17
17
|
#
|
18
18
|
# = title_tag('Foo Company', separator: ' * ')
|
19
19
|
def title_tag(*site)
|
20
|
-
@evil_front_titles ||= []
|
21
20
|
options = site.extract_options!
|
22
21
|
separator = options[:separator] || (I18n.locale == :ru ? ' — ' : ' - ')
|
23
|
-
|
24
|
-
|
22
|
+
|
23
|
+
site = [] if @evil_front_no_site_in_title
|
24
|
+
|
25
|
+
@evil_front_titles ||= []
|
26
|
+
titles = (@evil_front_titles + site).compact
|
27
|
+
titles = titles.join(separator)
|
25
28
|
EvilFront.html_safe("<title>#{ EvilFront.escape(titles) }</title>")
|
26
29
|
end
|
27
30
|
end
|
data/lib/evil-front/version.rb
CHANGED
data/spec/helpers_spec.rb
CHANGED
@@ -142,6 +142,11 @@ describe EvilFront::Helpers do
|
|
142
142
|
title_tag.should == '<title><B></title>'
|
143
143
|
end
|
144
144
|
|
145
|
+
it 'hides site name on request' do
|
146
|
+
title 'Page', no_site: true
|
147
|
+
title_tag('Site').should == '<title>Page</title>'
|
148
|
+
end
|
149
|
+
|
145
150
|
end
|
146
151
|
|
147
152
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evil-front
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Sitnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|