raicebook 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/Rakefile +2 -0
- data/lib/raicebook/helpers.rb +77 -0
- data/lib/raicebook/version.rb +3 -0
- data/lib/raicebook.rb +7 -0
- data/raicebook.gemspec +23 -0
- metadata +85 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'raicebook'
|
2
|
+
|
3
|
+
module Raicebook
|
4
|
+
module Helpers
|
5
|
+
|
6
|
+
def fb_include_tag
|
7
|
+
raw '<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>'
|
8
|
+
end
|
9
|
+
|
10
|
+
def fb_init_tag(options={})
|
11
|
+
default_options = {
|
12
|
+
:status => "true",
|
13
|
+
:cookie => "true",
|
14
|
+
:xfbml => "true",
|
15
|
+
:app_id => "0"
|
16
|
+
}
|
17
|
+
options = default_options.merge(options)
|
18
|
+
|
19
|
+
js = <<-JS
|
20
|
+
FB.init({
|
21
|
+
appId : '#{options[:app_id]}',
|
22
|
+
status : '#{options[:status]}'
|
23
|
+
cookie : '#{options[:cookie]}',
|
24
|
+
xfbml : '#{options[:xfbml]}'
|
25
|
+
});
|
26
|
+
JS
|
27
|
+
|
28
|
+
javascript_tag js
|
29
|
+
end
|
30
|
+
|
31
|
+
def fb_like_button(options={})
|
32
|
+
default_options = {
|
33
|
+
:layout => "standart",
|
34
|
+
:width => "450",
|
35
|
+
:show_faces => "true",
|
36
|
+
:href => request.url
|
37
|
+
}
|
38
|
+
options = default_options.merge(options)
|
39
|
+
|
40
|
+
content_tag("fb:like", "", options)
|
41
|
+
end
|
42
|
+
|
43
|
+
def fb_og_meta(options={})
|
44
|
+
content = String.new
|
45
|
+
|
46
|
+
options.each do |attr,val|
|
47
|
+
content += tag("meta", :property => "og:#{attr}", :content => val) + "\n"
|
48
|
+
end
|
49
|
+
|
50
|
+
content.html_safe
|
51
|
+
end
|
52
|
+
|
53
|
+
def fb_meta(options={})
|
54
|
+
content = String.new
|
55
|
+
|
56
|
+
options.each do |attr,val|
|
57
|
+
content += tag("meta", :property => "fb:#{attr}", :content => val) + "\n"
|
58
|
+
end
|
59
|
+
|
60
|
+
content.html_safe
|
61
|
+
end
|
62
|
+
|
63
|
+
def fb_like_box(options={})
|
64
|
+
default_options = {
|
65
|
+
:width => "292",
|
66
|
+
:show_faces => "true",
|
67
|
+
:stream => "true",
|
68
|
+
:header => "true",
|
69
|
+
:href => request.url
|
70
|
+
}
|
71
|
+
options = default_options.merge(options)
|
72
|
+
|
73
|
+
content_tag("fb:like-box", "", options)
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
data/lib/raicebook.rb
ADDED
data/raicebook.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "raicebook/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "raicebook"
|
7
|
+
s.version = Raicebook::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Bruno Wernimont"]
|
10
|
+
s.email = ["hello@brunowernimont.be"]
|
11
|
+
s.homepage = "http://rubygems.org/gems/raicebook"
|
12
|
+
s.summary = %q{This gem add a lot of usefull facebook helper for rails}
|
13
|
+
s.description = %q{This gem add a lot of usefull facebook helper for rails}
|
14
|
+
|
15
|
+
s.rubyforge_project = "raicebook"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
s.add_dependency('rails', '~> 3.0.3')
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: raicebook
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
version: 0.1.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Bruno Wernimont
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-01-16 00:00:00 +01:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rails
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 3
|
30
|
+
- 0
|
31
|
+
- 3
|
32
|
+
version: 3.0.3
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
description: This gem add a lot of usefull facebook helper for rails
|
36
|
+
email:
|
37
|
+
- hello@brunowernimont.be
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files: []
|
43
|
+
|
44
|
+
files:
|
45
|
+
- .gitignore
|
46
|
+
- Gemfile
|
47
|
+
- Rakefile
|
48
|
+
- lib/raicebook.rb
|
49
|
+
- lib/raicebook/helpers.rb
|
50
|
+
- lib/raicebook/version.rb
|
51
|
+
- raicebook.gemspec
|
52
|
+
has_rdoc: true
|
53
|
+
homepage: http://rubygems.org/gems/raicebook
|
54
|
+
licenses: []
|
55
|
+
|
56
|
+
post_install_message:
|
57
|
+
rdoc_options: []
|
58
|
+
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
segments:
|
67
|
+
- 0
|
68
|
+
version: "0"
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
segments:
|
75
|
+
- 0
|
76
|
+
version: "0"
|
77
|
+
requirements: []
|
78
|
+
|
79
|
+
rubyforge_project: raicebook
|
80
|
+
rubygems_version: 1.3.7
|
81
|
+
signing_key:
|
82
|
+
specification_version: 3
|
83
|
+
summary: This gem add a lot of usefull facebook helper for rails
|
84
|
+
test_files: []
|
85
|
+
|