irbtools 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -3
- data/VERSION +1 -1
- data/lib/irbtools.rb +15 -15
- metadata +17 -18
data/Rakefile
CHANGED
@@ -18,11 +18,11 @@ begin
|
|
18
18
|
gem.add_dependency 'g'
|
19
19
|
gem.add_dependency 'clipboard'
|
20
20
|
gem.add_dependency 'guessmethod'
|
21
|
-
gem.add_dependency 'drx'
|
21
|
+
# gem.add_dependency 'drx'
|
22
22
|
gem.add_dependency 'interactive_editor'
|
23
23
|
gem.add_dependency 'coderay'
|
24
|
-
gem.add_dependency 'irb_rocket'
|
25
|
-
#gem.post_install_message 'irbtools'
|
24
|
+
# gem.add_dependency 'irb_rocket'
|
25
|
+
# gem.post_install_message 'irbtools'
|
26
26
|
end
|
27
27
|
Jeweler::GemcutterTasks.new
|
28
28
|
rescue LoadError
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/irbtools.rb
CHANGED
@@ -17,7 +17,7 @@ irb_libs = ['rubygems',
|
|
17
17
|
'g', # nice debug printing (g) - MacOS only :/
|
18
18
|
'clipboard', # easy clipboard access (copy & paste)
|
19
19
|
'guessmethod', # automatically correct typos (method_missing hook)
|
20
|
-
'drx', # nice tk object inspector (.see)
|
20
|
+
# 'drx', # nice tk object inspector (.see) [not included because it fails to install out of the box on lots of systems]
|
21
21
|
'interactive_editor', # lets you open vim (or your favourite editor), hack something, save it, and it's loaded in the current irb session
|
22
22
|
'coderay', # some nice colorful display ;)
|
23
23
|
'irb_rocket', # put result as comment instead of a new line!
|
@@ -36,38 +36,32 @@ irb_libs.each{ |lib|
|
|
36
36
|
when 'hirb'
|
37
37
|
Hirb::View.enable
|
38
38
|
|
39
|
+
when 'fileutils'
|
40
|
+
include FileUtils::Verbose
|
41
|
+
|
39
42
|
when 'zucker/env'
|
40
43
|
include OS # linux?, windows?, ...
|
41
44
|
Zucker.more_aliases! # RV, RE
|
42
45
|
|
43
|
-
when 'fileutils'
|
44
|
-
include FileUtils::Verbose
|
45
|
-
|
46
46
|
when 'clipboard'
|
47
|
+
# copies the clipboard
|
47
48
|
def copy(str)
|
48
49
|
Clipboard.copy(str)
|
49
50
|
end
|
50
51
|
|
52
|
+
# pastes the clipboard
|
51
53
|
def paste
|
52
54
|
Clipboard.paste
|
53
55
|
end
|
54
56
|
|
55
|
-
|
56
|
-
require 'open3'
|
57
|
-
Open3.popen3('irb'){ |i,o,e|
|
58
|
-
i.puts session_history + "\nexit"
|
59
|
-
o.read
|
60
|
-
#copy o.read
|
61
|
-
}
|
62
|
-
# "The session history has been copied to the clipboard."
|
63
|
-
end
|
64
|
-
|
57
|
+
# copies everything you have entered in this irb session
|
65
58
|
def copy_input
|
66
59
|
copy session_history
|
67
60
|
"The session input history has been copied to the clipboard."
|
68
61
|
end
|
69
62
|
alias copy_session_input copy_input
|
70
63
|
|
64
|
+
# copies the output of all irb commands in this irb session
|
71
65
|
def copy_output
|
72
66
|
copy context.instance_variable_get(:@eval_history_values).inspect.gsub(/^\d+ (.*)/, '\1')
|
73
67
|
"The session output history has been copied to the clipboard."
|
@@ -75,10 +69,12 @@ irb_libs.each{ |lib|
|
|
75
69
|
alias copy_session_output copy_output
|
76
70
|
|
77
71
|
when 'coderay'
|
72
|
+
# syntax highlight a string
|
78
73
|
def colorize(string)
|
79
74
|
puts CodeRay.scan( string, :ruby ).term
|
80
75
|
end
|
81
76
|
|
77
|
+
# syntax highlight a file
|
82
78
|
def ray(path)
|
83
79
|
puts CodeRay.scan( File.read(path), :ruby ).term
|
84
80
|
end
|
@@ -86,7 +82,11 @@ irb_libs.each{ |lib|
|
|
86
82
|
end
|
87
83
|
|
88
84
|
rescue LoadError => err
|
89
|
-
|
85
|
+
if err.to_s == 'irb_rocket' && RubyEngine.mri? && !OS.windows?
|
86
|
+
warn "Couldn't load the irb_rocket gem. It is a great irb gem, but is not in the gem dependencies, because it is hosted on a different server\n --> You can install it with: gem install irb_rocket --source http://merbi.st"
|
87
|
+
else
|
88
|
+
warn "Couldn't load an irb library: #{err}"
|
89
|
+
end
|
90
90
|
end
|
91
91
|
}
|
92
92
|
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: irbtools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Jan Lelis
|
@@ -25,6 +26,7 @@ dependencies:
|
|
25
26
|
requirements:
|
26
27
|
- - ">="
|
27
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
28
30
|
segments:
|
29
31
|
- 0
|
30
32
|
version: "0"
|
@@ -38,6 +40,7 @@ dependencies:
|
|
38
40
|
requirements:
|
39
41
|
- - ">="
|
40
42
|
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
41
44
|
segments:
|
42
45
|
- 0
|
43
46
|
version: "0"
|
@@ -51,6 +54,7 @@ dependencies:
|
|
51
54
|
requirements:
|
52
55
|
- - ">="
|
53
56
|
- !ruby/object:Gem::Version
|
57
|
+
hash: 13
|
54
58
|
segments:
|
55
59
|
- 7
|
56
60
|
version: "7"
|
@@ -64,6 +68,7 @@ dependencies:
|
|
64
68
|
requirements:
|
65
69
|
- - ">="
|
66
70
|
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
67
72
|
segments:
|
68
73
|
- 0
|
69
74
|
version: "0"
|
@@ -77,6 +82,7 @@ dependencies:
|
|
77
82
|
requirements:
|
78
83
|
- - ">="
|
79
84
|
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
80
86
|
segments:
|
81
87
|
- 0
|
82
88
|
version: "0"
|
@@ -90,6 +96,7 @@ dependencies:
|
|
90
96
|
requirements:
|
91
97
|
- - ">="
|
92
98
|
- !ruby/object:Gem::Version
|
99
|
+
hash: 3
|
93
100
|
segments:
|
94
101
|
- 0
|
95
102
|
version: "0"
|
@@ -103,50 +110,40 @@ dependencies:
|
|
103
110
|
requirements:
|
104
111
|
- - ">="
|
105
112
|
- !ruby/object:Gem::Version
|
113
|
+
hash: 3
|
106
114
|
segments:
|
107
115
|
- 0
|
108
116
|
version: "0"
|
109
117
|
type: :runtime
|
110
118
|
version_requirements: *id007
|
111
119
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
120
|
+
name: interactive_editor
|
113
121
|
prerelease: false
|
114
122
|
requirement: &id008 !ruby/object:Gem::Requirement
|
115
123
|
none: false
|
116
124
|
requirements:
|
117
125
|
- - ">="
|
118
126
|
- !ruby/object:Gem::Version
|
127
|
+
hash: 3
|
119
128
|
segments:
|
120
129
|
- 0
|
121
130
|
version: "0"
|
122
131
|
type: :runtime
|
123
132
|
version_requirements: *id008
|
124
133
|
- !ruby/object:Gem::Dependency
|
125
|
-
name:
|
134
|
+
name: coderay
|
126
135
|
prerelease: false
|
127
136
|
requirement: &id009 !ruby/object:Gem::Requirement
|
128
137
|
none: false
|
129
138
|
requirements:
|
130
139
|
- - ">="
|
131
140
|
- !ruby/object:Gem::Version
|
141
|
+
hash: 3
|
132
142
|
segments:
|
133
143
|
- 0
|
134
144
|
version: "0"
|
135
145
|
type: :runtime
|
136
146
|
version_requirements: *id009
|
137
|
-
- !ruby/object:Gem::Dependency
|
138
|
-
name: coderay
|
139
|
-
prerelease: false
|
140
|
-
requirement: &id010 !ruby/object:Gem::Requirement
|
141
|
-
none: false
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
segments:
|
146
|
-
- 0
|
147
|
-
version: "0"
|
148
|
-
type: :runtime
|
149
|
-
version_requirements: *id010
|
150
147
|
description: irbtools is a meta gem which installs some great irb gems for you and configures your irb. Simply put a require 'irbtools' in the .irbrc file in your home directory.
|
151
148
|
email: mail@janlelis.de
|
152
149
|
executables: []
|
@@ -168,7 +165,7 @@ has_rdoc: true
|
|
168
165
|
homepage: http://github.com/janlelis/irbtools
|
169
166
|
licenses: []
|
170
167
|
|
171
|
-
post_install_message:
|
168
|
+
post_install_message:
|
172
169
|
rdoc_options:
|
173
170
|
- --charset=UTF-8
|
174
171
|
require_paths:
|
@@ -178,6 +175,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
175
|
requirements:
|
179
176
|
- - ">="
|
180
177
|
- !ruby/object:Gem::Version
|
178
|
+
hash: 3
|
181
179
|
segments:
|
182
180
|
- 0
|
183
181
|
version: "0"
|
@@ -186,6 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
184
|
requirements:
|
187
185
|
- - ">="
|
188
186
|
- !ruby/object:Gem::Version
|
187
|
+
hash: 3
|
189
188
|
segments:
|
190
189
|
- 0
|
191
190
|
version: "0"
|