flakey 0.7.0 → 0.8.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: fdaa0852e52677cbc342060527c5c57ce03249e9
4
- data.tar.gz: a8482a3dbddbf9b9895963b37f2106fbed04f31b
3
+ metadata.gz: 28b795800a5dcd3ea393bf982545c1ff566b0bef
4
+ data.tar.gz: 78a7668a64523e437a8445b017e763569b2bc17a
5
5
  SHA512:
6
- metadata.gz: 703a7508b1567ce45c8de3e9a64cf5a9d373f7b28094357ce9c190f762b8dc12cf94273dfe73cb97e6cb0da4a37c34012c14eca77d5e55ce97f8d0a058acd115
7
- data.tar.gz: bed81739f31e57756eb30c40a8f0cbee21d895d954e18a98e1f0f1e770014ce3f724e46f9b1c391ad2db5e76cd02792c3f42b65bee3a4423a423aea894d12480
6
+ metadata.gz: fd0e001c015608adb4b797eb5c773893606e8690a4d02d6e438fe1ad8bee816593ed2cc1b8b4ed160012501ec423d5317d4c1e9b9e880ad8594af965025661a2
7
+ data.tar.gz: 3c0f43d85704467a9ebd0fbf7590c92606c3657287a78fb5e536aef35beb468e62ba9ac178821a15519159652fc352bacfc87189160e210655fe1f95b197d9f4
@@ -8,7 +8,7 @@ module Flakey
8
8
  include Base
9
9
 
10
10
  BASE_URL = "https://twitter.com"
11
- SHARE_URL = BASE_URL + "/share"
11
+ SHARE_URL = BASE_URL + "/intent/tweet"
12
12
 
13
13
  # Default HTML classes for the various buttons.
14
14
  TWEET_BUTTON_CLASS = 'twitter-share-button'
@@ -117,10 +117,11 @@ module Flakey
117
117
 
118
118
  # Generate a link which will open a dialog for following the user with
119
119
  # whe specified user_id or screen_name.
120
- def follow_intent_link(text, options = {})
120
+ def follow_intent_link(options = {}, &block)
121
121
  user_id_to_follow = options[:user_id] || Flakey.configuration.twitter_user_id
122
122
  screen_name_to_follow = options[:screen_name] ||
123
123
  Flakey.configuration.twitter_handle
124
+ label = options.has_key?(:label) ? options.delete(:label) : "Follow Me"
124
125
 
125
126
  intent_url = 'https://twitter.com/intent/user?'
126
127
 
@@ -134,7 +135,11 @@ module Flakey
134
135
  intent_url += "screen_name=#{screen_name_to_follow}"
135
136
  end
136
137
 
137
- link_to text, intent_url, options.except(:user_id, :screen_name)
138
+ if block_given?
139
+ link_to(intent_url, options.except(:user_id, :screen_name), &block)
140
+ else
141
+ link_to label, intent_url, options.except(:user_id, :screen_name)
142
+ end
138
143
  end
139
144
 
140
145
  def tweet_url(options = {})
@@ -145,7 +150,7 @@ module Flakey
145
150
  via: Flakey.configuration.tweet_via
146
151
  }
147
152
  settings = defaults.merge(options)
148
- url = "https://twitter.com/intent/tweet?url=#{CGI.escape settings[:url]}"
153
+ url = "#{SHARE_URL}?url=#{CGI.escape settings[:url]}"
149
154
 
150
155
  %w[text hashtags related via].each do |url_key|
151
156
  if settings.has_key?(url_key.to_sym) && settings[url_key.to_sym] != ''
@@ -1,3 +1,3 @@
1
1
  module Flakey
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -60,7 +60,8 @@ describe Flakey::Twitter do
60
60
  before { subject.stub_chain('request.url') { 'http://www.example.com' } }
61
61
 
62
62
  it "should include the url" do
63
- subject.tweet_url().should == "https://twitter.com/share?url=http%3A%2F%2Fwww.example.com"
63
+ expected = "https://twitter.com/intent/tweet?url=http%3A%2F%2Fwww.example.com"
64
+ subject.tweet_url.should == expected
64
65
  end
65
66
 
66
67
  it "should include via" do
@@ -78,7 +79,6 @@ describe Flakey::Twitter do
78
79
  it "should include related" do
79
80
  subject.tweet_url(:related => "someone").should =~ /[&?]related=someone/
80
81
  end
81
-
82
82
  end
83
83
 
84
84
  describe 'custom_tweet_button' do
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flakey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.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: 2014-02-11 00:00:00.000000000 Z
11
+ date: 2014-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Social helpers for Rails apps.
@@ -73,9 +73,9 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
77
- - .rspec
78
- - .travis.yml
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".travis.yml"
79
79
  - Gemfile
80
80
  - LICENSE
81
81
  - README.md
@@ -108,17 +108,17 @@ require_paths:
108
108
  - lib
109
109
  required_ruby_version: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - '>='
111
+ - - ">="
112
112
  - !ruby/object:Gem::Version
113
113
  version: '0'
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - '>='
116
+ - - ">="
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
- rubygems_version: 2.1.11
121
+ rubygems_version: 2.2.2
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Makes a bunch of helper methods available for including in your Rails views.