em-midori 0.1.5.1 → 0.1.5.2

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: 3959c8ff30ab0b2e7cec8928e735e1fee122c523
4
- data.tar.gz: 895bc19c6ceac8a34b4498f6f900d7d514b681c9
3
+ metadata.gz: 4576b9c865261b29c67d63bb243db75aa6f246e9
4
+ data.tar.gz: aee5b0fe78bace0475a586030a03b09fa3734d56
5
5
  SHA512:
6
- metadata.gz: c210d5205f733618cc67831e324df45bb4c689cd22fd8023dda6c5f52f40515cc56c6ccf8f6435e3a4fcfea39dab8ea732a06e9f9e76246d34435a568f26bbde
7
- data.tar.gz: 970900a6a14f9798e1282c13db98b34aeedbb7c32a8e81f741fc6f634118543c87a2271cd7b7ca2f5385a27c6d27b6d1c164cc98946b6bc970e8f8d289647d96
6
+ metadata.gz: dae5bf2c56c08035a0015b122311211f76df64bbdc3afed592a030e6c22eb971711544f8d546a91c8178e07fa461814d051bdcde3f96064b6eabf001f6c4cb72
7
+ data.tar.gz: 68297ac0859c9f1a37b0dbe54ddb10042f550a952f82d21390310b5b4aa1f59c99a788b315fde25be5bfb07a82d8ce38dce59862008223d87e0e5b6d5a7a6f9f
data/lib/em-midori/api.rb CHANGED
@@ -145,22 +145,23 @@ class Midori::API
145
145
  # @return [nil] nil
146
146
  def use(middleware, *args)
147
147
  middleware = middleware.new(*args)
148
- Midori::CleanRoom.class_exec { middleware.helper }
149
148
  @scope_middlewares << middleware
150
149
  nil
151
150
  end
152
151
 
153
152
  def filter(middleware, *args)
154
153
  middleware = middleware.new(*args)
155
- Midori::CleanRoom.class_exec { middleware.helper }
156
154
  @temp_middlewares << middleware
157
155
  nil
158
156
  end
159
157
 
160
158
  # Helper block for defining methods in APIs
159
+ # @param [Symbol] name name of the method
161
160
  # @yield define what to run in CleanRoom
162
- def helper(&block)
163
- Midori::CleanRoom.class_exec(&block)
161
+ def helper(name, &block)
162
+ Midori::CleanRoom.class_exec do
163
+ define_method(name, &block)
164
+ end
164
165
  end
165
166
 
166
167
  def inherited(subclass)
@@ -20,8 +20,9 @@ class Midori::Middleware
20
20
  response
21
21
  end
22
22
 
23
- # code to be inserted inside CleanRoom
24
- # @return [nil] nil
25
- def helper
23
+ def self.helper(name, &block)
24
+ Midori::CleanRoom.class_exec do
25
+ define_method(name, &block)
26
+ end
26
27
  end
27
28
  end
@@ -1,5 +1,5 @@
1
1
  # Midori Module
2
2
  module Midori
3
3
  # Current Version Code
4
- VERSION = '0.1.5.1'.freeze
4
+ VERSION = '0.1.5.2'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em-midori
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5.1
4
+ version: 0.1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - HeckPsi Lab
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-01 00:00:00.000000000 Z
11
+ date: 2016-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine