irb-benchmark 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -3
- data/Gemfile.lock +43 -7
- data/LICENSE.txt +1 -1
- data/README.md +64 -0
- data/Rakefile +18 -3
- data/VERSION +1 -1
- data/irb-benchmark.gemspec +14 -12
- data/test/test_irb_benchmark.rb +16 -0
- metadata +14 -13
- data/README.rdoc +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2570b37ea76a93790fc216d8643ea6e554ffc4e
|
4
|
+
data.tar.gz: 429720b39832cbff037a17cd59146d34ca6029a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4c2223fd3129cb38f8b3cb44f23fa92fc3a5318f80bea7f3d8581a47bf4b56eeaaa66e426f4d6a9f570b67e9d426cf20029fb587564c2218887ffb5cb007654
|
7
|
+
data.tar.gz: f96036defb50bd7ea5a2abf9ee8b58db9fb74d2e984979579e687cdc9509ef7d04a790877a2fc69dfb0972032315b75e012aeb8ce6a16d6be797753d8cec3f06
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,19 +1,55 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
addressable (2.3.5)
|
5
|
+
builder (3.2.2)
|
6
|
+
descendants_tracker (0.0.3)
|
7
|
+
faraday (0.9.0)
|
8
|
+
multipart-post (>= 1.2, < 3)
|
9
|
+
git (1.2.6)
|
10
|
+
github_api (0.11.3)
|
11
|
+
addressable (~> 2.3)
|
12
|
+
descendants_tracker (~> 0.0.1)
|
13
|
+
faraday (~> 0.8, < 0.10)
|
14
|
+
hashie (>= 1.2)
|
15
|
+
multi_json (>= 1.7.5, < 2.0)
|
16
|
+
nokogiri (~> 1.6.0)
|
17
|
+
oauth2
|
18
|
+
hashie (2.0.5)
|
19
|
+
highline (1.6.20)
|
20
|
+
jeweler (2.0.1)
|
21
|
+
builder
|
22
|
+
bundler (>= 1.0)
|
7
23
|
git (>= 1.2.5)
|
24
|
+
github_api
|
25
|
+
highline (>= 1.6.15)
|
26
|
+
nokogiri (>= 1.5.10)
|
8
27
|
rake
|
9
28
|
rdoc
|
10
|
-
json (1.
|
11
|
-
|
12
|
-
|
29
|
+
json (1.8.1)
|
30
|
+
jwt (0.1.11)
|
31
|
+
multi_json (>= 1.5)
|
32
|
+
mini_portile (0.5.2)
|
33
|
+
minitest (5.2.3)
|
34
|
+
multi_json (1.8.4)
|
35
|
+
multi_xml (0.5.5)
|
36
|
+
multipart-post (2.0.0)
|
37
|
+
nokogiri (1.6.1)
|
38
|
+
mini_portile (~> 0.5.0)
|
39
|
+
oauth2 (0.9.3)
|
40
|
+
faraday (>= 0.8, < 0.10)
|
41
|
+
jwt (~> 0.1.8)
|
42
|
+
multi_json (~> 1.3)
|
43
|
+
multi_xml (~> 0.5)
|
44
|
+
rack (~> 1.2)
|
45
|
+
rack (1.5.2)
|
46
|
+
rake (10.1.1)
|
47
|
+
rdoc (4.1.1)
|
13
48
|
json (~> 1.4)
|
14
49
|
|
15
50
|
PLATFORMS
|
16
51
|
ruby
|
17
52
|
|
18
53
|
DEPENDENCIES
|
19
|
-
jeweler (~>
|
54
|
+
jeweler (~> 2.0.1)
|
55
|
+
minitest (~> 5.2.3)
|
data/LICENSE.txt
CHANGED
data/README.md
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# [IrbBenchmark](https://github.com/mdesantis/irb-benchmark)
|
2
|
+
|
3
|
+
[IrbBenchmark](https://github.com/mdesantis/irb-benchmark) wraps `irb` commands evaluations in a `Benchmark.measure{ ... }` block and displays the results after the command execution. Example:
|
4
|
+
|
5
|
+
```
|
6
|
+
irb(main):001:0> sleep 1
|
7
|
+
0.000000 0.000000 0.000000 ( 1.000323)
|
8
|
+
=> 1
|
9
|
+
```
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
```
|
14
|
+
$ gem install irb-benchmark
|
15
|
+
```
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
### Single shot usage
|
20
|
+
|
21
|
+
```
|
22
|
+
$ irb -rirb-benchmark
|
23
|
+
```
|
24
|
+
|
25
|
+
### In `.irbrc`
|
26
|
+
|
27
|
+
#### Classic `require`
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'irb-benchmark'
|
31
|
+
```
|
32
|
+
|
33
|
+
#### [irbtools](https://github.com/janlelis/irbtools) option
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
Irbtools.add_library :irb_benchmark, late: true
|
37
|
+
```
|
38
|
+
|
39
|
+
Note that the former option can be used with irbtools too, so it is the preferred.
|
40
|
+
|
41
|
+
### Enabling / disabling
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
IrbBenchmark.enabled = true / false
|
45
|
+
```
|
46
|
+
|
47
|
+
## [Wirb](https://github.com/janlelis/wirb) / [irbtools](https://github.com/janlelis/irbtools) integration
|
48
|
+
|
49
|
+
It auto-detects [Wirb](https://github.com/janlelis/wirb) presence and [FancyIrb](https://github.com/janlelis/fancy_irb) configuration for colorized output (both are used by the well-known [irbtools](https://github.com/janlelis/irbtools) gem).
|
50
|
+
|
51
|
+
## Known issues
|
52
|
+
|
53
|
+
The usage with FancyIrb alters the benchmark measures adding a small overhead.
|
54
|
+
|
55
|
+
## Bugs, feature requests, pull requests
|
56
|
+
|
57
|
+
Fell free to open an [issue](https://github.com/ProGNOMmers/irb-benchmark/issues) for problems or feature requests, or fork it and make a pull request.
|
58
|
+
|
59
|
+
## Thanks to
|
60
|
+
[janlelis](https://github.com/janlelis) and its [fancy_irb](https://github.com/janlelis/fancy_irb) which saved me from spending time to discover how to monkey-patch `Irb` :-)
|
61
|
+
|
62
|
+
## License
|
63
|
+
|
64
|
+
Copyright (c) 2012-2014 Maurizio De Santis. [MIT license](LICENSE.txt)
|
data/Rakefile
CHANGED
@@ -13,11 +13,11 @@ require 'rake'
|
|
13
13
|
|
14
14
|
require 'jeweler'
|
15
15
|
Jeweler::Tasks.new do |gem|
|
16
|
-
# gem is a Gem::Specification... see http://
|
16
|
+
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
17
17
|
gem.name = "irb-benchmark"
|
18
|
-
gem.homepage = "http://github.com/
|
18
|
+
gem.homepage = "http://github.com/mdesantis/irb-benchmark"
|
19
19
|
gem.license = "MIT"
|
20
|
-
gem.summary = %Q{
|
20
|
+
gem.summary = %Q{irb commands auto-benchmarking}
|
21
21
|
gem.description = %Q{irb-benchmark wraps irb commands in a Benchmark.measure{ ... } block and displays
|
22
22
|
the results after the command execution}
|
23
23
|
gem.email = "desantis.maurizio@gmail.com"
|
@@ -26,6 +26,21 @@ the results after the command execution}
|
|
26
26
|
end
|
27
27
|
Jeweler::RubygemsDotOrgTasks.new
|
28
28
|
|
29
|
+
require 'rake/testtask'
|
30
|
+
Rake::TestTask.new(:test) do |test|
|
31
|
+
test.libs << 'lib' << 'test'
|
32
|
+
test.pattern = 'test/**/test_*.rb'
|
33
|
+
test.verbose = true
|
34
|
+
end
|
35
|
+
|
36
|
+
desc "Code coverage detail"
|
37
|
+
task :simplecov do
|
38
|
+
ENV['COVERAGE'] = "true"
|
39
|
+
Rake::Task['test'].execute
|
40
|
+
end
|
41
|
+
|
42
|
+
task :default => :test
|
43
|
+
|
29
44
|
require 'rdoc/task'
|
30
45
|
Rake::RDocTask.new do |rdoc|
|
31
46
|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/irb-benchmark.gemspec
CHANGED
@@ -2,48 +2,50 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: irb-benchmark 0.1.2 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "irb-benchmark"
|
8
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.2"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["Maurizio De Santis"]
|
12
|
-
s.date = "
|
14
|
+
s.date = "2014-02-26"
|
13
15
|
s.description = "irb-benchmark wraps irb commands in a Benchmark.measure{ ... } block and displays \nthe results after the command execution"
|
14
16
|
s.email = "desantis.maurizio@gmail.com"
|
15
17
|
s.extra_rdoc_files = [
|
16
18
|
"LICENSE.txt",
|
17
|
-
"README.
|
19
|
+
"README.md"
|
18
20
|
]
|
19
21
|
s.files = [
|
20
22
|
"Gemfile",
|
21
23
|
"Gemfile.lock",
|
22
24
|
"LICENSE.txt",
|
23
|
-
"README.
|
25
|
+
"README.md",
|
24
26
|
"Rakefile",
|
25
27
|
"VERSION",
|
26
28
|
"irb-benchmark.gemspec",
|
27
29
|
"lib/irb-benchmark.rb",
|
28
30
|
"lib/irb_benchmark.rb",
|
29
|
-
"lib/irb_benchmark/irb_ext.rb"
|
31
|
+
"lib/irb_benchmark/irb_ext.rb",
|
32
|
+
"test/test_irb_benchmark.rb"
|
30
33
|
]
|
31
|
-
s.homepage = "http://github.com/
|
34
|
+
s.homepage = "http://github.com/mdesantis/irb-benchmark"
|
32
35
|
s.licenses = ["MIT"]
|
33
|
-
s.
|
34
|
-
s.
|
35
|
-
s.summary = "Auto-benchmarking of irb commands"
|
36
|
+
s.rubygems_version = "2.2.2"
|
37
|
+
s.summary = "irb commands auto-benchmarking"
|
36
38
|
|
37
39
|
if s.respond_to? :specification_version then
|
38
40
|
s.specification_version = 4
|
39
41
|
|
40
42
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
41
|
-
s.add_development_dependency(%q<jeweler>, ["~>
|
43
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
|
42
44
|
else
|
43
|
-
s.add_dependency(%q<jeweler>, ["~>
|
45
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
44
46
|
end
|
45
47
|
else
|
46
|
-
s.add_dependency(%q<jeweler>, ["~>
|
48
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
47
49
|
end
|
48
50
|
end
|
49
51
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'irb_benchmark'
|
3
|
+
|
4
|
+
class TestIrbBenchmark < MiniTest::Test
|
5
|
+
def setup
|
6
|
+
@stdout = StringIO.new
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_print
|
10
|
+
bm = Benchmark.measure{ }
|
11
|
+
$stdout = @stdout
|
12
|
+
IrbBenchmark.print bm
|
13
|
+
$stdout.rewind
|
14
|
+
assert_equal $stdout.read, bm.to_s
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irb-benchmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maurizio De Santis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jeweler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.1
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.0.1
|
27
27
|
description: "irb-benchmark wraps irb commands in a Benchmark.measure{ ... } block
|
28
28
|
and displays \nthe results after the command execution"
|
29
29
|
email: desantis.maurizio@gmail.com
|
@@ -31,19 +31,20 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files:
|
33
33
|
- LICENSE.txt
|
34
|
-
- README.
|
34
|
+
- README.md
|
35
35
|
files:
|
36
36
|
- Gemfile
|
37
37
|
- Gemfile.lock
|
38
38
|
- LICENSE.txt
|
39
|
-
- README.
|
39
|
+
- README.md
|
40
40
|
- Rakefile
|
41
41
|
- VERSION
|
42
42
|
- irb-benchmark.gemspec
|
43
43
|
- lib/irb-benchmark.rb
|
44
44
|
- lib/irb_benchmark.rb
|
45
45
|
- lib/irb_benchmark/irb_ext.rb
|
46
|
-
|
46
|
+
- test/test_irb_benchmark.rb
|
47
|
+
homepage: http://github.com/mdesantis/irb-benchmark
|
47
48
|
licenses:
|
48
49
|
- MIT
|
49
50
|
metadata: {}
|
@@ -53,18 +54,18 @@ require_paths:
|
|
53
54
|
- lib
|
54
55
|
required_ruby_version: !ruby/object:Gem::Requirement
|
55
56
|
requirements:
|
56
|
-
- -
|
57
|
+
- - ">="
|
57
58
|
- !ruby/object:Gem::Version
|
58
59
|
version: '0'
|
59
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
61
|
requirements:
|
61
|
-
- -
|
62
|
+
- - ">="
|
62
63
|
- !ruby/object:Gem::Version
|
63
64
|
version: '0'
|
64
65
|
requirements: []
|
65
66
|
rubyforge_project:
|
66
|
-
rubygems_version: 2.
|
67
|
+
rubygems_version: 2.2.2
|
67
68
|
signing_key:
|
68
69
|
specification_version: 4
|
69
|
-
summary:
|
70
|
+
summary: irb commands auto-benchmarking
|
70
71
|
test_files: []
|
data/README.rdoc
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
= IrbBenchmark
|
2
|
-
|
3
|
-
== Description
|
4
|
-
|
5
|
-
It wraps irb evaluations in a <tt>Benchmark.measure{ ... }</tt> block and displays
|
6
|
-
the results after the command execution. Simple and powerful.
|
7
|
-
|
8
|
-
== Installation
|
9
|
-
|
10
|
-
<tt>gem install irb-benchmark</tt>
|
11
|
-
|
12
|
-
== Usage
|
13
|
-
|
14
|
-
Single shot usage: open irb and <tt>require 'irb-benchmark'</tt>
|
15
|
-
|
16
|
-
In <tt>.irbrc</tt>:
|
17
|
-
* classic require: <tt>require 'irb-benchmark'</tt>
|
18
|
-
* irbtools option: <tt>Irbtools.add_library :irb_benchmark, :late => true</tt> (require can be used with irbtools too)
|
19
|
-
|
20
|
-
Enabling / disabling: <tt>IrbBenchmark.enabled = true / false</tt>
|
21
|
-
|
22
|
-
== Wirb / irbtools integration
|
23
|
-
|
24
|
-
It auto-detects Wirb[https://github.com/janlelis/wirb] presence and
|
25
|
-
FancyIrb[https://github.com/janlelis/fancy_irb] configuration for colorized
|
26
|
-
output (both are used by the well-known
|
27
|
-
irbtools[https://github.com/janlelis/irbtools] gem).
|
28
|
-
|
29
|
-
== Known issues
|
30
|
-
|
31
|
-
The usage with FancyIrb alters the benchmark measures adding a small overhead;
|
32
|
-
I'm working on it.
|
33
|
-
|
34
|
-
== Bugs, feature requests, pull requests
|
35
|
-
|
36
|
-
Fell free to open an issue[https://github.com/ProGNOMmers/irb-benchmark/issues]
|
37
|
-
for problems or feature requests, or fork it and make a pull request, it will
|
38
|
-
be taken in consideration.
|
39
|
-
|
40
|
-
== Thanks to
|
41
|
-
janlelis[https://github.com/janlelis] and its fancy_irb[https://github.com/janlelis/fancy_irb]
|
42
|
-
which saved me from spend time to discover how to monkey-patch Irb :-)
|
43
|
-
|
44
|
-
== Copyright
|
45
|
-
|
46
|
-
Copyright (c) 2012 Maurizio De Santis. See LICENSE.txt for
|
47
|
-
further details.
|