iodine 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of iodine might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f3c4befa23f4edb3a43a751b7b9b9a0834411b1
4
- data.tar.gz: 59be563a5d91a4dbdc72b06dd282d8acf9f96ad2
3
+ metadata.gz: f7911b148c188d1f152a742917c38f4f0e6842cd
4
+ data.tar.gz: 2b1f3862c8c952d5e81e6f7ab216e048086c1bbd
5
5
  SHA512:
6
- metadata.gz: ebb7e22141e7c3f96ff23c8a7923026193e14409bd00746c84acde2258951eb6ef272ad713db79d93e40541d98a07680fe5a5deab52eea2a067922d550504bd2
7
- data.tar.gz: 94e92158a092f1799b74500b9500c5a22b205d21ef13cc36f8cc589e6eaac618ca13f592b6dde45cbda16a698c0d1e23e197ec9702d8e96e085b59dca4cb4991
6
+ metadata.gz: 61d0143b7066b7d511e628d33bd5d1f2b098238f883b2a68339ed557344f967eac671ed4f18eb7a7f81851a8c3a5ea6fbbe93bede310420fe640210de090edf4
7
+ data.tar.gz: 49f1992df2719f383bbe478efa4bf33be3932dbeca3b06d866a876ba94b00ada59241a08c31fb9522a4d4d361036fdc59284df60961b7095fd24a9fb4980070b
@@ -8,6 +8,12 @@ Please notice that this change log contains changes for upcoming releases as wel
8
8
 
9
9
  ***
10
10
 
11
+ Change log v.0.1.18
12
+
13
+ **Update**: The request now has the shortcut method `Request#host_name` for accessing the host's name (without the port part of the string).
14
+
15
+ ***
16
+
11
17
  Change log v.0.1.17
12
18
 
13
19
  **Credit**: thanks you @frozenfoxx for going through the readme and fixing my broken grammer.
data/README.md CHANGED
@@ -262,12 +262,6 @@ For instance, in Iodine's implementation for the Websocket protocol: Websocket m
262
262
 
263
263
  The exception to the rule is the `ping` implementation. Your protocol's `ping` method will execute in parallel with other parts of your protocol's code. Pinging is a machanism that is often time sensitive and is required to maintain an open connection. For this reason, if your code is working hard on a long task, a ping will still occure automatically in the background and offset any connection timeout.
264
264
 
265
- ## Development
266
-
267
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
268
-
269
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
270
-
271
265
  ## Contributing
272
266
 
273
267
  Bug reports and pull requests are welcome on GitHub at https://github.com/boazsegev/iodine.
@@ -111,6 +111,11 @@ module Iodine
111
111
  self[:scheme]
112
112
  end
113
113
 
114
+ # the host's name (without the port)
115
+ def host_name
116
+ self[:host_name]
117
+ end
118
+
114
119
  # @return [true, false] returns true if the requested was an SSL protocol (true also if the connection is clear-text behind an SSL Proxy, such as with some PaaS providers).
115
120
  def ssl?
116
121
  self[:io].ssl? || self[:scheme] == 'https'.freeze || self[:scheme] == 'wss'.freeze
@@ -11,7 +11,18 @@ module Iodine
11
11
  attr_reader :request
12
12
  # The Http response, also allowing for websocket data
13
13
  attr_reader :response
14
- # this is called while still communicating over Http (during the upgrade process).
14
+ # this shoulw be called while still communicating over Http,
15
+ # as part of the "upgrade" process. The new object should be returned by the {Iodine::Http#on_websocket} handler.
16
+ #
17
+ # i.e.:
18
+ #
19
+ # Iodine::Http.on_websocket do |request, response|
20
+ # next if request.path =~ /refuse/
21
+ # Iodine::Http::WebsocketHandler.new request, response
22
+ # end
23
+ #
24
+ #
25
+ # see also the {WebsocketHandler.call} method for an example.
15
26
  def initialize request, response
16
27
  @request = request
17
28
  @response = response
@@ -37,7 +48,7 @@ module Iodine
37
48
  def on_shutdown
38
49
  end
39
50
 
40
- # This method allows the class itself to act as the Websocket handler, usable with:
51
+ # This method allows the class itself to act as the global Websocket handler, accepting websocket connections. Example use:
41
52
  #
42
53
  # # Iodine::Http::WebsocketHandler's default implementation does nothing.
43
54
  # Iodine::Http.on_websocket Iodine::Http::WebsocketHandler
@@ -48,7 +48,7 @@ module Iodine
48
48
  # the value is usually `nil` unless the protocol instance was created by a different protocol while "upgrading" from one protocol to the next.
49
49
  attr_reader :options
50
50
  # The protocol's Mutex locker. It should be locked whenever your code is runing, unless you are
51
- # writing asynchronouse code.
51
+ # writing asynchronous code.
52
52
  #
53
53
  # Use with care (or, better yet, don't use).
54
54
  attr_reader :locker
@@ -1,3 +1,3 @@
1
1
  module Iodine
2
- VERSION = "0.1.17"
2
+ VERSION = "0.1.18"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iodine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-16 00:00:00.000000000 Z
11
+ date: 2015-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler