share 0.0.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/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # SHARE
2
+
3
+ gem "share"
4
+
5
+ SHARE adds a Rails helper that include simple social share links
6
+
7
+ <%= share_links @post.title %>
8
+
9
+ This would add Twitter/Facebook/Google+ links to share the current page, the title is used in the twitter link
data/Rakefile ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'Share'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+
24
+
25
+
26
+ Bundler::GemHelper.install_tasks
27
+
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Rails.application.routes.draw do
2
+ end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,22 @@
1
+ .share-container {
2
+ list-style: none;
3
+ padding: 0;
4
+ a {
5
+ display: inline-block;
6
+ height: 32px;
7
+ width: 32px;
8
+ }
9
+ .share-item {
10
+ display: inline;
11
+ padding: 0.4em;
12
+ }
13
+ a.twitter {
14
+ background: url('<%= image_path "share/twitter.png" %>') no-repeat;
15
+ }
16
+ a.facebook {
17
+ background: url('<%= image_path "share/facebook.png" %>') no-repeat;
18
+ }
19
+ a.google {
20
+ background: url('<%= image_path "share/googleplus.png" %>') no-repeat;
21
+ }
22
+ }
@@ -0,0 +1,4 @@
1
+ module Share
2
+ class Engine < ::Rails::Engine
3
+ end
4
+ end
@@ -0,0 +1,17 @@
1
+ module Share
2
+ module Helpers
3
+ def share_links text
4
+ url = request.url
5
+ content_tag :ul, :class => "share-container" do |content|
6
+ { :twitter => "http://twitter.com/intent/tweet?&text=" + URI.encode("#{text} #{url})"),
7
+ :facebook => "http://facebook.com/sharer.php?u=#{url}",
8
+ :google => "https://plus.google.com/share?url=#{url}"}.map do |key, value|
9
+ content_tag(:li,
10
+ link_to("", value, :title => "Share on #{key.to_s.humanize}", :class => "share-link #{key}",
11
+ "onclick" => "javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"
12
+ ), :class => "share-item")
13
+ end.join.html_safe
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,3 @@
1
+ module Share
2
+ VERSION = "0.0.1"
3
+ end
data/lib/share.rb ADDED
@@ -0,0 +1,7 @@
1
+ require "share/helpers"
2
+ require "share/engine"
3
+
4
+ module Share
5
+ end
6
+
7
+ ActionView::Base.send :include, Share::Helpers
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :share do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: share
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Samer Buna
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: Add a Rails helper to include simple social share links
31
+ email:
32
+ - samer.buna@gmail.com
33
+ executables: []
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - config/routes.rb
38
+ - lib/share.rb
39
+ - lib/tasks/share_tasks.rake
40
+ - lib/share/version.rb
41
+ - lib/share/engine.rb
42
+ - lib/share/helpers.rb
43
+ - lib/assets/images/share/picasa.png
44
+ - lib/assets/images/share/rss.png
45
+ - lib/assets/images/share/tumblr.png
46
+ - lib/assets/images/share/facebook.png
47
+ - lib/assets/images/share/flickr.png
48
+ - lib/assets/images/share/googleplus.png
49
+ - lib/assets/images/share/linkedin.png
50
+ - lib/assets/images/share/pinterest.png
51
+ - lib/assets/images/share/twitter.png
52
+ - lib/assets/images/share/yahoo.png
53
+ - lib/assets/images/share/youtube.png
54
+ - lib/assets/stylesheets/share.css.scss.erb
55
+ - MIT-LICENSE
56
+ - Rakefile
57
+ - README.md
58
+ homepage: http://github.com/samerbuna/share
59
+ licenses: []
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 1.8.24
79
+ signing_key:
80
+ specification_version: 3
81
+ summary: Social Share Links
82
+ test_files: []