nanoc_fuel 0.0.1 → 0.0.2

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/README.md CHANGED
@@ -34,9 +34,11 @@ In your nanoc project's lib/helpers.rb file, include one of the helpers:
34
34
  Then, in your layout add any of these:
35
35
 
36
36
  fb_init("FB APP ID HERE")
37
-
37
+
38
38
  fb_comments("url", "num_posts", "width")
39
-
39
+
40
+ fb_like_btn("standard", "450", "true", "true")
41
+
40
42
  ga_tracking("UA-XXXXX")
41
43
 
42
44
  Contact
@@ -14,5 +14,10 @@ module NanocFuel::Helpers
14
14
  Haml::Engine.new(template).render(Object.new, :url => url, :num_posts => num_posts, :width => width)
15
15
  end
16
16
 
17
+ def fb_like_btn(layout, width, show_faces, send)
18
+ template = File.read(File.expand_path("../templates/facebook/fb_like_btn.haml", __FILE__))
19
+ Haml::Engine.new(template).render(Object.new, :layout => layout, :width => width, :show_faces => show_faces, :send => send)
20
+ end
21
+
17
22
  end
18
23
  end
@@ -0,0 +1 @@
1
+ %iframe{:src=>"http://www.facebook.com/plugins/like.php?href&send=#{send}&layout=#{layout}&width=#{width}&show_faces=#{show_faces}&action=like&colorscheme=light&font&height=80", :scrolling=>"no", :frameborder=>"0", :style=>"border:none; overflow:hidden; width:450px; height:80px;", :allowTransparency=>"true"}
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module NanocFuel
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
@@ -30,4 +30,19 @@ class NanocFuel::Helpers::FacebookTest < MiniTest::Unit::TestCase
30
30
  }
31
31
  assert_equal compact(html), compact(fb_init('12345'))
32
32
  end
33
+
34
+ def test_fb_comments
35
+ html = %q{
36
+ <fb:comments href='http://example.com' num_posts='10' width='520'></fb:comments>
37
+ }
38
+ assert_equal compact(html), compact(fb_comments('http://example.com', '10', '520'))
39
+ end
40
+
41
+ def test_fb_like_btn
42
+ html = %q{
43
+ <iframe allowTransparency='true' frameborder='0' scrolling='no' src='http://www.facebook.com/plugins/like.php?href&amp;amp;send=true&amp;amp;layout=standard&amp;amp;width=450&amp;amp;show_faces=true&amp;amp;action=like&amp;amp;colorscheme=light&amp;amp;font&amp;amp;height=80' style='border:none; overflow:hidden; width:450px; height:80px;'></iframe>
44
+ }
45
+ assert_equal compact(html), compact(fb_like_btn("standard", "450", "true", "true"))
46
+ end
47
+
33
48
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: nanoc_fuel
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jack Chu
@@ -62,6 +62,7 @@ files:
62
62
  - lib/nanoc_fuel/helpers/rule_templates/base
63
63
  - lib/nanoc_fuel/helpers/templates/facebook/fb_comments.haml
64
64
  - lib/nanoc_fuel/helpers/templates/facebook/fb_init.haml
65
+ - lib/nanoc_fuel/helpers/templates/facebook/fb_like_btn.haml
65
66
  - lib/nanoc_fuel/helpers/templates/google/ga_tracking_code.haml
66
67
  - lib/nanoc_fuel/tasks.rb
67
68
  - lib/nanoc_fuel/version.rb