flame 4.16.0 → 4.17.0

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: 03a3ae6bcb2cd8914e8b49c3ed154ee93b339801
4
- data.tar.gz: 1056440b475aa331229edbd2224b7175edbd189a
3
+ metadata.gz: e6ccec989786ef96d130c6526ac47ef646defd74
4
+ data.tar.gz: 20f122fcea6d8eebeb420eb58e93d00f85243084
5
5
  SHA512:
6
- metadata.gz: cb81be67a650c8ee4b330aaeb824843afd23299846917da40853d86bcfcc319acec8e5896edfef2d9a9a8e62d6d96555c88e03b8286a1858ee9c96b82b9f370e
7
- data.tar.gz: 15df77668cb75f4c272565cdc9506edc55a6e809f01e7dc3b8e2470d6246419be13213eb88ff5963ef4aebb6bbb6d83420e0233e145cddb342541c675f3a598b
6
+ metadata.gz: bdcedf23fb41f2cab59be449f0daa40dc529e3b832bf11fe04fa4d1d01c0e008b199580bd107bc7dec5a2935554b5b9016d0277b7c63439b229c37e9bb02275e
7
+ data.tar.gz: 07e37694dd64ab3da6a0ca659fccc3c4832b620a4be57ef13a512b7694acc963e778aeaabb4cf20f7934b75ef92340d0a40b195caa31a9aa581fb91f4770b0e2
@@ -178,11 +178,28 @@ module Flame
178
178
  ## @example Inherit controller with parent actions by method
179
179
  ## class MyController < BaseController.with_actions
180
180
  ## end
181
- def with_actions
181
+ ## @example Define actions from module in controller
182
+ ## class MyController < BaseController
183
+ ## include with_actions Module1
184
+ ## include with_actions Module2
185
+ ## ....
186
+ ## end
187
+ def with_actions(mod = nil)
188
+ return mod.extend(ModuleActions) if mod
182
189
  @with_actions ||= Class.new(self) { extend ParentActions }
183
190
  end
184
191
  end
185
192
 
193
+ ## Extension for modules whose public methods will be defined as actions
194
+ ## via including
195
+ module ModuleActions
196
+ def included(ctrl)
197
+ public_instance_methods.each do |meth|
198
+ ctrl.send :define_method, meth, public_instance_method(meth)
199
+ end
200
+ end
201
+ end
202
+
186
203
  ## Module for public instance methods re-defining from superclass
187
204
  ## @example Inherit controller with parent actions by `extend`
188
205
  ## class MyController < BaseController
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flame
4
- VERSION = '4.16.0'
4
+ VERSION = '4.17.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flame
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.16.0
4
+ version: 4.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-09 00:00:00.000000000 Z
11
+ date: 2017-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack