ripl 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +4 -0
- data/README.rdoc +5 -2
- data/lib/ripl.rb +2 -2
- data/lib/ripl/completion.rb +1 -1
- data/lib/ripl/runner.rb +4 -2
- data/lib/ripl/shell.rb +1 -1
- data/lib/ripl/version.rb +1 -1
- data/test/runner_test.rb +19 -0
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -143,18 +143,21 @@ see {ripl-rails}[http://github.com/cldwalker/ripl-rails].
|
|
143
143
|
|
144
144
|
== Ripl Plugins
|
145
145
|
|
146
|
-
* {ripl-rails}[http://github.com/cldwalker/ripl-rails] : script/console for ripl
|
147
|
-
* {ripl-color_error}[http://github.com/cldwalker/ripl-color_error] : colorize errors
|
148
146
|
* {ripl-multi_line}[http://github.com/janlelis/ripl-multi_line] : evaluate multiple lines
|
147
|
+
* {ripl-rails}[http://github.com/cldwalker/ripl-rails] : console for rails
|
148
|
+
* {ripl-rack}[http://github.com/cldwalker/ripl-rack] : console for rack
|
149
149
|
* {ripl-play}[http://github.com/cldwalker/ripl-play] : play back and record input into ripl
|
150
|
+
* {ripl-debug}[http://github.com/cldwalker/ripl-debug] : automatically debugs a failed eval
|
150
151
|
* {ripl-after_rc}[http://github.com/cldwalker/ripl-after_rc] : provide blocks to run after ~/.irbrc is loaded
|
151
152
|
* {ripl-irb}[http://github.com/cldwalker/ripl-irb] : smooths transition from irb
|
152
153
|
* {ripl-commands}[http://github.com/cldwalker/ripl-commands] : adds ripl commands similar to irb's commands
|
154
|
+
* {ripl-color_error}[http://github.com/cldwalker/ripl-color_error] : colorize errors
|
153
155
|
* {ripl-color_streams}[http://github.com/janlelis/ripl-color_streams] : colorizes stderr + stdout
|
154
156
|
* {ripl-color_result}[http://github.com/janlelis/ripl-color_result] : colorizes results
|
155
157
|
* {ripl-auto_indent}[http://github.com/janlelis/ripl-auto_indent] : auto indents multi-line input
|
156
158
|
* {ripl-hirb}[http://github.com/cldwalker/hirb] : comes with hirb to make it a proper riplzen
|
157
159
|
* {ripl-misc}[http://github.com/cldwalker/ripl-misc] : a playground for ripl plugins
|
160
|
+
* {ripl-profiles}[https://github.com/janlelis/ripl-profiles]: load ripl profiles with a --profile option
|
158
161
|
|
159
162
|
== Ripl Shells
|
160
163
|
Shells built on top of ripl:
|
data/lib/ripl.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
module Ripl
|
2
2
|
def self.config
|
3
|
-
@config ||= {:readline=>true, :riplrc=>'~/.riplrc'}
|
3
|
+
@config ||= {:readline=>true, :riplrc=>'~/.riplrc', :completion=>{}}
|
4
4
|
end
|
5
5
|
|
6
6
|
def self.start(*args); Runner.start(*args); end
|
7
7
|
|
8
8
|
def self.shell(options={})
|
9
|
-
@shell ||= Shell.create(config.merge(options))
|
9
|
+
@shell ||= Shell.create(config.merge!(options))
|
10
10
|
end
|
11
11
|
module Commands; end
|
12
12
|
end
|
data/lib/ripl/completion.rb
CHANGED
data/lib/ripl/runner.rb
CHANGED
@@ -15,6 +15,7 @@ module Ripl::Runner
|
|
15
15
|
end
|
16
16
|
|
17
17
|
module API
|
18
|
+
attr_reader :argv
|
18
19
|
def run(argv=ARGV)
|
19
20
|
argv[0].to_s[/^[^-]/] ? run_command(argv) : start(:argv=>argv)
|
20
21
|
end
|
@@ -54,8 +55,9 @@ module Ripl::Runner
|
|
54
55
|
end
|
55
56
|
|
56
57
|
def start(options={})
|
57
|
-
argv = options.delete(:argv) || ARGV
|
58
|
-
|
58
|
+
@argv = options.delete(:argv) || ARGV
|
59
|
+
argv = @argv.dup
|
60
|
+
load_rc(Ripl.config[:riplrc]) unless argv.delete('-F') || options[:riplrc] == false
|
59
61
|
parse_options(argv) if $0[/ripl$|ripl-\w+$/]
|
60
62
|
Ripl.shell(options).loop
|
61
63
|
end
|
data/lib/ripl/shell.rb
CHANGED
data/lib/ripl/version.rb
CHANGED
data/test/runner_test.rb
CHANGED
@@ -10,6 +10,12 @@ describe "Runner" do
|
|
10
10
|
Ripl.start
|
11
11
|
end
|
12
12
|
|
13
|
+
it "doesn't load riplrc" do
|
14
|
+
mock_shell
|
15
|
+
dont_allow(Runner).load_rc(anything)
|
16
|
+
Ripl.start :riplrc => false
|
17
|
+
end
|
18
|
+
|
13
19
|
it "sets a shell's variables" do
|
14
20
|
mock_riplrc
|
15
21
|
mock_shell
|
@@ -17,6 +23,13 @@ describe "Runner" do
|
|
17
23
|
Ripl.shell.name.should == 'shh'
|
18
24
|
end
|
19
25
|
|
26
|
+
it "passes options to Ripl.config" do
|
27
|
+
mock_riplrc
|
28
|
+
mock_shell
|
29
|
+
Ripl.start(:history=>'~/.mah_history')
|
30
|
+
Ripl.config[:history].should == '~/.mah_history'
|
31
|
+
end
|
32
|
+
|
20
33
|
it "overrides config set in riplrc" do
|
21
34
|
mock_riplrc { Ripl.config[:name] = 'blah' }
|
22
35
|
mock_shell
|
@@ -69,6 +82,12 @@ describe "Runner" do
|
|
69
82
|
ripl("rails", "-F", :riplrc=>false)
|
70
83
|
end
|
71
84
|
|
85
|
+
it "saves arguments passed to it" do
|
86
|
+
mock_exec 'blah', '-F'
|
87
|
+
ripl("rails", "blah", "-F", :riplrc=>false)
|
88
|
+
Ripl::Runner.argv.should == ['blah', '-F']
|
89
|
+
end
|
90
|
+
|
72
91
|
it "has other global option parsed" do
|
73
92
|
mock_exec '-r=blah'
|
74
93
|
mock(Runner).require('blah')
|
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: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 8
|
10
|
+
version: 0.2.8
|
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: 2010-12-
|
18
|
+
date: 2010-12-13 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|