pry-larry 0.6.0 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3164f6fcd6c14fce821cba144ebfbf77a0365f0f
4
- data.tar.gz: edbb046147cd52338ce729a392e5ce26b16cccae
3
+ metadata.gz: 9308a43162c450b70d038352df21f955f4873cf5
4
+ data.tar.gz: 62b488ea45c959ad1bdc82aab244cc22af702bd0
5
5
  SHA512:
6
- metadata.gz: 7b3808bcb488a52ddff89bbde95849d753e30c26a84f6c7cd45b0217f87abe46e25a634aef5fc8f6ad355d26d3c457d429cdbaecc61ef196b3de8d94fe0b03f6
7
- data.tar.gz: c3811be02eabf0c82f9e1597da178563e02bff07e9e1885b80acc206e80ce1349c6a5f13bd9c80fe637530e796f887a97cc56fa820fba6b40ec5bb678a4e5790
6
+ metadata.gz: fb9ca2a6ddb4668e9e74ae34e95764386c94be1996cf83208c4cc1748eddf6c54826306a5a25d4a18b161c548288d0e4944e28ba71d3031b17767af2fd05d19a
7
+ data.tar.gz: f35c969ba0f3526f2c277724e37a5ee7411a822ed2428258e29d65118cf68d7691cf8f178711baddfd9d46f1f2fe33278c931e0e3b38d5f70a945945ae4dafb4
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  Gemfile.lock
2
2
  *#
3
3
  *~
4
- *.gem
4
+ *.gem
5
+ pkg/
@@ -0,0 +1,8 @@
1
+ script: ruby -S rake
2
+ sudo: false
3
+ rvm:
4
+ - 2.1
5
+ - 2.2
6
+ - ruby-head
7
+ notifications:
8
+ email: true
@@ -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
@@ -1,2 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
+ group :test do
4
+ gem 'rspec'
5
+ end
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.6"
51
+ gem "pry-larry", "~> 0.7"
51
52
  ```
52
53
 
53
54
  __License__
data/Rakefile CHANGED
@@ -1,5 +1,7 @@
1
+ require 'bundler/gem_tasks'
1
2
  require 'bundler/setup'
2
3
  Bundler.require :default
3
4
  task :default do
4
- TOPLEVEL_BINDING.pry
5
+ sh "rspec spec/"
5
6
  end
7
+ task spec: :default
@@ -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
  }
@@ -1,5 +1,5 @@
1
1
  class Pry
2
2
  module Larry
3
- VERSION = "0.6.0"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
@@ -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
@@ -0,0 +1,3 @@
1
+ require 'bundler/setup'
2
+ require 'pry/test/helper'
3
+ Bundler.require :default, :test
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.6.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-04 00:00:00.000000000 Z
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.0.14.1
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.