tapping_device 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/ruby.yml +24 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +41 -0
- data/LICENSE.txt +21 -0
- data/README.md +176 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/tapping_device.rb +7 -0
- data/lib/tapping_device/trackable.rb +67 -0
- data/lib/tapping_device/version.rb +3 -0
- data/tapping_device.gemspec +33 -0
- metadata +118 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 145b8d4cd78d7f40b318352ff3a39a6a4aa194dee91e84db5e4946c522bd59b9
|
4
|
+
data.tar.gz: 9978287948da8f54fc96699be31059abd8ad7d643bf05cb9c54d43bc5ff06019
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7870a46e126309662fbdd4c7fea746b9bac8b4c31583061e7ed068f77c6d2d6960b84601f74172cb3bb289d615487c513468f1c18ee62f868eb4d229652e099d
|
7
|
+
data.tar.gz: 3b59a134c7e30ce2f5d2f1e3f6bdc6ad76b5fccac4e8092f5ae441c11858d1d3b0ad035b3e5648e0b3912b89da43633e8cc55db749662f1c0e8db8eee4b463d5
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
name: Test on ruby ${{ matrix.ruby_version }}
|
8
|
+
runs-on: ${{ matrix.os }}
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
ruby_version: ['2.4', '2.5', '2.6']
|
12
|
+
os: [ubuntu-latest]
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v1
|
15
|
+
- name: Set up Ruby ${{ matrix.ruby_version }}
|
16
|
+
uses: actions/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: ${{ matrix.ruby_version }}
|
19
|
+
|
20
|
+
- name: Build and test with Rake
|
21
|
+
run: |
|
22
|
+
gem install bundler
|
23
|
+
bundle install --jobs 4 --retry 3
|
24
|
+
bundle exec rake
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at stan001212@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
tapping_device (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
coderay (1.1.2)
|
10
|
+
diff-lcs (1.3)
|
11
|
+
method_source (0.9.2)
|
12
|
+
pry (0.12.2)
|
13
|
+
coderay (~> 1.1.0)
|
14
|
+
method_source (~> 0.9.0)
|
15
|
+
rake (10.0.4)
|
16
|
+
rspec (3.8.0)
|
17
|
+
rspec-core (~> 3.8.0)
|
18
|
+
rspec-expectations (~> 3.8.0)
|
19
|
+
rspec-mocks (~> 3.8.0)
|
20
|
+
rspec-core (3.8.2)
|
21
|
+
rspec-support (~> 3.8.0)
|
22
|
+
rspec-expectations (3.8.4)
|
23
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
+
rspec-support (~> 3.8.0)
|
25
|
+
rspec-mocks (3.8.1)
|
26
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
27
|
+
rspec-support (~> 3.8.0)
|
28
|
+
rspec-support (3.8.2)
|
29
|
+
|
30
|
+
PLATFORMS
|
31
|
+
ruby
|
32
|
+
|
33
|
+
DEPENDENCIES
|
34
|
+
bundler (~> 2.0)
|
35
|
+
pry
|
36
|
+
rake (~> 10.0)
|
37
|
+
rspec (~> 3.0)
|
38
|
+
tapping_device!
|
39
|
+
|
40
|
+
BUNDLED WITH
|
41
|
+
2.0.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 st0012
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,176 @@
|
|
1
|
+
# TappingDevice
|
2
|
+
|
3
|
+
![](https://github.com/st0012/tapping_device/workflows/Ruby/badge.svg)
|
4
|
+
|
5
|
+
`tapping_device` is a gem based on Ruby’s `TracePoint` class that allows you to tap method calls of specified objects. This could be useful for debugging. For example, you can use it to see who calls you `Post` records
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
class PostsController < ApplicationController
|
9
|
+
include TappingDevice::Trackable
|
10
|
+
|
11
|
+
before_action :set_post, only: [:show, :edit, :update, :destroy]
|
12
|
+
|
13
|
+
# GET /posts/1
|
14
|
+
# GET /posts/1.json
|
15
|
+
def show
|
16
|
+
tap_on!(@post) do |payload|
|
17
|
+
puts "Method: #{payload[:method_name]} line: #{payload[:filepath]}:#{payload[:line_number]}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
```
|
22
|
+
|
23
|
+
And you can see these in log:
|
24
|
+
|
25
|
+
```
|
26
|
+
Method: name line: /Users/st0012/projects/sample/app/views/posts/show.html.erb:5
|
27
|
+
Method: user_id line: /Users/st0012/projects/sample/app/views/posts/show.html.erb:10
|
28
|
+
Method: to_param line: /Users/st0012/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:236
|
29
|
+
```
|
30
|
+
|
31
|
+
**Don't use this on production**
|
32
|
+
|
33
|
+
|
34
|
+
## Installation
|
35
|
+
|
36
|
+
Add this line to your application's Gemfile:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
gem 'tapping_device', group: :development
|
40
|
+
```
|
41
|
+
|
42
|
+
And then execute:
|
43
|
+
|
44
|
+
```
|
45
|
+
$ bundle
|
46
|
+
```
|
47
|
+
|
48
|
+
Or install it yourself as:
|
49
|
+
|
50
|
+
```
|
51
|
+
$ gem install tapping_device
|
52
|
+
```
|
53
|
+
|
54
|
+
## Usage
|
55
|
+
In order to use `tapping_device`, you need to include `TappingDevice::Trackable` module in where you want to track your code.
|
56
|
+
|
57
|
+
### Methods
|
58
|
+
- `tap_initialization_of!(class)` - allows you to track a class’ instance initialization
|
59
|
+
- shortcut - `tap_init!`
|
60
|
+
- `tap_calls_on!(object)` - allows you to track any calls received by the object
|
61
|
+
- shortcut - `tap_on!`
|
62
|
+
- `stop_tapping!(object)` - this stops tapping on the given object
|
63
|
+
- shortcut - `untap!`
|
64
|
+
|
65
|
+
### Info of the call
|
66
|
+
All tapping methods (start with `tap_`) takes a block and yield a hash as block argument.
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
tap_initialization_of!(Student) do |payload|
|
70
|
+
puts(payload.to_s)
|
71
|
+
end
|
72
|
+
|
73
|
+
Student.new("Stan", 18)
|
74
|
+
|
75
|
+
#=> {:receiver=>#<Student:0x00007feec04d9e58 @name="Stan", @age=18>, :method_name=>:initialize, :arguments=>[[:name, "Stan"], [:age, 18]], :return_value=>18, :filepath=>"/path/spec/trackable_spec.rb", :line_number=>7, :defined_class=>Student}
|
76
|
+
```
|
77
|
+
|
78
|
+
The hash contains
|
79
|
+
|
80
|
+
- `receiver` - the receiver object
|
81
|
+
- `method_name` - method’s name (symbol)
|
82
|
+
- e.g. `:name`
|
83
|
+
- `arguments` - arguments of the method call
|
84
|
+
- e.g. `[[:name, “Stan”], [:age, 25]]`
|
85
|
+
- `return_value` - return value of the method call
|
86
|
+
- `filepath` - path to the file that performs the method call
|
87
|
+
- `line_number`
|
88
|
+
- `defined_class` - in which class that defines the that’s being called
|
89
|
+
- `trace` - stack trace of the call. Default is an empty array unless `with_trace_to` option is set
|
90
|
+
- `tp` - trace point object of this call
|
91
|
+
|
92
|
+
|
93
|
+
### Options
|
94
|
+
- `with_trace_to` - the number of traces we want to put into `trace`. Default is `nil`, so `trace` would be empty
|
95
|
+
- `exclude_from_paths` - an array of call path patterns that we want to skip. This could be very helpful when working on Rails projects.
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
tap_on!(@post, exclude_from_paths: [/active_record/]) do |payload|
|
99
|
+
puts "Method: #{payload[:method_name]} line: #{payload[:filepath]}:#{payload[:line_number]}"
|
100
|
+
end
|
101
|
+
```
|
102
|
+
|
103
|
+
```
|
104
|
+
Method: _read_attribute line: /Users/st0012/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-5.2.0/lib/active_record/attribute_methods/read.rb:40
|
105
|
+
Method: name line: /Users/st0012/projects/sample/app/views/posts/show.html.erb:5
|
106
|
+
Method: _read_attribute line: /Users/st0012/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-5.2.0/lib/active_record/attribute_methods/read.rb:40
|
107
|
+
Method: user_id line: /Users/st0012/projects/sample/app/views/posts/show.html.erb:10
|
108
|
+
.......
|
109
|
+
|
110
|
+
# versus
|
111
|
+
|
112
|
+
Method: name line: /Users/st0012/projects/sample/app/views/posts/show.html.erb:5
|
113
|
+
Method: user_id line: /Users/st0012/projects/sample/app/views/posts/show.html.erb:10
|
114
|
+
Method: to_param line: /Users/st0012/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:236
|
115
|
+
```
|
116
|
+
|
117
|
+
|
118
|
+
### `#tap_init!`
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
calls = []
|
122
|
+
tap_init!(Student) do |payload|
|
123
|
+
calls << [payload[:method_name], payload[:arguments]]
|
124
|
+
end
|
125
|
+
|
126
|
+
Student.new("Stan", 18)
|
127
|
+
Student.new("Jane", 23)
|
128
|
+
|
129
|
+
puts(calls.to_s) #=> [[:initialize, [[:name, "Stan"], [:age, 18]]], [:initialize, [[:name, "Jane"], [:age, 23]]]]
|
130
|
+
```
|
131
|
+
|
132
|
+
### `tap_on!`
|
133
|
+
|
134
|
+
```ruby
|
135
|
+
class PostsController < ApplicationController
|
136
|
+
include TappingDevice::Trackable
|
137
|
+
|
138
|
+
before_action :set_post, only: [:show, :edit, :update, :destroy]
|
139
|
+
|
140
|
+
# GET /posts/1
|
141
|
+
# GET /posts/1.json
|
142
|
+
def show
|
143
|
+
tap_on!(@post) do |payload|
|
144
|
+
puts "Method: #{payload[:method_name]} line: #{payload[:filepath]}:#{payload[:line_number]}"
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
```
|
149
|
+
|
150
|
+
And you can see these in log:
|
151
|
+
|
152
|
+
```
|
153
|
+
Method: name line: /Users/st0012/projects/sample/app/views/posts/show.html.erb:5
|
154
|
+
Method: user_id line: /Users/st0012/projects/sample/app/views/posts/show.html.erb:10
|
155
|
+
Method: to_param line: /Users/st0012/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:236
|
156
|
+
```
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
## Development
|
161
|
+
|
162
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
163
|
+
|
164
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
165
|
+
|
166
|
+
## Contributing
|
167
|
+
|
168
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/tapping_device. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
169
|
+
|
170
|
+
## License
|
171
|
+
|
172
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
173
|
+
|
174
|
+
## Code of Conduct
|
175
|
+
|
176
|
+
Everyone interacting in the TappingDevice project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/tapping_device/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "tapping_device"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
module TappingDevice
|
2
|
+
module Trackable
|
3
|
+
TAPPING_DEVICE = :@tapping_device
|
4
|
+
CALLER_START_POINT = 2
|
5
|
+
|
6
|
+
def tap_initialization_of!(klass, options = {}, &block)
|
7
|
+
raise "argument should be a class, got #{klass}" unless klass.is_a?(Class)
|
8
|
+
options[:condition] = -> (arguments) { arguments[:method_name] == :initialize && arguments[:defined_class] == klass }
|
9
|
+
options[:block] = block
|
10
|
+
track(klass, **options)
|
11
|
+
end
|
12
|
+
|
13
|
+
def tap_calls_on!(object, options = {}, &block)
|
14
|
+
options[:condition] = -> (arguments) { arguments[:receiver].object_id == object.object_id }
|
15
|
+
options[:block] = block
|
16
|
+
track(object, **options)
|
17
|
+
end
|
18
|
+
|
19
|
+
def stop_tapping!(object)
|
20
|
+
get_tapping_device(object)&.each { |tp| tp.disable }
|
21
|
+
end
|
22
|
+
|
23
|
+
alias :tap_init! :tap_initialization_of!
|
24
|
+
alias :tap_on! :tap_calls_on!
|
25
|
+
alias :untap! :stop_tapping!
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def track(object, condition:, block:, with_trace_to: nil, exclude_from_paths: [])
|
30
|
+
trace_point = TracePoint.trace(:return) do |tp|
|
31
|
+
filepath, line_number = caller(CALLER_START_POINT).first.split(":")[0..1]
|
32
|
+
|
33
|
+
# this needs to be placed upfront so we can exclude noise before doing more work
|
34
|
+
next if exclude_from_paths.any? { |pattern| pattern.match?(filepath) }
|
35
|
+
|
36
|
+
arguments = tp.binding.local_variables.map { |n| [n, tp.binding.local_variable_get(n)] }
|
37
|
+
|
38
|
+
yield_parameters = {
|
39
|
+
receiver: tp.self,
|
40
|
+
method_name: tp.callee_id,
|
41
|
+
arguments: arguments,
|
42
|
+
return_value: (tp.return_value rescue nil),
|
43
|
+
filepath: filepath,
|
44
|
+
line_number: line_number,
|
45
|
+
defined_class: tp.defined_class,
|
46
|
+
trace: [],
|
47
|
+
tp: tp
|
48
|
+
}
|
49
|
+
|
50
|
+
yield_parameters[:trace] = caller[CALLER_START_POINT..(CALLER_START_POINT + with_trace_to)] if with_trace_to
|
51
|
+
|
52
|
+
block.call(yield_parameters) if condition.call(yield_parameters)
|
53
|
+
end
|
54
|
+
|
55
|
+
add_tapping_device(object, trace_point)
|
56
|
+
end
|
57
|
+
|
58
|
+
def get_tapping_device(object)
|
59
|
+
object.instance_variable_get(TAPPING_DEVICE)
|
60
|
+
end
|
61
|
+
|
62
|
+
def add_tapping_device(object, trace_point)
|
63
|
+
object.instance_variable_set(TAPPING_DEVICE, []) unless get_tapping_device(object)
|
64
|
+
object.instance_variable_get(TAPPING_DEVICE) << trace_point
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "tapping_device/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "tapping_device"
|
7
|
+
spec.version = TappingDevice::VERSION
|
8
|
+
spec.authors = ["st0012"]
|
9
|
+
spec.email = ["stan001212@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{tapping_device provides useful helpers to intercept method calls}
|
12
|
+
spec.description = %q{tapping_device provides useful helpers to intercept method calls}
|
13
|
+
spec.homepage = "https://github.com/st0012/tapping_device"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
spec.metadata["source_code_uri"] = "https://github.com/st0012/tapping_device"
|
18
|
+
spec.metadata["changelog_uri"] = "https://github.com/st0012/tapping_device/releases"
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
23
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
+
end
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
30
|
+
spec.add_development_dependency "pry"
|
31
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
32
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tapping_device
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- st0012
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-10-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
description: tapping_device provides useful helpers to intercept method calls
|
70
|
+
email:
|
71
|
+
- stan001212@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".github/workflows/ruby.yml"
|
77
|
+
- ".gitignore"
|
78
|
+
- ".rspec"
|
79
|
+
- ".travis.yml"
|
80
|
+
- CODE_OF_CONDUCT.md
|
81
|
+
- Gemfile
|
82
|
+
- Gemfile.lock
|
83
|
+
- LICENSE.txt
|
84
|
+
- README.md
|
85
|
+
- Rakefile
|
86
|
+
- bin/console
|
87
|
+
- bin/setup
|
88
|
+
- lib/tapping_device.rb
|
89
|
+
- lib/tapping_device/trackable.rb
|
90
|
+
- lib/tapping_device/version.rb
|
91
|
+
- tapping_device.gemspec
|
92
|
+
homepage: https://github.com/st0012/tapping_device
|
93
|
+
licenses:
|
94
|
+
- MIT
|
95
|
+
metadata:
|
96
|
+
homepage_uri: https://github.com/st0012/tapping_device
|
97
|
+
source_code_uri: https://github.com/st0012/tapping_device
|
98
|
+
changelog_uri: https://github.com/st0012/tapping_device/releases
|
99
|
+
post_install_message:
|
100
|
+
rdoc_options: []
|
101
|
+
require_paths:
|
102
|
+
- lib
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
requirements: []
|
114
|
+
rubygems_version: 3.0.6
|
115
|
+
signing_key:
|
116
|
+
specification_version: 4
|
117
|
+
summary: tapping_device provides useful helpers to intercept method calls
|
118
|
+
test_files: []
|