dev 2.0.139 → 2.0.140

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/{git.rb → apps/git.rb} +0 -0
  3. data/lib/{msbuild.rb → apps/msbuild.rb} +0 -0
  4. data/lib/{clean.rb → apps/nuget.rb} +0 -0
  5. data/lib/{svn.rb → apps/svn.rb} +0 -0
  6. data/lib/{wix.rb → apps/wix.rb} +0 -0
  7. data/lib/{commands/array.rb → array.rb} +0 -0
  8. data/lib/command.rb +1 -1
  9. data/lib/commands.rb +29 -3
  10. data/lib/dev.rb +0 -14
  11. data/lib/{commands/gemspec.rb → gemspec.rb} +0 -0
  12. data/lib/{commands/hash.rb → hash.rb} +0 -0
  13. data/lib/{commands/internet.rb → internet.rb} +0 -0
  14. data/lib/project.rb +0 -1
  15. data/lib/projects.rb +0 -4
  16. data/lib/{commands → tasks}/add.rb +4 -1
  17. data/lib/{commands → tasks}/analyze.rb +0 -0
  18. data/lib/{commands → tasks}/build.rb +2 -3
  19. data/lib/tasks/clean.rb +8 -0
  20. data/lib/{clobber.rb → tasks/clobber.rb} +3 -0
  21. data/lib/{commands → tasks}/commit.rb +0 -2
  22. data/lib/{commands → tasks}/doc.rb +0 -2
  23. data/lib/{commands → tasks}/info.rb +0 -0
  24. data/lib/{commands → tasks}/publish.rb +1 -1
  25. data/lib/{commands → tasks}/pull.rb +2 -2
  26. data/lib/{commands → tasks}/push.rb +0 -0
  27. data/lib/{commands → tasks}/setup.rb +3 -0
  28. data/lib/tasks/tasks.rb +81 -0
  29. data/lib/{commands → tasks}/test.rb +0 -0
  30. data/lib/{commands → tasks}/update.rb +3 -0
  31. data/lib/tasks.rb +0 -1
  32. data/lib/{commands/text.rb → text.rb} +0 -0
  33. data/lib/{commands/timeout.rb → timeout.rb} +0 -0
  34. data/lib/{commands/timer.rb → timer.rb} +0 -0
  35. metadata +29 -35
  36. data/lib/commands/clean.rb +0 -12
  37. data/lib/commands/clobber.rb +0 -15
  38. data/lib/commands/command.rb +0 -230
  39. data/lib/commands/commands.rb +0 -36
  40. data/lib/commands/git.rb +0 -22
  41. data/lib/commands/tag.rb +0 -3
  42. data/lib/commands/upgrade.rb +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03dbd0206069539aff9ab21bdff101ecb7085686
4
- data.tar.gz: 0c40c997381f033e871762066e8a78a170e42343
3
+ metadata.gz: 257c38bbc2f26f92b4959dedc7baec5075b54857
4
+ data.tar.gz: 31c73655da50d2c6ce5447fb32daa18d987123f6
5
5
  SHA512:
6
- metadata.gz: efce37fb6f3341eba81c87eb91edc117d95c1113c2f76cdc3edbae21917151a4ccda00710e6df783c8cced13e5403526ef911634044aa5e7428e8356e749744b
7
- data.tar.gz: 9a5cbab4dde2c1ebcd727a284ee364dc1d65fc1e568c15570b7b9847f189734e0edaad8927e4f4a15fccf0de12cdfd28b4952f404ea67c810e340b2cc3f5df07
6
+ metadata.gz: a29e6db02c1e3dc6065d836fa8a30aaf0c1c84ccf6458bdc0b47cfdfe1ac5c08933b50a2a54fad63fa14e6c6a8969b7de44e9ae94e351971e5bc8a6e52df665d
7
+ data.tar.gz: 98a6a11db064608b9187f76bdce23e0c2784609311234107002691ca1db91d78d4707b9ba14b8ff48b2ecd7560c165a63a346e1e87a614a900e8c1255eb389fb
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/command.rb CHANGED
@@ -188,7 +188,7 @@ class Command < Hash
188
188
 
189
189
  def summary
190
190
  duration=""
191
- duration=getFormattedTimeSpan(self[:end_time]-[:start_time]) + " - " if(!self[:end_time].nil?)
191
+ duration=getFormattedTimeSpan(self[:end_time]-self[:start_time]) + " - " if(!self[:end_time].nil?)
192
192
  duration + "#{self[:exit_code].to_s} #{self[:input]} (#{self[:directory]})"
193
193
  end
194
194
 
data/lib/commands.rb CHANGED
@@ -1,12 +1,38 @@
1
1
  require 'json'
2
2
  require 'rake/clean'
3
3
 
4
-
5
-
6
4
  Dir.glob("#{File.dirname(__FILE__)}/commands/*.rb").each{|rb|
7
5
  require(rb)
8
6
  }
9
- require_relative('./msbuild.rb')
7
+ Dir.glob("#{File.dirname(__FILE__)}/tasks/*.rb").each{|rb|
8
+ require(rb)
9
+ }
10
+ class Commands < Hash
11
+
12
+ def initialize directory=Dir.pwd
13
+ Dir.chdir(directory) do
14
+ self[:pull]=Pull.new
15
+ self[:update]=Update.new
16
+ self[:setup]=Setup.new
17
+ self[:build]=Build.new
18
+ self[:test]=Test.new
19
+ self[:analyze]=Analyze.new
20
+ self[:doc]=Doc.new
21
+ #self[:clean]=Clean.new
22
+ self[:publish]=Publish.new
23
+ #self[:clobber]=Clobber.new
24
+ self[:add]=Add.new
25
+ self[:commit]=Commit.new
26
+ self[:push]=Push.new
27
+ end
28
+ end
29
+
30
+ end
31
+
32
+ #Dir.glob("#{File.dirname(__FILE__)}/commands/*.rb").each{|rb|
33
+ # require(rb)
34
+ #}
35
+ require_relative('./apps/msbuild.rb')
10
36
 
11
37
  COMMANDS=Commands.new
12
38
  MSBUILD=MSBuild.new
data/lib/dev.rb CHANGED
@@ -6,21 +6,7 @@ Dir.glob("#{File.dirname(__FILE__)}/**/*.rb").each{|rb|
6
6
 
7
7
  RAKE_DEFAULT_EXISTS=File.exists?('rake.default')
8
8
 
9
- # Clean Files
10
- CLEAN.include('**/*.{sdf,sud,ncb,cache,user}')
11
- CLEAN.include('rake.default')
12
9
 
13
- # Clean Folders
14
- CLEAN.include('obj') if File.exists?('obj')
15
- CLEAN.include('tmp') if File.exists?('tmp')
16
-
17
- # CLOBBER Files
18
- CLOBBER.include('**/*.gem')
19
- CLOBBER.include('bin/*.{dll,pdb}')
20
-
21
- # CLOBBER Folders
22
- CLOBBER.include('bin') if File.exists?('bin')
23
- CLOBBER.include('doc') if File.exists?('doc')
24
10
 
25
11
  current=Projects.current
26
12
  if(!current.nil?)
File without changes
File without changes
File without changes
data/lib/project.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'json'
2
- #require 'dev_commands'
3
2
 
4
3
  class Project < Hash
5
4
  attr_accessor :filename
data/lib/projects.rb CHANGED
@@ -1,9 +1,5 @@
1
1
  require 'json'
2
2
  require 'rake'
3
- #require 'dev_git'
4
- #require 'dev_svn'
5
- #require 'dev_msbuild'
6
- #require 'dev_environment'
7
3
 
8
4
  class Projects < Hash
9
5
  attr_accessor :filename
@@ -1,3 +1,6 @@
1
+ desc 'adds source files to git or subversion'
2
+ task :add do Tasks.execute_task :add;end
3
+
1
4
  class Add < Array
2
5
  def update
3
6
  if(File.exists?('.git') && File.exists?('.gitignore'))
@@ -36,4 +39,4 @@ class Add < Array
36
39
  end
37
40
  end
38
41
  end
39
- end
42
+ end
File without changes
@@ -1,4 +1,5 @@
1
- require 'rake'
1
+ desc 'performs build commands'
2
+ task :build do Tasks.execute_task :build;end
2
3
 
3
4
  SLN_FILES=FileList.new('*.sln','*/*.sln','*/*/*.sln')
4
5
 
@@ -6,8 +7,6 @@ class Build < Array
6
7
  def update
7
8
 
8
9
  changed = true
9
- #changed = Git.has_changes? if(File.exists?('.git') && defined?(Git))
10
- #changed = Svn.has_changes? if(File.exists?('.svn') && defined?(Svn))
11
10
  if(changed)
12
11
  Dir.glob('*.gemspec'){|gemspec|
13
12
  add "gem build #{gemspec}" if !File.exist?(Gemspec.gemfile gemspec)
@@ -0,0 +1,8 @@
1
+
2
+ # Clean Files
3
+ CLEAN.include('**/*.{sdf,sud,ncb,cache,user,wixobj}')
4
+ CLEAN.include('rake.default')
5
+
6
+ # Clean Folders
7
+ CLEAN.include('obj') if File.exists?('obj')
8
+ CLEAN.include('tmp') if File.exists?('tmp')
@@ -1,3 +1,4 @@
1
+ require 'rake/clean'
1
2
  # CLOBBER Files
2
3
  CLOBBER.include('**/*.gem')
3
4
  CLOBBER.include('bin/*.{dll,pdb}')
@@ -10,3 +11,5 @@ CLOBBER.include('*.gem')
10
11
  CLOBBER.include('bin','obj','packages')
11
12
 
12
13
 
14
+ desc 'performs clobber commands'
15
+ task :clobber => [:clean] do Tasks.execute_task :clobber;end
@@ -1,5 +1,3 @@
1
- #require_relative('internet.rb')
2
-
3
1
  class Commit < Array
4
2
  def update
5
3
  message=""
@@ -1,7 +1,5 @@
1
1
  class Doc < Array
2
2
  def update
3
- #cmd=Command.new ({ :input => 'yard --version', :ignore_failure => true})
4
- #cmd.execute
5
3
  if(Command.exit_code('yard --version'))
6
4
  add 'yard doc - LICENSE' if File.exists?('README.md') && File.exists?('LICENSE')
7
5
  end
File without changes
@@ -17,4 +17,4 @@ class Publish < Array
17
17
  end
18
18
  end
19
19
  end
20
- end
20
+ end
@@ -1,5 +1,5 @@
1
- #require_relative('git.rb')
2
- #require_relative('internet.rb')
1
+ desc 'performs a git pull'
2
+ task :pull do Tasks.execute_task :pull; end
3
3
 
4
4
  class Pull < Array
5
5
  def update
File without changes
@@ -1,3 +1,6 @@
1
+ desc 'performs setup commands'
2
+ task :setup do Tasks.execute_task :setup;end
3
+
1
4
  #
2
5
  # use the SVN_EXPORTS hash to define svn exports destined for DEV_ROOT/dep
3
6
  #
@@ -0,0 +1,81 @@
1
+ require 'rake'
2
+
3
+ class Tasks
4
+ #@@commands=nil
5
+ @@quiet=false
6
+
7
+ def self.quiet
8
+ @@quiet
9
+ end
10
+
11
+ def self.execute value
12
+ if(value.respond_to?(:execute))
13
+ value.update if value.respond_to?(:update)
14
+ value.execute
15
+ else
16
+ if(value.is_a?(String))
17
+ puts `#{value}`
18
+ else
19
+ if(value.is_a?(Array))
20
+ value.each{|e| execute(e)}
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ def self.execute_task task
27
+ if(defined?(COMMANDS))
28
+ if(COMMANDS.has_key?(task))
29
+ puts "[:#{task}]" if(!Tasks.quiet)
30
+ Tasks.execute(COMMANDS[task])
31
+ end
32
+ end
33
+ end
34
+ end
35
+
36
+ ['add','clobber','pull'].each{|name| require_relative("#{name}.rb")}
37
+ require 'rake/clean'
38
+
39
+
40
+
41
+ desc 'performs svn update'
42
+ task :update do Tasks.execute_task :update; end
43
+
44
+ desc 'performs setup commands'
45
+ task :setup do Tasks.execute_task :setup;end
46
+
47
+ desc 'performs build commands'
48
+ task :build do Tasks.execute_task :build;end
49
+
50
+ desc 'performs test commands'
51
+ task :test => [:build] do Tasks.execute_task :test;end
52
+
53
+ desc 'performs analyze commands'
54
+ task :analyze do Tasks.execute_task :analyze;end
55
+
56
+ desc 'performs documentation commands'
57
+ task :doc do Tasks.execute_task :doc;end
58
+
59
+ desc 'performs clean commands'
60
+ task :clean do Tasks.execute_task :clean;end
61
+
62
+ desc 'performs publish commands'
63
+ task :publish do Tasks.execute_task :publish; end
64
+
65
+ #desc 'performs clobber commands'
66
+ #task :clobber => [:clean] do Tasks.execute_task :clobber;end
67
+
68
+
69
+ desc 'commits source files to git or subversion'
70
+ task :commit do Tasks.execute_task :commit;end
71
+
72
+ desc 'performs a git push'
73
+ task :push do Tasks.execute_task :push;end
74
+
75
+ desc 'displays project info'
76
+ task :info do
77
+ if(defined?(INFO) && INFO.length > 0)
78
+ puts "[:info]" if(!Tasks.quiet)
79
+ INFO.each{|l|puts l}
80
+ end
81
+ end
File without changes
@@ -1,3 +1,6 @@
1
+ desc 'performs svn update'
2
+ task :update do Tasks.execute_task :update; end
3
+
1
4
  class Update < Array
2
5
  def update
3
6
  self .add 'svn update' if File.exists?('.svn') && Internet.available?
data/lib/tasks.rb CHANGED
@@ -2,7 +2,6 @@ require 'rake'
2
2
  require 'rake/clean'
3
3
 
4
4
  class Tasks
5
- #@@commands=nil
6
5
  @@quiet=false
7
6
 
8
7
  def self.quiet
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.139
4
+ version: 2.0.140
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
@@ -31,47 +31,42 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
33
  - LICENSE
34
- - lib/clean.rb
35
- - lib/clobber.rb
34
+ - lib/apps/git.rb
35
+ - lib/apps/msbuild.rb
36
+ - lib/apps/nuget.rb
37
+ - lib/apps/svn.rb
38
+ - lib/apps/wix.rb
39
+ - lib/array.rb
36
40
  - lib/command.rb
37
41
  - lib/commands.rb
38
- - lib/commands/add.rb
39
- - lib/commands/analyze.rb
40
- - lib/commands/array.rb
41
- - lib/commands/build.rb
42
- - lib/commands/clean.rb
43
- - lib/commands/clobber.rb
44
- - lib/commands/command.rb
45
- - lib/commands/commands.rb
46
- - lib/commands/commit.rb
47
- - lib/commands/doc.rb
48
- - lib/commands/gemspec.rb
49
- - lib/commands/git.rb
50
- - lib/commands/hash.rb
51
- - lib/commands/info.rb
52
- - lib/commands/internet.rb
53
- - lib/commands/publish.rb
54
- - lib/commands/pull.rb
55
- - lib/commands/push.rb
56
- - lib/commands/setup.rb
57
- - lib/commands/tag.rb
58
- - lib/commands/test.rb
59
- - lib/commands/text.rb
60
- - lib/commands/timeout.rb
61
- - lib/commands/timer.rb
62
- - lib/commands/update.rb
63
- - lib/commands/upgrade.rb
64
42
  - lib/dev.rb
65
43
  - lib/environment.rb
66
44
  - lib/file.rb
67
- - lib/git.rb
68
- - lib/msbuild.rb
45
+ - lib/gemspec.rb
46
+ - lib/hash.rb
47
+ - lib/internet.rb
69
48
  - lib/project.rb
70
49
  - lib/projects.rb
71
50
  - lib/source.rb
72
- - lib/svn.rb
73
51
  - lib/tasks.rb
74
- - lib/wix.rb
52
+ - lib/tasks/add.rb
53
+ - lib/tasks/analyze.rb
54
+ - lib/tasks/build.rb
55
+ - lib/tasks/clean.rb
56
+ - lib/tasks/clobber.rb
57
+ - lib/tasks/commit.rb
58
+ - lib/tasks/doc.rb
59
+ - lib/tasks/info.rb
60
+ - lib/tasks/publish.rb
61
+ - lib/tasks/pull.rb
62
+ - lib/tasks/push.rb
63
+ - lib/tasks/setup.rb
64
+ - lib/tasks/tasks.rb
65
+ - lib/tasks/test.rb
66
+ - lib/tasks/update.rb
67
+ - lib/text.rb
68
+ - lib/timeout.rb
69
+ - lib/timer.rb
75
70
  homepage: http://rubygems.org/gems/dev
76
71
  licenses:
77
72
  - Apache 2.0
@@ -92,9 +87,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
87
  version: '0'
93
88
  requirements: []
94
89
  rubyforge_project:
95
- rubygems_version: 2.4.5
90
+ rubygems_version: 2.2.3
96
91
  signing_key:
97
92
  specification_version: 4
98
93
  summary: dev
99
94
  test_files: []
100
- has_rdoc:
@@ -1,12 +0,0 @@
1
- class Clean < Array
2
- def update
3
- ['.yardoc','log','tmp','obj'].each{|dir|
4
- CLEAN.include(dir) if File.exists?(dir)
5
- }
6
-
7
- CLEAN.include('*.{suo,sdf}')
8
-
9
- #add '<%Rake::Task[:clean].reenable%>'
10
- add '<%Rake::Task[:clean].invoke%>'
11
- end
12
- end
@@ -1,15 +0,0 @@
1
- class Clobber < Array
2
- def update
3
- ['bin'].each{|dir|
4
- CLOBBER.include(dir) if File.exists?(dir)
5
- }
6
-
7
- clean=Clean.new
8
- clean.update
9
-
10
- CLOBBER.include('*.gem')
11
-
12
- #add '<%Rake::Task[:clobber].reenable%>'
13
- add '<%Rake::Task[:clobber].invoke%>'
14
- end
15
- end
@@ -1,230 +0,0 @@
1
- require 'open3'
2
- #require_relative('./array.rb')
3
- #require_relative('./hash.rb')
4
- #require_relative('./timer.rb')
5
-
6
- BUFFER_SIZE=1024 if(!defined?(BUFFER_SIZE))
7
-
8
- # = Command
9
- #
10
- # execution of system commands
11
- #
12
- # = Keys
13
- #
14
- # - :input The input of the commands.
15
- # - :timeout The timeout in seconds.
16
- # a value of zero is to infinite timeout.
17
- # defaults to zero
18
- # - :directory The working directory for the command.
19
- # defaults to the current directory
20
- # - :exit_code The exit code of the command
21
- # - :output The output contains the stdout output of the command
22
- # - :error The error contains stderr output of the command
23
- # - :machine The name of the machine the command executed on
24
- # - :user The user name
25
- # - :start_time
26
- # - :end_time
27
- #
28
- class Command < Hash
29
- def initialize command
30
-
31
- self[:input] = ''
32
- self[:timeout] = 0
33
- self[:directory] = ''
34
- self[:exit_code] = 0
35
- self[:output] = ''
36
- self[:error] = ''
37
- self[:machine] = ''
38
- self[:user] = ''
39
- self[:start_time] = nil
40
- self[:end_time] = nil
41
-
42
- if(command.kind_of?(String))
43
- self[:input] = command
44
- end
45
-
46
- if(command.kind_of?(Hash))
47
- command.each{|k,v|
48
- self[k.to_sym]=v
49
- }
50
- end
51
- end
52
-
53
- def quiet?
54
- (self.has_key?(:quiet) && self[:quiet])
55
- end
56
-
57
- def execute value=nil
58
-
59
- if(!value.nil? && value.is_a?(Hash))
60
- value.each{|k,v|self[k]=v}
61
- end
62
-
63
- pwd=Dir.pwd
64
- self[:directory] = pwd if(!self.has_key?(:directory) || self[:directory].length==0)
65
-
66
- if(self[:timeout] > 0)
67
- puts "#{self[:input]} (#{self[:directory]}) timeout #{self[:timeout].to_s}" if(!quiet?)
68
- else
69
- puts "#{self[:input]} (#{self[:directory]})" if(!quiet?)
70
- end
71
-
72
- self[:machine] = Command.machine
73
- self[:user] = Command.user
74
-
75
- self[:start_time]=Time.now
76
- timer=Timer.new
77
-
78
- Dir.chdir(self[:directory]) do
79
- if self[:input].include?('<%') && self[:input].include?('%>')
80
- ruby = self[:input].gsub("<%","").gsub("%>","")
81
-
82
- begin
83
- self[:output]=eval(ruby)
84
- rescue
85
- self[:exit_code]=1
86
- self[:error]="unable to eval(#{ruby})"
87
- end
88
-
89
- self[:elapsed] = timer.elapsed_str
90
- self[:end_time] = Time.now
91
- else
92
- begin
93
- if(self[:timeout] <= 0)
94
- self[:output],self[:error],status= Open3.capture3(self[:input])
95
- self[:exit_code]=status.to_i
96
- self[:elapsed] = timer.elapsed_str
97
- self[:end_time] = Time.now
98
- else
99
- require_relative 'timeout.rb'
100
- #puts run_with_timeout(self[:input], self[:timeout], 1).to_s
101
- #self[:output] = run_with_timeout(self[:input], self[:timeout], 1)
102
- result=run_with_timeout2(self[:directory],self[:input], self[:timeout], 2)
103
- self[:output]=result[0]
104
- self[:error]=result[1]
105
- self[:exit_code]=result[2]
106
-
107
- self[:elapsed] = timer.elapsed_str
108
- self[:end_time] = Time.now
109
-
110
- if(timer.elapsed >= self[:timeout])
111
- self[:exit_code]=1
112
- self[:error] = self[:error] + "timed out"
113
- end
114
- end
115
- rescue Exception => e
116
- self[:elapsed] = timer.elapsed_str
117
- self[:end_time] = Time.now
118
- self[:error] = "Exception: " + e.to_s
119
- self[:exit_code]=1
120
- end
121
- end
122
- end
123
-
124
-
125
- if(self[:exit_code] != 0)
126
- if(!quiet?)
127
- puts "exit_code=#{self[:exit_code]}"
128
- puts self[:output]
129
- puts self[:error]
130
- end
131
- if(!self.has_key?(:ignore_failure) || !self[:ignore_failure])
132
- raise "#{self[:input]} failed"
133
- end #unless (self.has_key?(:ignore_failure) && self[:ignore_failure]==true)
134
- end
135
-
136
- end
137
-
138
- def self.machine
139
- if !ENV['COMPUTERNAME'].nil?
140
- return ENV['COMPUTERNAME']
141
- end
142
-
143
- machine = `hostname`
144
- machine = machine.split('.')[0] if machine.include?('.')
145
- return machine.strip
146
- end
147
-
148
- def self.user
149
- ENV['USER'].nil? ? ENV['USERNAME'] : ENV['USER']
150
- end
151
-
152
- def self.home
153
- ["USERPROFILE","HOME"].each {|v|
154
- return ENV[v].gsub('\\','/') unless ENV[v].nil?
155
- }
156
- dir="~"
157
- dir=ENV["HOME"] unless ENV["HOME"].nil?
158
- dir=ENV["USERPROFILE"].gsub('\\','/') unless ENV["USERPROFILE"].nil?
159
- return dir
160
- end
161
-
162
- def self.dev_root
163
- ["DEV_HOME","DEV_ROOT"].each {|v|
164
- return ENV[v].gsub('\\','/') unless ENV[v].nil?
165
- }
166
- dir=home
167
- #dir=ENV["DEV_ROOT"].gsub('\\','/') unless ENV["DEV_ROOT"].nil?
168
- return dir
169
- end
170
-
171
- def self.exit_code command
172
- cmd = Command.new(command)
173
- cmd[:ignore_failure]=true
174
- cmd[:quiet]=true
175
- cmd.execute
176
- cmd[:exit_code]
177
- end
178
-
179
- def self.output command
180
- cmd = Command.new(command)
181
- cmd[:ignore_failure]=true
182
- cmd[:quiet]=true
183
- cmd.execute
184
- cmd[:output]
185
- end
186
-
187
- def self.error command
188
- cmd = Command.new(command)
189
- cmd[:ignore_failure]=true
190
- cmd[:quiet]=true
191
- cmd.execute
192
- cmd[:error]
193
- end
194
-
195
- def getFormattedTimeSpan timespan
196
- seconds = timespan
197
- seconds.to_s + " sec"
198
- end
199
-
200
- def self.execute command
201
- cmd = Command.new(command)
202
- cmd.execute
203
- cmd[:exit_code]
204
- end
205
-
206
- def summary
207
- duration=""
208
- duration=getFormattedTimeSpan(self[:end_time]-self[:start_time]) + " - " if(!self[:end_time].nil?)
209
- duration + "#{self[:exit_code].to_s} #{self[:input]} (#{self[:directory]})"
210
- end
211
-
212
- def to_html
213
- if self[:exit_code] == 0
214
- [
215
- '<div><table><tr><td width="20"></td><td><pre>',
216
- self[:input],
217
- '</pre></td></tr></table></div>'
218
- ].join
219
- else
220
- [
221
- '<div><table><tr><td width="20"></td><td><pre>',
222
- self[:input],
223
- '</pre><table><tr><td width="20"></td><td><table>',
224
- map { |k, v| ["<tr><td><strong>#{k}</strong></td>", v.respond_to?(:to_html) ? v.to_html : "<td><span><pre>#{v}</pre></span></td></tr>"] },
225
- '</table>',
226
- '</td></tr></table></td></tr></table></div>'
227
- ].join
228
- end
229
- end
230
- end
@@ -1,36 +0,0 @@
1
- #require_relative('hash.rb')
2
- #require_relative('pull.rb')
3
- #require_relative('update.rb')
4
- #require_relative('setup.rb')
5
- #require_relative('build.rb')
6
- #require_relative('test.rb')
7
- #require_relative('analyze.rb')
8
- #require_relative('publish.rb')
9
- #require_relative('doc.rb')
10
- #require_relative('clean.rb')
11
- #require_relative('clobber.rb')
12
- #require_relative('add.rb')
13
- #require_relative('commit.rb')
14
- #require_relative('push.rb')
15
-
16
- class Commands < Hash
17
-
18
- def initialize directory=Dir.pwd
19
- Dir.chdir(directory) do
20
- self[:pull]=Pull.new
21
- self[:update]=Update.new
22
- self[:setup]=Setup.new
23
- self[:build]=Build.new
24
- self[:test]=Test.new
25
- self[:analyze]=Analyze.new
26
- self[:doc]=Doc.new
27
- self[:clean]=Clean.new
28
- self[:publish]=Publish.new
29
- self[:clobber]=Clobber.new
30
- self[:add]=Add.new
31
- self[:commit]=Commit.new
32
- self[:push]=Push.new
33
- end
34
- end
35
-
36
- end
data/lib/commands/git.rb DELETED
@@ -1,22 +0,0 @@
1
- class Git
2
- def self.branch
3
- begin
4
- `git branch`.scan(/\* ([.\w-]+)/)[0][0]
5
- rescue
6
- ''
7
- end
8
- end
9
-
10
- def self.remote_origin directory=''
11
- url=''
12
- directory=Dir.pwd if directory.length == 0
13
- Dir.chdir(directory) do
14
- begin
15
- url=`git remote show origin`.scan(/Fetch URL: ([\.\-:\/\w\d]+)/)[0]
16
- rescue
17
- url=''
18
- end
19
- end
20
- url
21
- end
22
- end
data/lib/commands/tag.rb DELETED
@@ -1,3 +0,0 @@
1
- class Tag < Array
2
-
3
- end
@@ -1,6 +0,0 @@
1
- class Upgrade < Array
2
- def update
3
- if(File.exists?('Gemfile'))
4
- end
5
- end
6
- end