rails-sh 1.0.0 → 1.0.1
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.
- data/README.rdoc +4 -0
- data/VERSION +1 -1
- data/lib/rails/sh.rb +3 -2
- data/lib/rails/sh/command.rb +5 -1
- data/spec/rails/sh/command_spec.rb +4 -0
- metadata +3 -3
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/lib/rails/sh.rb
CHANGED
@@ -11,7 +11,9 @@ module Rails
|
|
11
11
|
def start
|
12
12
|
setup_readline
|
13
13
|
while buf = Readline.readline("\e[42mrails>\e[0m ", true)
|
14
|
-
|
14
|
+
line = buf.strip
|
15
|
+
next if line.empty?
|
16
|
+
execute(line)
|
15
17
|
setup_readline
|
16
18
|
end
|
17
19
|
end
|
@@ -24,7 +26,6 @@ module Rails
|
|
24
26
|
end
|
25
27
|
|
26
28
|
def execute(line)
|
27
|
-
line = line.strip
|
28
29
|
if command = Command.find(line)
|
29
30
|
arg = line[/\s+\w+/].strip rescue nil
|
30
31
|
command.call(arg)
|
data/lib/rails/sh/command.rb
CHANGED
@@ -11,6 +11,10 @@ describe Rails::Sh::Command do
|
|
11
11
|
Rails::Sh::Command.find('foo').should eq(@block)
|
12
12
|
end
|
13
13
|
|
14
|
+
it 'We can find nil with wrong name' do
|
15
|
+
Rails::Sh::Command.find('bar').should eq(nil)
|
16
|
+
end
|
17
|
+
|
14
18
|
it 'We can get command names' do
|
15
19
|
Rails::Sh::Command.command_names.should =~ [:exit, :foo, :routes]
|
16
20
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 1
|
9
|
+
version: 1.0.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- jugyo
|
@@ -113,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
113
|
requirements:
|
114
114
|
- - ">="
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
hash: -
|
116
|
+
hash: -1888015006894182058
|
117
117
|
segments:
|
118
118
|
- 0
|
119
119
|
version: "0"
|