aspector 0.13.1 → 0.14.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 +7 -0
- data/.gitignore +14 -0
- data/.rubocop.yml +26 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +8 -11
- data/Changelog.md +59 -0
- data/Gemfile +9 -14
- data/Gemfile.lock +84 -50
- data/README.md +118 -0
- data/Rakefile +6 -22
- data/aspector.gemspec +15 -127
- data/benchmarks/after_benchmark.rb +28 -0
- data/benchmarks/around_advice_benchmark.rb +35 -0
- data/benchmarks/around_benchmark.rb +32 -0
- data/benchmarks/before_benchmark.rb +28 -0
- data/benchmarks/benchmark_helper.rb +17 -0
- data/benchmarks/combined_benchmark.rb +36 -0
- data/benchmarks/method_invocation_benchmark.rb +30 -0
- data/benchmarks/raw_benchmark.rb +39 -0
- data/examples/activerecord_hooks.rb +10 -15
- data/examples/around_example.rb +20 -31
- data/examples/aspector_apply_example.rb +10 -17
- data/examples/aspector_example.rb +7 -16
- data/examples/cache_aspect.rb +20 -30
- data/examples/design_by_contract.rb +20 -44
- data/examples/exception_handler.rb +12 -20
- data/examples/exception_handler2.rb +16 -24
- data/examples/implicit_method_option_test.rb +8 -16
- data/examples/interception_options_example.rb +71 -0
- data/examples/logging_aspect.rb +16 -24
- data/examples/process_aspector.rb +13 -0
- data/examples/retry_aspect.rb +20 -20
- data/lib/aspector.rb +17 -15
- data/lib/aspector/advice.rb +44 -57
- data/lib/aspector/advice_metadata.rb +10 -11
- data/lib/aspector/aspect_instances.rb +2 -3
- data/lib/aspector/base.rb +6 -368
- data/lib/aspector/base_class_methods.rb +24 -55
- data/lib/aspector/deferred_logic.rb +3 -4
- data/lib/aspector/deferred_option.rb +5 -10
- data/lib/aspector/interception.rb +356 -0
- data/lib/aspector/logger.rb +18 -45
- data/lib/aspector/logging.rb +10 -29
- data/lib/aspector/method_matcher.rb +5 -6
- data/lib/aspector/object_extension.rb +4 -12
- data/lib/aspector/version.rb +3 -0
- data/spec/examples_spec.rb +59 -0
- data/spec/functionals/aspect_for_multiple_targets_spec.rb +54 -0
- data/spec/functionals/aspect_interception_options_accessing_spec.rb +112 -0
- data/spec/functionals/aspect_on_a_class_spec.rb +159 -0
- data/spec/functionals/aspect_on_an_instance_spec.rb +66 -0
- data/spec/functionals/aspector_spec.rb +138 -0
- data/spec/functionals/aspects_combined_spec.rb +37 -0
- data/spec/functionals/aspects_execution_order_spec.rb +61 -0
- data/spec/functionals/aspects_on_private_methods_spec.rb +82 -0
- data/spec/spec_helper.rb +20 -21
- data/spec/support/class_builder.rb +44 -0
- data/spec/units/advice_spec.rb +49 -0
- data/spec/units/advices/after_spec.rb +328 -0
- data/spec/units/advices/around_spec.rb +336 -0
- data/spec/units/advices/before_filter_spec.rb +287 -0
- data/spec/units/advices/before_spec.rb +237 -0
- data/spec/units/advices/raw_spec.rb +67 -0
- data/spec/units/base_class_methods_spec.rb +262 -0
- data/spec/units/base_spec.rb +133 -0
- data/spec/units/deferred_logic_spec.rb +35 -0
- data/spec/units/logger_spec.rb +20 -0
- data/spec/units/logging_spec.rb +85 -0
- data/spec/units/method_matcher_spec.rb +95 -0
- data/spec/units/object_extension_spec.rb +11 -0
- data/spec/units/special_chars_spec.rb +128 -0
- metadata +98 -246
- data/.document +0 -5
- data/.rvmrc +0 -8
- data/README.rdoc +0 -80
- data/VERSION +0 -1
- data/performance-tests/after_test.rb +0 -25
- data/performance-tests/around_advice_benchmark.rb +0 -66
- data/performance-tests/around_test.rb +0 -27
- data/performance-tests/before_test.rb +0 -25
- data/performance-tests/combined_test.rb +0 -33
- data/performance-tests/method_invocation_test.rb +0 -25
- data/performance-tests/raw_test.rb +0 -37
- data/performance-tests/test_helper.rb +0 -9
- data/run_all_examples.sh +0 -12
- data/spec/functional/advices_on_private_methods_spec.rb +0 -21
- data/spec/functional/aspect_on_eigen_class_spec.rb +0 -72
- data/spec/functional/aspect_on_object_spec.rb +0 -20
- data/spec/functional/aspector_spec.rb +0 -140
- data/spec/functional/aspects_combined_spec.rb +0 -48
- data/spec/functional/execution_order_spec.rb +0 -42
- data/spec/unit/advice_spec.rb +0 -4
- data/spec/unit/after_spec.rb +0 -88
- data/spec/unit/around_spec.rb +0 -76
- data/spec/unit/base_class_methods_spec.rb +0 -28
- data/spec/unit/base_spec.rb +0 -112
- data/spec/unit/before_spec.rb +0 -125
- data/spec/unit/deferred_logic_spec.rb +0 -23
- data/spec/unit/method_matcher_spec.rb +0 -43
- data/spec/unit/raw_spec.rb +0 -53
- data/spec/unit/special_chars_spec.rb +0 -122
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe Aspector::DeferredLogic do
|
|
4
|
+
describe '.new' do
|
|
5
|
+
pending
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
describe '#apply' do
|
|
9
|
+
context 'block in deferred logic' do
|
|
10
|
+
let(:klass) do
|
|
11
|
+
ClassBuilder.build do
|
|
12
|
+
def self.exec
|
|
13
|
+
'class-exec'
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
let(:logic) { described_class.new(-> { exec }) }
|
|
19
|
+
|
|
20
|
+
it 'should work with block' do
|
|
21
|
+
expect(logic.apply(klass)).to eq 'class-exec'
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
context 'block with argument in deferred logic' do
|
|
26
|
+
let(:argument_value) { rand }
|
|
27
|
+
let(:klass) { ClassBuilder.build }
|
|
28
|
+
let(:logic) { described_class.new(->(arg) { arg }) }
|
|
29
|
+
|
|
30
|
+
it 'block can take an argument' do
|
|
31
|
+
expect(logic.apply(klass, argument_value)).to eq argument_value
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe Aspector::Logger do
|
|
4
|
+
let(:context) { '' }
|
|
5
|
+
subject { described_class.new(context) }
|
|
6
|
+
|
|
7
|
+
describe '.new' do
|
|
8
|
+
it 'should store a context' do
|
|
9
|
+
expect(subject.context).to eq context
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it 'should set a log level' do
|
|
13
|
+
expect(subject.level).to_not be_nil
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
describe '#postfix' do
|
|
18
|
+
pending
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe Aspector::Logging do
|
|
4
|
+
subject { described_class }
|
|
5
|
+
let(:context) { double }
|
|
6
|
+
|
|
7
|
+
describe '.get_logger' do
|
|
8
|
+
before do
|
|
9
|
+
subject.instance_variable_set('@logger', logger)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
after do
|
|
13
|
+
subject.instance_variable_set('@logger', nil)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
let(:logger) { nil }
|
|
17
|
+
let(:klass_name) { 'NonExisting' }
|
|
18
|
+
|
|
19
|
+
context 'and given logger class doesnt exist' do
|
|
20
|
+
before do
|
|
21
|
+
expect(ENV)
|
|
22
|
+
.to receive(:[])
|
|
23
|
+
.and_return(klass_name)
|
|
24
|
+
.at_least(:once)
|
|
25
|
+
|
|
26
|
+
expect($stderr)
|
|
27
|
+
.to receive(:puts)
|
|
28
|
+
.with("#{klass_name} is not a valid constant name!")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it 'should use Aspector::Logger' do
|
|
32
|
+
expect(subject.get_logger(context)).to be_instance_of(Aspector::Logger)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
context 'and given logger class exists' do
|
|
37
|
+
let(:dummy_logger) { 'DummyLogger' }
|
|
38
|
+
|
|
39
|
+
before do
|
|
40
|
+
expect(ENV)
|
|
41
|
+
.to receive(:[])
|
|
42
|
+
.and_return(dummy_logger)
|
|
43
|
+
.at_least(:once)
|
|
44
|
+
|
|
45
|
+
expect(Object)
|
|
46
|
+
.to receive(:const_get)
|
|
47
|
+
.with(dummy_logger)
|
|
48
|
+
.and_return(Aspector::Logger)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
it 'should use it' do
|
|
52
|
+
expect(subject.get_logger(context)).to be_instance_of(Aspector::Logger)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
describe '.deconstantize' do
|
|
58
|
+
context 'and given logger class doesnt exist' do
|
|
59
|
+
let(:klass_name) { 'NonExisting' }
|
|
60
|
+
|
|
61
|
+
before do
|
|
62
|
+
expect($stderr)
|
|
63
|
+
.to receive(:puts)
|
|
64
|
+
.with("#{klass_name} is not a valid constant name!")
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
it 'should return internal logger class' do
|
|
68
|
+
expect(subject.send(:deconstantize, klass_name)).to eq Aspector::Logger
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
context 'and given logger class exists' do
|
|
73
|
+
let(:klass_name) { 'Aspector::Logger' }
|
|
74
|
+
|
|
75
|
+
before do
|
|
76
|
+
expect($stderr)
|
|
77
|
+
.not_to receive(:puts)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
it 'should return it deconstantized' do
|
|
81
|
+
expect(subject.send(:deconstantize, klass_name)).to eq Aspector::Logger
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe Aspector::MethodMatcher do
|
|
4
|
+
describe '#initialize' do
|
|
5
|
+
pending
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
describe '#match?' do
|
|
9
|
+
subject { described_class.new(match_data) }
|
|
10
|
+
|
|
11
|
+
context 'String matching - when we want to match method by string name' do
|
|
12
|
+
let(:method) { rand.to_s }
|
|
13
|
+
let(:match_data) { method }
|
|
14
|
+
|
|
15
|
+
it 'should match it' do
|
|
16
|
+
expect(subject.match?(method)).not_to be_nil
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
context 'Regular expression matching - when we want to match method by regexp' do
|
|
21
|
+
let(:method) { rand.to_s + 'constant-part' }
|
|
22
|
+
let(:match_data) { /constant/ }
|
|
23
|
+
|
|
24
|
+
it 'should match it' do
|
|
25
|
+
expect(subject.match?(method)).not_to be_nil
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
context 'when we want to add more match data (multiple elements' do
|
|
30
|
+
context 'and one of them matches' do
|
|
31
|
+
let(:match_data) { %w( test1 test2 ) }
|
|
32
|
+
|
|
33
|
+
it 'should not be nil' do
|
|
34
|
+
expect(subject.match?(match_data.last)).not_to be_nil
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
context 'and none of them match' do
|
|
39
|
+
let(:match_data) { %w( test1 test2 ) }
|
|
40
|
+
|
|
41
|
+
it 'should be nil' do
|
|
42
|
+
expect(subject.match?('test3')).to be_nil
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
context 'and all of them match' do
|
|
47
|
+
let(:match_data) { [/test/, /te/] }
|
|
48
|
+
|
|
49
|
+
it 'should not be nil' do
|
|
50
|
+
expect(subject.match?('test2')).not_to be_nil
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
context 'deferred logic matching' do
|
|
56
|
+
let(:match_data) { Aspector::DeferredLogic.new('') }
|
|
57
|
+
let(:method) { double }
|
|
58
|
+
|
|
59
|
+
before do
|
|
60
|
+
expect(method)
|
|
61
|
+
.to receive(:deferred_logic_results)
|
|
62
|
+
.with(match_data)
|
|
63
|
+
.and_return(/test/)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it 'should get aspect deferred logic results and match them' do
|
|
67
|
+
expect(subject.match?('test', method)).not_to be_nil
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
context 'deferred option matching' do
|
|
72
|
+
let(:match_data) { Aspector::DeferredOption.new[:methods] }
|
|
73
|
+
let(:method) { double }
|
|
74
|
+
|
|
75
|
+
before do
|
|
76
|
+
expect(method)
|
|
77
|
+
.to receive(:options)
|
|
78
|
+
.and_return(methods: /test/)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
it 'should get aspect options value for a proper key and match it' do
|
|
82
|
+
expect(subject.match?('test', method)).not_to be_nil
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
describe '#to_s' do
|
|
88
|
+
let(:match_data) { [rand, rand] }
|
|
89
|
+
subject { described_class.new(match_data) }
|
|
90
|
+
|
|
91
|
+
it 'should use inspected match_data as a string representation of MethodMatcher' do
|
|
92
|
+
expect(subject.to_s).to eq match_data.map(&:inspect).join(', ')
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe 'Special chars in method names' do
|
|
4
|
+
subject { klass.new }
|
|
5
|
+
|
|
6
|
+
methods_postfixes = %w( ? ! = )
|
|
7
|
+
full_methods = %w( + - * / ~ | % & ^ < > [] []= )
|
|
8
|
+
|
|
9
|
+
context 'special characters in instance method names' do
|
|
10
|
+
methods_postfixes.each do |char|
|
|
11
|
+
context "when method name contains '#{char}'" do
|
|
12
|
+
let(:klass) do
|
|
13
|
+
ClassBuilder.build do
|
|
14
|
+
aspector do
|
|
15
|
+
before "exec#{char}", :exec
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
define_method "exec#{char}" do |*_args|
|
|
19
|
+
values << char
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'should handle it without any issues' do
|
|
25
|
+
subject.send "exec#{char}"
|
|
26
|
+
expect(subject.values).to eq ['exec-result', char]
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
full_methods.each do |char|
|
|
32
|
+
context "when method name is '#{char}'" do
|
|
33
|
+
let(:klass) do
|
|
34
|
+
ClassBuilder.build do
|
|
35
|
+
aspector do
|
|
36
|
+
before char, :exec
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
define_method char do |*_args|
|
|
40
|
+
values << char
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it 'should handle it without any issues' do
|
|
46
|
+
subject.send(char, 1)
|
|
47
|
+
expect(subject.values).to eq ['exec-result', char]
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
context 'special characters in class method names' do
|
|
54
|
+
methods_postfixes.each do |char|
|
|
55
|
+
context "when method name contains '#{char}'" do
|
|
56
|
+
self.class.send :define_method, :methods_postfixes do
|
|
57
|
+
methods_postfixes
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
let(:klass) do
|
|
61
|
+
ClassBuilder.build do
|
|
62
|
+
aspector class_methods: true do
|
|
63
|
+
before "exec#{char}", :exec
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
class << self
|
|
67
|
+
def values
|
|
68
|
+
@values ||= []
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def exec(*_args)
|
|
72
|
+
values << 'exec-result'
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
methods_postfixes.each do |char|
|
|
76
|
+
define_method "exec#{char}" do |*args|
|
|
77
|
+
values << args.first
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
it 'should handle it without any issues' do
|
|
85
|
+
klass.send("exec#{char}", char)
|
|
86
|
+
expect(klass.values).to eq ['exec-result', char]
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
full_methods.each do |char|
|
|
92
|
+
context "when method name is '#{char}'" do
|
|
93
|
+
self.class.send :define_method, :full_methods_names do
|
|
94
|
+
full_methods
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
let(:klass) do
|
|
98
|
+
ClassBuilder.build do
|
|
99
|
+
aspector class_methods: true do
|
|
100
|
+
before char, :exec
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
class << self
|
|
104
|
+
def values
|
|
105
|
+
@values ||= []
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def exec(*_args)
|
|
109
|
+
values << 'exec-result'
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
full_methods_names.each do |char|
|
|
113
|
+
define_method char do |*args|
|
|
114
|
+
values << args.first
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
it 'should handle it without any issues' do
|
|
122
|
+
klass.send(char, char)
|
|
123
|
+
expect(klass.values).to eq ['exec-result', char]
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
metadata
CHANGED
|
@@ -1,212 +1,47 @@
|
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aspector
|
|
3
|
-
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
5
|
-
prerelease:
|
|
6
|
-
segments:
|
|
7
|
-
- 0
|
|
8
|
-
- 13
|
|
9
|
-
- 1
|
|
10
|
-
version: 0.13.1
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.14.0
|
|
11
5
|
platform: ruby
|
|
12
|
-
authors:
|
|
6
|
+
authors:
|
|
13
7
|
- Guoliang Cao
|
|
8
|
+
- Maciej Mensfeld
|
|
14
9
|
autorequire:
|
|
15
10
|
bindir: bin
|
|
16
11
|
cert_chain: []
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
none: false
|
|
24
|
-
requirements:
|
|
25
|
-
- - ">="
|
|
26
|
-
- !ruby/object:Gem::Version
|
|
27
|
-
hash: 3
|
|
28
|
-
segments:
|
|
29
|
-
- 0
|
|
30
|
-
version: "0"
|
|
31
|
-
version_requirements: *id001
|
|
32
|
-
type: :development
|
|
33
|
-
name: rspec
|
|
34
|
-
prerelease: false
|
|
35
|
-
- !ruby/object:Gem::Dependency
|
|
36
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
|
37
|
-
none: false
|
|
38
|
-
requirements:
|
|
39
|
-
- - ~>
|
|
40
|
-
- !ruby/object:Gem::Version
|
|
41
|
-
hash: 7
|
|
42
|
-
segments:
|
|
43
|
-
- 1
|
|
44
|
-
- 6
|
|
45
|
-
- 4
|
|
46
|
-
version: 1.6.4
|
|
47
|
-
version_requirements: *id002
|
|
48
|
-
type: :development
|
|
49
|
-
name: jeweler
|
|
50
|
-
prerelease: false
|
|
51
|
-
- !ruby/object:Gem::Dependency
|
|
52
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
|
53
|
-
none: false
|
|
54
|
-
requirements:
|
|
55
|
-
- - ">="
|
|
56
|
-
- !ruby/object:Gem::Version
|
|
57
|
-
hash: 3
|
|
58
|
-
segments:
|
|
59
|
-
- 0
|
|
60
|
-
version: "0"
|
|
61
|
-
version_requirements: *id003
|
|
62
|
-
type: :development
|
|
63
|
-
name: ruby-prof
|
|
64
|
-
prerelease: false
|
|
65
|
-
- !ruby/object:Gem::Dependency
|
|
66
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
|
67
|
-
none: false
|
|
68
|
-
requirements:
|
|
69
|
-
- - ~>
|
|
70
|
-
- !ruby/object:Gem::Version
|
|
71
|
-
hash: 55
|
|
72
|
-
segments:
|
|
73
|
-
- 0
|
|
74
|
-
- 8
|
|
75
|
-
- 4
|
|
76
|
-
version: 0.8.4
|
|
77
|
-
version_requirements: *id004
|
|
78
|
-
type: :development
|
|
79
|
-
name: guard
|
|
80
|
-
prerelease: false
|
|
81
|
-
- !ruby/object:Gem::Dependency
|
|
82
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
|
83
|
-
none: false
|
|
84
|
-
requirements:
|
|
85
|
-
- - ~>
|
|
86
|
-
- !ruby/object:Gem::Version
|
|
87
|
-
hash: 29
|
|
88
|
-
segments:
|
|
89
|
-
- 0
|
|
90
|
-
- 1
|
|
91
|
-
- 3
|
|
92
|
-
version: 0.1.3
|
|
93
|
-
version_requirements: *id005
|
|
94
|
-
type: :development
|
|
95
|
-
name: guard-bundler
|
|
96
|
-
prerelease: false
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
|
99
|
-
none: false
|
|
100
|
-
requirements:
|
|
101
|
-
- - ~>
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
hash: 15
|
|
104
|
-
segments:
|
|
105
|
-
- 0
|
|
106
|
-
- 5
|
|
107
|
-
- 2
|
|
108
|
-
version: 0.5.2
|
|
109
|
-
version_requirements: *id006
|
|
110
|
-
type: :development
|
|
111
|
-
name: guard-rspec
|
|
112
|
-
prerelease: false
|
|
113
|
-
- !ruby/object:Gem::Dependency
|
|
114
|
-
requirement: &id007 !ruby/object:Gem::Requirement
|
|
115
|
-
none: false
|
|
116
|
-
requirements:
|
|
117
|
-
- - ~>
|
|
118
|
-
- !ruby/object:Gem::Version
|
|
119
|
-
hash: 25
|
|
120
|
-
segments:
|
|
121
|
-
- 0
|
|
122
|
-
- 1
|
|
123
|
-
- 1
|
|
124
|
-
version: 0.1.1
|
|
125
|
-
version_requirements: *id007
|
|
126
|
-
type: :development
|
|
127
|
-
name: guard-shell
|
|
128
|
-
prerelease: false
|
|
129
|
-
- !ruby/object:Gem::Dependency
|
|
130
|
-
requirement: &id008 !ruby/object:Gem::Requirement
|
|
131
|
-
none: false
|
|
132
|
-
requirements:
|
|
133
|
-
- - ">="
|
|
134
|
-
- !ruby/object:Gem::Version
|
|
135
|
-
hash: 3
|
|
136
|
-
segments:
|
|
137
|
-
- 0
|
|
138
|
-
version: "0"
|
|
139
|
-
version_requirements: *id008
|
|
140
|
-
type: :development
|
|
141
|
-
name: rb-fsevent
|
|
142
|
-
prerelease: false
|
|
143
|
-
- !ruby/object:Gem::Dependency
|
|
144
|
-
requirement: &id009 !ruby/object:Gem::Requirement
|
|
145
|
-
none: false
|
|
146
|
-
requirements:
|
|
147
|
-
- - ~>
|
|
148
|
-
- !ruby/object:Gem::Version
|
|
149
|
-
hash: 17
|
|
150
|
-
segments:
|
|
151
|
-
- 1
|
|
152
|
-
- 0
|
|
153
|
-
- 3
|
|
154
|
-
version: 1.0.3
|
|
155
|
-
version_requirements: *id009
|
|
156
|
-
type: :development
|
|
157
|
-
name: growl
|
|
158
|
-
prerelease: false
|
|
159
|
-
- !ruby/object:Gem::Dependency
|
|
160
|
-
requirement: &id010 !ruby/object:Gem::Requirement
|
|
161
|
-
none: false
|
|
162
|
-
requirements:
|
|
163
|
-
- - ">="
|
|
164
|
-
- !ruby/object:Gem::Version
|
|
165
|
-
hash: 3
|
|
166
|
-
segments:
|
|
167
|
-
- 0
|
|
168
|
-
version: "0"
|
|
169
|
-
version_requirements: *id010
|
|
170
|
-
type: :development
|
|
171
|
-
name: awesome_print
|
|
172
|
-
prerelease: false
|
|
173
|
-
- !ruby/object:Gem::Dependency
|
|
174
|
-
requirement: &id011 !ruby/object:Gem::Requirement
|
|
175
|
-
none: false
|
|
176
|
-
requirements:
|
|
177
|
-
- - ">="
|
|
178
|
-
- !ruby/object:Gem::Version
|
|
179
|
-
hash: 3
|
|
180
|
-
segments:
|
|
181
|
-
- 0
|
|
182
|
-
version: "0"
|
|
183
|
-
version_requirements: *id011
|
|
184
|
-
type: :development
|
|
185
|
-
name: pry
|
|
186
|
-
prerelease: false
|
|
187
|
-
description: ""
|
|
188
|
-
email: gcao99@gmail.com
|
|
12
|
+
date: 2015-07-10 00:00:00.000000000 Z
|
|
13
|
+
dependencies: []
|
|
14
|
+
description: "[]"
|
|
15
|
+
email:
|
|
16
|
+
- gcao99@gmail.com
|
|
17
|
+
- maciej@mensfeld.pl
|
|
189
18
|
executables: []
|
|
190
|
-
|
|
191
19
|
extensions: []
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
- .
|
|
198
|
-
- .
|
|
199
|
-
- .
|
|
200
|
-
- .
|
|
201
|
-
- .
|
|
20
|
+
extra_rdoc_files: []
|
|
21
|
+
files:
|
|
22
|
+
- ".gitignore"
|
|
23
|
+
- ".irbrc"
|
|
24
|
+
- ".rspec"
|
|
25
|
+
- ".rubocop.yml"
|
|
26
|
+
- ".ruby-gemset"
|
|
27
|
+
- ".ruby-version"
|
|
28
|
+
- ".travis.yml"
|
|
29
|
+
- Changelog.md
|
|
202
30
|
- Gemfile
|
|
203
31
|
- Gemfile.lock
|
|
204
32
|
- Guardfile
|
|
205
33
|
- LICENSE.txt
|
|
206
|
-
- README.
|
|
34
|
+
- README.md
|
|
207
35
|
- Rakefile
|
|
208
|
-
- VERSION
|
|
209
36
|
- aspector.gemspec
|
|
37
|
+
- benchmarks/after_benchmark.rb
|
|
38
|
+
- benchmarks/around_advice_benchmark.rb
|
|
39
|
+
- benchmarks/around_benchmark.rb
|
|
40
|
+
- benchmarks/before_benchmark.rb
|
|
41
|
+
- benchmarks/benchmark_helper.rb
|
|
42
|
+
- benchmarks/combined_benchmark.rb
|
|
43
|
+
- benchmarks/method_invocation_benchmark.rb
|
|
44
|
+
- benchmarks/raw_benchmark.rb
|
|
210
45
|
- examples/activerecord_hooks.rb
|
|
211
46
|
- examples/around_example.rb
|
|
212
47
|
- examples/aspector_apply_example.rb
|
|
@@ -216,7 +51,9 @@ files:
|
|
|
216
51
|
- examples/exception_handler.rb
|
|
217
52
|
- examples/exception_handler2.rb
|
|
218
53
|
- examples/implicit_method_option_test.rb
|
|
54
|
+
- examples/interception_options_example.rb
|
|
219
55
|
- examples/logging_aspect.rb
|
|
56
|
+
- examples/process_aspector.rb
|
|
220
57
|
- examples/retry_aspect.rb
|
|
221
58
|
- lib/aspector.rb
|
|
222
59
|
- lib/aspector/advice.rb
|
|
@@ -226,70 +63,85 @@ files:
|
|
|
226
63
|
- lib/aspector/base_class_methods.rb
|
|
227
64
|
- lib/aspector/deferred_logic.rb
|
|
228
65
|
- lib/aspector/deferred_option.rb
|
|
66
|
+
- lib/aspector/interception.rb
|
|
229
67
|
- lib/aspector/logger.rb
|
|
230
68
|
- lib/aspector/logging.rb
|
|
231
69
|
- lib/aspector/method_matcher.rb
|
|
232
70
|
- lib/aspector/module_extension.rb
|
|
233
71
|
- lib/aspector/object_extension.rb
|
|
234
|
-
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
237
|
-
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
240
|
-
-
|
|
241
|
-
-
|
|
242
|
-
-
|
|
243
|
-
- spec/
|
|
244
|
-
- spec/functional/aspect_on_eigen_class_spec.rb
|
|
245
|
-
- spec/functional/aspect_on_object_spec.rb
|
|
246
|
-
- spec/functional/aspector_spec.rb
|
|
247
|
-
- spec/functional/aspects_combined_spec.rb
|
|
248
|
-
- spec/functional/execution_order_spec.rb
|
|
72
|
+
- lib/aspector/version.rb
|
|
73
|
+
- spec/examples_spec.rb
|
|
74
|
+
- spec/functionals/aspect_for_multiple_targets_spec.rb
|
|
75
|
+
- spec/functionals/aspect_interception_options_accessing_spec.rb
|
|
76
|
+
- spec/functionals/aspect_on_a_class_spec.rb
|
|
77
|
+
- spec/functionals/aspect_on_an_instance_spec.rb
|
|
78
|
+
- spec/functionals/aspector_spec.rb
|
|
79
|
+
- spec/functionals/aspects_combined_spec.rb
|
|
80
|
+
- spec/functionals/aspects_execution_order_spec.rb
|
|
81
|
+
- spec/functionals/aspects_on_private_methods_spec.rb
|
|
249
82
|
- spec/spec_helper.rb
|
|
250
|
-
- spec/
|
|
251
|
-
- spec/
|
|
252
|
-
- spec/
|
|
253
|
-
- spec/
|
|
254
|
-
- spec/
|
|
255
|
-
- spec/
|
|
256
|
-
- spec/
|
|
257
|
-
- spec/
|
|
258
|
-
- spec/
|
|
259
|
-
- spec/
|
|
260
|
-
|
|
83
|
+
- spec/support/class_builder.rb
|
|
84
|
+
- spec/units/advice_spec.rb
|
|
85
|
+
- spec/units/advices/after_spec.rb
|
|
86
|
+
- spec/units/advices/around_spec.rb
|
|
87
|
+
- spec/units/advices/before_filter_spec.rb
|
|
88
|
+
- spec/units/advices/before_spec.rb
|
|
89
|
+
- spec/units/advices/raw_spec.rb
|
|
90
|
+
- spec/units/base_class_methods_spec.rb
|
|
91
|
+
- spec/units/base_spec.rb
|
|
92
|
+
- spec/units/deferred_logic_spec.rb
|
|
93
|
+
- spec/units/logger_spec.rb
|
|
94
|
+
- spec/units/logging_spec.rb
|
|
95
|
+
- spec/units/method_matcher_spec.rb
|
|
96
|
+
- spec/units/object_extension_spec.rb
|
|
97
|
+
- spec/units/special_chars_spec.rb
|
|
261
98
|
homepage: http://github.com/gcao/aspector
|
|
262
|
-
licenses:
|
|
99
|
+
licenses:
|
|
263
100
|
- MIT
|
|
101
|
+
metadata: {}
|
|
264
102
|
post_install_message:
|
|
265
103
|
rdoc_options: []
|
|
266
|
-
|
|
267
|
-
require_paths:
|
|
104
|
+
require_paths:
|
|
268
105
|
- lib
|
|
269
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
|
270
|
-
|
|
271
|
-
requirements:
|
|
106
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
272
108
|
- - ">="
|
|
273
|
-
- !ruby/object:Gem::Version
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
version: "0"
|
|
278
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
279
|
-
none: false
|
|
280
|
-
requirements:
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0'
|
|
111
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
|
+
requirements:
|
|
281
113
|
- - ">="
|
|
282
|
-
- !ruby/object:Gem::Version
|
|
283
|
-
|
|
284
|
-
segments:
|
|
285
|
-
- 0
|
|
286
|
-
version: "0"
|
|
114
|
+
- !ruby/object:Gem::Version
|
|
115
|
+
version: '0'
|
|
287
116
|
requirements: []
|
|
288
|
-
|
|
289
117
|
rubyforge_project:
|
|
290
|
-
rubygems_version:
|
|
118
|
+
rubygems_version: 2.4.5
|
|
291
119
|
signing_key:
|
|
292
|
-
specification_version:
|
|
293
|
-
summary: Aspect Oriented Ruby Programming
|
|
294
|
-
test_files:
|
|
295
|
-
|
|
120
|
+
specification_version: 4
|
|
121
|
+
summary: '["Aspect", "Oriented", "Ruby", "Programming", "library"]'
|
|
122
|
+
test_files:
|
|
123
|
+
- spec/examples_spec.rb
|
|
124
|
+
- spec/functionals/aspect_for_multiple_targets_spec.rb
|
|
125
|
+
- spec/functionals/aspect_interception_options_accessing_spec.rb
|
|
126
|
+
- spec/functionals/aspect_on_a_class_spec.rb
|
|
127
|
+
- spec/functionals/aspect_on_an_instance_spec.rb
|
|
128
|
+
- spec/functionals/aspector_spec.rb
|
|
129
|
+
- spec/functionals/aspects_combined_spec.rb
|
|
130
|
+
- spec/functionals/aspects_execution_order_spec.rb
|
|
131
|
+
- spec/functionals/aspects_on_private_methods_spec.rb
|
|
132
|
+
- spec/spec_helper.rb
|
|
133
|
+
- spec/support/class_builder.rb
|
|
134
|
+
- spec/units/advice_spec.rb
|
|
135
|
+
- spec/units/advices/after_spec.rb
|
|
136
|
+
- spec/units/advices/around_spec.rb
|
|
137
|
+
- spec/units/advices/before_filter_spec.rb
|
|
138
|
+
- spec/units/advices/before_spec.rb
|
|
139
|
+
- spec/units/advices/raw_spec.rb
|
|
140
|
+
- spec/units/base_class_methods_spec.rb
|
|
141
|
+
- spec/units/base_spec.rb
|
|
142
|
+
- spec/units/deferred_logic_spec.rb
|
|
143
|
+
- spec/units/logger_spec.rb
|
|
144
|
+
- spec/units/logging_spec.rb
|
|
145
|
+
- spec/units/method_matcher_spec.rb
|
|
146
|
+
- spec/units/object_extension_spec.rb
|
|
147
|
+
- spec/units/special_chars_spec.rb
|