spirit_hands 2.1.1-java → 2.1.3-java

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
  SHA1:
3
- metadata.gz: 59995c23a9a27fa56fe5e473f26c7458472dfa9f
4
- data.tar.gz: f051126c196d538ac30bb340191f61deb8f728ee
3
+ metadata.gz: baf4e29fb380244925af561c3cb6e58d61412760
4
+ data.tar.gz: 414d1f2d040fc219a4f41cb778fbcaeb82d39c02
5
5
  SHA512:
6
- metadata.gz: 4d2608bf4f6b96fc03bed091ca0593623847c0f52f306bf410ed40f7ee07a653c0acf6fe49d6b7bde836f9c8a64f47e644908be5cb941053b62b2cfc7ecab8e7
7
- data.tar.gz: 79c8273fa7e693f47fc9f39c894020304cc2f9522f986a83788b6c6fe08a002ffef5f51ad4e604cb20322f8716f88a99ecc38d7133a1c02d473d5c9a2d526980
6
+ metadata.gz: d3986e5f47635c92f224da7223f3b7ac380aaf5c9b04f60fb93e1227d673cd4ddbebc46a15c2534b7842315e28fa5a9b31fa30fd0b998c8a4158d64b4bc40969
7
+ data.tar.gz: 6b378a73457a0a0531225786b2a664d8dfd720b06409925f4450c484b5cede512c2d73a0ff66f9098eaeed7ea05b9cbf90e9575411a06e732ec4e015a9e67bc1
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 2.1.0 (2016-11-19)
2
+ * Remove [pry-remote][pry-remote]
3
+
1
4
  ## 2.0.0 (2015-05-27)
2
5
  * Way more configurable
3
6
 
data/CONTRIBUTORS.md CHANGED
@@ -1,10 +1,12 @@
1
+ # Current Maintainers
2
+ * Barry Allard <barry.allard@gmail.com>
3
+
1
4
  # Original Author
2
5
  * Gopal Patel <nixme@stillhope.com>
3
6
 
4
- # Contributors
7
+ # Past Contributors
5
8
  * Andrew Volozhanin <linuxheadrus@gmail.com>
6
9
  * Casey Lang <hello@casey-lang.com>
7
10
  * Fernando Paredes <nano@fdp.io>
8
11
  * Micah Gates <github@mgates.com>
9
12
  * Paulo Henrique Lopes Ribeiro <plribeiro3000@gmail.com>
10
- * Barry Allard <barry.allard@gmail.com>
@@ -6,10 +6,16 @@ class << SpiritHands
6
6
  return false if @installed
7
7
  @installed = true
8
8
 
9
+ Pry.config.should_load_plugins = false
9
10
  SpiritHands.app = app unless app.nil?
10
11
  setup_less_colorize
11
12
  setup_less_show_raw_unicode
12
13
  setup_hirb
14
+ disable_remote
15
+ setup_coolline # setup Pry.config.input
16
+ setup_nav
17
+ setup_byebug
18
+ setup_doc
13
19
 
14
20
  # Use awesome_print for output, but keep pry's pager. If Hirb is
15
21
  # enabled, try printing with it first.
@@ -21,4 +27,42 @@ class << SpiritHands
21
27
  # Configuration (like Pry.color) can be changed later or even during console usage.
22
28
  ::SpiritHands::Prompt.install!
23
29
  end
30
+
31
+ private
32
+
33
+ def setup_nav
34
+ return if Pry.plugins['nav'].is_a? Pry::PluginManager::NoPlugin
35
+ require 'pry-nav'
36
+ if jruby?
37
+ Pry.plugins['nav'].activate!
38
+ else
39
+ Pry.plugins['nav'].disable!
40
+ end
41
+ rescue LoadError
42
+ end
43
+
44
+ def setup_byebug
45
+ return if Pry.plugins['byebug'].is_a? Pry::PluginManager::NoPlugin
46
+ require 'pry-byebug'
47
+ if jruby?
48
+ Pry.plugins['byebug'].disable!
49
+ else
50
+ Pry.plugins['byebug'].activate!
51
+ end
52
+ rescue LoadError
53
+ end
54
+
55
+ def setup_doc
56
+ require 'pry-doc'
57
+ Pry.plugins['doc'].activate!
58
+ end
59
+
60
+ def disable_remote
61
+ return if Pry.plugins['remote'].is_a? Pry::PluginManager::NoPlugin
62
+ Pry.plugins['remote'].disable!
63
+ end
64
+
65
+ def jruby?
66
+ RUBY_ENGINE == 'jruby'
67
+ end
24
68
  end # SpiritHands.self
@@ -0,0 +1,67 @@
1
+ module SpiritHands
2
+ class << self
3
+ # Is cooline enabled?
4
+ def coolline
5
+ @coolline = DEFAULT_COOLLINE if @coolline.nil?
6
+ @coolline
7
+ end
8
+
9
+ # Set whether hirb is enabled (default: true)
10
+ def coolline=(c)
11
+ c = DEFAULT_COOLLINE if c.nil?
12
+ @coolline = !!c
13
+ end
14
+
15
+ protected
16
+
17
+ def install_coolline!
18
+ return if coolline_installed?
19
+ @orig_input ||= Pry.input
20
+ @orig_completer ||= Pry.config.completer
21
+ require 'pry-coolline'
22
+ 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
32
+ end
33
+
34
+ def uninstall_coolline!
35
+ return unless coolline_installed?
36
+ 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
42
+ end
43
+
44
+ def coolline_installed?
45
+ !@orig_input.nil? && @orig_input != Pry.input
46
+ end
47
+
48
+ def setup_coolline!
49
+ if SpiritHands.coolline
50
+ SpiritHands.install_coolline!
51
+ else
52
+ SpiritHands.uninstall_coolline!
53
+ end
54
+ end
55
+
56
+ def setup_coolline
57
+ Pry.hooks.add_hook(:after_read, "setup_coolline0") do |code, pry|
58
+ setup_coolline!
59
+ end
60
+ Pry.hooks.add_hook(:before_session, "setup_coolline1") do |output, binding, pry|
61
+ setup_coolline!
62
+ end
63
+ end
64
+ end
65
+
66
+ DEFAULT_COOLLINE = false # TODO: fix pry-coolline and/or integration
67
+ end
@@ -1,6 +1,7 @@
1
1
  # encoding: UTF-8
2
2
  require 'readline'
3
3
  require 'spirit_hands/mattr_accessor_with_default'
4
+ require 'spirit_hands/options/coolline'
4
5
  require 'spirit_hands/options/color'
5
6
  require 'spirit_hands/options/less'
6
7
  require 'spirit_hands/options/hirb'
@@ -56,4 +57,21 @@ module SpiritHands
56
57
 
57
58
  # Enable or disable AwesomePrint (default: true)
58
59
  mattr_accessor_with_default :awesome_print, true
60
+
61
+ def self.app_name
62
+ if app.class.respond_to?(:parent_name) && \
63
+ app.class.parent_name.respond_to?(:underscore)
64
+ app.class.parent_name.underscore
65
+ elsif app
66
+ app.to_s
67
+ else
68
+ ::SpiritHands.app
69
+ end
70
+ end
71
+
72
+ def self.config
73
+ c = SpiritHands.singleton_methods.select { |x| x != :config && x =~ /\A[a-z_]+\z/ }
74
+ .map { |k| [k, (k == :app) ? app_name : SpiritHands.public_send(k)] }
75
+ Hash[c]
76
+ end
59
77
  end
@@ -1,3 +1,5 @@
1
+ require 'awesome_print'
2
+
1
3
  module SpiritHands
2
4
  module Print
3
5
  class << self
@@ -11,7 +13,6 @@ module SpiritHands
11
13
 
12
14
  def pretty(value)
13
15
  if ::SpiritHands.awesome_print
14
- require 'awesome_print' unless defined?(AwesomePrint)
15
16
  opts = { :indent => ::SpiritHands.value_indent }
16
17
  opts[:plain] = true if !SpiritHands.color
17
18
  value.ai(opts)
@@ -1,3 +1,3 @@
1
1
  module SpiritHands
2
- VERSION = '2.1.1'
2
+ VERSION = '2.1.3'
3
3
  end
data/lib/spirit_hands.rb CHANGED
@@ -17,6 +17,7 @@ require 'spirit_hands/melody'
17
17
  if defined? ::Rails
18
18
  require 'pry-rails'
19
19
  require 'spirit_hands/railtie'
20
+ Pry.plugins['rails'].activate!
20
21
  else
21
22
  SpiritHands.melody!
22
23
  end
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.1
4
+ version: 2.1.3
5
5
  platform: java
6
6
  authors:
7
7
  - Barry Allard
@@ -41,7 +41,7 @@ cert_chain:
41
41
  b4WKJs00+KO3etYQG7qD/wH7WEwu3QoLNapYz58Jc0OsDnwBWW0IDPSAFsENoTcY
42
42
  8m+dgfPonsYSqnDDfLuAmtKhLAA=
43
43
  -----END CERTIFICATE-----
44
- date: 2016-11-20 00:00:00.000000000 Z
44
+ date: 2016-11-23 00:00:00.000000000 Z
45
45
  dependencies:
46
46
  - !ruby/object:Gem::Dependency
47
47
  requirement: !ruby/object:Gem::Requirement
@@ -183,6 +183,7 @@ files:
183
183
  - lib/spirit_hands/melody.rb
184
184
  - lib/spirit_hands/options.rb
185
185
  - lib/spirit_hands/options/color.rb
186
+ - lib/spirit_hands/options/coolline.rb
186
187
  - lib/spirit_hands/options/hirb.rb
187
188
  - lib/spirit_hands/options/less.rb
188
189
  - lib/spirit_hands/options/less/colorize.rb
metadata.gz.sig CHANGED
Binary file