beef-articles 0.3.0 → 0.3.1
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/VERSION +1 -1
- data/app/helpers/articles_helper.rb +23 -8
- data/articles.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
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=#{
|
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=#{
|
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=#{
|
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=#{
|
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 =>
|
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=#{
|
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=#{
|
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=#{
|
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