dev 2.1.153 → 2.1.154
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.
- checksums.yaml +4 -4
- data/lib/apps/git.rb +207 -208
- data/lib/apps/msbuild.rb +90 -90
- data/lib/apps/nbench.rb +2 -1
- data/lib/apps/nuget.rb +57 -59
- data/lib/apps/svn.rb +137 -143
- data/lib/apps/wix.rb +47 -50
- data/lib/apps/xcodebuild.rb +13 -11
- data/lib/apps/zip.rb +25 -25
- data/lib/apps.rb +3 -1
- data/lib/base/array.rb +66 -64
- data/lib/base/command.rb +237 -238
- data/lib/base/dir.rb +73 -76
- data/lib/base/environment.rb +94 -99
- data/lib/base/file.rb +35 -33
- data/lib/base/gemspec.rb +47 -45
- data/lib/base/giturl.rb +88 -90
- data/lib/base/hash.rb +20 -15
- data/lib/base/history.rb +36 -33
- data/lib/base/internet.rb +22 -20
- data/lib/base/project.rb +410 -423
- data/lib/base/projects.rb +231 -246
- data/lib/base/source.rb +22 -20
- data/lib/base/string.rb +6 -4
- data/lib/base/text.rb +16 -14
- data/lib/base/timeout.rb +29 -28
- data/lib/base/timer.rb +23 -19
- data/lib/base/version.rb +68 -72
- data/lib/base.rb +5 -3
- data/lib/commands.rb +47 -43
- data/lib/dev.config.rb +3 -2
- data/lib/dev.rb +65 -66
- data/lib/tasks/add.rb +34 -40
- data/lib/tasks/analyze.rb +17 -15
- data/lib/tasks/build.rb +101 -103
- data/lib/tasks/clean.rb +6 -4
- data/lib/tasks/clobber.rb +20 -18
- data/lib/tasks/commit.rb +42 -44
- data/lib/tasks/default.rb +41 -39
- data/lib/tasks/doc.rb +10 -8
- data/lib/tasks/info.rb +8 -7
- data/lib/tasks/package.rb +23 -20
- data/lib/tasks/publish.rb +20 -25
- data/lib/tasks/pull.rb +9 -9
- data/lib/tasks/push.rb +11 -13
- data/lib/tasks/setup.rb +180 -183
- data/lib/tasks/test.rb +121 -107
- data/lib/tasks/update.rb +13 -11
- data/lib/tasks.rb +38 -42
- metadata +7 -9
- data/bin/dev +0 -3
data/lib/base/timeout.rb
CHANGED
@@ -1,25 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
############################################################################
|
2
|
-
# The following code is based on code originally copied from
|
4
|
+
# The following code is based on code originally copied from
|
3
5
|
# https://gist.github.com/lpar/1032297
|
4
6
|
# Gist title: lpar/timeout.rb
|
5
7
|
############################################################################
|
6
8
|
# Runs a specified shell command in a separate thread.
|
7
9
|
# If it exceeds the given timeout in seconds, kills it.
|
8
10
|
# Returns any output produced by the command (stdout or stderr) as a String.
|
9
|
-
# Uses Kernel.select to wait up to the tick length (in seconds) between
|
11
|
+
# Uses Kernel.select to wait up to the tick length (in seconds) between
|
10
12
|
# checks on the command's status
|
11
13
|
#
|
12
14
|
# If you've got a cleaner way of doing this, I'd be interested to see it.
|
13
15
|
# If you think you can do it with Ruby's Timeout module, think again.
|
14
|
-
def run_with_timeout(directory,command, timeout, tick)
|
15
|
-
output =
|
16
|
-
exit_code=1
|
16
|
+
def run_with_timeout(directory, command, timeout, tick)
|
17
|
+
output = ""
|
18
|
+
exit_code = 1
|
17
19
|
|
18
|
-
Open3.popen2e(command, :
|
20
|
+
Open3.popen2e(command, chdir: directory) do |_stdin, stderrout, thread|
|
19
21
|
pid = thread.pid
|
20
22
|
|
21
23
|
start = Time.now
|
22
|
-
while (Time.now - start) < timeout
|
24
|
+
while ((Time.now - start) < timeout) && thread.alive?
|
23
25
|
# Wait up to `tick` seconds for output/error data
|
24
26
|
Kernel.select([stderrout], nil, nil, tick)
|
25
27
|
# Try to read the data
|
@@ -29,14 +31,14 @@ def run_with_timeout(directory,command, timeout, tick)
|
|
29
31
|
# A read would block, so loop around for another select
|
30
32
|
rescue EOFError
|
31
33
|
# Command has completed, not really an error...
|
32
|
-
exit_code=wait_thread.value
|
34
|
+
exit_code = wait_thread.value
|
33
35
|
break
|
34
36
|
end
|
35
37
|
|
36
38
|
sleep(0.5)
|
37
39
|
end
|
38
40
|
|
39
|
-
exit_code=wait_thread.value
|
41
|
+
exit_code = wait_thread.value
|
40
42
|
|
41
43
|
# Give Ruby time to clean up the other thread
|
42
44
|
sleep 1
|
@@ -45,14 +47,13 @@ def run_with_timeout(directory,command, timeout, tick)
|
|
45
47
|
# We need to kill the process, because killing the thread leaves
|
46
48
|
# the process alive but detached, annoyingly enough.
|
47
49
|
Process.kill("TERM", pid)
|
48
|
-
exit_code=5
|
50
|
+
exit_code = 5
|
49
51
|
end
|
52
|
+
end
|
50
53
|
|
51
|
-
|
52
|
-
|
54
|
+
[output, exit_code]
|
55
|
+
end
|
53
56
|
|
54
|
-
return [output,exit_code]
|
55
|
-
end
|
56
57
|
# begin
|
57
58
|
# # Start task in another thread, which spawns a process
|
58
59
|
# stdin, stderrout, thread = Open3.popen2e(command, :chdir=>directory)
|
@@ -79,8 +80,8 @@ end
|
|
79
80
|
# sleep 1
|
80
81
|
|
81
82
|
# if thread.alive?
|
82
|
-
|
83
|
-
|
83
|
+
# We need to kill the process, because killing the thread leaves
|
84
|
+
# the process alive but detached, annoyingly enough.
|
84
85
|
# Process.kill("TERM", pid)
|
85
86
|
# exit_code=5
|
86
87
|
# else
|
@@ -92,30 +93,30 @@ end
|
|
92
93
|
# stderrout.close if stderrout
|
93
94
|
# end
|
94
95
|
# return [output,exit_code]
|
95
|
-
#end
|
96
|
+
# end
|
97
|
+
|
98
|
+
require "timeout"
|
96
99
|
|
97
|
-
|
98
|
-
def run_with_timeout2(directory,command,timeout)
|
100
|
+
def run_with_timeout2(directory, command, timeout)
|
99
101
|
# stdout, stderr pipes
|
100
102
|
rout, wout = IO.pipe
|
101
103
|
rerr, werr = IO.pipe
|
102
|
-
output=
|
103
|
-
error=
|
104
|
-
exit_code=1
|
105
|
-
pid = Process.spawn(command, :
|
104
|
+
output = ""
|
105
|
+
error = ""
|
106
|
+
exit_code = 1
|
107
|
+
pid = Process.spawn(command, chdir: directory, out: wout, err: werr)
|
106
108
|
begin
|
107
109
|
Timeout.timeout(timeout) do
|
108
110
|
exit_code = Process.wait2(pid)
|
109
111
|
output = rout.readlines.join("\n")
|
110
112
|
error = rerr.readlines.join("\n")
|
111
113
|
end
|
112
|
-
rescue
|
113
|
-
Proces.kill(
|
114
|
-
output = output
|
114
|
+
rescue StandardError
|
115
|
+
Proces.kill("TERM", pid)
|
116
|
+
output = "#{output}timeout occurred."
|
115
117
|
ensure
|
116
118
|
rout.close
|
117
119
|
rerr.close
|
118
120
|
end
|
119
|
-
[output,exit_code]
|
121
|
+
[output, exit_code]
|
120
122
|
end
|
121
|
-
|
data/lib/base/timer.rb
CHANGED
@@ -1,45 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
puts __FILE__ if defined?(DEBUG)
|
2
4
|
|
3
5
|
class Timer
|
4
6
|
attr_accessor :start_time
|
5
7
|
|
6
8
|
def initialize
|
7
|
-
@start_time=Time.now
|
9
|
+
@start_time = Time.now
|
8
10
|
end
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
+
# in seconds
|
13
|
+
def elapsed
|
14
|
+
Time.now - @start_time
|
12
15
|
end
|
13
16
|
|
14
17
|
def elapsed_str
|
15
|
-
elapsed_str="["
|
18
|
+
elapsed_str = "[#{"%.0f" % elapsed}s]"
|
16
19
|
end
|
17
20
|
|
18
|
-
def self.elapsed_exceeds?(name,duration_seconds)
|
19
|
-
if
|
20
|
-
|
21
|
-
|
22
|
-
return false
|
21
|
+
def self.elapsed_exceeds?(name, duration_seconds)
|
22
|
+
return true if Timer.get_elapsed(name).nil? || Timer.get_elapsed(name) > duration_seconds
|
23
|
+
|
24
|
+
false
|
23
25
|
end
|
24
26
|
|
25
27
|
def self.get_elapsed(name)
|
26
|
-
timestamp=get_timestamp(name)
|
27
|
-
|
28
|
-
|
28
|
+
timestamp = get_timestamp(name)
|
29
|
+
return Time.now - timestamp unless timestamp.nil?
|
30
|
+
|
31
|
+
nil
|
29
32
|
end
|
30
33
|
|
31
34
|
def self.get_timestamp(name)
|
32
|
-
dir=Rake.application.original_dir
|
33
|
-
if
|
35
|
+
dir = Rake.application.original_dir
|
36
|
+
if File.exist?("#{DEV[:dev_root]}/log/#{name}.timestamp")
|
34
37
|
return Time.parse(File.read("#{DEV[:dev_root]}/log/#{name}.timestamp").strip)
|
35
|
-
|
36
|
-
|
38
|
+
end
|
39
|
+
|
40
|
+
nil
|
37
41
|
end
|
38
42
|
|
39
43
|
def self.set_timestamp(name)
|
40
|
-
Dir.mkdir("#{DEV_TASKS[:dev_root]}/log")
|
41
|
-
File.open("#{DEV_TASKS[:dev_root]}/log/#{name}.timestamp",
|
44
|
+
Dir.mkdir("#{DEV_TASKS[:dev_root]}/log") unless Dir.exist?("#{DEV_TASKS[:dev_root]}/log")
|
45
|
+
File.open("#{DEV_TASKS[:dev_root]}/log/#{name}.timestamp", "w") { |f| f.puts(Time.now.to_s) }
|
42
46
|
end
|
43
47
|
end
|
44
48
|
|
45
|
-
TIMER=Timer.new
|
49
|
+
TIMER = Timer.new
|
data/lib/base/version.rb
CHANGED
@@ -1,83 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Version
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
4
|
+
def self.extract(text)
|
5
|
+
[/VERSION\s*=\s*['"]([\d.]+)['"]/,
|
6
|
+
/[Vv]ersion\s*=\s*['"]([\d.]+)['"]/,
|
7
|
+
/Version\(\s*"([\d.]+)"\s*\)/].each do |regex|
|
8
|
+
scan = text.scan(regex)
|
9
|
+
return scan[0][0] if !scan.nil? && (scan.length.positive? && !scan[0].nil? && scan[0].length.positive?)
|
10
|
+
end
|
11
|
+
nil
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.extract_from_file(filename)
|
15
|
+
Version.extract IO.read(filename)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.extract_from_filelist(filelist)
|
19
|
+
version = nil
|
20
|
+
filelist.each do |f|
|
21
|
+
version = extract_from_file f
|
22
|
+
return version unless version.nil?
|
23
|
+
end
|
24
|
+
nil
|
25
|
+
end
|
13
26
|
|
14
|
-
|
15
|
-
|
16
|
-
|
27
|
+
def self.update_text(text, version)
|
28
|
+
text = text.gsub(/version\s*=\s*'[\d.]+'/, "version='#{version}'")
|
29
|
+
text = text.gsub(/VERSION\s*=\s*'[\d.]+'/, "VERSION='#{version}'")
|
30
|
+
text = text.gsub(/version\s*=\s*"[\d.]+"/, "version=\"#{version}\"")
|
31
|
+
text = text.gsub(/Version\s*=\s*'[\d.]+'/, "Version='#{version}'")
|
32
|
+
text = text.gsub(/Version\s*=\s*"[\d.]+"/, "Version=\"#{version}\"")
|
33
|
+
text = text.gsub(/Version\(\s*"[\d.]+"\s*\)/, "Version(\"#{version}\")")
|
34
|
+
text = text.gsub(/Name\s*=\s*"Version"\s*Value\s*=\s*"[\d.]+"/, "Name=\"Version\" Value=\"#{version}\"")
|
35
|
+
end
|
17
36
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
37
|
+
def self.update_file(filename, version)
|
38
|
+
if File.exist?(filename)
|
39
|
+
orig = IO.read(filename)
|
40
|
+
text = Version.update_text orig, version
|
41
|
+
File.open(filename, "w") { |f| f.write(text) } if orig != text
|
42
|
+
end
|
43
|
+
end
|
26
44
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
text=text.gsub(/version\s*=\s*"[\d.]+"/,"version=\"#{version}\"")
|
31
|
-
text=text.gsub(/Version\s*=\s*'[\d.]+'/,"Version='#{version}'")
|
32
|
-
text=text.gsub(/Version\s*=\s*"[\d.]+"/,"Version=\"#{version}\"")
|
33
|
-
text=text.gsub(/Version\(\s*"[\d.]+"\s*\)/,"Version(\"#{version}\")")
|
34
|
-
text=text.gsub(/Name\s*=\s*"Version"\s*Value\s*=\s*"[\d.]+"/,"Name=\"Version\" Value=\"#{version}\"")
|
45
|
+
def self.update_filelist(filelist, version)
|
46
|
+
filelist.each do |f|
|
47
|
+
Version.update_file f, version
|
35
48
|
end
|
49
|
+
end
|
36
50
|
|
37
|
-
|
38
|
-
|
39
|
-
orig=IO.read(filename)
|
40
|
-
text=Version.update_text orig,version
|
41
|
-
File.open(filename,'w'){|f|f.write(text)} if(orig!=text)
|
42
|
-
end
|
43
|
-
end
|
51
|
+
def self.read(filename)
|
52
|
+
return Gem::Specification.load(filename).version.to_s if filename.include?(".gemspec")
|
44
53
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
49
|
-
end
|
54
|
+
if filename.include?("AssemblyInfo.cs")
|
55
|
+
scan = IO.read(filename).scan(/Version\("([\d.]+)"\)/)
|
56
|
+
return scan[0][0] if !scan.nil? && (scan.length.positive? && !scan[0].nil? && scan[0].length.positive?)
|
50
57
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
end
|
58
|
-
#return IO.read(filename).scan(/Version\(\"([\d.]+)\"\)/)[0][0]
|
59
|
-
scan=IO.read(filename).scan(/Version=\"([\d.]+)\"/)
|
60
|
-
if(!scan.nil?)
|
61
|
-
return scan[0][0] if(scan.length > 0 && !scan[0].nil? && scan[0].length > 0)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
'0.0'
|
65
|
-
end
|
58
|
+
# return IO.read(filename).scan(/Version\(\"([\d.]+)\"\)/)[0][0]
|
59
|
+
scan = IO.read(filename).scan(/Version="([\d.]+)"/)
|
60
|
+
return scan[0][0] if !scan.nil? && (scan.length.positive? && !scan[0].nil? && scan[0].length.positive?)
|
61
|
+
end
|
62
|
+
"0.0"
|
63
|
+
end
|
66
64
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
65
|
+
def self.get_version
|
66
|
+
Dir.glob("**/*.gemspec").each do |gemspec|
|
67
|
+
return Version.read gemspec
|
68
|
+
end
|
69
|
+
Dir.glob("**/AssemblyInfo.cs").each do |assemblyInfo|
|
70
|
+
return Version.read assemblyInfo
|
71
|
+
end
|
72
|
+
Dir.glob("**/*.wxs").each do |wxs|
|
73
|
+
return Version.read wxs
|
74
|
+
end
|
75
|
+
"0.0"
|
76
|
+
end
|
79
77
|
end
|
80
78
|
|
81
|
-
|
82
|
-
VERSION=Version.get_version
|
83
|
-
end
|
79
|
+
VERSION = Version.get_version unless defined?(VERSION)
|
data/lib/base.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
puts __FILE__ if defined?(DEBUG)
|
2
4
|
|
3
|
-
[
|
4
|
-
|
5
|
-
|
5
|
+
%w[array command dir environment file gemspec
|
6
|
+
hash history internet project projects source
|
7
|
+
string text timeout timer version].each { |name| require_relative("base/#{name}.rb") }
|
data/lib/commands.rb
CHANGED
@@ -1,51 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
if defined?(DEBUG)
|
2
|
-
|
3
|
-
|
4
|
+
puts DELIMITER
|
5
|
+
puts __FILE__
|
4
6
|
end
|
5
7
|
|
6
|
-
require_relative(
|
8
|
+
require_relative("apps")
|
9
|
+
|
10
|
+
require "json"
|
11
|
+
require "rake/clean"
|
12
|
+
require "pp"
|
7
13
|
|
8
|
-
|
9
|
-
require
|
10
|
-
|
14
|
+
Dir.glob("#{File.dirname(__FILE__)}/tasks/*.rb").sort.each do |rb|
|
15
|
+
require(rb) unless rb.include?("default")
|
16
|
+
end
|
11
17
|
|
12
|
-
Dir.glob("#{File.dirname(__FILE__)}/tasks/*.rb").each{|rb|
|
13
|
-
require(rb) if !rb.include?('default')
|
14
|
-
}
|
15
18
|
class Commands < Hash
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
19
|
+
attr_accessor :env
|
20
|
+
|
21
|
+
def initialize(env = nil, directory = Rake.application.original_dir)
|
22
|
+
@env = env
|
23
|
+
@env = Environment.new if @env.nil?
|
24
|
+
Dir.chdir(directory) do
|
25
|
+
self[:pull] = Pull.new
|
26
|
+
self[:update] = Update.new
|
27
|
+
self[:setup] = Setup.new
|
28
|
+
self[:build] = Build.new
|
29
|
+
self[:test] = Test.new
|
30
|
+
self[:analyze] = Analyze.new
|
31
|
+
self[:doc] = Doc.new
|
32
|
+
self[:package] = Package.new
|
33
|
+
self[:publish] = Publish.new
|
34
|
+
self[:add] = Add.new
|
35
|
+
self[:commit] = Commit.new
|
36
|
+
self[:push] = Push.new
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def info
|
41
|
+
puts "Commands"
|
42
|
+
each do |k, v|
|
43
|
+
v.update if v.respond_to? "update"
|
44
|
+
next unless v.length.positive?
|
45
|
+
|
46
|
+
puts " #{k}"
|
47
|
+
v.each do |c|
|
48
|
+
puts " #{c[:input]}" unless c.is_a?(Hash)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
48
52
|
end
|
49
53
|
|
50
|
-
COMMANDS=Commands.new
|
51
|
-
MSBUILD=MSBuild.new
|
54
|
+
COMMANDS = Commands.new
|
55
|
+
MSBUILD = MSBuild.new
|
data/lib/dev.config.rb
CHANGED
data/lib/dev.rb
CHANGED
@@ -1,81 +1,80 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
DELIMITER = "==================================================================================="
|
2
4
|
puts DELIMITER if defined?(DEBUG)
|
3
5
|
puts __FILE__ if defined?(DEBUG)
|
4
6
|
|
5
|
-
require_relative(
|
6
|
-
require_relative(
|
7
|
-
require_relative(
|
8
|
-
require_relative(
|
9
|
-
require_relative(
|
10
|
-
require_relative(
|
7
|
+
require_relative("base")
|
8
|
+
require_relative("base/string")
|
9
|
+
require_relative("base/environment")
|
10
|
+
require_relative("base/giturl")
|
11
|
+
require_relative("base/projects")
|
12
|
+
require_relative("commands")
|
11
13
|
|
12
14
|
class Dev
|
13
|
-
|
15
|
+
attr_accessor :env, :projects, :commands
|
16
|
+
|
17
|
+
def initialize(env = nil)
|
18
|
+
@env = Environment.new(env) if !env.nil? && env.is_a?(Hash)
|
19
|
+
@env = Environment.new if @env.nil?
|
20
|
+
@projects = Projects.new(@env)
|
21
|
+
@commands = Commands.new(@env)
|
22
|
+
@output = ""
|
23
|
+
end
|
14
24
|
|
15
|
-
|
16
|
-
|
17
|
-
@env=Environment.new() if @env.nil?
|
18
|
-
@projects=Projects.new(@env)
|
19
|
-
@commands=Commands.new(@env)
|
20
|
-
@output=''
|
21
|
-
end
|
22
|
-
|
23
|
-
def execute args
|
24
|
-
args=args.split(' ') if(args.kind_of?(String))
|
25
|
+
def execute(args)
|
26
|
+
args = args.split(" ") if args.is_a?(String)
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
words=arg.split('=')
|
30
|
-
if(words.length==2)
|
31
|
-
ENV[words[0]]=words[1]
|
32
|
-
end
|
33
|
-
end
|
34
|
-
}
|
28
|
+
# parse arguments that are of the form KEY=VALUE
|
29
|
+
args.each do |arg|
|
30
|
+
next unless arg.include?("=")
|
35
31
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
subcommand=args[0] if args.length > 0
|
40
|
-
subargs=Array.new
|
41
|
-
subargs=args[1,args.length-1] if args.length > 1
|
32
|
+
words = arg.split("=")
|
33
|
+
ENV[words[0]] = words[1] if words.length == 2
|
34
|
+
end
|
42
35
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
return projects.remove(subargs) if subcommand=='remove'
|
50
|
-
return projects.work(subargs) if subcommand=='work'
|
51
|
-
return projects.update(subargs) if subcommand=='update'
|
36
|
+
if args.length.zero?
|
37
|
+
usage
|
38
|
+
else
|
39
|
+
subcommand = args[0] if args.length.positive?
|
40
|
+
subargs = []
|
41
|
+
subargs = args[1, args.length - 1] if args.length > 1
|
52
42
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
43
|
+
return projects.add(subargs) if subcommand == "add"
|
44
|
+
return projects.clobber(subargs) if subcommand == "clobber"
|
45
|
+
return projects.import(subargs) if subcommand == "import"
|
46
|
+
return projects.list(subargs) if subcommand == "list"
|
47
|
+
return projects.make(subargs) if subcommand == "make"
|
48
|
+
return projects.info(subargs) if subcommand == "info"
|
49
|
+
return projects.remove(subargs) if subcommand == "remove"
|
50
|
+
return projects.work(subargs) if subcommand == "work"
|
51
|
+
return projects.update(subargs) if subcommand == "update"
|
57
52
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
53
|
+
@env.out "unknown command: '#{subcommand}'"
|
54
|
+
1
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def usage
|
59
|
+
return 0
|
60
|
+
@env.out "usage: dev <subcommand> [options]"
|
61
|
+
@env.out ""
|
62
|
+
@env.out "available subcommands"
|
63
|
+
@env.out " help"
|
64
|
+
@env.out " list"
|
65
|
+
@env.out " make"
|
66
|
+
@env.out " info"
|
67
|
+
@env.out " work"
|
68
|
+
@env.out ""
|
69
|
+
@env.out "Type 'dev help <subcommand>' for help on a specific subcommand.'"
|
70
|
+
0
|
71
|
+
end
|
72
72
|
end
|
73
73
|
|
74
|
-
require_relative(
|
75
|
-
require_relative(
|
76
|
-
require_relative(
|
74
|
+
require_relative("base")
|
75
|
+
require_relative("tasks")
|
76
|
+
require_relative("commands")
|
77
77
|
|
78
78
|
puts "defining DEV" if Environment.default.debug?
|
79
|
-
DEV=Dev.new
|
80
|
-
require_relative(
|
81
|
-
|
79
|
+
DEV = Dev.new
|
80
|
+
require_relative("tasks/default")
|