sharrando 0.2 → 0.3
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.
- checksums.yaml +4 -4
- data/lib/sharrando/sharrando.rb +7 -1
- data/lib/sharrando/social.rb +6 -0
- data/lib/sharrando/version.rb +1 -1
- data/spec/sharrando_spec.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdfc577976ba08c17f1ed9578520c4db18d802d2
|
4
|
+
data.tar.gz: 0c41e0e1e83d282f0162edef79147a4e90951668
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d19efd4899522063994c3b227a273f297593718887586b0e9f21c5d8d13140479678b522e6371a45071d17f537dd35e9e03ea17cb018eb6cf8c68ae979a6554
|
7
|
+
data.tar.gz: fe01eca3a65e5eb015e1669f7febc2603fff4217f37dc618df794270324027f4f54ac99cd1ebde2ebd0ccd4f0c9f54a1b245071d7200335c01270745d0cc8aec
|
data/lib/sharrando/sharrando.rb
CHANGED
@@ -9,8 +9,14 @@
|
|
9
9
|
#++
|
10
10
|
|
11
11
|
module Sharrando
|
12
|
-
def
|
12
|
+
def sharrando_on(social, *things)
|
13
13
|
things.each { |k, v| things[k] = CGI::escape(v) if v.is_a?(String) }
|
14
14
|
Social.new.send(social, *things)
|
15
15
|
end
|
16
|
+
|
17
|
+
Social.list.each do |social|
|
18
|
+
define_method(:"sharrando_on_#{social}") do |*things|
|
19
|
+
sharrando_on(social, *things)
|
20
|
+
end
|
21
|
+
end
|
16
22
|
end
|
data/lib/sharrando/social.rb
CHANGED
@@ -45,5 +45,11 @@ module Sharrando
|
|
45
45
|
def linkedin(url: url, title: title, description: description, source: source)
|
46
46
|
"http://www.linkedin.com/shareArticle?mini=true&url=#{url}&title=#{title}&summary=#{description}&source=#{source}"
|
47
47
|
end
|
48
|
+
|
49
|
+
class << self
|
50
|
+
def list
|
51
|
+
%i(email twitter facebook google_plus tumblr delicious linkedin)
|
52
|
+
end
|
53
|
+
end
|
48
54
|
end
|
49
55
|
end
|
data/lib/sharrando/version.rb
CHANGED
data/spec/sharrando_spec.rb
CHANGED
@@ -3,8 +3,13 @@ require 'sharrando'
|
|
3
3
|
include Sharrando
|
4
4
|
|
5
5
|
describe Sharrando do
|
6
|
-
it 'gets twitter
|
7
|
-
url =
|
6
|
+
it 'gets twitter sharing url' do
|
7
|
+
url = sharrando_on(:twitter, text: 'lololol')
|
8
|
+
expect(url).to be_eql('https://twitter.com/home?status=lololol')
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'gets twitter sharing url via custom helper' do
|
12
|
+
url = sharrando_on_twitter(text: 'lololol')
|
8
13
|
expect(url).to be_eql('https://twitter.com/home?status=lololol')
|
9
14
|
end
|
10
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sharrando
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|