rocketio 0.4.0 → 0.4.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea0d4a3075d390c8d228df3bd4325dbfedf0fa2a
4
- data.tar.gz: 2036177712149f499001e173e754aedf2dbba5b3
3
+ metadata.gz: 39cbcb10e360e5cba9a86831084011c5e070c48b
4
+ data.tar.gz: 099c5bd995fb5e040ba8c027a58a8c6abd604d39
5
5
  SHA512:
6
- metadata.gz: 7ed5c73407168bcf5e7765fdcc23b13f3419dda752d55eaa912bcd262a6d4d770c22c99c1410ab670cce0774582aaa5a882e00368234d7fd7950bd1406ba79a4
7
- data.tar.gz: fe411c3cc506dccfae0de5c0ec0d345f7f82589202ca4fed0e20fb6905558e4f8cbeb8309bceb2da98099529c5240edcd1d6c6b2ef1748755d0b14c6141af3ee
6
+ metadata.gz: d6076d46b0c21a7df963e17ae6089189b911f1472594ebcb7765100bb221433bb90654c277582c49bee0a59f8775c0d0d84e3597f3ff864786deacaa0779a7c5
7
+ data.tar.gz: fc5643cfc2c87e0ae2f36b2ce8fbf7750d6b0a84739879918db895eba4e4586cb73154c32d85fc5cd886a613e48d0e34a257779ef9532e057f52fa05d6e05c60
@@ -14,11 +14,15 @@ module RocketIO
14
14
  def_delegators RocketIO, :"#{env}?"
15
15
  end
16
16
 
17
- def initialize requested_method = RocketIO::INDEX_METHOD, path_params = nil
17
+ def initialize requested_method = RocketIO::INDEX_METHOD, path_params = nil, params = nil
18
18
  @__requested_method__ = requested_method.to_sym
19
19
 
20
20
  @__path_params_array__ = path_params || RocketIO::EMPTY_ARRAY
21
21
  @__path_params_array__.freeze
22
+
23
+ if params
24
+ @__params__ = indifferent_params(params)
25
+ end
22
26
  end
23
27
 
24
28
  # call requested method
@@ -44,37 +48,6 @@ module RocketIO
44
48
  end
45
49
  end
46
50
 
47
- private
48
- def __call__
49
-
50
- validate_or_request_authentication_if_needed
51
- validate_or_request_authorization_if_needed
52
-
53
- __run__ proc {
54
- invoke_before_filter
55
- invoke_around_filter proc {
56
- response.body = public_send(requested_method, *requested_method_arguments)
57
- }
58
- invoke_after_filter
59
- }
60
-
61
- if head? # dropping body on HEAD requests
62
- response.body = RocketIO::EMPTY_ARRAY
63
- else
64
- response.body ||= RocketIO::EMPTY_ARRAY
65
- end
66
-
67
- if env[RocketIO::HTTP_ACCEPT] == RocketIO::APPLICATION_JSON
68
- response[RocketIO::CONTENT_TYPE] = RocketIO::APPLICATION_JSON
69
- end
70
-
71
- response.finish
72
- end
73
-
74
- def __run__ app
75
- app.call
76
- end
77
-
78
51
  def env
79
52
  @__env__
80
53
  end
@@ -121,6 +94,37 @@ module RocketIO
121
94
  def response
122
95
  @__response__ ||= RocketIO::Response.new
123
96
  end
97
+
98
+ private
99
+ def __call__
100
+
101
+ validate_or_request_authentication_if_needed
102
+ validate_or_request_authorization_if_needed
103
+
104
+ __run__ proc {
105
+ invoke_before_filter
106
+ invoke_around_filter proc {
107
+ response.body = public_send(requested_method, *requested_method_arguments)
108
+ }
109
+ invoke_after_filter
110
+ }
111
+
112
+ if head? # dropping body on HEAD requests
113
+ response.body = RocketIO::EMPTY_ARRAY
114
+ else
115
+ response.body ||= RocketIO::EMPTY_ARRAY
116
+ end
117
+
118
+ if env[RocketIO::HTTP_ACCEPT] == RocketIO::APPLICATION_JSON
119
+ response[RocketIO::CONTENT_TYPE] = RocketIO::APPLICATION_JSON
120
+ end
121
+
122
+ response.finish
123
+ end
124
+
125
+ def __run__ app
126
+ app.call
127
+ end
124
128
  end
125
129
 
126
130
  class << Controller
@@ -1,3 +1,3 @@
1
1
  module RocketIO
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocketio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Slee Woo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-01 00:00:00.000000000 Z
11
+ date: 2016-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -203,5 +203,5 @@ rubyforge_project:
203
203
  rubygems_version: 2.5.1
204
204
  signing_key:
205
205
  specification_version: 4
206
- summary: '["rocketio-0.4.0", "Simple routing lib"]'
206
+ summary: '["rocketio-0.4.1", "Simple routing lib"]'
207
207
  test_files: []