userbin 0.1.3 → 0.1.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/userbin/authentication.rb +11 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4283d8611ee035f2141284b2c339d5244f2830fa
4
- data.tar.gz: 0200a7e005412dc60e56fee0693fcea5a1f826bd
3
+ metadata.gz: 3b49115ba8bce94342e0738a96b33f6c95102e9b
4
+ data.tar.gz: 0b9596b630e74103533891606a1cdd96aa7214c4
5
5
  SHA512:
6
- metadata.gz: 2980f02fb4669639ac88c121141959499e6e783dc23ca58f4dc41156838a3639f626e55537ec0a04b4d8f4016857400cee9e8cc69f7a10bb5184fa938a55a4c4
7
- data.tar.gz: 4735bd77af93832204838b1776c0779c77056af02f31e19778e7b4bc92933f07a0fa1214dd2f592f86c49084d79d2e6fe767b56e22ae7b3959a684916148f6d4
6
+ metadata.gz: a6c29ce4ffc880fa041f2c429427a4bcec59078ec2777b2d2b19d553721392e58561219c42edd533528cabe9454a1dd88f4fb4526739f0993ad3bda36d0c0623
7
+ data.tar.gz: e67479d5e41349e976d87f462afff529e5d0b2d11cdd2e2ded7e3f07093e69b30322b80760ea0129b638a2a5d0cbfd451251bc00501207f238cd1043b873b4c1
@@ -56,14 +56,14 @@ module Userbin
56
56
 
57
57
  def link_tags(login_path)
58
58
  <<-LINK_TAGS
59
- <link rel="userbin:root" href="/">
60
- <link rel="userbin:login" href="#{login_path}">
59
+ <link rel="userbin:root" href="/" />
60
+ <link rel="userbin:login" href="#{login_path}" />
61
61
  LINK_TAGS
62
62
  end
63
63
 
64
64
  def meta_tag
65
65
  <<-META_TAG
66
- <meta property="userbin:events" content="/userbin">
66
+ <meta property="userbin:events" content="/userbin" />
67
67
  META_TAG
68
68
  end
69
69
 
@@ -109,11 +109,17 @@ module Userbin
109
109
  def generate_response(env, signature, data)
110
110
  status, headers, response = @app.call(env)
111
111
  if headers['Content-Type'] && headers['Content-Type']['text/html']
112
- body = response.each.map do |chunk|
112
+ if response.respond_to?(:body)
113
+ body = [*response.body]
114
+ else
115
+ body = response
116
+ end
117
+
118
+ body = body.each.map do |chunk|
113
119
  inject_tags(chunk)
114
120
  end
115
121
 
116
- if response.class.name.end_with?('::Response')
122
+ if response.respond_to?(:body)
117
123
  response.body = body
118
124
  else
119
125
  response = body
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.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johan