nanoc-fuel 0.0.5 → 0.0.6
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.
- data/lib/{nanoc_fuel.rb → nanoc-fuel.rb} +0 -0
- data/lib/nanoc-fuel/helpers/facebook.rb +12 -3
- data/lib/nanoc-fuel/helpers/templates/facebook/fb_meta_admin.haml +1 -0
- data/lib/nanoc-fuel/helpers/templates/facebook/fb_meta_app_id.haml +1 -0
- data/lib/nanoc-fuel/version.rb +1 -1
- data/nanoc-fuel.gemspec +2 -2
- data/test/helpers/facebook_test.rb +16 -4
- metadata +6 -2
File without changes
|
@@ -8,16 +8,25 @@ module NanocFuel::Helpers
|
|
8
8
|
template = File.read(File.expand_path("../templates/facebook/fb_init.haml", __FILE__))
|
9
9
|
Haml::Engine.new(template).render(Object.new, :app_id => app_id)
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
def fb_comments(url, num_posts, width)
|
13
13
|
template = File.read(File.expand_path("../templates/facebook/fb_comments.haml", __FILE__))
|
14
14
|
Haml::Engine.new(template).render(Object.new, :url => url, :num_posts => num_posts, :width => width)
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def fb_like_btn(layout, width, show_faces, send)
|
18
18
|
template = File.read(File.expand_path("../templates/facebook/fb_like_btn.haml", __FILE__))
|
19
19
|
Haml::Engine.new(template).render(Object.new, :layout => layout, :width => width, :show_faces => show_faces, :send => send)
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
|
+
def fb_meta_admin(meta_admin)
|
23
|
+
template = File.read(File.expand_path("../templates/facebook/fb_meta_admin.haml", __FILE__))
|
24
|
+
Haml::Engine.new(template).render(Object.new, :meta_admin => meta_admin)
|
25
|
+
end
|
26
|
+
|
27
|
+
def fb_meta_app_id(meta_app_id)
|
28
|
+
template = File.read(File.expand_path("../templates/facebook/fb_meta_app_id.haml", __FILE__))
|
29
|
+
Haml::Engine.new(template).render(Object.new, :meta_app_id => meta_app_id)
|
30
|
+
end
|
22
31
|
end
|
23
32
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
%meta{:content => "#{meta_admin}", :property => "fb:admins"}
|
@@ -0,0 +1 @@
|
|
1
|
+
%meta{:content => "#{meta_app_id}", :property => "fb:app_id"}
|
data/lib/nanoc-fuel/version.rb
CHANGED
data/nanoc-fuel.gemspec
CHANGED
@@ -6,8 +6,8 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = "nanoc-fuel"
|
7
7
|
s.version = NanocFuel::VERSION
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ["Jack Chu", "Bob Whitney"]
|
10
|
-
s.email = ["jack@jackchu.com", "robertj.whitney@gmail.com"]
|
9
|
+
s.authors = ["Jack Chu", "Bob Whitney", "Winter Lee"]
|
10
|
+
s.email = ["jack@jackchu.com", "robertj.whitney@gmail.com", "wintafay@gmail.com"]
|
11
11
|
s.homepage = "https://github.com/kamui/nanoc-fuel"
|
12
12
|
s.summary = %q{nanoc extension that adds useful helpers (facebook, google analytics, etc).}
|
13
13
|
s.description = %q{}
|
@@ -4,7 +4,6 @@ class NanocFuel::Helpers::FacebookTest < MiniTest::Unit::TestCase
|
|
4
4
|
include NanocFuel::Helpers::Facebook
|
5
5
|
|
6
6
|
def test_fb_init
|
7
|
-
|
8
7
|
html = %q{
|
9
8
|
<div id='fb-root'></div>
|
10
9
|
<script type='text/javascript'>
|
@@ -31,19 +30,32 @@ class NanocFuel::Helpers::FacebookTest < MiniTest::Unit::TestCase
|
|
31
30
|
}
|
32
31
|
assert_equal compact(html), compact(fb_init('12345'))
|
33
32
|
end
|
34
|
-
|
33
|
+
|
35
34
|
def test_fb_comments
|
36
35
|
html = %q{
|
37
36
|
<fb:comments href='http://example.com' num_posts='10' width='520'></fb:comments>
|
38
37
|
}
|
39
38
|
assert_equal compact(html), compact(fb_comments('http://example.com', '10', '520'))
|
40
39
|
end
|
41
|
-
|
40
|
+
|
42
41
|
def test_fb_like_btn
|
43
42
|
html = %q{
|
44
43
|
<iframe allowTransparency='true' frameborder='0' scrolling='no' src='//www.facebook.com/plugins/like.php?href&amp;send=true&amp;layout=standard&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80' style='border:none; overflow:hidden; width:450px; height:80px;'></iframe>
|
45
44
|
}
|
46
45
|
assert_equal compact(html), compact(fb_like_btn("standard", "450", "true", "true"))
|
47
46
|
end
|
48
|
-
|
47
|
+
|
48
|
+
def test_fb_meta_admin
|
49
|
+
html = %q{
|
50
|
+
<meta content='210427235657242' property='fb:admins' />
|
51
|
+
}
|
52
|
+
assert_equal compact(html), compact(fb_meta_admin("210427235657242"))
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_fb_meta_app_id
|
56
|
+
html = %q{
|
57
|
+
<meta content='210427235657242' property='fb:app_id' />
|
58
|
+
}
|
59
|
+
assert_equal compact(html), compact(fb_meta_app_id("210427235657242"))
|
60
|
+
end
|
49
61
|
end
|
metadata
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
name: nanoc-fuel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jack Chu
|
9
9
|
- Bob Whitney
|
10
|
+
- Winter Lee
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
@@ -39,6 +40,7 @@ description: ""
|
|
39
40
|
email:
|
40
41
|
- jack@jackchu.com
|
41
42
|
- robertj.whitney@gmail.com
|
43
|
+
- wintafay@gmail.com
|
42
44
|
executables: []
|
43
45
|
|
44
46
|
extensions: []
|
@@ -52,6 +54,7 @@ files:
|
|
52
54
|
- LICENSE
|
53
55
|
- README.md
|
54
56
|
- Rakefile
|
57
|
+
- lib/nanoc-fuel.rb
|
55
58
|
- lib/nanoc-fuel/base.rb
|
56
59
|
- lib/nanoc-fuel/filters.rb
|
57
60
|
- lib/nanoc-fuel/helpers.rb
|
@@ -62,10 +65,11 @@ files:
|
|
62
65
|
- lib/nanoc-fuel/helpers/templates/facebook/fb_comments.haml
|
63
66
|
- lib/nanoc-fuel/helpers/templates/facebook/fb_init.haml
|
64
67
|
- lib/nanoc-fuel/helpers/templates/facebook/fb_like_btn.haml
|
68
|
+
- lib/nanoc-fuel/helpers/templates/facebook/fb_meta_admin.haml
|
69
|
+
- lib/nanoc-fuel/helpers/templates/facebook/fb_meta_app_id.haml
|
65
70
|
- lib/nanoc-fuel/helpers/templates/google/ga_tracking_code.haml
|
66
71
|
- lib/nanoc-fuel/tasks.rb
|
67
72
|
- lib/nanoc-fuel/version.rb
|
68
|
-
- lib/nanoc_fuel.rb
|
69
73
|
- nanoc-fuel.gemspec
|
70
74
|
- test/helpers/facebook_test.rb
|
71
75
|
- test/helpers/google_test.rb
|