spirit_hands 2.1.3 → 2.1.4

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: a188f19cfea293256ed5686225cf5a4e5a8940e2
4
- data.tar.gz: 66d00406a3c10f1f56553e00f8e93f4ac730ba74
3
+ metadata.gz: 56112730b29566ec4a0c76171ba938507c392886
4
+ data.tar.gz: 37e937d2d03c449577918cd048254802c5ae18dd
5
5
  SHA512:
6
- metadata.gz: 2bff4bf6b2745acc52008d68c67f9e97421f0f0031d2b68a94c07ee9a9b702b64e6cbc32c76f1fbe1c1231ddef9200f62ec63ab729833019dbf5666b273a58c0
7
- data.tar.gz: 8d8ca39c9aa492b4c11f1fc77fc3c7f06d909df5084369445db83537abb12a8b28ce4dd97a833fbfced9635c7cfe700575db1f6df4c2801aa6e6072a774cab20
6
+ metadata.gz: 5fbdffcd9a2efd3523737d6e0afd3db7fee6375fccb89512e0e21f9ce476b7ab44ba83fc669e69598b77306fa2493eb7fcab6f2e50a689c8e8ec20c87cbe9be3
7
+ data.tar.gz: 8717444bbbc828137b363f903f0764de87edef30e45c3850549339a6dba0606d37d0a02558bfced14f073b8ebcff7ec4fe1f3ba80dc71a0b483006b7787d3bcd
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,63 +1,56 @@
1
1
  module SpiritHands
2
2
  class << self
3
- # Is cooline enabled?
3
+ # Is coolline enabled?
4
4
  def coolline
5
5
  @coolline = DEFAULT_COOLLINE if @coolline.nil?
6
6
  @coolline
7
7
  end
8
8
 
9
9
  # Set whether hirb is enabled (default: true)
10
- def coolline=(c)
11
- c = DEFAULT_COOLLINE if c.nil?
12
- @coolline = !!c
13
- end
10
+ attr_writer :coolline
14
11
 
15
12
  protected
16
13
 
17
14
  def install_coolline!
18
15
  return if coolline_installed?
19
- @orig_input ||= Pry.input
20
- @orig_completer ||= Pry.config.completer
21
- require 'pry-coolline'
22
16
  Pry.plugins['coolline'].activate!
23
- begin
24
- require 'pry-bond'
25
- Pry.plugins['bond'].activate!
26
- rescue LoadError
27
- end
28
- @coolline_input ||= Pry.input
29
- @coolline_completer ||= Pry.config.completer
30
- Pry.config.completer = @coolline_completer
31
- Pry.input = @coolline_input
17
+ self.input_config = @coolline_input
32
18
  end
33
19
 
34
20
  def uninstall_coolline!
35
21
  return unless coolline_installed?
36
22
  Pry.plugins['coolline'].disable!
37
- if !Pry.plugins['bond'].is_a? Pry::PluginManager::NoPlugin
38
- Pry.plugins['bond'].disable!
39
- end
40
- Pry.config.completer = @orig_completer
41
- Pry.input = @orig_input
23
+ self.input_config = @orig_input
42
24
  end
43
25
 
44
26
  def coolline_installed?
45
- !@orig_input.nil? && @orig_input != Pry.input
27
+ Pry.input == @coolline_input[0]
46
28
  end
47
29
 
48
30
  def setup_coolline!
49
- if SpiritHands.coolline
50
- SpiritHands.install_coolline!
31
+ if coolline
32
+ install_coolline!
51
33
  else
52
- SpiritHands.uninstall_coolline!
34
+ uninstall_coolline!
53
35
  end
54
36
  end
55
37
 
38
+ def input_config=(args)
39
+ Pry.input, Pry.config.completer = args
40
+ end
41
+
42
+ def input_config
43
+ [Pry.input, Pry.config.completer]
44
+ end
45
+
56
46
  def setup_coolline
57
- Pry.hooks.add_hook(:after_read, "setup_coolline0") do |code, pry|
47
+ @orig_input = input_config
48
+ require 'pry-coolline'
49
+ @coolline_input = input_config
50
+ Pry.hooks.add_hook(:before_session, "setup_coolline_before") do |output, binding, pry|
58
51
  setup_coolline!
59
52
  end
60
- Pry.hooks.add_hook(:before_session, "setup_coolline1") do |output, binding, pry|
53
+ Pry.hooks.add_hook(:after_eval, "setup_coolline_after") do |code, pry|
61
54
  setup_coolline!
62
55
  end
63
56
  end
@@ -1,3 +1,3 @@
1
1
  module SpiritHands
2
- VERSION = '2.1.3'
2
+ VERSION = '2.1.4'
3
3
  end
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.3
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Barry Allard
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  version: '0'
228
228
  requirements: []
229
229
  rubyforge_project:
230
- rubygems_version: 2.5.2
230
+ rubygems_version: 2.4.5.1
231
231
  signing_key:
232
232
  specification_version: 4
233
233
  summary: Exercise those fingers. Pry-based enhancements for the default Rails console.
metadata.gz.sig CHANGED
Binary file