tracer 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32f50385faf52046ed48365c62f294a7d2d64fc99b5457c13e2bb7d239944883
4
- data.tar.gz: 14942209dd335bdde1267eaf6382b4ce1aad47200cfa6c3af82eadb8c03fae49
3
+ metadata.gz: f2f82acd68b0e8d7cd3f4f8f76edf568b7eba1cb93617c2b61bb1c309cabb13d
4
+ data.tar.gz: 99975c258b07d9aa9a2b615ef5edc4284d57881300f2bc1d556cc0394e4ce471
5
5
  SHA512:
6
- metadata.gz: 8969d4d076f10f25d0b1281d4decb8fd4c3b2aa39429e16a4771be45942b103450f7459afed93ad97bc44a73d50e9601805248729659bf9da36d50a279c0cfe7
7
- data.tar.gz: a83839fd50491fcfe4374acc42be6ab8000d3335431947d6d7a12c69a5fc1e0a5875fa2afb9ce00a41f7d24a66f69a7774195869083416f184282fa7dd3a34ea
6
+ metadata.gz: 7446a1e834acf1139d4a8e2bbe5123c58abb2977f110bf7179128607886cae256cf830948de0b754d354360464ad4c9e70fd52b6e18d8a451b4030921cde65fa
7
+ data.tar.gz: 9b0cbe82ba37dce014210083b8110dfa9f59cd795bb2e1d5058a2fea432f8ba7aa0f0453a4d5f046c60416fea7ef4463862cfdd8acebae901bfa69809d25fc6a
data/Gemfile CHANGED
@@ -2,5 +2,10 @@ source "https://rubygems.org"
2
2
 
3
3
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
- # Specify your gem's dependencies in tracer.gemspec
6
5
  gemspec
6
+
7
+ group :development do
8
+ gem "bundler"
9
+ gem "rake"
10
+ gem "test-unit"
11
+ end
data/Rakefile CHANGED
@@ -2,8 +2,8 @@ require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
3
 
4
4
  Rake::TestTask.new(:test) do |t|
5
- t.libs << "test" << "test/lib"
6
- t.libs << "lib"
5
+ t.libs << "test/lib"
6
+ t.ruby_opts << "-rhelper"
7
7
  t.test_files = FileList["test/**/test_*.rb"]
8
8
  end
9
9
 
@@ -60,6 +60,7 @@
60
60
  # by Keiju ISHITSUKA(keiju@ishitsuka.com)
61
61
  #
62
62
  class Tracer
63
+ VERSION = "0.1.1"
63
64
 
64
65
  class << self
65
66
  # display additional debug information (defaults to false)
@@ -142,11 +143,13 @@ class Tracer
142
143
  stdout.print "Trace off\n" if Tracer.verbose?
143
144
  end
144
145
 
145
- def add_filter(p = proc) # :nodoc:
146
+ def add_filter(p = nil, &b) # :nodoc:
147
+ p ||= b
146
148
  @filters.push p
147
149
  end
148
150
 
149
- def set_get_line_procs(file, p = proc) # :nodoc:
151
+ def set_get_line_procs(file, p = nil, &b) # :nodoc:
152
+ p ||= b
150
153
  @get_line_procs[file] = p
151
154
  end
152
155
 
@@ -239,7 +242,7 @@ class Tracer
239
242
  end
240
243
 
241
244
  ##
242
- # Register an event handler <code>p</code> which is called everytime a line
245
+ # Register an event handler <code>p</code> which is called every time a line
243
246
  # in +file_name+ is executed.
244
247
  #
245
248
  # Example:
@@ -248,7 +251,8 @@ class Tracer
248
251
  # puts "line number executed is #{line}"
249
252
  # })
250
253
 
251
- def Tracer.set_get_line_procs(file_name, p = proc)
254
+ def Tracer.set_get_line_procs(file_name, p = nil, &b)
255
+ p ||= b
252
256
  Single.set_get_line_procs(file_name, p)
253
257
  end
254
258
 
@@ -261,7 +265,8 @@ class Tracer
261
265
  # "Kernel" == klass.to_s
262
266
  # end
263
267
 
264
- def Tracer.add_filter(p = proc)
268
+ def Tracer.add_filter(p = nil, &b)
269
+ p ||= b
265
270
  Single.add_filter(p)
266
271
  end
267
272
  end
@@ -1,26 +1,25 @@
1
- begin
2
- require_relative "lib/tracer/version"
3
- rescue LoadError
4
- # for Ruby core repository
5
- require_relative "version"
1
+ # frozen_string_literal: true
2
+
3
+ name = File.basename(__FILE__, ".gemspec")
4
+ version = ["lib", Array.new(name.count("-")+1, "..").join("/")].find do |dir|
5
+ break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
6
+ /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
7
+ end rescue nil
6
8
  end
7
9
 
8
10
  Gem::Specification.new do |spec|
9
- spec.name = "tracer"
10
- spec.version = Tracer::VERSION
11
+ spec.name = name
12
+ spec.version = version
11
13
  spec.authors = ["Keiju ISHITSUKA"]
12
14
  spec.email = ["keiju@ruby-lang.org"]
13
15
 
14
16
  spec.summary = %q{Outputs a source level execution trace of a Ruby program.}
15
17
  spec.description = %q{Outputs a source level execution trace of a Ruby program.}
16
18
  spec.homepage = "https://github.com/ruby/tracer"
17
- spec.license = "BSD-2-Clause"
19
+ spec.licenses = ["Ruby", "BSD-2-Clause"]
18
20
 
19
- spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/tracer.rb", "lib/tracer/version.rb", "tracer.gemspec"]
21
+ spec.files = ["Gemfile", "LICENSE.txt", "README.md", "Rakefile", "lib/tracer.rb", "tracer.gemspec"]
20
22
  spec.bindir = "exe"
21
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
24
  spec.require_paths = ["lib"]
23
-
24
- spec.add_development_dependency "bundler"
25
- spec.add_development_dependency "rake"
26
25
  end
metadata CHANGED
@@ -1,43 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keiju ISHITSUKA
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-01 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: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
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'
11
+ date: 2020-12-22 00:00:00.000000000 Z
12
+ dependencies: []
41
13
  description: Outputs a source level execution trace of a Ruby program.
42
14
  email:
43
15
  - keiju@ruby-lang.org
@@ -45,22 +17,18 @@ executables: []
45
17
  extensions: []
46
18
  extra_rdoc_files: []
47
19
  files:
48
- - ".gitignore"
49
- - ".travis.yml"
50
20
  - Gemfile
51
21
  - LICENSE.txt
52
22
  - README.md
53
23
  - Rakefile
54
- - bin/console
55
- - bin/setup
56
24
  - lib/tracer.rb
57
- - lib/tracer/version.rb
58
25
  - tracer.gemspec
59
26
  homepage: https://github.com/ruby/tracer
60
27
  licenses:
28
+ - Ruby
61
29
  - BSD-2-Clause
62
30
  metadata: {}
63
- post_install_message:
31
+ post_install_message:
64
32
  rdoc_options: []
65
33
  require_paths:
66
34
  - lib
@@ -75,8 +43,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
43
  - !ruby/object:Gem::Version
76
44
  version: '0'
77
45
  requirements: []
78
- rubygems_version: 3.2.0.pre1
79
- signing_key:
46
+ rubygems_version: 3.2.2
47
+ signing_key:
80
48
  specification_version: 4
81
49
  summary: Outputs a source level execution trace of a Ruby program.
82
50
  test_files: []
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
@@ -1,6 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.5.1
5
- - ruby-head
6
- before_install: gem install bundler -v 1.16.2
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "tracer"
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 DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Tracer
4
- VERSION = "0.1.0"
5
- end