spirit_hands 2.1.5 → 2.1.7

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: 8eb88b8aea97586990e36bbec0fcdf68eabc442bef11c2b3bfd4670cfa5bef83
4
- data.tar.gz: e633d82f2b419830853f406685c14bec47b5f5cf784686323ab820c4cec13976
3
+ metadata.gz: a3f7eaab705c3a7bed252779448e8ea589b37b318b2931c28295635fcb60cb28
4
+ data.tar.gz: 251f78dd4572a72e1cceb724549b76a44bd1af2ecc7ad4bd545bd8dc85e27037
5
5
  SHA512:
6
- metadata.gz: fae1c8066dca976806914ca550e88916fb64055e594f293a6751e1211ad81d783fe16c0a7767d092cc01a3f75ea52b7833fcf5a11f65a42cbc307b2857cc9390
7
- data.tar.gz: 2930515eb5d228536767bdf51bff86652b797f4650738e64fcdfbfcb4f87ac77389ab959fb47fac674c180211b6ed2901c1dea5ad2a654866a08e9daa37076cd
6
+ metadata.gz: 14af527cca96f8c3d59fe7c4dfc9674eeaa2e6fd9535bf8a2f52e0585a1b38ba64f477d044e345e5c43a66d2c84fcc74cfcef33264e6706931a2fd5caa66458b
7
+ data.tar.gz: 2cf00b84ef247d9d05b84b737e16b97ddeee8db2be4b2a3a716325fbd35524c0c36610c12aaad2f1a34535f6f3194db4c96ea598cab78937efc25f735a68fb1a
checksums.yaml.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -144,3 +144,10 @@ mixed encodings.
144
144
  [changelog]: https://github.com/steakknife/spirit_hands/blob/master/CHANGELOG.md
145
145
  [pry-nav]: https://github.com/nixme/pry-nav
146
146
  [pry-byebug]: https://github.com/deivid-rodriguez/pry-byebug
147
+
148
+ ### Security
149
+
150
+ ```
151
+ $ gem cert --add <(curl -Ls https://raw.githubusercontent.com/steakknife/spirit_hands/master/gem-public_cert.pem)
152
+ $ gem install spirit_hands -P MediumSecurity
153
+ ```
@@ -7,6 +7,7 @@ module Hirb
7
7
  class Pager
8
8
  class << self
9
9
  # Pages using a configured or detected shell command.
10
+ remove_method :command_pager
10
11
  def command_pager(output, options={})
11
12
  if valid_pager_command?(pc = options[:pager_command])
12
13
  basic_pager(output, pc)
@@ -14,6 +15,7 @@ module Hirb
14
15
  end
15
16
 
16
17
  # Exposed to allow user-custom, external-driven formatting
18
+ remove_method :basic_pager
17
19
  def basic_pager(output, override_pager_command=nil)
18
20
  pc = basic_pager_command(override_pager_command)
19
21
  pager = IO.popen(pc, "w")
@@ -33,11 +35,13 @@ module Hirb
33
35
  @pager_command = pager_command_select(*commands)
34
36
  end
35
37
 
38
+ remove_method :pager_command
36
39
  def pager_command #:nodoc:
37
40
  @pager_command || pager_command_select
38
41
  end
39
42
 
40
43
  # Pages with a ruby-only pager which either pages or quits.
44
+ remove_method :default_pager
41
45
  def default_pager(output, options={})
42
46
  pager = new(options[:width], options[:height])
43
47
  while pager.activated_by?(output, options[:inspect])
@@ -59,6 +63,7 @@ module Hirb
59
63
  private
60
64
 
61
65
  #:stopdoc:
66
+ remove_method :valid_pager_command?
62
67
  def valid_pager_command?(cmd)
63
68
  cmd && Util.command_exists?(cmd.shellsplit[0])
64
69
  end
@@ -85,6 +90,7 @@ module Hirb
85
90
  end
86
91
  end
87
92
 
93
+ remove_method :continue_paging?
88
94
  def continue_paging?
89
95
  puts "=== Press enter/return to continue or q to quit: ==="
90
96
  !$stdin.gets.chomp[/q/i]
@@ -92,22 +98,28 @@ module Hirb
92
98
  #:startdoc:
93
99
  end # class methods
94
100
 
101
+ remove_method :width
102
+ remove_method :height
95
103
  attr_reader :width, :height, :options
96
104
 
105
+ remove_method :initialize
97
106
  def initialize(width, height, options={})
98
107
  resize(width, height)
99
108
  @options = options
100
109
  end
101
110
 
111
+ remove_method :pager_command
102
112
  def pager_command
103
113
  options[:pager_command] || self.class.pager_command
104
114
  end
105
115
 
106
116
  # Pages given string using configured pager.
117
+ remove_method :page
107
118
  def page(string, inspect_mode)
108
119
  self.class.page(string, inspect_mode, pager_command, @width, @height)
109
120
  end
110
121
 
122
+ remove_method :slice!
111
123
  def slice!(output, inspect_mode=false) #:nodoc:
112
124
  effective_height = @height - 2 # takes into account pager prompt
113
125
  if inspect_mode
@@ -123,10 +135,12 @@ module Hirb
123
135
  end
124
136
 
125
137
  # Determines if string should be paged based on configured width and height.
138
+ remove_method :activated_by?
126
139
  def activated_by?(string_to_page, inspect_mode=false)
127
140
  inspect_mode ? (String.size(string_to_page) > @height * @width) : (string_to_page.count("\n") > @height)
128
141
  end
129
142
 
143
+ remove_method :char_count
130
144
  if String.method_defined? :chars
131
145
  def char_count(string) #:nodoc:
132
146
  string.chars.count
@@ -137,6 +151,7 @@ module Hirb
137
151
  end
138
152
  end
139
153
 
154
+ remove_method :resize
140
155
  def resize(width, height) #:nodoc:
141
156
  @width, @height = View.determine_terminal_size(width, height)
142
157
  end
@@ -1,8 +1,9 @@
1
1
  # Integrate Hirb + SpiritHands print output (AwesomePrint / inspect)
2
2
  require 'hirb'
3
- require 'spirit_hands'
3
+ #require 'spirit_hands'
4
4
 
5
5
  class << Hirb::View
6
+ remove_method :view_or_page_output
6
7
  def view_or_page_output(str)
7
8
  view_output(str) ||
8
9
  page_output(::SpiritHands::Print.pretty(str), true)
@@ -2,7 +2,7 @@ module SpiritHands
2
2
  class << self
3
3
  # Is coolline enabled?
4
4
  def coolline
5
- @coolline = DEFAULT_COOLLINE if @coolline.nil?
5
+ @coolline = DEFAULT_COOLLINE if !instance_variable_defined?(:@coolline) || @coolline.nil?
6
6
  @coolline
7
7
  end
8
8
 
@@ -59,7 +59,12 @@ module SpiritHands
59
59
  # <.../>
60
60
  SINGLE_TAGS = {
61
61
  # <cmd/>: command number
62
- 'cmd' => ->(state) { state.pry.input_array.size },
62
+ 'cmd' =>
63
+ lambda do |state|
64
+ pry = state.pry
65
+ (pry.respond_to?(:input_ring) ? pry.input_ring : pry.input_array)
66
+ .size
67
+ end,
63
68
 
64
69
  # <tgt/>: target string
65
70
  'tgt' => ->(state) {
@@ -145,7 +150,7 @@ module SpiritHands
145
150
  end
146
151
 
147
152
  def nontag_char(c)
148
- if @escape
153
+ if instance_variable_defined?(:@escape) && @escape
149
154
  nontag_escaped_char(c)
150
155
  else
151
156
  nontag_unescaped_char(c)
@@ -1,6 +1,7 @@
1
+ require 'spirit_hands/prompt/base/render'
2
+
1
3
  module SpiritHands
2
4
  module Prompt
3
- autoload :Render, 'spirit_hands/prompt/base/render'
4
5
 
5
6
  class << self
6
7
  private
@@ -1,3 +1,3 @@
1
1
  module SpiritHands
2
- VERSION = '2.1.5'
2
+ VERSION = '2.1.7'
3
3
  end
data/lib/spirit_hands.rb CHANGED
@@ -5,14 +5,11 @@
5
5
  # # ...
6
6
  #
7
7
  #
8
- module SpiritHands
9
- autoload :VERSION, 'spirit_hands/version'
10
- autoload :Print, 'spirit_hands/print'
11
- autoload :Prompt, 'spirit_hands/prompt'
12
- autoload :Terminal, 'spirit_hands/terminal'
13
- end
14
-
15
8
  require 'spirit_hands/options'
9
+ require 'spirit_hands/print'
10
+ require 'spirit_hands/prompt'
11
+ require 'spirit_hands/terminal'
12
+ require 'spirit_hands/version'
16
13
  require 'spirit_hands/melody'
17
14
  if defined? ::Rails
18
15
  require 'pry-rails'
data/spirit_hands.gemspec CHANGED
@@ -1,15 +1,13 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  $:.unshift File.expand_path('../lib', __FILE__)
4
- module ::SpiritHands
5
- autoload :VERSION, 'spirit_hands/version'
6
- end
4
+ require 'spirit_hands/version'
7
5
 
8
6
  Gem::Specification.new do |gem|
9
7
  gem.name = 'spirit_hands'
10
8
  gem.version = SpiritHands::VERSION
11
9
  gem.author = 'Barry Allard'
12
- gem.email = 'barry.allard@gmail.com'
10
+ gem.email = 'barry.allard [at] gmail [dot] com'
13
11
  gem.license = 'MIT'
14
12
  gem.homepage = 'https://github.com/steakknife/spirit_hands'
15
13
  gem.summary = 'Exercise those fingers. Pry-based enhancements for the default Rails console.'
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spirit_hands
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.5
4
+ version: 2.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Barry Allard
@@ -40,7 +40,7 @@ cert_chain:
40
40
  uZq4rw4hXeykFAwwohvlW+ZxlHQeCgfKcIlRm14/nUZsXyNcsLrh+kWMnJafn5Kw
41
41
  Iq8vhap5ZgvXWYrk
42
42
  -----END CERTIFICATE-----
43
- date: 2018-05-02 00:00:00.000000000 Z
43
+ date: 2019-03-18 00:00:00.000000000 Z
44
44
  dependencies:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: pry
@@ -157,7 +157,7 @@ dependencies:
157
157
  description: Spending hours in the rails console? Spruce it up and show off those
158
158
  hard-working hands! spirit_hands replaces IRB with Pry, improves output through
159
159
  awesome_print, and has some other goodies up its sleeves.
160
- email: barry.allard@gmail.com
160
+ email: barry.allard [at] gmail [dot] com
161
161
  executables: []
162
162
  extensions: []
163
163
  extra_rdoc_files: []
@@ -219,8 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  - !ruby/object:Gem::Version
220
220
  version: '0'
221
221
  requirements: []
222
- rubyforge_project:
223
- rubygems_version: 2.7.6
222
+ rubygems_version: 3.0.2
224
223
  signing_key:
225
224
  specification_version: 4
226
225
  summary: Exercise those fingers. Pry-based enhancements for the default Rails console.
metadata.gz.sig CHANGED
Binary file