acts_as_opengraph 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,2 +1,9 @@
1
1
  require 'bundler'
2
- Bundler::GemHelper.install_tasks
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rake/testtask'
5
+ Rake::TestTask.new do |t|
6
+ t.libs << "test"
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ t.verbose = true
9
+ end
@@ -15,6 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.rubyforge_project = "acts_as_opengraph"
16
16
 
17
17
  s.add_development_dependency('sqlite3')
18
+ s.add_development_dependency('rails')
18
19
 
19
20
  s.files = `git ls-files`.split("\n")
20
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -22,11 +22,11 @@ module ActiveRecord
22
22
  options[:columns]["#{att_name}".to_sym] ||= alternative_column_name_for("og_#{att_name}".to_sym)
23
23
  end
24
24
 
25
- write_inheritable_attribute :opengraph_atts, opengraph_atts
26
- class_inheritable_reader :opengraph_atts
25
+ class_attribute :opengraph_atts
26
+ self.opengraph_atts = opengraph_atts
27
27
 
28
- write_inheritable_attribute :options, options
29
- class_inheritable_reader :options
28
+ class_attribute :options
29
+ self.options = options
30
30
 
31
31
  opengraph_atts.each do |att_name|
32
32
  define_method "opengraph_#{att_name}" do
@@ -1,3 +1,3 @@
1
1
  module ActsAsOpengraph
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -24,11 +24,12 @@ class MovieTest < Test::Unit::TestCase
24
24
  MOVIE_NAME = "The Rock"
25
25
  MOVIE_DESCRIPTION = "A renegade general and his group of U.S. Marines take over Alcatraz and threaten San Francisco Bay with biological weapons."
26
26
  MOVIE_URL = "http://www.imdb.com/title/tt0117500/"
27
+ MOVIE_IMAGE = "http://ia.media-imdb.com/rock.jpg"
27
28
 
28
29
  GENERATED_OPENGRAPH_DATA = [
29
30
  {:value=> MOVIE_NAME, :name=> "og:title"},
30
31
  {:value=> "movie", :name=> "og:type"},
31
- {:value=> "http://ia.media-imdb.com/rock.jpg", :name=> "og:image"},
32
+ {:value=> MOVIE_IMAGE, :name=> "og:image"},
32
33
  {:value=> MOVIE_URL, :name=> "og:url"},
33
34
  {:value=> MOVIE_DESCRIPTION, :name=> "og:description"},
34
35
  {:value=> "IMDb", :name=> "og:site_name"}
@@ -36,10 +37,10 @@ class MovieTest < Test::Unit::TestCase
36
37
 
37
38
  GENERATED_META_TAGS = %(<meta property="og:title" content="#{MOVIE_NAME}"/>
38
39
  <meta property="og:type" content="movie"/>
39
- <meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
40
- <meta property="og:url" content="#{MOVIE_URL}"/>
41
- <meta property="og:description" content="#{MOVIE_DESCRIPTION}"/>
42
- <meta property="og:site-name" content="IMDb"/>)
40
+ <meta property="og:image" content="#{Rack::Utils.escape_html(MOVIE_IMAGE)}"/>
41
+ <meta property="og:url" content="#{Rack::Utils.escape_html(MOVIE_URL)}"/>
42
+ <meta property="og:description" content="#{Rack::Utils.escape_html(MOVIE_DESCRIPTION)}"/>
43
+ <meta property="og:site_name" content="IMDb"/>)
43
44
 
44
45
  GENERATED_LIKE_BUTTON = %(<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.imdb.com%2Ftitle%2Ftt0117500%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>)
45
46
  GENERATED_LIKE_BUTTON_CUSTOM_URL = %(<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fmovies%2F6&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_opengraph
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ruben Ascencio
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-29 00:00:00 -07:00
18
+ date: 2011-12-30 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -32,6 +32,20 @@ dependencies:
32
32
  version: "0"
33
33
  type: :development
34
34
  version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: rails
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ type: :development
48
+ version_requirements: *id002
35
49
  description: ActiveRecord extension that turns your models into graph objects. Includes helper methods for adding <meta> tags and the Like Button to your views.
36
50
  email:
37
51
  - galateaweb@gmail.com