pry-larry 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.travis.yml +8 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +3 -0
- data/README.md +2 -1
- data/Rakefile +3 -1
- data/lib/pry-larry.rb +2 -1
- data/lib/pry-larry/version.rb +1 -1
- data/spec/pry_larry_spec.rb +40 -0
- data/spec/setup.rb +3 -0
- metadata +12 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9308a43162c450b70d038352df21f955f4873cf5
|
4
|
+
data.tar.gz: 62b488ea45c959ad1bdc82aab244cc22af702bd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb9ca2a6ddb4668e9e74ae34e95764386c94be1996cf83208c4cc1748eddf6c54826306a5a25d4a18b161c548288d0e4944e28ba71d3031b17767af2fd05d19a
|
7
|
+
data.tar.gz: f35c969ba0f3526f2c277724e37a5ee7411a822ed2428258e29d65118cf68d7691cf8f178711baddfd9d46f1f2fe33278c931e0e3b38d5f70a945945ae4dafb4
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
__v0.7.0__
|
2
|
+
|
3
|
+
* Do not use color if "pry.color" is equal to false or nil.
|
4
|
+
* Prevent growth of Array(s) referenced by "Pry::Larry::MEMORY".
|
5
|
+
|
1
6
|
__v0.6.0__
|
2
7
|
|
3
8
|
* Add "pry.config.larry.benchmark_commands". Default is to not print benchmark information for Pry commands.
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
[![Code Climate](https://codeclimate.com/github/jazzonmymind/pry-larry.rb/badges/gpa.svg)](https://codeclimate.com/github/jazzonmymind/pry-larry.rb)
|
2
|
+
[![Build Status](https://travis-ci.org/jazzonmymind/pry-larry.rb.svg?branch=master)](https://travis-ci.org/jazzonmymind/pry-larry.rb)
|
2
3
|
|
3
4
|
__pry-larry.rb__
|
4
5
|
|
@@ -47,7 +48,7 @@ gem install pry-larry
|
|
47
48
|
Gemfile
|
48
49
|
|
49
50
|
```ruby
|
50
|
-
gem "pry-larry", "~> 0.
|
51
|
+
gem "pry-larry", "~> 0.7"
|
51
52
|
```
|
52
53
|
|
53
54
|
__License__
|
data/Rakefile
CHANGED
data/lib/pry-larry.rb
CHANGED
@@ -11,6 +11,7 @@ module Pry::Larry
|
|
11
11
|
else
|
12
12
|
pry.config.larry.speak_if.call(pry, walltime) and pry.config.larry.speaker.call(pry, walltime)
|
13
13
|
end
|
14
|
+
MEMORY[pry.hash].clear
|
14
15
|
end
|
15
16
|
BEFORE_SESSION = ->(_,_, pry) do
|
16
17
|
Pry::Larry.start(pry) if pry.config.larry.auto_start
|
@@ -78,7 +79,7 @@ module Pry::Larry
|
|
78
79
|
speak_if: ->(pry, walltime) { walltime > 0 },
|
79
80
|
speaker: ->(pry, walltime) {
|
80
81
|
pry.pager.page "%{LarrySays} %{WallTime}s" % {
|
81
|
-
:LarrySays => Pry::Helpers::Text.green("Benchmark:"),
|
82
|
+
:LarrySays => pry.color ? Pry::Helpers::Text.green("Benchmark:") : "Benchmark:",
|
82
83
|
:WallTime => sprintf("%.2f", walltime)
|
83
84
|
}
|
84
85
|
}
|
data/lib/pry-larry/version.rb
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
require_relative 'setup'
|
2
|
+
RSpec.describe Pry::Larry do
|
3
|
+
let(:tester) do
|
4
|
+
PryTester.new(binding)
|
5
|
+
end
|
6
|
+
|
7
|
+
let(:hash_key) do
|
8
|
+
tester.pry.hash
|
9
|
+
end
|
10
|
+
|
11
|
+
before do
|
12
|
+
Pry::Larry.start(tester.pry)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "prevents growth of Array(s) referenced by Pry::Larry::MEMORY" do
|
16
|
+
5.times {|n| tester.eval(n.to_s) }
|
17
|
+
expect(Pry::Larry::MEMORY[hash_key]).to be_empty
|
18
|
+
end
|
19
|
+
|
20
|
+
it "tells the user the duration of eval" do
|
21
|
+
tester.pry.color = false
|
22
|
+
tester.eval("sleep 0.1")
|
23
|
+
expect(tester.out.string).to match(/Benchmark: 0\.1[0-9]s/)
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "start subcommand" do
|
27
|
+
it "tells the user that Larry has been enabled" do
|
28
|
+
Pry::Larry.stop(tester.pry)
|
29
|
+
tester.eval "larry start"
|
30
|
+
expect(tester.out.string).to include("Alright, I have started.")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe "stop subcommand" do
|
35
|
+
it "tells the user that Larry has been disabled" do
|
36
|
+
tester.eval "larry stop"
|
37
|
+
expect(tester.out.string).to include("Alright, I have stopped.")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/spec/setup.rb
ADDED
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-larry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jazzonmymind
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.10'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.10'
|
27
27
|
description: Larry keeps track of elapsed wall-clock time and tells you how long code
|
@@ -31,8 +31,9 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
-
- .gitignore
|
35
|
-
- .pryrc
|
34
|
+
- ".gitignore"
|
35
|
+
- ".pryrc"
|
36
|
+
- ".travis.yml"
|
36
37
|
- CHANGELOG.md
|
37
38
|
- Gemfile
|
38
39
|
- README.md
|
@@ -40,6 +41,8 @@ files:
|
|
40
41
|
- lib/pry-larry.rb
|
41
42
|
- lib/pry-larry/version.rb
|
42
43
|
- pry-larry.gemspec
|
44
|
+
- spec/pry_larry_spec.rb
|
45
|
+
- spec/setup.rb
|
43
46
|
homepage: https://github.com/jazzonmymind/pry-larry.rb
|
44
47
|
licenses:
|
45
48
|
- Nonstandard
|
@@ -50,17 +53,17 @@ require_paths:
|
|
50
53
|
- lib
|
51
54
|
required_ruby_version: !ruby/object:Gem::Requirement
|
52
55
|
requirements:
|
53
|
-
- -
|
56
|
+
- - ">="
|
54
57
|
- !ruby/object:Gem::Version
|
55
58
|
version: '0'
|
56
59
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
58
|
-
- -
|
61
|
+
- - ">="
|
59
62
|
- !ruby/object:Gem::Version
|
60
63
|
version: '0'
|
61
64
|
requirements: []
|
62
65
|
rubyforge_project:
|
63
|
-
rubygems_version: 2.
|
66
|
+
rubygems_version: 2.5.1
|
64
67
|
signing_key:
|
65
68
|
specification_version: 4
|
66
69
|
summary: Larry is a plugin for Pry that tracks wall clock time.
|