irbtools 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 0.8.1
2
+ * rewrote irb_rocket: fancy_irb. No more workarounds needed, anymore.
3
+ * added sketches gem
4
+ * customizable welcome message
5
+ * more little fixes/enhancements
6
+
1
7
  0.8.0
2
8
  * added Object#ri method
3
9
  * feature: extension package loading (e.g. irbtools-more)
data/README.rdoc CHANGED
@@ -5,17 +5,15 @@ This is a meta gem which installs some useful irb gems and configures your irb.
5
5
  == Setup
6
6
 
7
7
  gem install irbtools
8
- gem install irb_rocket --source http://merbi.st
9
8
 
10
9
  * On Linux, you also need the +xclip+ program: sudo <tt>apt-get install xclip</tt>
11
- * The <tt>irb_rocket</tt> gem might require <tt>libncurses-dev</tt>
12
10
  * On MacOS, you need growl, if you want to use the +g+ gem.
13
11
 
14
12
  == Usage
15
13
 
16
- To use it, put the following in your <tt>~/.irbrc</tt> file (this file is loaded everytime you start an irb):
14
+ To use it, put the following in your <tt>~/.irbrc</tt> file (this file is loaded every time you start an irb):
17
15
 
18
- require 'rubygems' # only needed in 1.8
16
+ require 'rubygems' if RUBY_VERSION[2] == ?8 # rubygems is only needed in 1.8
19
17
  require 'irbtools'
20
18
 
21
19
  If it does not exist, just create a new one.
@@ -41,8 +39,9 @@ See http://rbjl.net/40-irbtools-release-the-power-of-irb or read the commented s
41
39
 
42
40
  === Included gems and libraries
43
41
 
44
- * wirble[http://pablotron.org/software/wirble/] colors
45
- * hirb[http://tagaholic.me/2009/03/13/hirb-irb-on-the-good-stuff.html] active record tables
42
+ * wirble[http://pablotron.org/software/wirble/] colorize output
43
+ * fancy_irbt[tODO] put result as comment and more colorization
44
+ * hirb[http://tagaholic.me/2009/03/13/hirb-irb-on-the-good-stuff.html] (active record) tables and custom views for specific objects
46
45
  * *fileutils* cd, pwd, ln_s, mv, rm, mkdir, touch ... ;)
47
46
  * zucker/env[http://rubyzucker.info] Info, OS, RubyVersion, RubyEngine
48
47
  * zucker/debug[http:/rubyzucker.info] nice debug printing (q, o, c, .m, .d)
@@ -51,34 +50,34 @@ See http://rbjl.net/40-irbtools-release-the-power-of-irb or read the commented s
51
50
  * clipboard[http://github.com/janlelis/clipboard] easy clipboard access (copy & paste)
52
51
  * guessmethod[http://guessmethod.rubyforge.org/] automatically corrects typos (method_missing hook)
53
52
  * interactive_editor[http://github.com/jberkel/interactive_editor] lets you open vim, hack something, and it gets loaded into the current session
53
+ * sketches[http://sketches.rubyforge.org/] another, more flexible "start editor and it gets loaded into your irb session" plugin
54
54
  * coderay[http://coderay.rubychan.de/] some nice colorful display ;)
55
55
  * boson[http://tagaholic.me/boson/] IRB commands repository (which also works for the shell!)
56
- * irb_rocket[http://merbi.st/plugins/22] put result as comment instead of a new line!
57
56
 
58
57
  === Helper methods
59
- See the source/rdoc for a description. These methods are defined directly by irbtools.
58
+ See the source/rdoc for a description. These methods are defined directly by irbtools. Each gem may add its own helper methods.
60
59
 
61
- *General*: <tt>ls, cat, rq, rrq/rerequire, ls, session_history, reset!, clear, use_ruby/use, dbg, Object#ri</tt>
60
+ *General*: <tt>ls, cat, rq, rrq/rerequire, ld, session_history, reset!, clear, use_ruby/use, dbg, Object#ri</tt>
62
61
 
63
62
  *Clipboard*: <tt>copy, paste, copy_input, copy_output</tt>
64
63
 
65
64
  *CodeRay*: <tt>colorize, ray</tt>
66
65
 
66
+ == Welcome message
67
+
68
+ You can customize the welcome message with <tt>Irbtools.welcome_message=</tt>
69
+
67
70
  == Bugs / TODO
68
71
 
69
72
  * Make guessmethod 1.9 compatible
70
- * Fix Clipboard Windows issues
71
- * Fix irb_rockets general stdout problem. If something stdout related fails, odds are high that it's irb_rockets fault.
72
- * Pager for hirb and ri
73
- * Use RDoc driver instead of system ri for ri (?)
74
- * ...
73
+ * Nicer ri command
75
74
 
76
75
  == More Features
77
76
 
78
- * See the irbtools-more[http://github.com/janlelis/irbtools-more] package.
77
+ * See the irbtools-more[https://github.com/janlelis/irbtools-more] package.
79
78
 
80
79
  == Copyright
81
80
 
82
- Copyright (c) 2010 Jan Lelis, http://rbjl.net. See LICENSE for details.
81
+ Copyright (c) 2010 Jan Lelis, http://rbjl.net, released under the MIT license.
83
82
 
84
83
  J-_-L
data/Rakefile CHANGED
@@ -10,18 +10,18 @@ begin
10
10
  gem.email = "mail@janlelis.de"
11
11
  gem.homepage = "http://github.com/janlelis/irbtools"
12
12
  gem.authors = ["Jan Lelis"]
13
- gem.requirements << "It's recommended to use the irb_rocket gem: gem install irb_rocket --source http://merbi.st"
14
13
  gem.add_dependency 'wirble'
14
+ gem.add_dependency 'fancy_irb'
15
15
  gem.add_dependency 'hirb'
16
16
  gem.add_dependency 'zucker', '>=8'
17
17
  gem.add_dependency 'awesome_print'
18
18
  gem.add_dependency 'g'
19
- gem.add_dependency 'clipboard'
19
+ gem.add_dependency 'clipboard', '>=0.9'
20
20
  gem.add_dependency 'guessmethod'
21
21
  gem.add_dependency 'interactive_editor'
22
22
  gem.add_dependency 'coderay'
23
23
  gem.add_dependency 'boson'
24
- # gem.add_dependency 'irb_rocket'
24
+ gem.add_dependency 'sketches'
25
25
  end
26
26
  Jeweler::GemcutterTasks.new
27
27
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 0.8.1
data/irbtools.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{irbtools}
8
- s.version = "0.8.0"
8
+ s.version = "0.8.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jan Lelis"]
12
- s.date = %q{2010-10-12}
12
+ s.date = %q{2010-11-10}
13
13
  s.description = %q{irbtools is a meta gem which installs some useful irb gems and configures your irb. Simply put a require 'irbtools' in the .irbrc file in your home directory.}
14
14
  s.email = %q{mail@janlelis.de}
15
15
  s.extra_rdoc_files = [
@@ -29,14 +29,10 @@ Gem::Specification.new do |s|
29
29
  "lib/irbtools/configure.rb",
30
30
  "lib/irbtools/general.rb",
31
31
  "lib/irbtools/libraries.rb",
32
- "lib/irbtools/workarounds.rb",
33
- "screenshots/examples1.png",
34
- "screenshots/examples2.png"
35
32
  ]
36
33
  s.homepage = %q{http://github.com/janlelis/irbtools}
37
34
  s.rdoc_options = ["--charset=UTF-8"]
38
35
  s.require_paths = ["lib"]
39
- s.requirements = ["It's recommended to use the irb_rocket gem: gem install irb_rocket --source http://merbi.st"]
40
36
  s.rubygems_version = %q{1.3.7}
41
37
  s.summary = %q{irbtools is a meta gem which installs some useful irb gems and configures your irb.}
42
38
 
@@ -46,38 +42,44 @@ Gem::Specification.new do |s|
46
42
 
47
43
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
48
44
  s.add_runtime_dependency(%q<wirble>, [">= 0"])
45
+ s.add_runtime_dependency(%q<fancy_irb>, [">= 0"])
49
46
  s.add_runtime_dependency(%q<hirb>, [">= 0"])
50
47
  s.add_runtime_dependency(%q<zucker>, [">= 8"])
51
48
  s.add_runtime_dependency(%q<awesome_print>, [">= 0"])
52
49
  s.add_runtime_dependency(%q<g>, [">= 0"])
53
- s.add_runtime_dependency(%q<clipboard>, [">= 0"])
50
+ s.add_runtime_dependency(%q<clipboard>, [">= 0.9"])
54
51
  s.add_runtime_dependency(%q<guessmethod>, [">= 0"])
55
52
  s.add_runtime_dependency(%q<interactive_editor>, [">= 0"])
56
53
  s.add_runtime_dependency(%q<coderay>, [">= 0"])
57
54
  s.add_runtime_dependency(%q<boson>, [">= 0"])
55
+ s.add_runtime_dependency(%q<sketches>, [">= 0"])
58
56
  else
59
57
  s.add_dependency(%q<wirble>, [">= 0"])
58
+ s.add_dependency(%q<fancy_irb>, [">= 0"])
60
59
  s.add_dependency(%q<hirb>, [">= 0"])
61
60
  s.add_dependency(%q<zucker>, [">= 8"])
62
61
  s.add_dependency(%q<awesome_print>, [">= 0"])
63
62
  s.add_dependency(%q<g>, [">= 0"])
64
- s.add_dependency(%q<clipboard>, [">= 0"])
63
+ s.add_dependency(%q<clipboard>, [">= 0.9"])
65
64
  s.add_dependency(%q<guessmethod>, [">= 0"])
66
65
  s.add_dependency(%q<interactive_editor>, [">= 0"])
67
66
  s.add_dependency(%q<coderay>, [">= 0"])
68
67
  s.add_dependency(%q<boson>, [">= 0"])
68
+ s.add_dependency(%q<sketches>, [">= 0"])
69
69
  end
70
70
  else
71
71
  s.add_dependency(%q<wirble>, [">= 0"])
72
+ s.add_dependency(%q<fancy_irb>, [">= 0"])
72
73
  s.add_dependency(%q<hirb>, [">= 0"])
73
74
  s.add_dependency(%q<zucker>, [">= 8"])
74
75
  s.add_dependency(%q<awesome_print>, [">= 0"])
75
76
  s.add_dependency(%q<g>, [">= 0"])
76
- s.add_dependency(%q<clipboard>, [">= 0"])
77
+ s.add_dependency(%q<clipboard>, [">= 0.9"])
77
78
  s.add_dependency(%q<guessmethod>, [">= 0"])
78
79
  s.add_dependency(%q<interactive_editor>, [">= 0"])
79
80
  s.add_dependency(%q<coderay>, [">= 0"])
80
81
  s.add_dependency(%q<boson>, [">= 0"])
82
+ s.add_dependency(%q<sketches>, [">= 0"])
81
83
  end
82
84
  end
83
85
 
data/lib/irbtools.rb CHANGED
@@ -53,7 +53,6 @@ IRB.conf[:IRB_RC] = proc{
53
53
  }
54
54
 
55
55
 
56
-
57
56
  # # # # #
58
57
  # general shortcuts & helper methods
59
58
  require File.expand_path('irbtools/general', File.dirname(__FILE__) )
@@ -68,7 +67,7 @@ IRB.conf[:SAVE_HISTORY] = 2000 # how many lines will go to ~/.ir
68
67
  (IRB.conf[:PROMPT] ||= {} ).merge!( {:IRBTOOLS => {
69
68
  :PROMPT_I => ">> ", # normal
70
69
  :PROMPT_N => "| ", # indenting
71
- :PROMPT_C => "(>>) ", # continuing a statement
70
+ :PROMPT_C => ".> ", # continuing a statement
72
71
  :PROMPT_S => "%l> ", # continuing a string
73
72
  :RETURN => "=> %s \n",
74
73
  :AUTO_INDENT => true,
@@ -82,7 +81,7 @@ IRB.conf[:PROMPT_MODE] = :IRBTOOLS
82
81
  # add current directory to the loadpath
83
82
  $: << '.' if RubyVersion.is.at_least? '1.9.2'
84
83
 
85
- # shoter ruby info constants
84
+ # shorter ruby info constants
86
85
  Object.const_set 'RV', RubyVersion rescue nil
87
86
  Object.const_set 'RE', RubyEngine rescue nil
88
87
 
@@ -94,12 +93,10 @@ begin
94
93
  rescue
95
94
  end
96
95
 
97
- # # # # #
98
- # workarounds
99
- require File.expand_path('irbtools/workarounds', File.dirname(__FILE__) )
100
-
101
96
  # # # # #
102
97
  # done :)
103
- puts "Welcome to IRB. You are using #{ RUBY_DESCRIPTION }. Have fun ;)"
98
+ if msg = Irbtools.welcome_message
99
+ puts msg
100
+ end
104
101
 
105
102
  # J-_-L
@@ -20,8 +20,12 @@ module Irbtools
20
20
  @libs_in_proc = []
21
21
  @packages = []
22
22
  @railsrc = '~/.railsrc'
23
+ @welcome_message = "Welcome to IRB. You are using #{ RUBY_DESCRIPTION }. Have fun ;)"
23
24
 
24
25
  class << self
26
+ # message to display when starting. Set to nil to disable
27
+ attr_accessor :welcome_message
28
+
25
29
  # lets you define the path to the irbrc or deactivate this feature with nil
26
30
  attr_accessor :railsrc
27
31
 
@@ -11,10 +11,8 @@ Irbtools.add_library :wirble do # colors
11
11
  Wirble.colorize unless OS.windows?
12
12
  end
13
13
 
14
- Irbtools.add_library :irb_rocket # put result as comment instead of a new line!
15
-
16
- Irbtools.add_library :hirb do # active record tables
17
- Hirb::View.enable
14
+ Irbtools.add_library :fancy_irb do # put result as comment instead of a new line!
15
+ FancyIrb.start
18
16
  end
19
17
 
20
18
  Irbtools.add_library :fileutils do # cd, pwd, ln_s, mv, rm, mkdir, touch ... ;)
@@ -36,7 +34,7 @@ Irbtools.add_library :coderay do
36
34
 
37
35
  # syntax highlight a file
38
36
  def ray(path)
39
- puts CodeRay.scan( File.read(path), :ruby ).term
37
+ print CodeRay.scan( File.read(path), :ruby ).term
40
38
  end
41
39
  end
42
40
 
@@ -72,6 +70,7 @@ Irbtools.add_library 'yaml' # nice debug printing (y)
72
70
  Irbtools.add_library 'g' # nice debug printing (g) - MacOS only :/
73
71
  Irbtools.add_library 'guessmethod', true # automatically correct typos (method_missing hook)
74
72
  Irbtools.add_library 'interactive_editor' # lets you open vim (or your favourite editor), hack something, save it, and it's loaded in the current irb session
73
+ Irbtools.add_library 'sketches' # another, more flexible "start editor and it gets loaded into your irb session" plugin
75
74
  #Irbtools.add_library 'zucker/all' # see rubyzucker.info
76
75
 
77
76
  Irbtools.add_library :boson do
@@ -79,9 +78,15 @@ Irbtools.add_library :boson do
79
78
  Boson.start :verbose => false
80
79
  end
81
80
 
81
+ Irbtools.add_library :hirb do # active record tables
82
+ Hirb::View.enable
83
+ extend Hirb::Console
84
+ end
85
+
86
+
82
87
  # remove failing/not needed libs
83
88
  if OS.windows?
84
- Irbtools.libraries -= %w[irb_rocket coderay]
89
+ Irbtools.libraries -= %w[coderay]
85
90
  end
86
91
 
87
92
  unless OS.mac?
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irbtools
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 0
10
- version: 0.8.0
9
+ - 1
10
+ version: 0.8.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jan Lelis
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-12 00:00:00 +02:00
18
+ date: 2010-11-10 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -33,7 +33,7 @@ dependencies:
33
33
  type: :runtime
34
34
  version_requirements: *id001
35
35
  - !ruby/object:Gem::Dependency
36
- name: hirb
36
+ name: fancy_irb
37
37
  prerelease: false
38
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
39
  none: false
@@ -47,35 +47,35 @@ dependencies:
47
47
  type: :runtime
48
48
  version_requirements: *id002
49
49
  - !ruby/object:Gem::Dependency
50
- name: zucker
50
+ name: hirb
51
51
  prerelease: false
52
52
  requirement: &id003 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
55
  - - ">="
56
56
  - !ruby/object:Gem::Version
57
- hash: 19
57
+ hash: 3
58
58
  segments:
59
- - 8
60
- version: "8"
59
+ - 0
60
+ version: "0"
61
61
  type: :runtime
62
62
  version_requirements: *id003
63
63
  - !ruby/object:Gem::Dependency
64
- name: awesome_print
64
+ name: zucker
65
65
  prerelease: false
66
66
  requirement: &id004 !ruby/object:Gem::Requirement
67
67
  none: false
68
68
  requirements:
69
69
  - - ">="
70
70
  - !ruby/object:Gem::Version
71
- hash: 3
71
+ hash: 19
72
72
  segments:
73
- - 0
74
- version: "0"
73
+ - 8
74
+ version: "8"
75
75
  type: :runtime
76
76
  version_requirements: *id004
77
77
  - !ruby/object:Gem::Dependency
78
- name: g
78
+ name: awesome_print
79
79
  prerelease: false
80
80
  requirement: &id005 !ruby/object:Gem::Requirement
81
81
  none: false
@@ -89,7 +89,7 @@ dependencies:
89
89
  type: :runtime
90
90
  version_requirements: *id005
91
91
  - !ruby/object:Gem::Dependency
92
- name: clipboard
92
+ name: g
93
93
  prerelease: false
94
94
  requirement: &id006 !ruby/object:Gem::Requirement
95
95
  none: false
@@ -103,21 +103,22 @@ dependencies:
103
103
  type: :runtime
104
104
  version_requirements: *id006
105
105
  - !ruby/object:Gem::Dependency
106
- name: guessmethod
106
+ name: clipboard
107
107
  prerelease: false
108
108
  requirement: &id007 !ruby/object:Gem::Requirement
109
109
  none: false
110
110
  requirements:
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
- hash: 3
113
+ hash: 25
114
114
  segments:
115
115
  - 0
116
- version: "0"
116
+ - 9
117
+ version: "0.9"
117
118
  type: :runtime
118
119
  version_requirements: *id007
119
120
  - !ruby/object:Gem::Dependency
120
- name: interactive_editor
121
+ name: guessmethod
121
122
  prerelease: false
122
123
  requirement: &id008 !ruby/object:Gem::Requirement
123
124
  none: false
@@ -131,7 +132,7 @@ dependencies:
131
132
  type: :runtime
132
133
  version_requirements: *id008
133
134
  - !ruby/object:Gem::Dependency
134
- name: coderay
135
+ name: interactive_editor
135
136
  prerelease: false
136
137
  requirement: &id009 !ruby/object:Gem::Requirement
137
138
  none: false
@@ -145,7 +146,7 @@ dependencies:
145
146
  type: :runtime
146
147
  version_requirements: *id009
147
148
  - !ruby/object:Gem::Dependency
148
- name: boson
149
+ name: coderay
149
150
  prerelease: false
150
151
  requirement: &id010 !ruby/object:Gem::Requirement
151
152
  none: false
@@ -158,6 +159,34 @@ dependencies:
158
159
  version: "0"
159
160
  type: :runtime
160
161
  version_requirements: *id010
162
+ - !ruby/object:Gem::Dependency
163
+ name: boson
164
+ prerelease: false
165
+ requirement: &id011 !ruby/object:Gem::Requirement
166
+ none: false
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ hash: 3
171
+ segments:
172
+ - 0
173
+ version: "0"
174
+ type: :runtime
175
+ version_requirements: *id011
176
+ - !ruby/object:Gem::Dependency
177
+ name: sketches
178
+ prerelease: false
179
+ requirement: &id012 !ruby/object:Gem::Requirement
180
+ none: false
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ hash: 3
185
+ segments:
186
+ - 0
187
+ version: "0"
188
+ type: :runtime
189
+ version_requirements: *id012
161
190
  description: irbtools is a meta gem which installs some useful irb gems and configures your irb. Simply put a require 'irbtools' in the .irbrc file in your home directory.
162
191
  email: mail@janlelis.de
163
192
  executables: []
@@ -180,9 +209,6 @@ files:
180
209
  - lib/irbtools/configure.rb
181
210
  - lib/irbtools/general.rb
182
211
  - lib/irbtools/libraries.rb
183
- - lib/irbtools/workarounds.rb
184
- - screenshots/examples1.png
185
- - screenshots/examples2.png
186
212
  has_rdoc: true
187
213
  homepage: http://github.com/janlelis/irbtools
188
214
  licenses: []
@@ -210,8 +236,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
236
  segments:
211
237
  - 0
212
238
  version: "0"
213
- requirements:
214
- - "It's recommended to use the irb_rocket gem: gem install irb_rocket --source http://merbi.st"
239
+ requirements: []
240
+
215
241
  rubyforge_project:
216
242
  rubygems_version: 1.3.7
217
243
  signing_key:
@@ -1,97 +0,0 @@
1
- # encoding: utf-8
2
-
3
- # # # # #
4
- # require 'irbtools' in your .irbrc
5
- # but you could also require 'irbtools/configure' and then call Irbtools.init to modify the loaded libraries
6
- # see the README file for more information
7
-
8
- # irb_rocket stdout problems
9
- if IRB.const_defined? :CaptureIO
10
- module IRB
11
- class CaptureIO
12
- def self.streams
13
- {
14
- :stdout => @@current_capture.instance_variable_get( :@out ),
15
- :stderr => @@current_capture.instance_variable_get( :@err ),
16
- }
17
- end
18
-
19
- alias original_capture capture
20
- def capture(&block)
21
- @@current_capture = self
22
- original_capture &block
23
- end
24
- end
25
- end
26
-
27
- # patch methods using stdout
28
- module Kernel
29
- private
30
-
31
- alias exec_unpatched exec
32
- def exec(*args)
33
- STDOUT.reopen(IRB::CaptureIO.streams[:stdout])
34
- STDERR.reopen(IRB::CaptureIO.streams[:stderr])
35
- exec_unpatched *args
36
- end
37
- end
38
-
39
- alias dbg_unpatched dbg
40
- def dbg
41
- STDOUT.reopen(IRB::CaptureIO.streams[:stdout])
42
- STDERR.reopen(IRB::CaptureIO.streams[:stderr])
43
- dbg_unpatched
44
- end
45
-
46
- if Object.const_defined? :InteractiveEditor
47
- InteractiveEditor::Editors.class_eval do
48
- editors = %w[vi vim emacs nano mate ed]
49
- editors.each{ |editor|
50
- alias_for editor, editor_unpatched = ( editor + '_unpatched' ).to_sym
51
- define_method editor do
52
- STDOUT.reopen(IRB::CaptureIO.streams[:stdout])
53
- STDERR.reopen(IRB::CaptureIO.streams[:stderr])
54
- send editor_unpatched
55
- end
56
- }
57
- end
58
- end
59
-
60
- # hacks for hirb - irb_rocket interaction
61
- module IRB
62
- class Irb
63
- alias output_value_unrocket output_value
64
- def output_value
65
- return ' ' if @io.nil?
66
- hirb_output = Hirb::Util.capture_stdout do output_value_unrocket end
67
- if Hirb::View.did_output?
68
- print hirb_output
69
- else
70
- last = @context.io.prompt + @last_line.split("\n").last
71
- @io.print(rc + cuu1 + (cuf1*last.length) + " " +
72
- Wirble::Colorize::Color.escape(:blue) + "#=>" + sgr0 +
73
- " " + Wirble::Colorize.colorize(@context.last_value.inspect) + cud1)
74
- end
75
- end
76
- end
77
- end
78
-
79
- class << Hirb::View
80
- def did_output?; @did_output; end
81
-
82
- def render_output(output, options={})
83
- @did_output = false
84
- if (formatted_output = formatter.format_output(output, options))
85
- render_method.call(formatted_output)
86
- @did_output = true
87
- true
88
- else
89
- false
90
- end
91
- end
92
- end
93
-
94
- end
95
-
96
- # J-_-L
97
-
Binary file
Binary file