pubba 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sinatra/pubba/html/helpers.rb +12 -11
- data/lib/sinatra/pubba/page.rb +3 -3
- data/lib/sinatra/pubba/site.rb +1 -1
- data/lib/sinatra/pubba/version.rb +1 -1
- metadata +13 -13
@@ -3,22 +3,23 @@ module Sinatra
|
|
3
3
|
module HTML
|
4
4
|
module Helpers
|
5
5
|
def page_head_tags
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
tags = []
|
7
|
+
@page.head_tags.each do |tag|
|
8
|
+
t = tag.dup
|
9
|
+
type = t.delete(:tag)
|
10
|
+
tags << tag_content(type, '', t)
|
9
11
|
end
|
12
|
+
tags.join('')
|
10
13
|
end
|
11
14
|
|
12
15
|
def page_body_tags
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
tags = []
|
17
|
+
@page.body_tags.dup.each do |tag|
|
18
|
+
t = tag.dup
|
19
|
+
type = t.delete(:tag)
|
20
|
+
tags << tag_content(type, '', t)
|
16
21
|
end
|
17
|
-
|
18
|
-
|
19
|
-
def burst(url)
|
20
|
-
joiner = url.include?("?") ? "&" : "?"
|
21
|
-
"#{url}#{joiner}aid=#{settings.asset_id}"
|
22
|
+
tags.join('')
|
22
23
|
end
|
23
24
|
|
24
25
|
def tag_content(tag, content, attrs={}, self_closing=false)
|
data/lib/sinatra/pubba/page.rb
CHANGED
@@ -88,11 +88,11 @@ module Sinatra
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def add_script_tag(part, url)
|
91
|
-
|
92
|
-
|
91
|
+
h = { tag: 'script', type: "text/javascript" }
|
92
|
+
h[:src] = url.start_with?("http") ? url : "/javascripts/#{name}-#{part}.js"
|
93
93
|
|
94
94
|
tag_set = (part == "head") ? @head_tags : @body_tags
|
95
|
-
maybe_add_tag(tag_set,
|
95
|
+
maybe_add_tag(tag_set, h, :src)
|
96
96
|
end
|
97
97
|
|
98
98
|
def maybe_add_tag(tag_set, hsh, key)
|
data/lib/sinatra/pubba/site.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pubba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-12-05 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sprockets
|
16
|
-
requirement: &
|
16
|
+
requirement: &2151907100 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.1.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2151907100
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: r18n-desktop
|
27
|
-
requirement: &
|
27
|
+
requirement: &2151906380 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.4.11
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2151906380
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &2151905860 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.9.2
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2151905860
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: sinatra
|
49
|
-
requirement: &
|
49
|
+
requirement: &2151905220 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.3.1
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2151905220
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: sinatra-contrib
|
60
|
-
requirement: &
|
60
|
+
requirement: &2151904600 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.3.1
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2151904600
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: yard
|
71
|
-
requirement: &
|
71
|
+
requirement: &2151904060 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2151904060
|
80
80
|
description:
|
81
81
|
email:
|
82
82
|
- andy@stonean.com
|