irberize 0.0.1
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.
- data/bin/irberize +4 -0
- data/lib/irberize.rb +26 -0
- metadata +56 -0
data/bin/irberize
ADDED
data/lib/irberize.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'irb'
|
2
|
+
require 'irb/completion'
|
3
|
+
|
4
|
+
module IRBerize
|
5
|
+
def self.run(s)
|
6
|
+
# the following code closely resembles IRB.start
|
7
|
+
IRB.setup(__FILE__)
|
8
|
+
irb = IRB::Irb.new
|
9
|
+
|
10
|
+
IRB.conf[:IRB_RC] = proc do |conf|
|
11
|
+
eval s, conf.workspace.binding
|
12
|
+
IRB.conf.delete(:IRB_RC)
|
13
|
+
end
|
14
|
+
|
15
|
+
IRB.conf[:IRB_RC].call(irb.context)
|
16
|
+
IRB.conf[:MAIN_CONTEXT] = irb.context
|
17
|
+
|
18
|
+
trap("SIGINT") do
|
19
|
+
irb.signal_handle
|
20
|
+
end
|
21
|
+
|
22
|
+
catch(:IRB_EXIT) do
|
23
|
+
irb.eval_input
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: irberize
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors: []
|
7
|
+
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-02-04 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Run a ruby script with IRB
|
17
|
+
email:
|
18
|
+
executables:
|
19
|
+
- irberize
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- bin/irberize
|
26
|
+
- lib/irberize.rb
|
27
|
+
has_rdoc: true
|
28
|
+
homepage:
|
29
|
+
licenses: []
|
30
|
+
|
31
|
+
post_install_message:
|
32
|
+
rdoc_options: []
|
33
|
+
|
34
|
+
require_paths:
|
35
|
+
- lib
|
36
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: "0"
|
41
|
+
version:
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: "0"
|
47
|
+
version:
|
48
|
+
requirements: []
|
49
|
+
|
50
|
+
rubyforge_project:
|
51
|
+
rubygems_version: 1.3.5
|
52
|
+
signing_key:
|
53
|
+
specification_version: 3
|
54
|
+
summary: Run a ruby script with IRB
|
55
|
+
test_files: []
|
56
|
+
|