flakey 0.5.0 → 0.6.0
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/.rspec +1 -0
- data/lib/flakey/google_plus.rb +21 -0
- data/lib/flakey/twitter.rb +3 -2
- data/lib/flakey/version.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c51d3dd75fc0ce011738d2cdb55de2ba392a86b
|
4
|
+
data.tar.gz: 3ab08d3a6cb8f7d24313e89e715ca3b9d174efe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d86f8bed97856ffa01e95e1b68ee8eed18dea787c0d28a520185ba336bc62273d011007e5478b0c783cd14fb214ed3caaf6d738b86a5213849154d24eb316477
|
7
|
+
data.tar.gz: 005e23576cc0444c71d5cbee8f7b3dae4859628b49d2b11570a2764d89ad7ef91c29224b8f51056a9228167e6df755e8f7137c2be29969c72476c0380842407c
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/lib/flakey/google_plus.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
module Flakey
|
2
2
|
module GooglePlus
|
3
|
+
include Base
|
4
|
+
|
3
5
|
BASE_URL = "https://plus.google.com"
|
4
6
|
|
5
7
|
# INFO: https://developers.google.com/+/plugins/+1button/
|
@@ -24,5 +26,24 @@ module Flakey
|
|
24
26
|
user_id = user_id || Flakey.configuration.google_plus_user_id
|
25
27
|
BASE_URL + "/#{user_id}"
|
26
28
|
end
|
29
|
+
|
30
|
+
def custom_google_plus_button(options = (), &block)
|
31
|
+
defaults = {
|
32
|
+
url: default_url,
|
33
|
+
class: 'custom-google-plus-button',
|
34
|
+
target: '_blank',
|
35
|
+
label: "label"
|
36
|
+
}
|
37
|
+
settings = defaults.merge(options)
|
38
|
+
label = settings.delete(:label)
|
39
|
+
url = "#{BASE_URL}/share?url=#{CGI.escape(settings[:url])}"
|
40
|
+
settings.delete(:url)
|
41
|
+
|
42
|
+
if block_given?
|
43
|
+
link_to(url, settings, &block)
|
44
|
+
else
|
45
|
+
link_to label, url, settings
|
46
|
+
end
|
47
|
+
end
|
27
48
|
end
|
28
49
|
end
|
data/lib/flakey/twitter.rb
CHANGED
@@ -167,15 +167,16 @@ module Flakey
|
|
167
167
|
}
|
168
168
|
settings = defaults.merge(options)
|
169
169
|
|
170
|
+
label = settings.delete(:label)
|
170
171
|
# Delete these so we can pass the settings directly into link_to
|
171
|
-
%w[url text hashtags related via].each do |url_key|
|
172
|
+
%w[url text hashtags related via label].each do |url_key|
|
172
173
|
settings.delete(url_key.to_sym)
|
173
174
|
end
|
174
175
|
|
175
176
|
if block_given?
|
176
177
|
link_to(url, settings, &block)
|
177
178
|
else
|
178
|
-
link_to
|
179
|
+
link_to label, url, settings
|
179
180
|
end
|
180
181
|
end
|
181
182
|
end
|
data/lib/flakey/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flakey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Tuite
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -74,6 +74,7 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- .gitignore
|
77
|
+
- .rspec
|
77
78
|
- .travis.yml
|
78
79
|
- Gemfile
|
79
80
|
- LICENSE
|