rib 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -0
- data/CHANGES.md +20 -5
- data/README.md +14 -0
- data/lib/rib/app/rails.rb +65 -5
- data/lib/rib/version.rb +1 -1
- data/rib.gemspec +89 -98
- metadata +15 -15
data/.travis.yml
CHANGED
data/CHANGES.md
CHANGED
@@ -1,15 +1,30 @@
|
|
1
1
|
# Rib CHANGES
|
2
2
|
|
3
|
+
## Rib 0.9.4 -- 2011-09-01
|
4
|
+
|
5
|
+
* [rib-rails] So now we replicated what Rails did for its console, both for
|
6
|
+
Rails 2 and Rails 3. You can now fully use `rib rails` or `rib auto` as
|
7
|
+
`rails console` or `./script/console` in respect to Rails 2 or 3. For
|
8
|
+
example, it works for:
|
9
|
+
|
10
|
+
rib auto production
|
11
|
+
rib rails production
|
12
|
+
rib auto test --debugger # remember to add ruby-debug(19)? to Gemfile
|
13
|
+
rib auto test --sandbox
|
14
|
+
rib rails test --debugger --sandbox
|
15
|
+
|
16
|
+
It should also make Rails 3 print SQL log to stdout. Thanks tka.
|
17
|
+
|
3
18
|
## Rib 0.9.3 -- 2011-08-28
|
4
19
|
|
5
20
|
* [rib] Calling `Rib.shell` would no longer automatically `require 'rib/core'`
|
6
|
-
|
7
|
-
|
21
|
+
anymore. This is too messy. We should only do this in `bin/rib`. See:
|
22
|
+
commit #7a97441afeecae80f5493f4e8a4a6ba3044e2c33
|
8
23
|
|
9
|
-
|
10
|
-
|
24
|
+
require 'rib/more/anchor'
|
25
|
+
Rib.anchor 123
|
11
26
|
|
12
|
-
|
27
|
+
Should no longer crashed... Thanks Andrew.
|
13
28
|
|
14
29
|
## Rib 0.9.2 -- 2011-08-25
|
15
30
|
|
data/README.md
CHANGED
@@ -47,6 +47,14 @@ As Rails console
|
|
47
47
|
|
48
48
|
rib rails
|
49
49
|
|
50
|
+
You could also run in production and pass arguments normally as you'd do in
|
51
|
+
`rails console` or `./script/console`
|
52
|
+
|
53
|
+
rib rails production --sandbox --debugger
|
54
|
+
|
55
|
+
Note: You might need to add ruby-debug or ruby-debug19 to your Gemfile if
|
56
|
+
you're passing --debugger and using bundler together.
|
57
|
+
|
50
58
|
As Ramaze console
|
51
59
|
|
52
60
|
rib ramaze
|
@@ -56,6 +64,12 @@ it should be (for now, it's either Rails or Ramaze)
|
|
56
64
|
|
57
65
|
rib auto
|
58
66
|
|
67
|
+
If you're trying to use `rib auto` for a Rails app, you could also pass
|
68
|
+
arguments as if you were using `rib rails`. `rib auto` is merely passing
|
69
|
+
arguments.
|
70
|
+
|
71
|
+
rib auto production --sandbox --debugger
|
72
|
+
|
59
73
|
As a fully featured interactive Ruby shell (as ripl-rc)
|
60
74
|
|
61
75
|
rib all
|
data/lib/rib/app/rails.rb
CHANGED
@@ -16,22 +16,82 @@ module Rib::Rails
|
|
16
16
|
else
|
17
17
|
Rib::Rails.load_rails2
|
18
18
|
end
|
19
|
-
|
20
|
-
puts("Loading #{::Rails.env} environment (Rails #{::Rails.version})")
|
21
19
|
end
|
22
20
|
|
23
21
|
def load_rails2
|
22
|
+
optparse_env
|
23
|
+
Rib.silence{
|
24
|
+
# rails 2 is so badly written
|
25
|
+
require 'stringio'
|
26
|
+
stderr = $stderr
|
27
|
+
$stderr = StringIO.new
|
28
|
+
Object.const_set('RAILS_ENV', ENV['RAILS_ENV'])
|
29
|
+
$stderr = stderr
|
30
|
+
}
|
31
|
+
|
32
|
+
# copied from commands/console
|
24
33
|
['./config/environment',
|
25
34
|
'console_app' ,
|
26
35
|
'console_with_helpers'].each{ |f| require f }
|
36
|
+
|
37
|
+
optparse_rails
|
27
38
|
end
|
28
39
|
|
29
40
|
def load_rails3
|
30
|
-
|
31
|
-
'rails/console/app' ,
|
32
|
-
'rails/console/helpers'].each{ |f| require f }
|
41
|
+
optparse_env
|
33
42
|
|
43
|
+
# copied from rails/commands
|
44
|
+
require './config/application'
|
34
45
|
::Rails.application.require_environment!
|
46
|
+
|
47
|
+
optparse_rails
|
48
|
+
end
|
49
|
+
|
50
|
+
# copied from rails/commands/console
|
51
|
+
def optparse_env
|
52
|
+
# Has to set the RAILS_ENV before config/application is required
|
53
|
+
if ARGV.first && !ARGV.first.index("-") && env = ARGV.shift # has to shift the env ARGV so IRB doesn't freak
|
54
|
+
ENV['RAILS_ENV'] = %w(production development test).detect {|e| e =~ /^#{env}/} || env
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# copied from rails/commands/console
|
59
|
+
def optparse_rails
|
60
|
+
require 'optparse'
|
61
|
+
options = {}
|
62
|
+
|
63
|
+
OptionParser.new do |opt|
|
64
|
+
opt.banner = "Usage: console [environment] [options]"
|
65
|
+
opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |v| options[:sandbox] = v }
|
66
|
+
opt.on("--debugger", 'Enable ruby-debugging for the console.') { |v| options[:debugger] = v }
|
67
|
+
opt.parse!(ARGV)
|
68
|
+
end
|
69
|
+
|
70
|
+
# rails 3
|
71
|
+
if ::Rails.respond_to?(:application) && (app = ::Rails.application)
|
72
|
+
app.sandbox = options[:sandbox]
|
73
|
+
app.load_console
|
74
|
+
else
|
75
|
+
# rails 2
|
76
|
+
require 'console_sandbox' if options[:sandbox]
|
77
|
+
end
|
78
|
+
|
79
|
+
if options[:debugger]
|
80
|
+
begin
|
81
|
+
require 'ruby-debug'
|
82
|
+
puts "=> Debugger enabled"
|
83
|
+
rescue Exception
|
84
|
+
puts "You need to install ruby-debug to run the console in debugging mode. With gems, use 'gem install ruby-debug'"
|
85
|
+
exit
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
if options[:sandbox]
|
90
|
+
puts "Loading #{Rails.env} environment in sandbox (Rails #{Rails.version})"
|
91
|
+
puts "Any modifications you make will be rolled back on exit"
|
92
|
+
else
|
93
|
+
puts "Loading #{Rails.env} environment (Rails #{Rails.version})"
|
94
|
+
end
|
35
95
|
end
|
36
96
|
|
37
97
|
def rails?
|
data/lib/rib/version.rb
CHANGED
data/rib.gemspec
CHANGED
@@ -1,109 +1,100 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
-
s.name =
|
5
|
-
s.version = "0.9.
|
4
|
+
s.name = "rib"
|
5
|
+
s.version = "0.9.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = [
|
9
|
-
s.date =
|
10
|
-
s.description =
|
11
|
-
|
12
|
-
Rib is based on the design of [ripl][] and the work of [ripl-rc][], some of
|
13
|
-
the features are also inspired by [pry][]. The aim of Rib is to be fully
|
14
|
-
featured and yet very easy to opt-out or opt-in other features. It shall
|
15
|
-
be simple, lightweight and modular so that everyone could customize Rib.
|
16
|
-
|
17
|
-
[ripl]: https://github.com/cldwalker/ripl
|
18
|
-
[ripl-rc]: https://github.com/godfat/ripl-rc
|
19
|
-
[pry]: https://github.com/pry/pry}
|
20
|
-
s.email = [%q{godfat (XD) godfat.org}]
|
8
|
+
s.authors = ["Lin Jen-Shin (godfat)"]
|
9
|
+
s.date = "2011-09-01"
|
10
|
+
s.description = "Ruby-Interactive-ruBy -- Yet another interactive Ruby shell\n\nRib is based on the design of [ripl][] and the work of [ripl-rc][], some of\nthe features are also inspired by [pry][]. The aim of Rib is to be fully\nfeatured and yet very easy to opt-out or opt-in other features. It shall\nbe simple, lightweight and modular so that everyone could customize Rib.\n\n[ripl]: https://github.com/cldwalker/ripl\n[ripl-rc]: https://github.com/godfat/ripl-rc\n[pry]: https://github.com/pry/pry"
|
11
|
+
s.email = ["godfat (XD) godfat.org"]
|
21
12
|
s.executables = [
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
13
|
+
"rib",
|
14
|
+
"rib-all",
|
15
|
+
"rib-auto",
|
16
|
+
"rib-min",
|
17
|
+
"rib-rails",
|
18
|
+
"rib-ramaze"]
|
28
19
|
s.files = [
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
s.homepage =
|
92
|
-
s.require_paths = [
|
93
|
-
s.rubygems_version =
|
94
|
-
s.summary =
|
20
|
+
".gitignore",
|
21
|
+
".gitmodules",
|
22
|
+
".travis.yml",
|
23
|
+
"CHANGES.md",
|
24
|
+
"CONTRIBUTORS",
|
25
|
+
"Gemfile",
|
26
|
+
"LICENSE",
|
27
|
+
"README.md",
|
28
|
+
"Rakefile",
|
29
|
+
"TODO.md",
|
30
|
+
"bin/rib",
|
31
|
+
"bin/rib-all",
|
32
|
+
"bin/rib-auto",
|
33
|
+
"bin/rib-min",
|
34
|
+
"bin/rib-rails",
|
35
|
+
"bin/rib-ramaze",
|
36
|
+
"lib/rib.rb",
|
37
|
+
"lib/rib/all.rb",
|
38
|
+
"lib/rib/api.rb",
|
39
|
+
"lib/rib/app/auto.rb",
|
40
|
+
"lib/rib/app/rails.rb",
|
41
|
+
"lib/rib/app/ramaze.rb",
|
42
|
+
"lib/rib/config.rb",
|
43
|
+
"lib/rib/core.rb",
|
44
|
+
"lib/rib/core/completion.rb",
|
45
|
+
"lib/rib/core/history.rb",
|
46
|
+
"lib/rib/core/multiline.rb",
|
47
|
+
"lib/rib/core/readline.rb",
|
48
|
+
"lib/rib/core/squeeze_history.rb",
|
49
|
+
"lib/rib/core/strip_backtrace.rb",
|
50
|
+
"lib/rib/core/underscore.rb",
|
51
|
+
"lib/rib/debug.rb",
|
52
|
+
"lib/rib/extra/autoindent.rb",
|
53
|
+
"lib/rib/extra/hirb.rb",
|
54
|
+
"lib/rib/more.rb",
|
55
|
+
"lib/rib/more/anchor.rb",
|
56
|
+
"lib/rib/more/color.rb",
|
57
|
+
"lib/rib/more/edit.rb",
|
58
|
+
"lib/rib/more/multiline_history.rb",
|
59
|
+
"lib/rib/more/multiline_history_file.rb",
|
60
|
+
"lib/rib/plugin.rb",
|
61
|
+
"lib/rib/ripl.rb",
|
62
|
+
"lib/rib/runner.rb",
|
63
|
+
"lib/rib/shell.rb",
|
64
|
+
"lib/rib/test.rb",
|
65
|
+
"lib/rib/test/multiline.rb",
|
66
|
+
"lib/rib/version.rb",
|
67
|
+
"rib.gemspec",
|
68
|
+
"screenshot.png",
|
69
|
+
"task/.gitignore",
|
70
|
+
"task/gemgem.rb",
|
71
|
+
"test/core/test_completion.rb",
|
72
|
+
"test/core/test_history.rb",
|
73
|
+
"test/core/test_multiline.rb",
|
74
|
+
"test/core/test_readline.rb",
|
75
|
+
"test/core/test_squeeze_history.rb",
|
76
|
+
"test/core/test_underscore.rb",
|
77
|
+
"test/more/test_color.rb",
|
78
|
+
"test/more/test_multiline_history.rb",
|
79
|
+
"test/test_api.rb",
|
80
|
+
"test/test_plugin.rb",
|
81
|
+
"test/test_shell.rb"]
|
82
|
+
s.homepage = "https://github.com/godfat/rib"
|
83
|
+
s.require_paths = ["lib"]
|
84
|
+
s.rubygems_version = "1.8.10"
|
85
|
+
s.summary = "Ruby-Interactive-ruBy -- Yet another interactive Ruby shell"
|
95
86
|
s.test_files = [
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
87
|
+
"test/core/test_completion.rb",
|
88
|
+
"test/core/test_history.rb",
|
89
|
+
"test/core/test_multiline.rb",
|
90
|
+
"test/core/test_readline.rb",
|
91
|
+
"test/core/test_squeeze_history.rb",
|
92
|
+
"test/core/test_underscore.rb",
|
93
|
+
"test/more/test_color.rb",
|
94
|
+
"test/more/test_multiline_history.rb",
|
95
|
+
"test/test_api.rb",
|
96
|
+
"test/test_plugin.rb",
|
97
|
+
"test/test_shell.rb"]
|
107
98
|
|
108
99
|
if s.respond_to? :specification_version then
|
109
100
|
s.specification_version = 3
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-09-01 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bond
|
16
|
-
requirement: &
|
16
|
+
requirement: &2154274080 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2154274080
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: hirb
|
27
|
-
requirement: &
|
27
|
+
requirement: &2154273520 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2154273520
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: readline_buffer
|
38
|
-
requirement: &
|
38
|
+
requirement: &2154273040 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2154273040
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bacon
|
49
|
-
requirement: &
|
49
|
+
requirement: &2154272460 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2154272460
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rr
|
60
|
-
requirement: &
|
60
|
+
requirement: &2154271780 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2154271780
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
|
-
requirement: &
|
71
|
+
requirement: &2154270880 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2154270880
|
80
80
|
description: ! 'Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
|
81
81
|
|
82
82
|
|
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|
190
190
|
rubyforge_project:
|
191
|
-
rubygems_version: 1.8.
|
191
|
+
rubygems_version: 1.8.10
|
192
192
|
signing_key:
|
193
193
|
specification_version: 3
|
194
194
|
summary: Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
|