flakey 0.0.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -58,28 +58,19 @@ module Flakey
58
58
  def tweet_button(options = {})
59
59
  url = options[:url] || request.url
60
60
  text = options[:text]
61
- hashtags = options[:hashtags] ||
62
- Flakey.configuration.tweet_hashtags
63
- label = options[:label] ||
64
- Flakey.configuration.tweet_label
65
- via = options[:via] ||
66
- Flakey.configuration.tweet_via
67
- related = options[:related] ||
68
- Flakey.configuration.tweet_related
69
- size = options[:size] ||
70
- Flakey.configuration.tweet_button_size
71
- class_list = options[:class] ||
72
- Flakey.configuration.tweet_button_class
61
+ hashtags = options[:hashtags] || Flakey.configuration.tweet_hashtags
62
+ label = options[:label] || Flakey.configuration.tweet_label
63
+ via = options[:via] || Flakey.configuration.tweet_via
64
+ related = options[:related] || Flakey.configuration.tweet_related
65
+ size = options[:size] || Flakey.configuration.tweet_button_size
66
+ class_list = options[:class] || Flakey.configuration.tweet_button_class
73
67
 
74
- data_attr = {
75
- :via => via,
76
- :related => related,
77
- :hashtags => hashtags,
78
- :url => url
79
- }
68
+ data_attr = { via: via, related: related, hashtags: hashtags }
80
69
  # Twitter will take the page title if we just leave it out.
81
70
  data_attr.merge!(text: text) unless text.nil?
82
71
  data_attr.merge!(size: size) unless size.nil?
72
+ data_attr.merge!(url: url) unless url.nil?
73
+
83
74
  class_list = class_list ?
84
75
  class_list.concat(' ' + TWEET_BUTTON_CLASS) : TWEET_BUTTON_CLASS
85
76
 
@@ -1,3 +1,3 @@
1
1
  module Flakey
2
- VERSION = "0.0.7"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,7 +1,9 @@
1
- (function(d, s, id) {
2
- var js, fjs = d.getElementsByTagName(s)[0];
3
- if (d.getElementById(id)) return;
4
- js = d.createElement(s); js.id = id;
5
- js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=<%= Flakey.configuration.facebook_app_id %>";
6
- fjs.parentNode.insertBefore(js, fjs);
7
- }(document, 'script', 'facebook-jssdk'));
1
+ <% if defined?(Rails) && !Rails.env.test? %>
2
+ (function(d, s, id) {
3
+ var js, fjs = d.getElementsByTagName(s)[0];
4
+ if (d.getElementById(id)) return;
5
+ js = d.createElement(s); js.id = id;
6
+ js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=<%= Flakey.configuration.facebook_app_id %>";
7
+ fjs.parentNode.insertBefore(js, fjs);
8
+ }(document, 'script', 'facebook-jssdk'));
9
+ <% end %>
@@ -1,9 +1,11 @@
1
- <% if Flakey.configuration.plus_one_button_language %>
2
- window.___gcfg = {lang: '<%= Flakey.configuration.plus_one_button_language %>'};
3
- <% end %>
1
+ <% if defined?(Rails) && !Rails.env.test? %>
2
+ <% if Flakey.configuration.plus_one_button_language %>
3
+ window.___gcfg = {lang: '<%= Flakey.configuration.plus_one_button_language %>'};
4
+ <% end %>
4
5
 
5
- (function() {
6
- var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
7
- po.src = 'https://apis.google.com/js/plusone.js';
8
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
9
- })();
6
+ (function() {
7
+ var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
8
+ po.src = 'https://apis.google.com/js/plusone.js';
9
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
10
+ })();
11
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <% if defined?(Rails) && !Rails.env.test? %>
2
+ !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
3
+ <% end %>
metadata CHANGED
@@ -1,48 +1,48 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flakey
3
3
  version: !ruby/object:Gem::Version
4
+ version: 0.1.0
4
5
  prerelease:
5
- version: 0.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - David Tuite
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-17 00:00:00.000000000 Z
12
+ date: 2013-07-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ! '>='
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- none: false
21
- prerelease: false
22
15
  name: rspec
23
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
24
18
  requirements:
25
19
  - - ! '>='
26
20
  - !ruby/object:Gem::Version
27
21
  version: '0'
28
- none: false
29
22
  type: :development
30
- - !ruby/object:Gem::Dependency
23
+ prerelease: false
31
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
32
26
  requirements:
33
27
  - - ! '>='
34
28
  - !ruby/object:Gem::Version
35
29
  version: '0'
36
- none: false
37
- prerelease: false
30
+ - !ruby/object:Gem::Dependency
38
31
  name: rake
39
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
40
34
  requirements:
41
35
  - - ! '>='
42
36
  - !ruby/object:Gem::Version
43
37
  version: '0'
44
- none: false
45
38
  type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
46
  description: Social helpers for Rails apps.
47
47
  email:
48
48
  - dtuite@gmail.com
@@ -70,7 +70,7 @@ files:
70
70
  - spec/spec_helper.rb
71
71
  - vendor/assets/javascripts/flakey/facebook.js.erb
72
72
  - vendor/assets/javascripts/flakey/google_plus.js.erb
73
- - vendor/assets/javascripts/flakey/twitter.js
73
+ - vendor/assets/javascripts/flakey/twitter.js.erb
74
74
  homepage: ''
75
75
  licenses: []
76
76
  post_install_message:
@@ -78,26 +78,26 @@ rdoc_options: []
78
78
  require_paths:
79
79
  - lib
80
80
  required_ruby_version: !ruby/object:Gem::Requirement
81
+ none: false
81
82
  requirements:
82
83
  - - ! '>='
83
84
  - !ruby/object:Gem::Version
84
85
  version: '0'
85
86
  segments:
86
87
  - 0
87
- hash: -1397062392363678178
88
- none: false
88
+ hash: -4057276441558711601
89
89
  required_rubygems_version: !ruby/object:Gem::Requirement
90
+ none: false
90
91
  requirements:
91
92
  - - ! '>='
92
93
  - !ruby/object:Gem::Version
93
94
  version: '0'
94
95
  segments:
95
96
  - 0
96
- hash: -1397062392363678178
97
- none: false
97
+ hash: -4057276441558711601
98
98
  requirements: []
99
99
  rubyforge_project:
100
- rubygems_version: 1.8.24
100
+ rubygems_version: 1.8.25
101
101
  signing_key:
102
102
  specification_version: 3
103
103
  summary: Makes a bunch of helper methods available for including in your Rails views.
@@ -1 +0,0 @@
1
- !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");