cutep 1.0.0 → 1.1.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 +12 -0
- data/.rspec +3 -0
- data/.travis.yml +6 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +67 -0
- data/Rakefile +6 -194
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/cutep.gemspec +29 -0
- data/lib/cutep.rb +4 -0
- data/lib/qp.rb +58 -63
- data/lib/qp/version.rb +6 -0
- data/{examples/sample.rb → sample.rb} +0 -0
- metadata +59 -66
- data/ChangeLog +0 -79
- data/History.txt +0 -20
- data/License.txt +0 -20
- data/Manifest.txt +0 -20
- data/README.txt +0 -5
- data/memo.txt +0 -13
- data/scripts/makemanifest.rb +0 -20
- data/scripts/txt2html +0 -67
- data/setup.rb +0 -1585
- data/spec/qp_spec.rb +0 -9
- data/spec/spec.opts +0 -1
- data/spec/spec_helper.rb +0 -1
- data/website/index.html +0 -118
- data/website/index.txt +0 -61
- data/website/javascripts/rounded_corners_lite.inc.js +0 -285
- data/website/stylesheets/screen.css +0 -140
- data/website/template.rhtml +0 -48
data/lib/cutep.rb
ADDED
data/lib/qp.rb
CHANGED
@@ -1,63 +1,58 @@
|
|
1
|
-
# Copyright (C) 2003-
|
2
|
-
# License:
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
'
|
20
|
-
end
|
21
|
-
|
22
|
-
def
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
if $
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
assert_match(/\d+\.\d/, QP.runtime)
|
60
|
-
#assert_match(/\d+\.\d:testcase.rb:\d\d:_*send_* \[1, 'a'\]/, QP.tp(caller(1), 1, 'a'))
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
1
|
+
# Copyright (C) 2003-2020 Koichiro Eto, All rights reserved.
|
2
|
+
# License: MIT License
|
3
|
+
|
4
|
+
require "qp/version"
|
5
|
+
|
6
|
+
module QP
|
7
|
+
def caller_msg(ca)
|
8
|
+
file, linenum, msg = ca.first.split(/:([0-9]+):/)
|
9
|
+
msg = $1 if /\Ain \`(.+)\'\z/ =~ msg
|
10
|
+
File.basename(file)+':'+linenum.to_s+':'+msg.to_s
|
11
|
+
end
|
12
|
+
|
13
|
+
def ar_inspect(ar)
|
14
|
+
'['+ar.map {|arg| arg.inspect }.join(', ')+']'
|
15
|
+
end
|
16
|
+
|
17
|
+
def runtime
|
18
|
+
$__qp_t__ = Time.now unless defined? $__qp_t__
|
19
|
+
sprintf('%.1f', Time.now - $__qp_t__)
|
20
|
+
end
|
21
|
+
|
22
|
+
def qp(ca, *args)
|
23
|
+
QP.caller_msg(ca)+"\t"+QP.ar_inspect(args)
|
24
|
+
end
|
25
|
+
|
26
|
+
def tp(ca, *args)
|
27
|
+
QP.runtime+':'+QP.qp(ca, *args)
|
28
|
+
end
|
29
|
+
|
30
|
+
module_function :caller_msg, :ar_inspect, :runtime, :qp, :tp
|
31
|
+
end
|
32
|
+
|
33
|
+
def qp(*args)
|
34
|
+
$stdout.print QP.qp(caller(1), *args)+"\n"
|
35
|
+
end
|
36
|
+
|
37
|
+
def tp(*args)
|
38
|
+
print QP.tp(caller(1), *args)+"\n"
|
39
|
+
end
|
40
|
+
|
41
|
+
if $0 == __FILE__
|
42
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
43
|
+
$__test_qp__ = true
|
44
|
+
end
|
45
|
+
|
46
|
+
if defined?($__test_qp__) && $__test_qp__
|
47
|
+
require 'test/unit'
|
48
|
+
require 'test/unit/ui/console/testrunner'
|
49
|
+
|
50
|
+
class TestQP < Test::Unit::TestCase #:nodoc:
|
51
|
+
def test_all
|
52
|
+
#assert_match(/testcase.rb:\d\d:_*send_*/, QP.caller_msg(caller(1)))
|
53
|
+
assert_equal("[1, \"a\"]", QP.ar_inspect([1, 'a']))
|
54
|
+
assert_match(/\d+\.\d/, QP.runtime)
|
55
|
+
#assert_match(/\d+\.\d:testcase.rb:\d\d:_*send_* \[1, 'a'\]/, QP.tp(caller(1), 1, 'a'))
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/lib/qp/version.rb
ADDED
File without changes
|
metadata
CHANGED
@@ -1,71 +1,64 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.2
|
3
|
-
specification_version: 1
|
1
|
+
--- !ruby/object:Gem::Specification
|
4
2
|
name: cutep
|
5
|
-
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.
|
7
|
-
date: 2007-06-29 00:00:00 +09:00
|
8
|
-
summary: "\"Cute p\" provide more human readable \"p\" function."
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: eto _at_ rubyforge _dot_ org
|
12
|
-
homepage: http://cutep.rubyforge.org
|
13
|
-
rubyforge_project: cutep
|
14
|
-
description: "\"Cute p\" provide more human readable \"p\" function."
|
15
|
-
autorequire:
|
16
|
-
default_executable:
|
17
|
-
bindir: bin
|
18
|
-
has_rdoc: true
|
19
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">"
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.0.0
|
24
|
-
version:
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
25
5
|
platform: ruby
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
-
|
38
|
-
- examples/sample.rb
|
39
|
-
- lib/qp.rb
|
40
|
-
- memo.txt
|
41
|
-
- scripts/makemanifest.rb
|
42
|
-
- scripts/txt2html
|
43
|
-
- setup.rb
|
44
|
-
- spec/qp_spec.rb
|
45
|
-
- spec/spec.opts
|
46
|
-
- spec/spec_helper.rb
|
47
|
-
- website/index.html
|
48
|
-
- website/index.txt
|
49
|
-
- website/javascripts/rounded_corners_lite.inc.js
|
50
|
-
- website/stylesheets/screen.css
|
51
|
-
- website/template.rhtml
|
52
|
-
test_files: []
|
53
|
-
|
54
|
-
rdoc_options:
|
55
|
-
- --main
|
56
|
-
- README.txt
|
57
|
-
extra_rdoc_files:
|
58
|
-
- History.txt
|
59
|
-
- License.txt
|
60
|
-
- Manifest.txt
|
61
|
-
- README.txt
|
62
|
-
- memo.txt
|
63
|
-
- website/index.txt
|
6
|
+
authors:
|
7
|
+
- Koichiro Eto
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-08-16 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: ' Normal "p" only outputs the specified variables, etc. However, during
|
14
|
+
programming, you may need information about where the "p" is being called. "qp"
|
15
|
+
outputs the information about where it is called at the same time.'
|
16
|
+
email:
|
17
|
+
- k-eto@aist.go.jp
|
64
18
|
executables: []
|
65
|
-
|
66
19
|
extensions: []
|
67
|
-
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- ".gitignore"
|
23
|
+
- ".rspec"
|
24
|
+
- ".travis.yml"
|
25
|
+
- CODE_OF_CONDUCT.md
|
26
|
+
- Gemfile
|
27
|
+
- LICENSE.txt
|
28
|
+
- README.md
|
29
|
+
- Rakefile
|
30
|
+
- bin/console
|
31
|
+
- bin/setup
|
32
|
+
- cutep.gemspec
|
33
|
+
- lib/cutep.rb
|
34
|
+
- lib/qp.rb
|
35
|
+
- lib/qp/version.rb
|
36
|
+
- sample.rb
|
37
|
+
homepage: https://github.com/eto/cutep
|
38
|
+
licenses:
|
39
|
+
- MIT
|
40
|
+
metadata:
|
41
|
+
allowed_push_host: https://rubygems.org/
|
42
|
+
homepage_uri: https://github.com/eto/cutep
|
43
|
+
source_code_uri: https://github.com/eto/cutep
|
44
|
+
changelog_uri: https://github.com/eto/cutep
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.3.0
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
68
59
|
requirements: []
|
69
|
-
|
70
|
-
|
71
|
-
|
60
|
+
rubygems_version: 3.1.2
|
61
|
+
signing_key:
|
62
|
+
specification_version: 4
|
63
|
+
summary: '"qp" is an extension of "p".'
|
64
|
+
test_files: []
|
data/ChangeLog
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
2007-06-29 Kouichirou Eto <2007 eto.com>
|
2
|
-
|
3
|
-
* Version 1.0.0 released.
|
4
|
-
|
5
|
-
2007-06-29 Kouichirou Eto <2007 eto.com>
|
6
|
-
|
7
|
-
* lib/qp/version.rb: Deleted.
|
8
|
-
* Rakefile: Changed.
|
9
|
-
|
10
|
-
* Rakefile: Add task chmod
|
11
|
-
|
12
|
-
* website/index.txt: Update.
|
13
|
-
* website/stylesheets/screen.css: Update.
|
14
|
-
* website/stylesheets/bg.png: New file.
|
15
|
-
|
16
|
-
* examples/sample1.rb: New file.
|
17
|
-
* examples/sample2.rb: New file.
|
18
|
-
|
19
|
-
2007-06-16 Kouichirou Eto <2007 eto.com>
|
20
|
-
|
21
|
-
* Version 0.0.3 released.
|
22
|
-
* Just update documents.
|
23
|
-
|
24
|
-
2007-06-16 Kouichirou Eto <2007 eto.com>
|
25
|
-
|
26
|
-
* Rakefile: Redefine install_gem task.
|
27
|
-
|
28
|
-
2007-06-15 Kouichirou Eto <2007 eto.com>
|
29
|
-
|
30
|
-
* example/sample.rb: New file.
|
31
|
-
|
32
|
-
* Rakefile: Add chmod functions.
|
33
|
-
|
34
|
-
* website/index.txt: Update document.
|
35
|
-
|
36
|
-
* website/template.rhtml: Delete "Dr Nic".
|
37
|
-
* website/stylesheets/screen.css: Change background color.
|
38
|
-
|
39
|
-
2007-06-14 Kouichirou Eto <2007 eto.com>
|
40
|
-
|
41
|
-
* Version 0.0.2 released.
|
42
|
-
* Just update specs.
|
43
|
-
|
44
|
-
2007-06-14 Kouichirou Eto <2007 eto.com>
|
45
|
-
|
46
|
-
* lib/qp/version.rb: Version up to 0.0.2
|
47
|
-
|
48
|
-
* scripts/txt2html: Update to qp.
|
49
|
-
|
50
|
-
* scripts/makemanifest.rb: New file.
|
51
|
-
from http://d.hatena.ne.jp/bellbind/20070605/1180979599
|
52
|
-
|
53
|
-
* spec/qp_spec.rb: Update a rule.
|
54
|
-
|
55
|
-
* Rakefile: Add a CLEAN rule.
|
56
|
-
* Rakefile: Add a path "lib".
|
57
|
-
|
58
|
-
2007-06-13 Kouichirou Eto <2007 eto.com>
|
59
|
-
|
60
|
-
* Version 0.0.1 released.
|
61
|
-
* Initial release
|
62
|
-
|
63
|
-
2007-06-13 Kouichirou Eto <2007 eto.com>
|
64
|
-
|
65
|
-
* lib/qp.rb: Added.
|
66
|
-
* lib/qp/version.rb: Deleted.
|
67
|
-
|
68
|
-
* spec/cutep_spec.rb: Add a spec.
|
69
|
-
* spec/qp_spec.rb: Renamed.
|
70
|
-
|
71
|
-
* License.txt: Add my name.
|
72
|
-
* README.txt: Add a description.
|
73
|
-
|
74
|
-
* Rakefile: Add my specs.
|
75
|
-
|
76
|
-
2007-06-13 Kouichirou Eto <2007 eto.com>
|
77
|
-
|
78
|
-
* Init.
|
79
|
-
|
data/History.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
== 1.0.0 2007-06-29
|
2
|
-
|
3
|
-
* 0 major enhancement:
|
4
|
-
* Delete version.rb
|
5
|
-
|
6
|
-
== 0.0.3 2007-06-16
|
7
|
-
|
8
|
-
* 0 major enhancement:
|
9
|
-
* Just update documents.
|
10
|
-
|
11
|
-
== 0.0.2 2007-06-14
|
12
|
-
|
13
|
-
* 0 major enhancement:
|
14
|
-
* Just update specs.
|
15
|
-
|
16
|
-
== 0.0.1 2007-06-13
|
17
|
-
|
18
|
-
* 1 major enhancement:
|
19
|
-
* Initial release
|
20
|
-
|
data/License.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2003-2007 Kouichirou Eto
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
ChangeLog
|
2
|
-
History.txt
|
3
|
-
License.txt
|
4
|
-
Manifest.txt
|
5
|
-
README.txt
|
6
|
-
Rakefile
|
7
|
-
examples/sample.rb
|
8
|
-
lib/qp.rb
|
9
|
-
memo.txt
|
10
|
-
scripts/makemanifest.rb
|
11
|
-
scripts/txt2html
|
12
|
-
setup.rb
|
13
|
-
spec/qp_spec.rb
|
14
|
-
spec/spec.opts
|
15
|
-
spec/spec_helper.rb
|
16
|
-
website/index.html
|
17
|
-
website/index.txt
|
18
|
-
website/javascripts/rounded_corners_lite.inc.js
|
19
|
-
website/stylesheets/screen.css
|
20
|
-
website/template.rhtml
|
data/README.txt
DELETED
data/memo.txt
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
----------------------------------------------------------------------
|
2
|
-
== 1.0.0 2007-06-29
|
3
|
-
|
4
|
-
* 0 major enhancement:
|
5
|
-
* Remove unused files and directories.
|
6
|
-
|
7
|
-
----------------------------------------------------------------------
|
8
|
-
2007-06-29 Kouichirou Eto <2007 eto.com>
|
9
|
-
|
10
|
-
* Version 1.0.0 released.
|
11
|
-
|
12
|
-
|
13
|
-
----------------------------------------------------------------------
|
data/scripts/makemanifest.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
|
3
|
-
base_dir = File.join(File.dirname(__FILE__), "..")
|
4
|
-
glob_pattern = File.join("**", "*")
|
5
|
-
exclude_patterns = [
|
6
|
-
/^pkg/,/^doc/,
|
7
|
-
]
|
8
|
-
|
9
|
-
Dir.chdir(base_dir)
|
10
|
-
files = Dir.glob(glob_pattern).delete_if do |fname|
|
11
|
-
File.directory?(fname) or
|
12
|
-
exclude_patterns.find do |pattern|
|
13
|
-
pattern =~ fname
|
14
|
-
end
|
15
|
-
end
|
16
|
-
manifest = File.new("Manifest.txt", "w")
|
17
|
-
manifest.puts files.sort.join("\n")
|
18
|
-
manifest.close
|
19
|
-
|
20
|
-
puts "Manifest.txt updated"
|