Skip to content

Commit 06f37bf

Browse files
committed
- Remove Colsole and Exec modules
1 parent c95b759 commit 06f37bf

File tree

44 files changed

+173
-316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+173
-316
lines changed

Gemfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
source "https://rubygems.org"
22

3-
gemspec
3+
gem 'runfile-tasks'
4+
gem 'cucumber'
5+
gem 'rspec-expectations'
6+
gem 'rdoc'
7+
gem 'similar_text'
8+
gem 'byebug'
9+
gem 'colsole'
410

5-
group :development do
6-
gem 'runfile-tasks'
7-
gem 'cucumber'
8-
gem 'rspec-expectations'
9-
gem 'rdoc'
10-
gem 'similar_text'
11-
gem 'byebug'
12-
end
11+
gemspec

Runfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
require "runfile-tasks"
22
require "yaml"
3+
require "colsole"
4+
require "byebug"
5+
6+
include Colsole
37

48
title "Runfile Runfile"
59
summary "Runfile tasks for building the Runfile gem"

bin/run

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ require 'runfile'
55
# for dev
66
# require File.dirname(__FILE__) + "/../lib/runfile"
77

8-
include Colsole
98
include Runfile::DSL
109

1110
Runfile::Runner.instance.execute ARGV

bin/run!

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ require 'runfile'
1111
# for dev
1212
# require File.dirname(__FILE__) + "/../lib/runfile"
1313

14-
include Colsole
1514
include Runfile::DSL
1615

1716
Runfile::Runner.instance.execute ARGV, false

examples/a_minimal/Runfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
usage "greet <name>"
22
help "Say hello to <name>"
33
action :greet do |args|
4-
say "Hello #{args['<name>']}"
4+
puts "Hello #{args['<name>']}"
55
end

examples/b_basic/Runfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# include colsole, for easy color output
2+
require 'colsole'
3+
include Colsole
4+
15
# define the application itself
26
title "Runner"
37
summary "The first ever Runfile program"

examples/c_documented/Runfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# each Runfile may have a summary and a version. Both are optional.
44
#---
55

6+
# optionally, include colsole, for easy color output (for the method 'say')
7+
require 'colsole'
8+
include Colsole
9+
610
# title sets the title of the application (default: 'Runfile').
711
title "Runner"
812

examples/d_realistic/Runfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ usage "compile <source> <dest> [--quick]"
55
help "Compile <source> to <dest>"
66
option "-q --quick", "Make everything quicker"
77
action :compile do |args|
8-
say "!txtred!Compiling #{args['<source>']}... "
8+
puts "Compiling #{args['<source>']}... "
99
sleep 3 unless args['--quick']
10-
say "!txtgrn!done"
11-
say "Output is saved to #{args['<dest>']}"
10+
puts "done"
11+
puts "Output is saved to #{args['<dest>']}"
1212
end
1313

1414
usage "download <url> [<outfile>] [-CIq]"
1515
help "Download HTML and images from <url>. Use the --quick flag to download quickly."
1616
option "-C --no-cache", "Bypass cache"
1717
option "-I --no-img" , "Do not download images"
1818
action :download do |args|
19-
say "!txtred!Downloading #{args['<url>']}... "
19+
puts "Downloading #{args['<url>']}... "
2020
sleep 3 unless args['--quick']
21-
say "!txtgrn!downloaded"
22-
say "!txtred!cache was bypassed" if args['--no-cache']
21+
puts "downloaded"
22+
puts "cache was bypassed" if args['--no-cache']
2323
end

examples/e_optionals/Runfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
action :explain do
2-
say "Actions without arguments do not need 'usage'"
2+
puts "Actions without arguments do not need 'usage'"
33
end
44

55
usage "greet <name>"
66
action :greet do |args|
7-
say "Hello #{args['<name>']}"
7+
puts "Hello #{args['<name>']}"
88
end
99

1010
help "Say bye"
1111
action :bye do
12-
say "Here we added help to an action without usage... "
13-
say "!txtgrn!and it works!"
12+
puts "Here we added help to an action without usage... "
1413
end
1514

examples/f_namespace/Runfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# this is a globel action
22
action :greet do
3-
say "Hello"
3+
puts "Hello"
44
end
55

66
# define a "super command" (namespace).
@@ -11,24 +11,24 @@ command "make"
1111
# will be stored as ":make_custard".
1212
usage "custard"
1313
action :custard do
14-
say "Making custard..."
14+
puts "Making custard..."
1515
end
1616

1717
usage "jam"
1818
action :jam do
19-
say "Making jam..."
19+
puts "Making jam..."
2020
end
2121

2222
usage "meat [--mix]"
2323
option "--mix", "Mix all the ingredients. Good."
2424
action :meat do |args|
25-
say "Making meat..."
26-
say "...and mixing it all up" if args['--mix']
25+
puts "Making meat..."
26+
puts "...and mixing it all up" if args['--mix']
2727
end
2828

2929
# return back to global namespace
3030
command
3131

3232
action :eat do
33-
say "Custard? Good! Jam? Good! Meat? Good!!!"
33+
puts "Custard? Good! Jam? Good! Meat? Good!!!"
3434
end

0 commit comments

Comments
 (0)