sweet_actions 0.2.1 → 0.2.2

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: a2460958332f8a5291485d228c95da9b3c6f38a9
4
- data.tar.gz: 977ce5b64b0d74e726ebc212ab259bc3db1d26e5
3
+ metadata.gz: f9e6b84092d8aaeeaf6249a8f5cf538ccae5eb53
4
+ data.tar.gz: 9185abe50542cef3bbc83b70c34ffcfacf4ce523
5
5
  SHA512:
6
- metadata.gz: 2994cd3afa31f96da8f23a90af9399ff029da96c9c813fab812c34f2c07492a78b891e7b75ff02d4b36895ba6ae6c157ee2223e99817470a8c4e2d002a7006de
7
- data.tar.gz: 568fc472e0f7ba8476ad86e359650f730a128f279fb01aca0e562fb5926e65cafe468f7f812a81894938b041bf63cf489f84cafb4f0bc072fc35b7155b007936
6
+ metadata.gz: e6d93b31fbe5055163bd63638f7f4d46dace29d01266690fcf1957959a4f3525f9a883b8f1830135fcb78b2095c921f1704f2c8d49b9f4fa393028dacc164eda
7
+ data.tar.gz: bf4f7e09c60bff522990e48b32770f7ea35e2b1221b0650215e3d9b563b5cb07cb8a3c24932f9e30acefee5f6539296964ab18c5bfccab9503e8a497a3b37442
@@ -17,6 +17,10 @@ module SweetActions
17
17
 
18
18
  def after_init(options); end
19
19
 
20
+ def before_action
21
+ # optional hook
22
+ end
23
+
20
24
  def action
21
25
  raise "action method is required for #{self.class.name} because it inherits from SweetActions::Action"
22
26
  end
@@ -24,7 +24,7 @@ module SweetActions
24
24
  parts = [namespace, resource_module, action_class_name].compact
25
25
  klass_name = parts.join('::')
26
26
  return klass_name.constantize if klass_defined?(klass_name)
27
- path = parts.map(&:downcase).join('/')
27
+ path = parts.map(&:downcase).join('/')
28
28
  raise SweetActions::Exceptions::ActionNotFound, path: path, class_name: klass_name
29
29
  end
30
30
 
@@ -7,6 +7,7 @@ module SweetActions
7
7
 
8
8
  def perform_action
9
9
  run_action = Proc.new do
10
+ before_action
10
11
  @response_data = action
11
12
  end
12
13
 
@@ -1,3 +1,3 @@
1
1
  module SweetActions
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sweet_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Francis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-06 00:00:00.000000000 Z
11
+ date: 2018-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  requirements: []
175
175
  rubyforge_project:
176
- rubygems_version: 2.6.13
176
+ rubygems_version: 2.5.1
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: A more object oriented approach to controller actions