scripting 0.2.0 → 0.2.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/VERSION +1 -1
- data/lib/scripting/commands.rb +1 -1
- data/scripting.gemspec +1 -1
- data/spec/commands_spec.rb +4 -7
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/scripting/commands.rb
CHANGED
@@ -40,7 +40,7 @@ module Scripting
|
|
40
40
|
|
41
41
|
help do
|
42
42
|
$stderr.puts "\nAvailable commands:"
|
43
|
-
max_width = options.commands.keys.collect
|
43
|
+
max_width = options.commands.keys.collect { |key| key.to_s.length }.max
|
44
44
|
options.commands.each do |k,v|
|
45
45
|
$stderr.puts sprintf(" %*s: %s", max_width, k, v.description)
|
46
46
|
end
|
data/scripting.gemspec
CHANGED
data/spec/commands_spec.rb
CHANGED
@@ -47,21 +47,18 @@ describe Scripting::Commands::Command do
|
|
47
47
|
|
48
48
|
it "should run the specified command" do
|
49
49
|
@app.run! 'answer'
|
50
|
-
@stdout.should
|
50
|
+
@stdout.should == "42\n"
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should send arguments to the specified command" do
|
54
54
|
@app.run! %w{add 4 8}
|
55
|
-
@stdout.should
|
55
|
+
@stdout.should == "12.0\n"
|
56
56
|
end
|
57
57
|
|
58
58
|
it "should run the specified command as well as other work items" do
|
59
|
-
@app.
|
60
|
-
work { puts "Hello world!" }
|
61
|
-
end
|
59
|
+
@app.work { puts "Hello world!" }
|
62
60
|
@app.run! %w{echo to infinity and beyond!}
|
63
|
-
@stdout.should
|
64
|
-
@stdout.should include("Hello world!")
|
61
|
+
@stdout.should == "to infinity and beyond!\nHello world!\n"
|
65
62
|
end
|
66
63
|
|
67
64
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: scripting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- sdeming
|
@@ -92,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements:
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
hash:
|
95
|
+
hash: 4148192804319844985
|
96
96
|
segments:
|
97
97
|
- 0
|
98
98
|
version: "0"
|