flakey 0.8.0 → 0.8.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.
- checksums.yaml +4 -4
- data/lib/flakey/twitter.rb +5 -1
- data/lib/flakey/version.rb +1 -1
- data/spec/flakey/twitter_spec.rb +10 -4
- 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: 6df7cde2f608268b06bd0af47b20c903ac6638c3
|
4
|
+
data.tar.gz: 6f1b37822dc4a4d6423242129208c2044fca2e79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d3f604f7624053c37bd201936dac52d49c3f5193076658d07ac816473dfda3fa0bd3d0c42c0b74d1a6f54f0bd2de60cc04cd71688ff34297348f1df7303ffa2
|
7
|
+
data.tar.gz: 8228db43a4d10f6de25515bdec6fe9c141cb303d88fa0fdcbf71f09bf8184386cd1b8ff403d87b22ccc982e46a7ae312aa0feb6aaf00e92806622a2c850b5f53
|
data/lib/flakey/twitter.rb
CHANGED
@@ -80,11 +80,15 @@ module Flakey
|
|
80
80
|
data_attr.merge!(text: sanitize(text)) unless text.nil?
|
81
81
|
data_attr.merge!(size: size) unless size.nil?
|
82
82
|
data_attr.merge!(url: url) unless url.nil?
|
83
|
+
data_attr.merge!(options[:data]) unless options[:data].nil?
|
83
84
|
|
84
85
|
class_list = class_list ?
|
85
86
|
class_list.concat(' ' + TWEET_BUTTON_CLASS) : TWEET_BUTTON_CLASS
|
86
87
|
|
87
|
-
|
88
|
+
settings = { class: class_list, data: data_attr }
|
89
|
+
settings.merge!(id: options[:id]) if options[:id].present?
|
90
|
+
|
91
|
+
link_to "Tweet", SHARE_URL, settings
|
88
92
|
end
|
89
93
|
|
90
94
|
# Generate a traditional follow button. This method needs the Twitter
|
data/lib/flakey/version.rb
CHANGED
data/spec/flakey/twitter_spec.rb
CHANGED
@@ -4,6 +4,7 @@ require 'action_view'
|
|
4
4
|
|
5
5
|
class DummyHelper
|
6
6
|
include ::ActionView::Helpers::UrlHelper
|
7
|
+
include ::ActionView::Helpers::SanitizeHelper
|
7
8
|
include Flakey::Twitter
|
8
9
|
end
|
9
10
|
|
@@ -22,20 +23,25 @@ describe Flakey::Twitter do
|
|
22
23
|
|
23
24
|
describe "#tweet_button" do
|
24
25
|
before { subject.stub_chain('request.url') { '' } }
|
26
|
+
let(:base) { Flakey::Twitter::SHARE_URL }
|
25
27
|
|
26
28
|
it "should append to the class list" do
|
27
29
|
subject.should_receive(:link_to)
|
28
|
-
.with("Tweet",
|
29
|
-
hash_including(class: 'hello twitter-share-button'))
|
30
|
+
.with("Tweet", base, hash_including(class: 'hello twitter-share-button'))
|
30
31
|
subject.tweet_button(class: 'hello')
|
31
32
|
end
|
32
33
|
|
33
34
|
it "should work without a class argument" do
|
34
35
|
subject.should_receive(:link_to)
|
35
|
-
.with("Tweet",
|
36
|
-
hash_including(class: 'twitter-share-button'))
|
36
|
+
.with("Tweet", base, hash_including(class: 'twitter-share-button'))
|
37
37
|
subject.tweet_button
|
38
38
|
end
|
39
|
+
|
40
|
+
it "should facilitate an id" do
|
41
|
+
subject.should_receive(:link_to)
|
42
|
+
.with("Tweet", base, hash_including(id: 'the-id'))
|
43
|
+
subject.tweet_button(id: 'the-id')
|
44
|
+
end
|
39
45
|
end
|
40
46
|
|
41
47
|
describe "#follow_button" do
|
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.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Tuite
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|