every_day_irb 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/VERSION +1 -1
- data/lib/every_day_irb.rb +18 -18
- metadata +40 -21
data/LICENSE
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.0
|
data/lib/every_day_irb.rb
CHANGED
@@ -15,11 +15,16 @@ def cat(path)
|
|
15
15
|
File.read path
|
16
16
|
end
|
17
17
|
|
18
|
-
# allows concise syntax like rq:mathn
|
18
|
+
# allows concise syntax like rq:mathn
|
19
19
|
def rq(lib)
|
20
20
|
require lib.to_s
|
21
21
|
end
|
22
22
|
|
23
|
+
# load shortcut, not suited for non-rb
|
24
|
+
def ld(lib)
|
25
|
+
load lib.to_s + '.rb'
|
26
|
+
end
|
27
|
+
|
23
28
|
# rerequire, not suited for non-rb, please note: can have non-intended side effects in rare cases
|
24
29
|
def rerequire(lib)
|
25
30
|
$".dup.each{ |path|
|
@@ -33,23 +38,6 @@ def rerequire(lib)
|
|
33
38
|
end
|
34
39
|
alias rrq rerequire
|
35
40
|
|
36
|
-
# load shortcut, not suited for non-rb
|
37
|
-
def ld(lib)
|
38
|
-
load lib.to_s + '.rb'
|
39
|
-
end
|
40
|
-
|
41
|
-
# returns the last lines, needed for some copy_ methods
|
42
|
-
def session_history(number_of_lines = nil)
|
43
|
-
if !number_of_lines
|
44
|
-
if defined?(Ripl) && Ripl.respond_to?(:started?) && Ripl.started?
|
45
|
-
number_of_lines = Ripl.shell.line
|
46
|
-
else
|
47
|
-
number_of_lines = context.instance_variable_get(:@line_no)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
Readline::HISTORY.entries[-number_of_lines...-1]*"\n"
|
51
|
-
end
|
52
|
-
|
53
41
|
# restart irb
|
54
42
|
def reset!
|
55
43
|
# remember history...
|
@@ -68,6 +56,18 @@ def clear
|
|
68
56
|
system 'clear'
|
69
57
|
end
|
70
58
|
|
59
|
+
# returns the last lines, needed for some copy_ methods
|
60
|
+
def session_history(number_of_lines = nil)
|
61
|
+
if !number_of_lines
|
62
|
+
if defined?(Ripl) && Ripl.respond_to?(:started?) && Ripl.started?
|
63
|
+
number_of_lines = Ripl.shell.line
|
64
|
+
else
|
65
|
+
number_of_lines = context.instance_variable_get(:@line_no)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
Readline::HISTORY.entries[-number_of_lines...-1]*"\n"
|
69
|
+
end
|
70
|
+
|
71
71
|
# load debugger, inspired by rdp
|
72
72
|
def dbg
|
73
73
|
begin
|
metadata
CHANGED
@@ -1,51 +1,70 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: every_day_irb
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 1.2.0
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Jan Lelis
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
17
|
+
|
18
|
+
date: 2012-01-10 00:00:00 Z
|
13
19
|
dependencies: []
|
14
|
-
|
15
|
-
|
16
|
-
dbg'
|
20
|
+
|
21
|
+
description: "every_day_irb defines some helper methods that might be useful in every-day irb usage, e.g.: ls, cat, rq, rrq, ld, session_history, reset!, clear, dbg"
|
17
22
|
email: mail@janlelis.de
|
18
23
|
executables: []
|
24
|
+
|
19
25
|
extensions: []
|
20
|
-
|
26
|
+
|
27
|
+
extra_rdoc_files:
|
21
28
|
- LICENSE
|
22
|
-
files:
|
29
|
+
files:
|
23
30
|
- lib/every_day_irb.rb
|
24
31
|
- VERSION
|
25
32
|
- every_day_irb.gemspec
|
26
33
|
- LICENSE
|
27
34
|
homepage: http://github.com/janlelis/irbtools
|
28
35
|
licenses: []
|
36
|
+
|
29
37
|
post_install_message:
|
30
38
|
rdoc_options: []
|
31
|
-
|
39
|
+
|
40
|
+
require_paths:
|
32
41
|
- lib
|
33
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
34
43
|
none: false
|
35
|
-
requirements:
|
36
|
-
- -
|
37
|
-
- !ruby/object:Gem::Version
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
hash: 57
|
48
|
+
segments:
|
49
|
+
- 1
|
50
|
+
- 8
|
51
|
+
- 7
|
38
52
|
version: 1.8.7
|
39
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
40
54
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
45
62
|
requirements: []
|
63
|
+
|
46
64
|
rubyforge_project:
|
47
|
-
rubygems_version: 1.8.
|
65
|
+
rubygems_version: 1.8.10
|
48
66
|
signing_key:
|
49
67
|
specification_version: 3
|
50
68
|
summary: every_day_irb defines some helper methods that might be useful in irb.
|
51
69
|
test_files: []
|
70
|
+
|