ripl-rc 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,12 @@
1
1
  = ripl-rc changes history
2
2
 
3
+ == ripl-rc 0.1.5 -- 2011-03-26
4
+
5
+ * [ bin] shows a better error message when ripl-rails can't be found
6
+ * [ ripl-rc] made require 'ripl-rc' works like require 'ripl/rc'
7
+ * [multiline] fixed regexp warning on ruby 1.8.7
8
+ * [multiline] fixed history when using multiline
9
+
3
10
  == ripl-rc 0.1.4 -- 2011-03-01
4
11
 
5
12
  * [ color] fix syntax error; sorry, i definitely need tests.. :s
data/bin/ripl-rc CHANGED
@@ -1,8 +1,17 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'ripl/rc'
4
+
4
5
  if ARGV.size > 0
5
- load(`which #{Ripl::Runner.app}-#{ARGV.shift}`.chomp)
6
+ plugin = "#{Ripl::Runner.app}-#{ARGV.shift}"
7
+ path = `which #{plugin}`.strip
8
+ if path == ''
9
+ puts("Can't find `#{plugin}' in $PATH.\n" \
10
+ "Please make sure `#{plugin}' is installed.\n" \
11
+ "e.g. run `gem install #{plugin}`")
12
+ else
13
+ load(path)
14
+ end
6
15
  else
7
16
  Ripl.start
8
17
  end
data/lib/ripl-rc.rb ADDED
@@ -0,0 +1,2 @@
1
+
2
+ require 'ripl/rc'
@@ -4,16 +4,16 @@ require 'ripl'
4
4
  # from https://github.com/janlelis/ripl-multi_line
5
5
  module Ripl::Rc; end
6
6
  module Ripl::Rc::Multiline
7
- ERROR_REGEXP = /#{
8
- [ %q%unexpected \$end%,
9
- %q%unterminated [a-z]+ meets end of file%,
7
+ ERROR_REGEXP = Regexp.new(
8
+ [ "unexpected \\$end",
9
+ "unterminated [a-z]+ meets end of file",
10
10
  # rubinius
11
- %q%expecting '\\n' or ';'%,
12
- %q%missing 'end'%,
13
- %q%expecting '}'%,
11
+ "expecting '\\\\n' or ';'",
12
+ "missing 'end'",
13
+ "expecting '}'",
14
14
  # jruby
15
- %q%syntax error, unexpected end-of-file%,
16
- ]*'|' }/
15
+ "syntax error, unexpected end-of-file",
16
+ ].join('|'))
17
17
 
18
18
  def before_loop
19
19
  @rc_multiline_buffer = []
@@ -37,7 +37,8 @@ module Ripl::Rc::Multiline
37
37
 
38
38
  def print_eval_error(e)
39
39
  if e.is_a?(SyntaxError) && e.message =~ ERROR_REGEXP
40
- @rc_multiline_buffer << @input
40
+ @rc_multiline_buffer << @input if @rc_multiline_buffer.empty?
41
+ history.pop
41
42
  throw :rc_multiline_cont
42
43
  else
43
44
  super
@@ -48,7 +49,10 @@ module Ripl::Rc::Multiline
48
49
  if @rc_multiline_buffer.empty?
49
50
  super
50
51
  else
51
- super "#{@rc_multiline_buffer.join("\n")}\n#{input}"
52
+ @rc_multiline_buffer << input
53
+ history.pop
54
+ history << "\n" + (str = @rc_multiline_buffer.join("\n"))
55
+ super str
52
56
  end
53
57
  end
54
58
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Ripl
3
3
  module Rc
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
6
6
  end
data/ripl-rc.gemspec CHANGED
@@ -2,21 +2,21 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ripl-rc}
5
- s.version = "0.1.4"
5
+ s.version = "0.1.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Lin Jen-Shin (godfat)"]
9
- s.date = %q{2011-03-01}
9
+ s.date = %q{2011-03-26}
10
10
  s.default_executable = %q{ripl-rc}
11
11
  s.description = %q{ripl plugins collection, take you want, leave you don't.}
12
12
  s.email = ["godfat (XD) godfat.org"]
13
13
  s.executables = ["ripl-rc"]
14
14
  s.extra_rdoc_files = ["CHANGES", "CONTRIBUTORS", "LICENSE", "TODO"]
15
- s.files = [".gitignore", "2011-02-28.md", "CHANGES", "CONTRIBUTORS", "Gemfile", "LICENSE", "README", "README.md", "Rakefile", "TODO", "bin/ripl-rc", "lib/ripl/rc.rb", "lib/ripl/rc/anchor.rb", "lib/ripl/rc/color.rb", "lib/ripl/rc/ctrld_newline.rb", "lib/ripl/rc/eat_whites.rb", "lib/ripl/rc/mkdir_history.rb", "lib/ripl/rc/multiline.rb", "lib/ripl/rc/noirbrc.rb", "lib/ripl/rc/squeeze_history.rb", "lib/ripl/rc/strip_backtrace.rb", "lib/ripl/rc/version.rb", "ripl-rc.gemspec", "screenshot.png", "task/gemgem.rb", "test/test_squeeze_history.rb"]
15
+ s.files = [".gitignore", "2011-02-28.md", "CHANGES", "CONTRIBUTORS", "Gemfile", "LICENSE", "README", "README.md", "Rakefile", "TODO", "bin/ripl-rc", "lib/ripl-rc.rb", "lib/ripl/rc.rb", "lib/ripl/rc/anchor.rb", "lib/ripl/rc/color.rb", "lib/ripl/rc/ctrld_newline.rb", "lib/ripl/rc/eat_whites.rb", "lib/ripl/rc/mkdir_history.rb", "lib/ripl/rc/multiline.rb", "lib/ripl/rc/noirbrc.rb", "lib/ripl/rc/squeeze_history.rb", "lib/ripl/rc/strip_backtrace.rb", "lib/ripl/rc/version.rb", "ripl-rc.gemspec", "screenshot.png", "task/gemgem.rb", "test/test_squeeze_history.rb"]
16
16
  s.homepage = %q{http://github.com/godfat/}
17
17
  s.rdoc_options = ["--main", "README"]
18
18
  s.require_paths = ["lib"]
19
- s.rubygems_version = %q{1.5.3}
19
+ s.rubygems_version = %q{1.6.2}
20
20
  s.summary = %q{ripl plugins collection, take you want, leave you don't.}
21
21
  s.test_files = ["test/test_squeeze_history.rb"]
22
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ripl-rc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-03-01 00:00:00.000000000 +08:00
12
+ date: 2011-03-26 00:00:00.000000000 +08:00
13
13
  default_executable: ripl-rc
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ripl
17
- requirement: &2168489000 !ruby/object:Gem::Requirement
17
+ requirement: &2158040060 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2168489000
25
+ version_requirements: *2158040060
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: bacon
28
- requirement: &2168488280 !ruby/object:Gem::Requirement
28
+ requirement: &2158039580 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2168488280
36
+ version_requirements: *2158039580
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rr
39
- requirement: &2168487580 !ruby/object:Gem::Requirement
39
+ requirement: &2158039100 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2168487580
47
+ version_requirements: *2158039100
48
48
  description: ripl plugins collection, take you want, leave you don't.
49
49
  email:
50
50
  - godfat (XD) godfat.org
@@ -68,6 +68,7 @@ files:
68
68
  - Rakefile
69
69
  - TODO
70
70
  - bin/ripl-rc
71
+ - lib/ripl-rc.rb
71
72
  - lib/ripl/rc.rb
72
73
  - lib/ripl/rc/anchor.rb
73
74
  - lib/ripl/rc/color.rb
@@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
107
  version: '0'
107
108
  requirements: []
108
109
  rubyforge_project:
109
- rubygems_version: 1.5.3
110
+ rubygems_version: 1.6.2
110
111
  signing_key:
111
112
  specification_version: 3
112
113
  summary: ripl plugins collection, take you want, leave you don't.