ripl 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemspec +1 -1
- data/CHANGELOG.rdoc +5 -0
- data/LICENSE.txt +1 -1
- data/README.rdoc +2 -0
- data/lib/ripl/history.rb +1 -1
- data/lib/ripl/shell.rb +1 -1
- data/lib/ripl/version.rb +1 -1
- data/test/history_test.rb +12 -3
- data/test/shell_test.rb +1 -1
- data/test/test_helper.rb +7 -0
- metadata +5 -5
data/.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Ripl::VERSION
|
8
8
|
s.authors = ["Gabriel Horner"]
|
9
9
|
s.email = "gabriel.horner@gmail.com"
|
10
|
-
s.homepage = "http://github.com/
|
10
|
+
s.homepage = "http://github.com/cldwalker/ripl"
|
11
11
|
s.summary = "ruby interactive print loop - A light, modular alternative to irb and a shell framework"
|
12
12
|
s.description = "ripl is a light, modular alternative to irb. Like irb, it loads ~/.irbrc, has autocompletion and keeps history in ~/.irb_history. Unlike irb, it is highly customizable via plugins and supports commands i.e. ripl-play. This customizability makes it easy to build custom shells (i.e. for a gem or application) and complex shells (i.e. for the web). In other words, ripl is also a shell framework."
|
13
13
|
s.required_rubygems_version = ">= 1.3.6"
|
data/CHANGELOG.rdoc
CHANGED
data/LICENSE.txt
CHANGED
data/README.rdoc
CHANGED
@@ -152,6 +152,7 @@ see {ripl-rails}[http://github.com/cldwalker/ripl-rails].
|
|
152
152
|
|
153
153
|
== Credits
|
154
154
|
* janlelis for bug fix and tweaks
|
155
|
+
* godfat and JoshCheek for bug fixes
|
155
156
|
|
156
157
|
== Ripl Plugins
|
157
158
|
|
@@ -175,6 +176,7 @@ see {ripl-rails}[http://github.com/cldwalker/ripl-rails].
|
|
175
176
|
display short backtrace
|
176
177
|
* {ripl-rocket}[https://github.com/janlelis/ripl-rocket]: outputs ripl result as a hash rocket
|
177
178
|
* {ripl-padrino}[https://github.com/achiu/ripl-padrino]: console for padrino
|
179
|
+
* {ripltools}[https://github.com/janlelis/ripltools]: a collection of ripl plugins
|
178
180
|
|
179
181
|
== Ripl Shells
|
180
182
|
Shells built on top of ripl:
|
data/lib/ripl/history.rb
CHANGED
@@ -19,7 +19,7 @@ module Ripl::History
|
|
19
19
|
def write_history
|
20
20
|
File.open(history_file, 'w') {|f| f.write Array(history).join("\n") }
|
21
21
|
end
|
22
|
-
|
22
|
+
def after_loop; write_history; end
|
23
23
|
end
|
24
24
|
Ripl::Shell.include Ripl::History
|
25
25
|
Ripl.config[:history] = '~/.irb_history'
|
data/lib/ripl/shell.rb
CHANGED
data/lib/ripl/version.rb
CHANGED
data/test/history_test.rb
CHANGED
@@ -4,10 +4,11 @@ require 'fileutils'
|
|
4
4
|
HISTORY_FILE = File.dirname(__FILE__) + '/ripl_history'
|
5
5
|
|
6
6
|
describe "History with readline" do
|
7
|
-
def shell
|
8
|
-
Ripl.shell(
|
7
|
+
def shell
|
8
|
+
Ripl.shell(:history => HISTORY_FILE, :readline => false, :completion => false)
|
9
9
|
end
|
10
10
|
|
11
|
+
before_all { reset_shell }
|
11
12
|
before do
|
12
13
|
reset_ripl
|
13
14
|
if defined? Readline
|
@@ -18,7 +19,7 @@ describe "History with readline" do
|
|
18
19
|
|
19
20
|
it "#after_loop saves history" do
|
20
21
|
inputs = %w{blih blah}
|
21
|
-
|
22
|
+
shell.instance_variable_set '@history', inputs
|
22
23
|
shell.after_loop
|
23
24
|
File.read(HISTORY_FILE).should == inputs.join("\n")
|
24
25
|
end
|
@@ -35,4 +36,12 @@ describe "History with readline" do
|
|
35
36
|
shell.before_loop
|
36
37
|
shell.history.to_a.should == []
|
37
38
|
end
|
39
|
+
|
40
|
+
it "#write_history is accessible to plugins in #after_loop" do
|
41
|
+
mod = Object.const_set "Ping_write_history", Module.new
|
42
|
+
mod.send(:define_method, 'write_history') { @history = ['pong_write_history'] }
|
43
|
+
Shell.send :include, mod
|
44
|
+
shell.after_loop
|
45
|
+
shell.history.should == ['pong_write_history']
|
46
|
+
end
|
38
47
|
end
|
data/test/shell_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -30,6 +30,13 @@ module Helpers
|
|
30
30
|
Ripl.instance_eval "@config = @shell = @riplrc = nil"
|
31
31
|
end
|
32
32
|
|
33
|
+
def reset_shell
|
34
|
+
Ripl.send(:remove_const, :Shell)
|
35
|
+
$".delete $".grep(/shell\.rb/)[0]
|
36
|
+
require 'ripl/shell'
|
37
|
+
Ripl::Shell.include Ripl::History
|
38
|
+
end
|
39
|
+
|
33
40
|
def reset_config
|
34
41
|
Ripl.config.merge! :history => '~/.irb_history', :completion => {}
|
35
42
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ripl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gabriel Horner
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-02-21 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -128,7 +128,7 @@ files:
|
|
128
128
|
- man/ripl.1.html
|
129
129
|
- man/ripl.1.ronn
|
130
130
|
has_rdoc: true
|
131
|
-
homepage: http://github.com/
|
131
|
+
homepage: http://github.com/cldwalker/ripl
|
132
132
|
licenses:
|
133
133
|
- MIT
|
134
134
|
post_install_message:
|