flame 4.4.6 → 4.5.0

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: 2ed076f9cb6b06e8ff52bcc3ef2b3ed48ddb8367
4
- data.tar.gz: 3dd82460f8151c9fefd4e3b021a1600f265a597f
3
+ metadata.gz: bee4c8c30a16739dcb07c56380cb708417391be2
4
+ data.tar.gz: c4eee8b0d6a07ef8fd989302053fa5d400c96bdc
5
5
  SHA512:
6
- metadata.gz: 58015b03b6ad0d85e50c561e020a4700f9d904ddaccae4a7e4bc6397e4ac39779d7254b4d801ffa5592e28c0e907f1f7851bee62fd61910752e0e93e070a678a
7
- data.tar.gz: a38da0983c8fa3c85bf95c22a3b470a35cb864b9be623a04eeff592f2ce48429460d911dd61080924e7f4199bd354113ddc7bd0a54fba101db24c0b80806c355
6
+ metadata.gz: 898a1ee83de94d30416f8a838dc1f843684d54888c04cd9f660791ef0a60b65deb75e4b395a53af04d150b372042da5324e1ad9527485d79fade1a73f4ba8e34
7
+ data.tar.gz: c8f39a96bdd1b31d170e56e5a9e21e8c328ff4a78551b719a5f9fc982ec7b6435e24547fd60a4b5a2e89524fbdd1092c41062bdc42e7ad815a4769a30fda18c9
@@ -109,8 +109,30 @@ module Flame
109
109
  parts.join('_')
110
110
  end
111
111
 
112
- ## Take public instance method from parent
113
- def inherit_public_methods
112
+ ## Re-define public instance method from parent
113
+ ## @example Inherit controller with parent actions by method
114
+ ## class MyController < BaseController.with_actions
115
+ ## end
116
+ def with_actions
117
+ @with_actions ||= Class.new(self) { extend ParentActions }
118
+ end
119
+ end
120
+
121
+ ## Module for public instance methods re-defining from superclass
122
+ ## @example Inherit controller with parent actions by `extend`
123
+ ## class MyController < BaseController
124
+ ## extend Flame::Controller::ParentActions
125
+ ## end
126
+ module ParentActions
127
+ def inherited(ctrl)
128
+ ctrl.define_parent_actions
129
+ end
130
+
131
+ def self.extended(ctrl)
132
+ ctrl.define_parent_actions
133
+ end
134
+
135
+ def define_parent_actions
114
136
  superclass.public_instance_methods(false).each do |public_method|
115
137
  um = superclass.public_instance_method(public_method)
116
138
  define_method public_method, um
data/lib/flame/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flame
4
- VERSION = '4.4.6'.freeze
4
+ VERSION = '4.5.0'.freeze
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.4.6
4
+ version: 4.5.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: 2016-09-22 00:00:00.000000000 Z
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack