exvo_helpers 0.6.0 → 0.6.1

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: fe102799963f4f6307894386e687d2d464b11846
4
- data.tar.gz: a9d675b50751ee47e3346b82c15ad94bc32e97c4
3
+ metadata.gz: f8a3848aa8222b5da42a20bbeff76a48c83bdf94
4
+ data.tar.gz: 9761562a4472d2922f5c0aa27e05750f64f796c9
5
5
  SHA512:
6
- metadata.gz: dfc10b4873a01b9d67244f97d25f892764a2e63fdc26980b48c78e79ffafe5585da7ecd1565fc1139f875d7e5ca68418bc3d493e61a1e03e18ee3a3f14821262
7
- data.tar.gz: f0e2db14e07a87e95fb3b4e0d9bd2ce39d9158ae3bc8fb0bc32d2cb06acc014a0300286a3bcb8ac9f410a9b01fa847716351ce5b2008ce2b5d183b4fe6ef2b1b
6
+ metadata.gz: 4983aa1cf6582ae33a0394458333ef2dc6f79d171f909379ee9a736f0bf436ff21ae4e0641eed397c6f2b3e879951efa0d839e83b833faa193bb5f28d63d27fe
7
+ data.tar.gz: 8578869bd7d4a8b4370eb87be39b17c30978231233397bb89402a034933ce195a414bd398077ed1452d661ba0c9fb2ce6b6c19d38f6005203735967a712ecee9
@@ -2,6 +2,10 @@
2
2
 
3
3
  Note, that only significant changes are listed.
4
4
 
5
+ ## 0.6.1 (2013-06-14)
6
+
7
+ * `bugherd` view helper
8
+
5
9
 
6
10
  ## 0.6.0 (2013-05-01)
7
11
 
data/README.md CHANGED
@@ -191,6 +191,33 @@ KISSmetrics javascript snippet to track users. Note, that you need to have `ENV[
191
191
  ```
192
192
 
193
193
 
194
+ ### bugherd(apikey)
195
+
196
+ Asynchronous Bugherd javascript snippet.
197
+
198
+ ```ruby
199
+ = bugherd('yourapikey')
200
+ ```
201
+
202
+ =>
203
+
204
+ ```html
205
+ <script type="text/javascript">
206
+ (function (d, t) {
207
+ var bh = d.createElement(t), s = d.getElementsByTagName(t)[0];
208
+ ...
209
+ ```
210
+
211
+ If you'd like to customize the position of the 'Send Feedback' button, you can do this with this CSS snippet:
212
+
213
+ ```css
214
+ #_BH_frame {
215
+ left: 10px !important;
216
+ }
217
+ ```
218
+
219
+ The above code will move the button to the left side.
220
+
194
221
 
195
222
 
196
223
  Copyright © 2011-2013 Exvo.com Development BV, released under the MIT license
@@ -1,5 +1,5 @@
1
1
  module Exvo
2
2
  module Helpers
3
- VERSION = '0.6.0'
3
+ VERSION = '0.6.1'
4
4
  end
5
5
  end
@@ -100,6 +100,21 @@ END
100
100
 
101
101
  out += <<END
102
102
  </script>
103
+ END
104
+
105
+ out.respond_to?(:html_safe) ? out.html_safe : out
106
+ end
107
+
108
+ def bugherd(apikey)
109
+ out = <<END
110
+ <script type='text/javascript'>
111
+ (function (d, t) {
112
+ var bh = d.createElement(t), s = d.getElementsByTagName(t)[0];
113
+ bh.type = 'text/javascript';
114
+ bh.src = '//www.bugherd.com/sidebarv2.js?apikey=#{ apikey }';
115
+ s.parentNode.insertBefore(bh, s);
116
+ })(document, 'script');
117
+ </script>
103
118
  END
104
119
 
105
120
  out.respond_to?(:html_safe) ? out.html_safe : out
@@ -52,4 +52,12 @@ describe Exvo::ViewHelpers do
52
52
  specify { snippet.should match(%r(identify.+#{email})) }
53
53
  end
54
54
 
55
+ describe "#bugherd" do
56
+ let(:snippet) { view_helper.bugherd("123") }
57
+
58
+ specify { snippet.should match(/<script type='text\/javascript'>/) }
59
+ specify { snippet.should match(/www\.bugherd\.com/) }
60
+ specify { snippet.should match(/apikey=123/) }
61
+ end
62
+
55
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exvo_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paweł Gościcki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-01 00:00:00.000000000 Z
11
+ date: 2013-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake