beef-articles 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -16,35 +16,50 @@ module ArticlesHelper
16
16
  end
17
17
 
18
18
  def digg_link(options, html_options = {})
19
- link_to 'Digg', "http://digg.com/submit?phase=2&url=#{url_for(options)}", html_options.reverse_merge(:class => 'share-link', :id => 'digg-submit', :title => 'Digg this!')
19
+ link_to 'Digg', "http://digg.com/submit?phase=2&url=#{server_url_for(options)}", html_options.reverse_merge(:class => 'share-link', :id => 'digg-submit', :title => 'Digg this!')
20
20
  end
21
21
 
22
22
  def delicious_link(options, html_options = {})
23
- link_to 'delicious', "http://del.icio.us/post?url=#{url_for(options)}", html_options.reverse_merge(:class => 'share-link', :id => 'delicious-submit', :title => 'Save to delicious')
23
+ link_to 'delicious', "http://del.icio.us/post?url=#{server_url_for(options)}", html_options.reverse_merge(:class => 'share-link', :id => 'delicious-submit', :title => 'Save to delicious')
24
24
  end
25
25
 
26
26
  def facebook_link(options, html_options = {})
27
- link_to 'Facebook', "http://www.facebook.com/sharer.php?u=#{url_for(options)}", html_options.reverse_merge(:class => 'share-link', :id => 'facebook-submit', :title => 'Share on Facebook')
27
+ link_to 'Facebook', "http://www.facebook.com/sharer.php?u=#{server_url_for(options)}", html_options.reverse_merge(:class => 'share-link', :id => 'facebook-submit', :title => 'Share on Facebook')
28
28
  end
29
29
 
30
30
  def stumble_link(options, html_options = {})
31
- link_to 'Stumble Upon', "http://www.stumbleupon.com/submit?url=#{url_for(options)}", html_options.reverse_merge(:class => 'share-link', :id => 'stumble-submit', :title => 'Stumble on this')
31
+ link_to 'Stumble Upon', "http://www.stumbleupon.com/submit?url=#{server_url_for(options)}", html_options.reverse_merge(:class => 'share-link', :id => 'stumble-submit', :title => 'Stumble on this')
32
32
  end
33
33
 
34
34
  def mail_link(options, html_options = {})
35
- mail_to nil, "Email", html_options.reverse_merge( :body => url_for(options), :class => 'share-link', :id => 'mail-link', :title => 'Email this to a friend')
35
+ mail_to nil, "Email", html_options.reverse_merge( :body => server_url_for(options), :class => 'share-link', :id => 'mail-link', :title => 'Email this to a friend')
36
36
  end
37
37
 
38
38
  def twitter_link(options, html_options = {})
39
- link_to 'Twitter', "http://twitter.com/home?status=#{url_for(options)}}", html_options.reverse_merge(:class => 'share-link', :id => 'twitter-submit', :title => 'Tweet this')
39
+ link_to 'Twitter', "http://twitter.com/home?status=#{server_url_for(options)}}", html_options.reverse_merge(:class => 'share-link', :id => 'twitter-submit', :title => 'Tweet this')
40
40
  end
41
41
 
42
42
  def reddit_link(options, html_options = {})
43
- link_to 'Reddit', "http://www.reddit.com/submit?url=#{url_for(options)}", html_options.reverse_merge(:class => 'share-link', :id => 'reddit-submit', :title => 'Reddit this!')
43
+ link_to 'Reddit', "http://www.reddit.com/submit?url=#{server_url_for(options)}", html_options.reverse_merge(:class => 'share-link', :id => 'reddit-submit', :title => 'Reddit this!')
44
44
  end
45
45
 
46
46
  def technorati_link(options, html_options = {})
47
- link_to 'Technorati', "http://technorati.com/faves/?add=#{url_for(options)}", html_options.reverse_merge(:class => 'share-link', :id => 'technorati-submit', :title => 'Technorati this!')
47
+ link_to 'Technorati', "http://technorati.com/faves/?add=#{server_url_for(options)}", html_options.reverse_merge(:class => 'share-link', :id => 'technorati-submit', :title => 'Technorati this!')
48
+ end
49
+
50
+ def server_url_for(options = {})
51
+ options ||= {}
52
+ url = case options
53
+ when Hash
54
+ options = { :only_path => true }.update(options.symbolize_keys)
55
+ escape = options.key?(:escape) ? options.delete(:escape) : true
56
+ @controller.send(:url_for, options)
57
+ else
58
+ escape = false
59
+ polymorphic_url(options)
60
+ end
61
+
62
+ escape ? escape_once(url) : url
48
63
  end
49
64
 
50
65
  def archive(options = {} )
data/articles.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{articles}
5
- s.version = "0.3.0"
5
+ s.version = "0.3.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Steve England"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beef-articles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve England