netshade-oembed_links 0.1.5 → 0.1.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/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 0.1.6 / 2009-02-01
2
+
3
+ * 1 minor enhancement
4
+
5
+ * template resolver strips text on output
6
+
1
7
  === 0.1.3 / 2008-10-16
2
8
 
3
9
  * 1 minor enhancement
data/README.txt CHANGED
@@ -62,7 +62,7 @@ OEmbed.transform("Here is a link to amazon http://www.amazon.com/Complete-Aubrey
62
62
  end
63
63
 
64
64
 
65
- To get started quickly in Rails:
65
+ To get started quickly in Rails (< 2.2. oembed_links doesn't work in 2.2 yet, when rendering w/ Rails templates):
66
66
 
67
67
  Copy the included oembed_links_example.yml file to RAILS_ROOT/config/oembed_links.yml,
68
68
  add a dependency to the gem in your environment.rb ( config.gem "oembed_links" )
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'hoe'
3
3
 
4
- Hoe.new('oembed_links', "0.1.3") do |p|
4
+ Hoe.new('oembed_links', "0.1.6") do |p|
5
5
  p.summary = ""
6
6
  p.url = 'http://indystar.com/'
7
7
  p.description = "Easy OEmbed integration for Ruby (and Rails)."
@@ -102,11 +102,11 @@ class OEmbed
102
102
  def render_content(*args, &block)
103
103
  options = (args.last.is_a?(Hash)) ? args.last : { }
104
104
  if options[:template]
105
- @rendered = TemplateResolver.eval_template_for_path(options[:template], @url, @response, self)
105
+ @rendered = TemplateResolver.eval_template_for_path(options[:template], @url, @response, self).strip
106
106
  elsif block_given?
107
- @rendered = yield(@response)
107
+ @rendered = yield(@response).strip
108
108
  else
109
- @rendered = self.to_s
109
+ @rendered = self.to_s.strip
110
110
  end
111
111
  end
112
112
 
@@ -72,6 +72,7 @@ class OEmbed
72
72
  #
73
73
  # The evaluated result of the template will be returned.
74
74
  def self.eval_template_for_path(path, url, data, response)
75
+ rendered_response = nil
75
76
  if defined?(ApplicationController) && defined?(ActionController)
76
77
  if !defined?(ActionController::TestRequest) ||
77
78
  !defined?(ActionController::TestResponse)
@@ -84,7 +85,9 @@ class OEmbed
84
85
  path,
85
86
  200,
86
87
  true,
87
- { :data => data, :url => url, :response => response }).body
88
+ { :data => data,
89
+ :url => url,
90
+ :response => response }).body
88
91
  end
89
92
  if rendered_response.nil? && actual_path = resolve_template_path(path)
90
93
  contents = File.read(actual_path)
data/oembed_links.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{oembed_links}
3
- s.version = "0.1.5"
3
+ s.version = "0.1.6"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Indianapolis Star MD&D"]
@@ -247,7 +247,8 @@ describe OEmbed, "Rails template resolving functions" do
247
247
  OEmbed::TemplateResolver.template_processor = nil
248
248
  @current_path = File.dirname(__FILE__)
249
249
  @template_path = File.join(@current_path, "templates")
250
-
250
+
251
+ gem "actionpack", "< 2.2"
251
252
  require 'actionpack'
252
253
  require 'action_controller'
253
254
  require 'action_controller/test_process'
@@ -256,7 +257,7 @@ describe OEmbed, "Rails template resolving functions" do
256
257
 
257
258
  end
258
259
  ApplicationController.view_paths += [File.dirname(__FILE__)]
259
- Dependencies.mark_for_unload(ApplicationController)
260
+ ActiveSupport::Dependencies.mark_for_unload(ApplicationController)
260
261
  end
261
262
 
262
263
  it "should support Rails-like template paths for template selection" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netshade-oembed_links
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Indianapolis Star MD&D