rbbcc 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +8 -0
- data/Gemfile.lock +17 -1
- data/exe/rbbcc +14 -2
- data/lib/rbbcc.rb +4 -3
- data/lib/rbbcc/invoker.rb +28 -0
- data/lib/rbbcc/plugin.rb +28 -0
- data/lib/rbbcc/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca8253cb2fb2d8bd3824d294d54f13d5e34a9326d25244ce7ea4d4fddc202978
|
4
|
+
data.tar.gz: 71796d5a508760ed617347d2275f30e90fb9a8b9d68354aba884b33d4625cd3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b36369cea2736423e7722b8cf087460b3966d0f73b6b9579b98aba643e0c4f6eef3bcd0f0089d0f25da61df3b2b612165ad8d1d25911511138b4b228eb94a6e5
|
7
|
+
data.tar.gz: 6e8047c3928dd676218a88c618c8546ae20de8a499acd6d700df0d0a1f4363fbee26cb168fd1190de879f939a57fc4a43cfaa453cecf50c52c0ab105f080b04f
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,28 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/udzura/rbbcc-hello.git
|
3
|
+
revision: 2e1af47d22e7cc92e970dc6c058e113cf00821db
|
4
|
+
specs:
|
5
|
+
rbbcc-hello (0.1.0)
|
6
|
+
rbbcc
|
7
|
+
|
1
8
|
PATH
|
2
9
|
remote: .
|
3
10
|
specs:
|
4
|
-
rbbcc (0.6.
|
11
|
+
rbbcc (0.6.3)
|
5
12
|
|
6
13
|
GEM
|
7
14
|
remote: https://rubygems.org/
|
8
15
|
specs:
|
16
|
+
appbundler (0.13.2)
|
17
|
+
mixlib-cli (>= 1.4, < 3.0)
|
18
|
+
mixlib-shellout (>= 2.0, < 4.0)
|
19
|
+
chef-utils (16.6.14)
|
9
20
|
coderay (1.1.3)
|
10
21
|
method_source (1.0.0)
|
11
22
|
minitest (5.14.2)
|
23
|
+
mixlib-cli (2.1.8)
|
24
|
+
mixlib-shellout (3.2.2)
|
25
|
+
chef-utils
|
12
26
|
pry (0.13.1)
|
13
27
|
coderay (~> 1.1)
|
14
28
|
method_source (~> 1.0)
|
@@ -18,11 +32,13 @@ PLATFORMS
|
|
18
32
|
ruby
|
19
33
|
|
20
34
|
DEPENDENCIES
|
35
|
+
appbundler
|
21
36
|
bundler (~> 2.0)
|
22
37
|
minitest (>= 5)
|
23
38
|
pry (~> 0.12)
|
24
39
|
rake (~> 13.0)
|
25
40
|
rbbcc!
|
41
|
+
rbbcc-hello!
|
26
42
|
|
27
43
|
BUNDLED WITH
|
28
44
|
2.1.4
|
data/exe/rbbcc
CHANGED
@@ -1,4 +1,16 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
if ARGV[0] == '-v' || ARGV[0] == '--version'
|
4
|
+
require 'rbbcc/version'
|
5
|
+
print "RbBCC: version "
|
6
|
+
puts RbBCC::VERSION
|
7
|
+
print "Using "
|
8
|
+
puts RUBY_DESCRIPTION
|
9
|
+
elsif ARGV[0] == '--invoke'
|
10
|
+
require 'rbbcc/invoker'
|
11
|
+
ARGV.shift
|
12
|
+
RbBCC::Invoker.new(ARGV).run
|
13
|
+
else
|
14
|
+
binpath = File.readlink "/proc/self/exe"
|
15
|
+
exec binpath, *ARGV
|
16
|
+
end
|
data/lib/rbbcc.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rbbcc/plugin'
|
3
|
+
|
4
|
+
module RbBCC
|
5
|
+
class Invoker
|
6
|
+
def initialize(args)
|
7
|
+
@command = args.shift
|
8
|
+
raise "Invalid option. Please specify script name" unless @command
|
9
|
+
|
10
|
+
args.shift if args[0] == '--'
|
11
|
+
@args = args
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
plugins = Gem::Specification
|
16
|
+
.find_all
|
17
|
+
.select{|s| s.name =~ /^rbbcc-/ }
|
18
|
+
.map(&:name)
|
19
|
+
plugins.each {|n| require n }
|
20
|
+
|
21
|
+
script = RbBCC::Plugin.find_script_name(@command)
|
22
|
+
raise Errno::ENOENT, "Script not found: #{@command}" unless script
|
23
|
+
|
24
|
+
binpath = File.readlink "/proc/self/exe"
|
25
|
+
Process.exec binpath, script, *@args
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/rbbcc/plugin.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
module RbBCC
|
2
|
+
module Plugin
|
3
|
+
ScriptLocation = Struct.new(:name, :location)
|
4
|
+
|
5
|
+
def self.scripts
|
6
|
+
@scripts ||= []
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.find_script_name(name)
|
10
|
+
scripts.find{|s|
|
11
|
+
s.name == name || "#{s.name}.rb" == name
|
12
|
+
}&.location
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.register!
|
16
|
+
caller_loc = caller[0].split(':')[0]
|
17
|
+
plugin_loc = File.expand_path("../../script", caller_loc)
|
18
|
+
unless File.directory?(plugin_loc)
|
19
|
+
raise "Cannot find a script directory #{plugin_loc}. Maybe an invalid project"
|
20
|
+
end
|
21
|
+
|
22
|
+
found = Dir.glob("#{plugin_loc}/*.rb")
|
23
|
+
.map{|path| ScriptLocation.new File.basename(path, '.rb'), path }
|
24
|
+
self.scripts.concat found
|
25
|
+
self.scripts
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/rbbcc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbcc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uchio Kondo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: BCC port for MRI. See https://github.com/iovisor/bcc
|
14
14
|
email:
|
@@ -87,6 +87,8 @@ files:
|
|
87
87
|
- lib/rbbcc/debug.rb
|
88
88
|
- lib/rbbcc/disp_helper.rb
|
89
89
|
- lib/rbbcc/fiddle_ext.rb
|
90
|
+
- lib/rbbcc/invoker.rb
|
91
|
+
- lib/rbbcc/plugin.rb
|
90
92
|
- lib/rbbcc/symbol_cache.rb
|
91
93
|
- lib/rbbcc/table.rb
|
92
94
|
- lib/rbbcc/usdt.rb
|