irb-benchmark 0.1.2 → 0.1.3

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
- SHA1:
3
- metadata.gz: b2570b37ea76a93790fc216d8643ea6e554ffc4e
4
- data.tar.gz: 429720b39832cbff037a17cd59146d34ca6029a9
2
+ SHA256:
3
+ metadata.gz: a7907af47a2f8abe7a0a3a2391a36b125eca042245e6308b05dbef5e376679f6
4
+ data.tar.gz: 037024a2501d20bdd78c92003bd94ed30e789be2b4888bbf8084dc49def163f2
5
5
  SHA512:
6
- metadata.gz: d4c2223fd3129cb38f8b3cb44f23fa92fc3a5318f80bea7f3d8581a47bf4b56eeaaa66e426f4d6a9f570b67e9d426cf20029fb587564c2218887ffb5cb007654
7
- data.tar.gz: f96036defb50bd7ea5a2abf9ee8b58db9fb74d2e984979579e687cdc9509ef7d04a790877a2fc69dfb0972032315b75e012aeb8ce6a16d6be797753d8cec3f06
6
+ metadata.gz: 9be1b93dda14a5a73816742b9f4037a13e64321772b718a488689ed97dbfb648edc8905c653bba0cff4240cd83659086cba5afbe9259890b4b4398b6eb5cef28
7
+ data.tar.gz: 148b32a69610e44ae5eb711d9171e0dc21a3e018752222262210d72cf18c95201e0922382a603d5df52d96c1a08b5aac622656306ce13c4ddb5a264195d0eeec
@@ -0,0 +1,3 @@
1
+ AllCops:
2
+ Exclude:
3
+ - '*.gemspec'
data/Gemfile CHANGED
@@ -1,5 +1,10 @@
1
- source "http://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- gem "minitest", "~> 5.2.3", group: :test
3
+ git_source(:github) do |repo_name|
4
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
5
+ "https://github.com/#{repo_name}.git"
6
+ end
4
7
 
5
- gem "jeweler", "~> 2.0.1", group: :development
8
+ gem 'minitest', group: :test
9
+
10
+ gem 'jeweler', group: :development
@@ -1,55 +1,61 @@
1
1
  GEM
2
- remote: http://rubygems.org/
2
+ remote: https://rubygems.org/
3
3
  specs:
4
- addressable (2.3.5)
5
- builder (3.2.2)
6
- descendants_tracker (0.0.3)
7
- faraday (0.9.0)
4
+ addressable (2.4.0)
5
+ builder (3.2.3)
6
+ descendants_tracker (0.0.4)
7
+ thread_safe (~> 0.3, >= 0.3.1)
8
+ faraday (0.9.2)
8
9
  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)
10
+ git (1.3.0)
11
+ github_api (0.16.0)
12
+ addressable (~> 2.4.0)
13
+ descendants_tracker (~> 0.0.4)
13
14
  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)
15
+ hashie (>= 3.4)
16
+ mime-types (>= 1.16, < 3.0)
17
+ oauth2 (~> 1.0)
18
+ hashie (3.5.6)
19
+ highline (1.7.10)
20
+ jeweler (2.3.7)
21
21
  builder
22
- bundler (>= 1.0)
22
+ bundler (>= 1)
23
23
  git (>= 1.2.5)
24
- github_api
24
+ github_api (~> 0.16.0)
25
25
  highline (>= 1.6.15)
26
26
  nokogiri (>= 1.5.10)
27
+ psych (~> 2.2)
27
28
  rake
28
29
  rdoc
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)
30
+ semver2
31
+ jwt (1.5.6)
32
+ mime-types (2.99.3)
33
+ mini_portile2 (2.3.0)
34
+ minitest (5.10.3)
35
+ multi_json (1.12.2)
36
+ multi_xml (0.6.0)
36
37
  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)
38
+ nokogiri (1.8.1)
39
+ mini_portile2 (~> 2.3.0)
40
+ oauth2 (1.4.0)
41
+ faraday (>= 0.8, < 0.13)
42
+ jwt (~> 1.0)
42
43
  multi_json (~> 1.3)
43
44
  multi_xml (~> 0.5)
44
- rack (~> 1.2)
45
- rack (1.5.2)
46
- rake (10.1.1)
47
- rdoc (4.1.1)
48
- json (~> 1.4)
45
+ rack (>= 1.2, < 3)
46
+ psych (2.2.4)
47
+ rack (2.0.3)
48
+ rake (12.3.0)
49
+ rdoc (6.0.0)
50
+ semver2 (3.4.2)
51
+ thread_safe (0.3.6)
49
52
 
50
53
  PLATFORMS
51
54
  ruby
52
55
 
53
56
  DEPENDENCIES
54
- jeweler (~> 2.0.1)
55
- minitest (~> 5.2.3)
57
+ jeweler
58
+ minitest
59
+
60
+ BUNDLED WITH
61
+ 1.16.0
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2014 Maurizio De Santis <desantis.maurizio@gmail.com>
1
+ Copyright (c) 2012-2017 Maurizio De Santis <desantis.maurizio@gmail.com>
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # [IrbBenchmark](https://github.com/mdesantis/irb-benchmark)
2
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:
3
+ [IrbBenchmark](https://github.com/mdesantis/irb-benchmark) wraps `irb` commands
4
+ evaluations in a `Benchmark.measure{ ... }` block and displays the results after
5
+ the command execution. Example:
4
6
 
5
7
  ```
6
8
  irb(main):001:0> sleep 1
@@ -36,7 +38,8 @@ require 'irb-benchmark'
36
38
  Irbtools.add_library :irb_benchmark, late: true
37
39
  ```
38
40
 
39
- Note that the former option can be used with irbtools too, so it is the preferred.
41
+ Note that the former option can be used with irbtools too, so it is the
42
+ preferred.
40
43
 
41
44
  ### Enabling / disabling
42
45
 
@@ -44,9 +47,13 @@ Note that the former option can be used with irbtools too, so it is the preferre
44
47
  IrbBenchmark.enabled = true / false
45
48
  ```
46
49
 
47
- ## [Wirb](https://github.com/janlelis/wirb) / [irbtools](https://github.com/janlelis/irbtools) integration
50
+ ## [Wirb](https://github.com/janlelis/wirb) /
51
+ [irbtools](https://github.com/janlelis/irbtools) integration
48
52
 
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).
53
+ It auto-detects [Wirb](https://github.com/janlelis/wirb) presence and
54
+ [FancyIrb](https://github.com/janlelis/fancy_irb) configuration for colorized
55
+ output (both are used by the well-known
56
+ [irbtools](https://github.com/janlelis/irbtools) gem).
50
57
 
51
58
  ## Known issues
52
59
 
@@ -54,11 +61,15 @@ The usage with FancyIrb alters the benchmark measures adding a small overhead.
54
61
 
55
62
  ## Bugs, feature requests, pull requests
56
63
 
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.
64
+ Fell free to open an
65
+ [issue](https://github.com/ProGNOMmers/irb-benchmark/issues) for bugs or
66
+ feature requests, or fork it and make a pull request.
58
67
 
59
68
  ## 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` :-)
69
+ [janlelis](https://github.com/janlelis) and its
70
+ [fancy_irb](https://github.com/janlelis/fancy_irb) which saved me from spending
71
+ time to discover how to monkey-patch `Irb` :-)
61
72
 
62
73
  ## License
63
74
 
64
- Copyright (c) 2012-2014 Maurizio De Santis. [MIT license](LICENSE.txt)
75
+ Copyright (c) 2012-2017 Maurizio De Santis. [MIT license](LICENSE.txt)
data/Rakefile CHANGED
@@ -1,27 +1,27 @@
1
- # encoding: utf-8
2
-
3
1
  require 'rubygems'
4
2
  require 'bundler'
5
3
  begin
6
4
  Bundler.setup(:default, :development)
7
5
  rescue Bundler::BundlerError => e
8
- $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
6
+ warn e.message
7
+ warn 'Run `bundle install` to install missing gems'
10
8
  exit e.status_code
11
9
  end
12
10
  require 'rake'
13
11
 
14
12
  require 'jeweler'
15
13
  Jeweler::Tasks.new do |gem|
16
- # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
- gem.name = "irb-benchmark"
18
- gem.homepage = "http://github.com/mdesantis/irb-benchmark"
19
- gem.license = "MIT"
20
- gem.summary = %Q{irb commands auto-benchmarking}
21
- gem.description = %Q{irb-benchmark wraps irb commands in a Benchmark.measure{ ... } block and displays
22
- the results after the command execution}
23
- gem.email = "desantis.maurizio@gmail.com"
24
- gem.authors = ["Maurizio De Santis"]
14
+ # gem is a Gem::Specification...
15
+ # see http://guides.rubygems.org/specification-reference/ for more options
16
+ gem.name = 'irb-benchmark'
17
+ gem.homepage = 'http://github.com/mdesantis/irb-benchmark'
18
+ gem.license = 'MIT'
19
+ gem.summary = %(irb commands auto-benchmarking)
20
+ gem.description =
21
+ 'irb-benchmark wraps irb commands in a Benchmark.measure { ... } block ' \
22
+ 'and displays the results after the command execution'
23
+ gem.email = 'desantis.maurizio@gmail.com'
24
+ gem.authors = ['Maurizio De Santis']
25
25
  # dependencies defined in Gemfile
26
26
  end
27
27
  Jeweler::RubygemsDotOrgTasks.new
@@ -33,17 +33,17 @@ Rake::TestTask.new(:test) do |test|
33
33
  test.verbose = true
34
34
  end
35
35
 
36
- desc "Code coverage detail"
36
+ desc 'Code coverage detail'
37
37
  task :simplecov do
38
- ENV['COVERAGE'] = "true"
38
+ ENV['COVERAGE'] = 'true'
39
39
  Rake::Task['test'].execute
40
40
  end
41
41
 
42
- task :default => :test
42
+ task default: :test
43
43
 
44
44
  require 'rdoc/task'
45
45
  Rake::RDocTask.new do |rdoc|
46
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
46
+ version = File.exist?('VERSION') ? File.read('VERSION') : ''
47
47
 
48
48
  rdoc.rdoc_dir = 'rdoc'
49
49
  rdoc.title = "irb-benchmark #{version}"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -2,23 +2,24 @@
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
+ # stub: irb-benchmark 0.1.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
- s.name = "irb-benchmark"
9
- s.version = "0.1.2"
8
+ s.name = "irb-benchmark".freeze
9
+ s.version = "0.1.3"
10
10
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.require_paths = ["lib"]
13
- s.authors = ["Maurizio De Santis"]
14
- s.date = "2014-02-26"
15
- s.description = "irb-benchmark wraps irb commands in a Benchmark.measure{ ... } block and displays \nthe results after the command execution"
16
- s.email = "desantis.maurizio@gmail.com"
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib".freeze]
13
+ s.authors = ["Maurizio De Santis".freeze]
14
+ s.date = "2017-12-07"
15
+ s.description = "irb-benchmark wraps irb commands in a Benchmark.measure { ... } block and displays the results after the command execution".freeze
16
+ s.email = "desantis.maurizio@gmail.com".freeze
17
17
  s.extra_rdoc_files = [
18
18
  "LICENSE.txt",
19
19
  "README.md"
20
20
  ]
21
21
  s.files = [
22
+ ".rubocop.yml",
22
23
  "Gemfile",
23
24
  "Gemfile.lock",
24
25
  "LICENSE.txt",
@@ -31,21 +32,21 @@ Gem::Specification.new do |s|
31
32
  "lib/irb_benchmark/irb_ext.rb",
32
33
  "test/test_irb_benchmark.rb"
33
34
  ]
34
- s.homepage = "http://github.com/mdesantis/irb-benchmark"
35
- s.licenses = ["MIT"]
36
- s.rubygems_version = "2.2.2"
37
- s.summary = "irb commands auto-benchmarking"
35
+ s.homepage = "http://github.com/mdesantis/irb-benchmark".freeze
36
+ s.licenses = ["MIT".freeze]
37
+ s.rubygems_version = "2.7.2".freeze
38
+ s.summary = "irb commands auto-benchmarking".freeze
38
39
 
39
40
  if s.respond_to? :specification_version then
40
41
  s.specification_version = 4
41
42
 
42
43
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
43
- s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
44
+ s.add_development_dependency(%q<jeweler>.freeze, [">= 0"])
44
45
  else
45
- s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
46
+ s.add_dependency(%q<jeweler>.freeze, [">= 0"])
46
47
  end
47
48
  else
48
- s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
49
+ s.add_dependency(%q<jeweler>.freeze, [">= 0"])
49
50
  end
50
51
  end
51
52
 
@@ -1 +1 @@
1
- require 'irb_benchmark'
1
+ require 'irb_benchmark' # rubocop:disable Naming/FileName
@@ -1,23 +1,20 @@
1
+ # Main IrbBenchmark module, which has to be injected into IRB::Context.
1
2
  module IrbBenchmark
2
-
3
3
  VERSION = File.read(File.expand_path('../../VERSION', __FILE__)).chomp.freeze
4
4
 
5
5
  @enabled = true
6
6
 
7
7
  class << self
8
-
9
8
  attr_accessor :enabled
10
9
 
11
10
  def print(bm)
12
- if defined?(Wirb) and (!defined?(FancyIrb) || FancyIrb[:colorize, :output])
11
+ if defined?(Wirb) && (!defined?(FancyIrb) || FancyIrb[:colorize, :output])
13
12
  $stdout.print Wirb.colorize_result bm.to_s
14
13
  else
15
14
  $stdout.print bm.to_s
16
15
  end
17
16
  end
18
-
19
17
  end
20
-
21
18
  end
22
19
 
23
20
  require 'irb_benchmark/irb_ext'
@@ -2,17 +2,18 @@ require 'irb'
2
2
  require 'benchmark'
3
3
 
4
4
  module IRB
5
+ # IRB::Context monkeypatch. Injects benchmark measurements into
6
+ # IRB evaluations.
5
7
  class Context
6
-
7
8
  alias evaluate_non_benchmarked evaluate
8
9
 
9
10
  def evaluate(*args)
10
11
  if IrbBenchmark.enabled
11
- IrbBenchmark.print Benchmark.measure{ evaluate_non_benchmarked(*args) }
12
+ bm = Benchmark.measure { evaluate_non_benchmarked(*args) }
13
+ IrbBenchmark.print(bm)
12
14
  else
13
15
  evaluate_non_benchmarked(*args)
14
16
  end
15
17
  end
16
-
17
18
  end
18
19
  end
@@ -7,10 +7,10 @@ class TestIrbBenchmark < MiniTest::Test
7
7
  end
8
8
 
9
9
  def test_print
10
- bm = Benchmark.measure{ }
10
+ bm = Benchmark.measure {}
11
11
  $stdout = @stdout
12
12
  IrbBenchmark.print bm
13
13
  $stdout.rewind
14
14
  assert_equal $stdout.read, bm.to_s
15
15
  end
16
- end
16
+ end
metadata CHANGED
@@ -1,31 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irb-benchmark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
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: 2014-02-26 00:00:00.000000000 Z
11
+ date: 2017-12-07 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: 2.0.1
19
+ version: '0'
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: 2.0.1
27
- description: "irb-benchmark wraps irb commands in a Benchmark.measure{ ... } block
28
- and displays \nthe results after the command execution"
26
+ version: '0'
27
+ description: irb-benchmark wraps irb commands in a Benchmark.measure { ... } block
28
+ and displays the results after the command execution
29
29
  email: desantis.maurizio@gmail.com
30
30
  executables: []
31
31
  extensions: []
@@ -33,6 +33,7 @@ extra_rdoc_files:
33
33
  - LICENSE.txt
34
34
  - README.md
35
35
  files:
36
+ - ".rubocop.yml"
36
37
  - Gemfile
37
38
  - Gemfile.lock
38
39
  - LICENSE.txt
@@ -64,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
65
  version: '0'
65
66
  requirements: []
66
67
  rubyforge_project:
67
- rubygems_version: 2.2.2
68
+ rubygems_version: 2.7.2
68
69
  signing_key:
69
70
  specification_version: 4
70
71
  summary: irb commands auto-benchmarking