flakey 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d187c4c3ce3d93de1645f91188907f18e16dc02
4
- data.tar.gz: 650a378fb981aaad343ffaecf3f9d9f6f857424d
3
+ metadata.gz: 5c51d3dd75fc0ce011738d2cdb55de2ba392a86b
4
+ data.tar.gz: 3ab08d3a6cb8f7d24313e89e715ca3b9d174efe0
5
5
  SHA512:
6
- metadata.gz: 0191415d53b96b87038fca53fa7ee125db6c44f4fad61f459e81075ae91d79e805dd6bb5578b04e9e39d0bb3a94f59dc4fae41558efa7fa634d4255538a85abf
7
- data.tar.gz: b5e89cf998a0abbb42c8fa194e1e5fbb4b2830bcf39d73a5319b71140fd3178c48d47cd7e6015f9703f8af5dbecb8aa1d3c77e49e396bebcc92cfa1a17bdeb27
6
+ metadata.gz: d86f8bed97856ffa01e95e1b68ee8eed18dea787c0d28a520185ba336bc62273d011007e5478b0c783cd14fb214ed3caaf6d738b86a5213849154d24eb316477
7
+ data.tar.gz: 005e23576cc0444c71d5cbee8f7b3dae4859628b49d2b11570a2764d89ad7ef91c29224b8f51056a9228167e6df755e8f7137c2be29969c72476c0380842407c
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -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
@@ -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 settings.delete(:label), url, settings
179
+ link_to label, url, settings
179
180
  end
180
181
  end
181
182
  end
@@ -1,3 +1,3 @@
1
1
  module Flakey
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "flakey/configuration"
2
+ require "flakey/base"
2
3
  require "flakey/twitter"
3
4
  require "flakey/facebook"
4
5
  require "flakey/github"
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.5.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-01 00:00:00.000000000 Z
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