action_callback 0.1.0 → 0.2.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 +4 -4
- data/Gemfile +6 -3
- data/README.md +7 -8
- data/action_callback.gemspec +12 -9
- data/lib/action_callback.rb +4 -0
- data/lib/action_callback/callback.rb +2 -0
- data/lib/action_callback/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1408b24ae441a6364097562fbe661d421fce0a04
|
4
|
+
data.tar.gz: e84f0b9768c1b20ea2d7166aff9038bc5b4c1d91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15efcc59e3cdff54ae5a7be3b694362614c8822d6de670ad954f9822c7999ef72bc15d48c286c5d541ddbcb2cc6f1ad567e091528a003152bb1f5a98a5884af0
|
7
|
+
data.tar.gz: e0e49cb0fd4731e3973c08df8cd70e468d462be351be18d99a5a1b76486db0aac51a4b795228a784bc0e99c7521497070752279431110eda10c06c7b98c34d1b
|
data/Gemfile
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
# Specify your gem's dependencies in callback_action.gemspec
|
4
3
|
gemspec
|
5
4
|
|
6
|
-
|
7
|
-
gem
|
5
|
+
group :test do
|
6
|
+
gem "sqlite3"
|
7
|
+
gem 'minitest-reporters'
|
8
|
+
gem 'minitest-debugger'
|
9
|
+
gem 'rails', '4.0.0'
|
10
|
+
end
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# CallbackAction
|
4
4
|
|
5
|
-
This gem gives you ability to add callbacks like `before_action` / `before_fitler` etc to your
|
5
|
+
This gem gives you ability to add callbacks like `before_action` / `before_fitler` etc to your Active Record models and plain ruby classes.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -22,12 +22,10 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
If you are using
|
25
|
+
If you are using Rails, in your Active Record models:
|
26
26
|
|
27
27
|
```ruby
|
28
|
-
class Foobar
|
29
|
-
extend ActionCallback
|
30
|
-
|
28
|
+
class Foobar < ActiveRecord::Base
|
31
29
|
before_action :foobar, on: [:foo, :bar]
|
32
30
|
|
33
31
|
def foo
|
@@ -44,11 +42,12 @@ class Foobar
|
|
44
42
|
end
|
45
43
|
```
|
46
44
|
|
47
|
-
If you are using
|
48
|
-
(but you will still need that when you are defining a plain ruby class):
|
45
|
+
If you are using plain ruby:
|
49
46
|
|
50
47
|
```ruby
|
51
|
-
class Foobar
|
48
|
+
class Foobar
|
49
|
+
extend ActionCallback
|
50
|
+
|
52
51
|
before_action :foobar, on: [:foo, :bar]
|
53
52
|
|
54
53
|
def foo
|
data/action_callback.gemspec
CHANGED
@@ -4,15 +4,18 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'action_callback/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.
|
10
|
-
spec.
|
7
|
+
spec.name = "action_callback"
|
8
|
+
spec.version = ActionCallback::VERSION
|
9
|
+
spec.summary = 'Add callbacks to your ActiveRecord models or plain Ruby classes'
|
10
|
+
spec.description = "Here you can add callbacks to your models using `before_action`, `after_action`"
|
11
11
|
|
12
|
-
spec.
|
13
|
-
|
14
|
-
spec.
|
15
|
-
|
12
|
+
spec.required_ruby_version = ">= 2.0.0"
|
13
|
+
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.authors = ["Edmund Li"]
|
17
|
+
spec.email = ["edmund.xz.lee@gmail.com"]
|
18
|
+
spec.homepage = "https://github.com/EdmundLeex/action_callback"
|
16
19
|
|
17
20
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
21
|
spec.bindir = "exe"
|
@@ -21,5 +24,5 @@ Gem::Specification.new do |spec|
|
|
21
24
|
|
22
25
|
spec.add_development_dependency "bundler", "~> 1.12"
|
23
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
-
spec.add_development_dependency "minitest", "~>
|
27
|
+
spec.add_development_dependency "minitest", "~> 4.2"
|
25
28
|
end
|
data/lib/action_callback.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_callback
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edmund Li
|
@@ -44,15 +44,15 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '4.2'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
55
|
-
description:
|
54
|
+
version: '4.2'
|
55
|
+
description: Here you can add callbacks to your models using `before_action`, `after_action`
|
56
56
|
email:
|
57
57
|
- edmund.xz.lee@gmail.com
|
58
58
|
executables: []
|
@@ -85,7 +85,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
85
85
|
requirements:
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
88
|
+
version: 2.0.0
|
89
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
91
|
- - ">="
|
@@ -93,8 +93,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.
|
96
|
+
rubygems_version: 2.6.8
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
|
-
summary: Add
|
99
|
+
summary: Add callbacks to your ActiveRecord models or plain Ruby classes
|
100
100
|
test_files: []
|