jazz_fingers 4.0.1 → 5.0.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: 8f7803378737e2a5abab5af11528a62698006071
4
- data.tar.gz: aab9be62d8ca3739ba4a5112843bd82e1bc4b227
3
+ metadata.gz: 4999936c5383de2179cf7bc5d77a6fd222d3de26
4
+ data.tar.gz: cb9a42ec388dcf1a9350ec07819d884562f5e25e
5
5
  SHA512:
6
- metadata.gz: f1df8c48619f2585ae452121fd087098faad067d201785f3459f52114460069291fb53d813f6d4b4432805c2441314f700584d2237be4a19ff602bbdc0dccd09
7
- data.tar.gz: 48c3fadbda08c48affaeb829e0076853ba45bfdac760665d286c8d62c48d964d2719eecceebc90d8e98132a4afa7cb9978bbfcb81d236ff407de72a11b41b6c3
6
+ metadata.gz: 0e7754ab8b9f32c1219e1841d1c5345f3d2a6956ab6f5ef42a9de2c2e315ae864db7ba95d5894648a52640b1dae63d711814977e95e0f954e26ae0348cbddae0
7
+ data.tar.gz: fb570df06f4a74a8d2c93d3773ad883f8a40a1e93a33dd0b761a5b329d3fa3892e753420ce38929bb1f48259dcca2c30a63925830dfb98d6ca01656764801ecb
data/.hound.yml CHANGED
@@ -1,17 +1,5 @@
1
1
  Metrics/LineLength:
2
- Enabled: false
3
-
4
- Style/EachWithObject:
5
- Enabled: false
2
+ Max: 120
6
3
 
7
- Style/Encoding:
8
- EnforcedStyle: when_needed
9
-
10
- Style/FormatString:
4
+ Style/Documentation:
11
5
  Enabled: false
12
-
13
- Style/SignalException:
14
- EnforcedStyle: only_raise
15
-
16
- Style/StringLiterals:
17
- EnforcedStyle: double_quotes
data/.rubocop.yml CHANGED
@@ -1,17 +1,5 @@
1
1
  Metrics/LineLength:
2
- Enabled: false
3
-
4
- Style/EachWithObject:
5
- Enabled: false
2
+ Max: 120
6
3
 
7
- Style/Encoding:
8
- EnforcedStyle: when_needed
9
-
10
- Style/FormatString:
4
+ Style/Documentation:
11
5
  Enabled: false
12
-
13
- Style/SignalException:
14
- EnforcedStyle: only_raise
15
-
16
- Style/StringLiterals:
17
- EnforcedStyle: double_quotes
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 5.0.0 (2018-05-02)
4
+ * Remove [pry-doc][pry-doc] dependency to reduce memory footprint
5
+ * Remove [hirb][hirb] dependency since its not being actively maintained
6
+
3
7
  ## 4.0.1 (2016-05-26)
4
8
  * Remove requires for `pry-remote`
5
9
 
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
data/README.md CHANGED
@@ -10,11 +10,15 @@ hard-working fingers!
10
10
 
11
11
  * [**Pry**][pry] for a powerful shell alternative to IRB.
12
12
  * [**Awesome Print**][awesome_print] for stylish pretty print.
13
- * [**Hirb**][hirb] for tabular collection output.
14
- * [**Pry Doc**][pry-doc] to browse Ruby source, including C, directly from the
15
13
  console.
16
14
  * [**Pry Coolline**][pry-coolline] for syntax highlighting as you type.
17
15
 
16
+ ## Notes on Update to `5.0.0`
17
+ * [**Hirb**][hirb] was removed since it is not actively being maintained
18
+ * [**Pry-Doc**][pry-doc] was removed since it adds a lot of memory footprint which makes `JazzFingers` too heavy to use in production.
19
+ Add it to your `Gemfile` if you want it back
20
+ * `jazz_fingers/setup` is not needed since the setup is done automatically after the configuration block ends
21
+ * Call `JazzFingers.setup!` if you are using the default configurations
18
22
 
19
23
  ## Usage
20
24
 
@@ -38,8 +42,7 @@ X) will work but is not recommended.
38
42
 
39
43
  ## Options
40
44
 
41
- Change the following options by creating an initializer
42
- Example `config/initializers/jazz_fingers.rb`:
45
+ Some configurations can be overwritten:
43
46
 
44
47
  ```ruby
45
48
  if defined?(JazzFingers)
@@ -49,8 +52,6 @@ if defined?(JazzFingers)
49
52
  config.coolline = false
50
53
  config.application_name = MyAwesomeProject
51
54
  end
52
-
53
- require 'jazz_fingers/setup'
54
55
  end
55
56
  ```
56
57
 
data/Rakefile CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env rake
2
2
 
3
- require "bundler/gem_tasks"
3
+ require 'bundler/gem_tasks'
data/jazz_fingers.gemspec CHANGED
@@ -1,30 +1,29 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- require File.expand_path("../lib/jazz_fingers/version", __FILE__)
1
+ require File.expand_path('lib/jazz_fingers/version', __dir__)
4
2
 
5
3
  Gem::Specification.new do |gem|
6
- gem.name = "jazz_fingers"
4
+ gem.name = 'jazz_fingers'
7
5
  gem.version = JazzFingers::VERSION
8
- gem.author = "Paulo Henrique Lopes Ribeiro"
9
- gem.email = "plribeiro3000@gmail.com"
10
- gem.license = "MIT"
11
- gem.homepage = "https://github.com/plribeiro3000/jazz_fingers"
12
- gem.summary = "Exercise those fingers. Pry-based enhancements for the default Ruby console."
13
- gem.description = "Spending hours in the ruby console? Spruce it up and show off those hard-working hands! jazz_fingers replaces IRB with Pry, improves output through awesome_print, and has some other goodies up its sleeves."
6
+ gem.author = 'Paulo Henrique Lopes Ribeiro'
7
+ gem.email = 'plribeiro3000@gmail.com'
8
+ gem.license = 'MIT'
9
+ gem.homepage = 'https://github.com/plribeiro3000/jazz_fingers'
10
+ gem.summary = 'Exercise those fingers. Pry-based enhancements for the default Ruby console.'
11
+ description =
12
+ 'Spending hours in the ruby console? Spruce it up and show off those hard-working hands! jazz_fingers'\
13
+ 'replaces IRB with Pry, improves output through awesome_print, and has some other goodies up its sleeves.'
14
+ gem.description = description
14
15
 
15
16
  gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
16
17
  gem.files = `git ls-files`.split("\n")
17
18
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
- gem.require_paths = ["lib"]
19
+ gem.require_paths = ['lib']
19
20
 
20
21
  # Dependencies
21
- gem.required_ruby_version = ">= 2.0"
22
- gem.add_runtime_dependency "pry", "~> 0.10"
23
- gem.add_runtime_dependency "pry-doc", "~> 0.6"
24
- gem.add_runtime_dependency "pry-byebug", "~> 3.4"
25
- gem.add_runtime_dependency "hirb", "~> 0.7"
26
- gem.add_runtime_dependency "pry-coolline", "~> 0.2"
27
- gem.add_runtime_dependency "awesome_print", "~> 1.6"
22
+ gem.required_ruby_version = '>= 2.0'
23
+ gem.add_runtime_dependency 'awesome_print', '~> 1.6'
24
+ gem.add_runtime_dependency 'pry', '~> 0.10'
25
+ gem.add_runtime_dependency 'pry-byebug', '~> 3.4'
26
+ gem.add_runtime_dependency 'pry-coolline', '~> 0.2'
28
27
 
29
- gem.add_development_dependency "rubocop"
28
+ gem.add_development_dependency 'rubocop'
30
29
  end
@@ -1,7 +1,7 @@
1
1
  module JazzFingers
2
2
  class Configuration
3
3
  attr_writer :colored_prompt, :prompt_separator, :coolline, :awesome_print,
4
- :application_name
4
+ :application_name
5
5
 
6
6
  # Color the prompt?
7
7
  #
@@ -23,7 +23,7 @@ module JazzFingers
23
23
  # Default: right angle quote, or '>' when using rb-readline which doesn't
24
24
  # handle mixed encodings well.
25
25
  def prompt_separator
26
- @prompt_separator ||= defined?(RbReadline) ? ">" : "\u00BB"
26
+ @prompt_separator ||= defined?(RbReadline) ? '>' : "\u00BB"
27
27
  end
28
28
 
29
29
  def coolline?
@@ -40,22 +40,19 @@ module JazzFingers
40
40
 
41
41
  def application_name
42
42
  return "(#{underscore(@application_name)})" unless @application_name.nil?
43
+ return "(#{Rails.application.class.parent_name.underscore})" if defined?(Rails)
43
44
 
44
- if defined?(Rails)
45
- return "(#{Rails.application.class.parent_name.underscore})"
46
- else
47
- return "(jazz_fingers)"
48
- end
45
+ '(jazz_fingers)'
49
46
  end
50
47
 
51
48
  private
52
49
 
53
50
  def underscore(camel_cased_word)
54
- camel_cased_word.to_s.gsub(/::/, '/').
55
- gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
56
- gsub(/([a-z\d])([A-Z])/,'\1_\2').
57
- tr("-", "_").
58
- downcase
51
+ camel_cased_word.to_s.gsub(/::/, '/')
52
+ .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
53
+ .gsub(/([a-z\d])([A-Z])/, '\1_\2')
54
+ .tr('-', '_')
55
+ .downcase
59
56
  end
60
57
  end
61
58
  end
@@ -1,5 +1,5 @@
1
- require "pry-coolline"
2
- require "coderay"
1
+ require 'pry-coolline'
2
+ require 'coderay'
3
3
 
4
4
  module JazzFingers
5
5
  class Input
@@ -1,11 +1,10 @@
1
- require "awesome_print"
1
+ require 'awesome_print'
2
2
 
3
3
  module JazzFingers
4
4
  class Print
5
5
  class << self
6
6
  def config
7
7
  lambda do |_output, value, pry_object|
8
- return if Hirb::View.view_or_page_output(value)
9
8
  pretty = value.ai(indent: 2)
10
9
  pry_object.pager.page("=> #{pretty}\n")
11
10
  end
@@ -44,8 +44,8 @@ module JazzFingers
44
44
  level = 0 if level < 0
45
45
  text = Pry.view_clip(object)
46
46
 
47
- if text == "main"
48
- ""
47
+ if text == 'main'
48
+ ''
49
49
  else
50
50
  "(#{'../' * level}#{text})"
51
51
  end
@@ -59,7 +59,7 @@ module JazzFingers
59
59
 
60
60
  def block_prompt
61
61
  lambda do |_object, level, pry|
62
- spaces = " " * level
62
+ spaces = ' ' * level
63
63
  "#{RUBY_VERSION} #{name}#{line_number(pry)} * #{spaces}"
64
64
  end
65
65
  end
@@ -1,3 +1,3 @@
1
1
  module JazzFingers
2
- VERSION = "4.0.1"
2
+ VERSION = '5.0.0'.freeze
3
3
  end
data/lib/jazz_fingers.rb CHANGED
@@ -1,20 +1,22 @@
1
1
  ENV['HOME'] ||= '/dev/null'
2
2
 
3
- require "hirb"
4
- require "pry"
5
- require "pry-byebug"
6
- require "pry-doc"
7
- require "readline"
8
- require "jazz_fingers/hirb_ext"
3
+ require 'pry'
4
+ require 'pry-byebug'
5
+ require 'readline'
6
+ require 'forwardable'
9
7
 
10
8
  module JazzFingers
11
- autoload :Configuration, "jazz_fingers/configuration"
12
- autoload :Input, "jazz_fingers/input"
13
- autoload :Print, "jazz_fingers/print"
14
- autoload :Prompt, "jazz_fingers/prompt"
15
- autoload :VERSION, "jazz_fingers/version"
9
+ autoload :Configuration, 'jazz_fingers/configuration'
10
+ autoload :Input, 'jazz_fingers/input'
11
+ autoload :Print, 'jazz_fingers/print'
12
+ autoload :Prompt, 'jazz_fingers/prompt'
13
+ autoload :VERSION, 'jazz_fingers/version'
16
14
 
17
15
  class << self
16
+ extend Forwardable
17
+
18
+ def_delegators :config, :awesome_print?, :coolline?
19
+
18
20
  def print
19
21
  @print ||= Print.config
20
22
  end
@@ -35,10 +37,23 @@ module JazzFingers
35
37
 
36
38
  def configure
37
39
  yield @config ||= Configuration.new
40
+ setup!
38
41
  end
39
42
 
40
43
  def config
41
44
  @config ||= Configuration.new
42
45
  end
46
+
47
+ def setup!
48
+ Pry.print = print if JazzFingers.awesome_print?
49
+ Pry.prompt = prompt
50
+ Pry.input = input if JazzFingers.coolline?
51
+ Pry.config.should_load_plugins = false
52
+ Pry.commands.alias_command('c', 'continue')
53
+ Pry.commands.alias_command('s', 'step')
54
+ Pry.commands.alias_command('n', 'next')
55
+
56
+ true
57
+ end
43
58
  end
44
59
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jazz_fingers
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Henrique Lopes Ribeiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-26 00:00:00.000000000 Z
11
+ date: 2018-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: pry
14
+ name: awesome_print
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.10'
19
+ version: '1.6'
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
- version: '0.10'
26
+ version: '1.6'
27
27
  - !ruby/object:Gem::Dependency
28
- name: pry-doc
28
+ name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.6'
33
+ version: '0.10'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.6'
40
+ version: '0.10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry-byebug
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.4'
55
- - !ruby/object:Gem::Dependency
56
- name: hirb
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0.7'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '0.7'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: pry-coolline
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +66,6 @@ dependencies:
80
66
  - - "~>"
81
67
  - !ruby/object:Gem::Version
82
68
  version: '0.2'
83
- - !ruby/object:Gem::Dependency
84
- name: awesome_print
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '1.6'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '1.6'
97
69
  - !ruby/object:Gem::Dependency
98
70
  name: rubocop
99
71
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +81,7 @@ dependencies:
109
81
  - !ruby/object:Gem::Version
110
82
  version: '0'
111
83
  description: Spending hours in the ruby console? Spruce it up and show off those hard-working
112
- hands! jazz_fingers replaces IRB with Pry, improves output through awesome_print,
84
+ hands! jazz_fingersreplaces IRB with Pry, improves output through awesome_print,
113
85
  and has some other goodies up its sleeves.
114
86
  email: plribeiro3000@gmail.com
115
87
  executables: []
@@ -131,11 +103,9 @@ files:
131
103
  - jazz_fingers.gemspec
132
104
  - lib/jazz_fingers.rb
133
105
  - lib/jazz_fingers/configuration.rb
134
- - lib/jazz_fingers/hirb_ext.rb
135
106
  - lib/jazz_fingers/input.rb
136
107
  - lib/jazz_fingers/print.rb
137
108
  - lib/jazz_fingers/prompt.rb
138
- - lib/jazz_fingers/setup.rb
139
109
  - lib/jazz_fingers/version.rb
140
110
  homepage: https://github.com/plribeiro3000/jazz_fingers
141
111
  licenses:
@@ -162,4 +132,3 @@ signing_key:
162
132
  specification_version: 4
163
133
  summary: Exercise those fingers. Pry-based enhancements for the default Ruby console.
164
134
  test_files: []
165
- has_rdoc:
@@ -1,15 +0,0 @@
1
- class << Hirb::View
2
- alias_method :enable_output_method_existing, :enable_output_method
3
- alias_method :disable_output_method_existing, :disable_output_method
4
-
5
- def enable_output_method
6
- @output_method = true
7
- JazzFingers.config.awesome_print = true
8
- enable_output_method_existing
9
- end
10
-
11
- def disable_output_method
12
- JazzFingers.config.awesome_print = false
13
- disable_output_method_existing
14
- end
15
- end
@@ -1,10 +0,0 @@
1
- # JazzFingers dance
2
- Pry.print = JazzFingers.print if JazzFingers.config.awesome_print?
3
- Pry.prompt = JazzFingers.prompt
4
- Pry.input = JazzFingers.input if JazzFingers.config.coolline?
5
- Pry.config.should_load_plugins = false
6
-
7
- # Command Shortcuts
8
- Pry.commands.alias_command("c", "continue")
9
- Pry.commands.alias_command("s", "step")
10
- Pry.commands.alias_command("n", "next")