execution_time 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
2
  SHA256:
3
- metadata.gz: 45866a2169cfa32f2c5f997b9024a6bc9c2391aa0884d5db473fb3430b1d9acf
4
- data.tar.gz: efa1214e1d79f36575d049ee5275dbb5c61f4686e848780723ced7416dd39762
3
+ metadata.gz: db79ec20431ed5134a18fb0b21029400df60851760d2bf4e5390d4f22a3d0b69
4
+ data.tar.gz: 1f6a6575fba8d55758c9a2a6b591d3084f418b390ef9ec1884e7e67399f7315f
5
5
  SHA512:
6
- metadata.gz: 650db07957ae748115639fbd55db584278188ea5df8a8226c665421fb4df073ab06490e597bd4ac0f75f235ce8d7810f048cb8f5da3774cbff420c457af089cc
7
- data.tar.gz: f2352ff698164ad0405f215959d5b17141513cd00dd956d1e315cfe883aa968072a51cb27bf78309f84b0986598734db350ad444f814e613d77e326281891055
6
+ metadata.gz: 4efa6a6e4482fc17fcdcf8637c2f835e8fddf5f10446f21288bd6da669e66fc20611e2dbe3f2d136d61f42caa833d148727fcb9824f032499a0c9c070d6a751d
7
+ data.tar.gz: be78c6409bf4ce01056a367a0921db07a44af8738f242a404949d1654a9e72aae10158b0c9e3db16fd866cb6a3fa81bad6d3ace7b9640bd91a120af46256ad7b
data/README.md CHANGED
@@ -10,7 +10,20 @@ Monitor execution time and other metrics directly in `rails console`, similar to
10
10
 
11
11
  Just add this gem to the Gemfile and start `rails c`. After this try to do something like `User.first`.
12
12
 
13
- If you want to measure few lines of code just wrap it with `begin/end`.
13
+ If you want to measure few lines of code just wrap it with `begin/end`:
14
+
15
+ ```ruby
16
+ [4] pry(main)> begin
17
+ [4] pry(main)* User.first.first_name.size
18
+ [4] pry(main)* a = User.count + 1
19
+ [4] pry(main)* b = User.second.last_name.size
20
+ [4] pry(main)* end
21
+ User Load (0.4ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1 [["LIMIT", 1]]
22
+ (3.6ms) SELECT COUNT(*) FROM "users"
23
+ User Load (0.3ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1 OFFSET $2 [["LIMIT", 1], ["OFFSET", 1]]
24
+ [METRICS] Completed in 6.8ms | Allocations: 839 | ActiveRecord: 4.3ms (queries: 3)
25
+ => 5
26
+ ```
14
27
 
15
28
  ## Installation
16
29
 
@@ -1,3 +1,3 @@
1
1
  module ExecutionTime
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
@@ -72,7 +72,11 @@ module ExecutionTime
72
72
  module IrbContextExt
73
73
  def evaluate(*args)
74
74
  Measurer.watch do
75
- super(*args)
75
+ if RUBY_VERSION.to_s =~ /^3/
76
+ super(args[0], args[1], **args[2])
77
+ else
78
+ super(*args)
79
+ end
76
80
  end
77
81
  end
78
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: execution_time
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
  - Igor Kasyanchuk
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-03 00:00:00.000000000 Z
11
+ date: 2022-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -56,7 +56,7 @@ homepage: https://github.com/igorkasyanchuk
56
56
  licenses:
57
57
  - MIT
58
58
  metadata: {}
59
- post_install_message:
59
+ post_install_message:
60
60
  rdoc_options: []
61
61
  require_paths:
62
62
  - lib
@@ -71,8 +71,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  - !ruby/object:Gem::Version
72
72
  version: '0'
73
73
  requirements: []
74
- rubygems_version: 3.0.3
75
- signing_key:
74
+ rubygems_version: 3.2.3
75
+ signing_key:
76
76
  specification_version: 4
77
77
  summary: Measure execution time in Rails console
78
78
  test_files: []