ripl 0.2.7 → 0.2.8

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.
@@ -1,3 +1,7 @@
1
+ == 0.2.8
2
+ * Allow completion to be optional
3
+ * Save commandline args to Ripl::Runner.argv
4
+
1
5
  == 0.2.7
2
6
  * Fix and (change order of) option parsing for ripl commands
3
7
  * Add default help for a ripl command
@@ -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:
@@ -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
@@ -7,4 +7,4 @@ module Ripl::Completion
7
7
  end
8
8
  end
9
9
  Ripl::Shell.send :include, Ripl::Completion
10
- (Ripl.config[:completion] ||= {})[:eval_binding] = lambda { Ripl.shell.binding }
10
+ Ripl.config[:completion][:eval_binding] = lambda { Ripl.shell.binding }
@@ -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
- load_rc(Ripl.config[:riplrc]) unless argv.delete('-F')
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
@@ -5,7 +5,7 @@ class Ripl::Shell
5
5
 
6
6
  def self.create(options={})
7
7
  require 'ripl/readline' if options[:readline]
8
- require 'ripl/completion'
8
+ require 'ripl/completion' if options[:completion]
9
9
  new(options)
10
10
  rescue LoadError
11
11
  new(options)
@@ -1,3 +1,3 @@
1
1
  module Ripl
2
- VERSION = '0.2.7'
2
+ VERSION = '0.2.8'
3
3
  end
@@ -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: 25
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 7
10
- version: 0.2.7
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-04 00:00:00 -05:00
18
+ date: 2010-12-13 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency