rails-sh 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,8 +1,6 @@
1
1
  = rails-sh
2
2
 
3
- The Rails Shell to execute sub commands of rails quickly.
4
-
5
- This only supports Rails3 :)
3
+ rails-sh is a mini shell for rails3 that provides a uniform and quick access to commands.
6
4
 
7
5
  == Install
8
6
 
@@ -13,7 +11,13 @@ This only supports Rails3 :)
13
11
  $ cd your-rails3-app
14
12
  $ rails-sh
15
13
 
16
- == Example
14
+ You can specify an environment as follows:
15
+
16
+ $ rails-sh test
17
+
18
+ == Examples
19
+
20
+ Generate a controller:
17
21
 
18
22
  rails> g controller foo bar
19
23
  $ rails g controller foo bar
@@ -29,9 +33,32 @@ This only supports Rails3 :)
29
33
  invoke test_unit
30
34
  create test/unit/helpers/foo_helper_test.rb
31
35
 
36
+ Run console:
37
+
38
+ rails> console
39
+
40
+ use `irb_exit` to exit from console.
41
+
42
+ Print routes:
43
+
32
44
  rails> routes
33
45
  foo_bar GET /foo/bar(.:format) {:controller=>"foo", :action=>"bar"}
34
46
 
47
+ == Commands
48
+
49
+ * generate
50
+ * destroy
51
+ * plugin
52
+ * benchmarker
53
+ * profiler
54
+ * console
55
+ * server
56
+ * dbconsole
57
+ * application
58
+ * runner
59
+ * routes
60
+ * exit
61
+
35
62
  == Contributing to rails-sh
36
63
 
37
64
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.1.0
data/bin/rails-sh CHANGED
@@ -7,8 +7,6 @@ require File.expand_path('./config/boot')
7
7
  require APP_PATH
8
8
  Rails.application.require_environment!
9
9
 
10
- puts "Rails.env: #{Rails.env}"
11
-
12
10
  $:.unshift File.expand_path('../../lib', __FILE__)
13
11
  require 'rails/sh'
14
12
  Rails::Sh.start
data/lib/rails/sh.rb CHANGED
@@ -9,6 +9,8 @@ module Rails
9
9
 
10
10
  class << self
11
11
  def start
12
+ puts "Rails.env: #{Rails.env}"
13
+ puts "type `help` to print help"
12
14
  setup_readline
13
15
  while buf = Readline.readline("\e[42mrails>\e[0m ", true)
14
16
  line = buf.strip
@@ -35,6 +35,17 @@ Rails::Sh::Command.define 'exit' do
35
35
  _exit
36
36
  end
37
37
 
38
+ Rails::Sh::Command.define 'help' do
39
+ Rails::Sh.execute_rails_command('--help')
40
+ puts <<-HELP
41
+
42
+ The rails-sh commands are:
43
+ help print help
44
+ routes print routes
45
+ exit exit from rails-sh
46
+ HELP
47
+ end
48
+
38
49
  Rails::Sh::Command.define 'routes' do |controller|
39
50
  Rails.application.reload_routes!
40
51
  all_routes = Rails.application.routes.routes
@@ -16,7 +16,7 @@ describe Rails::Sh::Command do
16
16
  end
17
17
 
18
18
  it 'We can get command names' do
19
- Rails::Sh::Command.command_names.should =~ [:exit, :foo, :routes]
19
+ Rails::Sh::Command.command_names.should =~ [:exit, :foo, :help, :routes]
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
+ - 1
7
8
  - 0
8
- - 3
9
- version: 1.0.3
9
+ version: 1.1.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - jugyo
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-24 00:00:00 +09:00
17
+ date: 2011-01-25 00:00:00 +09:00
18
18
  default_executable: rails-sh
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -113,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- hash: -2667775157488192115
116
+ hash: -794054863153019561
117
117
  segments:
118
118
  - 0
119
119
  version: "0"