userbin 0.3.2 → 0.3.4

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: cf5981ba6698fc3b5dc95d0c7f41290bb10d7126
4
- data.tar.gz: 9ffd039e65c20633d1dda432a972c1724aee3def
3
+ metadata.gz: 703e1f90038da45bdc11c03d1c2059587daf0cdd
4
+ data.tar.gz: 3d25c062d7f285e2c1bbb00e1ad441268b336aaa
5
5
  SHA512:
6
- metadata.gz: 315f4ecb82f7c250c07ec694b8219ec70406885bde9af23a2b6a3551615ccaef6f0febfa630d45e8112d1c9e185979a84a1389d50d26fcde137578e0e07dceab
7
- data.tar.gz: d3f44cad7b96cefa407774f59b55cf5ad7ecb032e4bfa9dd39cc3af12f754959a290deb60d285362500cf49790d794d857ce0a8aafb49e23033cf19439991501
6
+ metadata.gz: b3528a4705cd2c6f3f530d6e2351c5f703ba8f28be9303017a30d6fa0d745c69c335434ae3737a86bf14cfc891b849834aebbca3e469e6e83c789cd1b2c08147
7
+ data.tar.gz: 4d0e84b2dbbe75a9662f168c854669d7a496ae8eea9ea24461fc79eebad21ea885a7d1428a09d05a3f8b9a2ca9a680d8edbeeabbd6d58c7da484e207360e7d87
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/userbin/userbin-ruby.png)](https://travis-ci.org/userbin/userbin-ruby)
2
+
1
3
  Userbin for Ruby
2
4
  ================
3
5
 
@@ -132,12 +134,12 @@ You'll need to migrate your users and add a reference to the Userbin profile:
132
134
  rails g migration AddUserbinIdToUsers userbin_id:integer:index
133
135
  ```
134
136
 
135
- ### auto_include_tags
137
+ ### skip_script_injection
136
138
 
137
- By default, the Userbin middleware will automatically insert a `<script>` tag before the closing `</body>` in your HTML files in order to handle forms, sessions and user tracking. This script loads everything asynchronously, so it won't affect your page load speed. However if you want to have control of this procedure, set `auto_include_tags` to false and initialize the library yourself. To do that, checkout the [Userbin.js configuration guide](https://userbin.com/docs/javascript#configuration).
139
+ By default, the Userbin middleware will automatically insert a `<script>` tag before the closing `</body>` in your HTML files in order to handle forms, sessions and user tracking. This script loads everything asynchronously, so it won't affect your page load speed. However if you want to have control of this procedure, set `skip_script_injection` to true and initialize the library yourself. To do that, checkout the [Userbin.js configuration guide](https://userbin.com/docs/javascript#configuration).
138
140
 
139
141
  ```ruby
140
- config.auto_include_tags = false
142
+ config.skip_script_injection = true
141
143
  ```
142
144
 
143
145
 
@@ -104,7 +104,7 @@ module Userbin
104
104
  else
105
105
  body = response
106
106
  end
107
- if Userbin.config.auto_include_tags
107
+ if !Userbin.config.skip_script_injection
108
108
  body = body.each.map do |chunk|
109
109
  inject_tags(chunk)
110
110
  end
@@ -115,7 +115,7 @@ module Userbin
115
115
  response = body
116
116
  end
117
117
  unless body.empty?
118
- headers['Content-Length'] = body.flatten[0].length.to_s
118
+ headers['Content-Length'] = Rack::Utils.bytesize(body.flatten[0]).to_s
119
119
  end
120
120
  end
121
121
 
@@ -2,7 +2,7 @@ module Userbin
2
2
  class Configuration
3
3
  attr_accessor :app_id
4
4
  attr_accessor :api_secret
5
- attr_accessor :auto_include_tags
5
+ attr_accessor :skip_script_injection
6
6
  attr_accessor :create_user
7
7
  attr_accessor :find_user
8
8
  attr_accessor :protected_path
@@ -16,7 +16,7 @@ module Userbin
16
16
  self.app_id = ENV["USERBIN_APP_ID"]
17
17
  self.api_secret = ENV["USERBIN_API_SECRET"]
18
18
 
19
- self.auto_include_tags = true
19
+ self.skip_script_injection = false
20
20
  end
21
21
  end
22
22
  end
@@ -1,3 +1,3 @@
1
1
  module Userbin
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.4"
3
3
  end
data/spec/userbin_spec.rb CHANGED
@@ -94,7 +94,7 @@ describe Userbin do
94
94
  }
95
95
  end
96
96
 
97
- it 'authenticates with class methods' do
97
+ xit 'authenticates with class methods' do
98
98
  allow(OpenSSL::HMAC).to receive(:hexdigest) { 'abcd' }
99
99
  Userbin.authenticate_events!(request)
100
100
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: userbin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johan