dev 2.1.153 → 2.1.154

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/lib/apps/git.rb +207 -208
  3. data/lib/apps/msbuild.rb +90 -90
  4. data/lib/apps/nbench.rb +2 -1
  5. data/lib/apps/nuget.rb +57 -59
  6. data/lib/apps/svn.rb +137 -143
  7. data/lib/apps/wix.rb +47 -50
  8. data/lib/apps/xcodebuild.rb +13 -11
  9. data/lib/apps/zip.rb +25 -25
  10. data/lib/apps.rb +3 -1
  11. data/lib/base/array.rb +66 -64
  12. data/lib/base/command.rb +237 -238
  13. data/lib/base/dir.rb +73 -76
  14. data/lib/base/environment.rb +94 -99
  15. data/lib/base/file.rb +35 -33
  16. data/lib/base/gemspec.rb +47 -45
  17. data/lib/base/giturl.rb +88 -90
  18. data/lib/base/hash.rb +20 -15
  19. data/lib/base/history.rb +36 -33
  20. data/lib/base/internet.rb +22 -20
  21. data/lib/base/project.rb +410 -423
  22. data/lib/base/projects.rb +231 -246
  23. data/lib/base/source.rb +22 -20
  24. data/lib/base/string.rb +6 -4
  25. data/lib/base/text.rb +16 -14
  26. data/lib/base/timeout.rb +29 -28
  27. data/lib/base/timer.rb +23 -19
  28. data/lib/base/version.rb +68 -72
  29. data/lib/base.rb +5 -3
  30. data/lib/commands.rb +47 -43
  31. data/lib/dev.config.rb +3 -2
  32. data/lib/dev.rb +65 -66
  33. data/lib/tasks/add.rb +34 -40
  34. data/lib/tasks/analyze.rb +17 -15
  35. data/lib/tasks/build.rb +101 -103
  36. data/lib/tasks/clean.rb +6 -4
  37. data/lib/tasks/clobber.rb +20 -18
  38. data/lib/tasks/commit.rb +42 -44
  39. data/lib/tasks/default.rb +41 -39
  40. data/lib/tasks/doc.rb +10 -8
  41. data/lib/tasks/info.rb +8 -7
  42. data/lib/tasks/package.rb +23 -20
  43. data/lib/tasks/publish.rb +20 -25
  44. data/lib/tasks/pull.rb +9 -9
  45. data/lib/tasks/push.rb +11 -13
  46. data/lib/tasks/setup.rb +180 -183
  47. data/lib/tasks/test.rb +121 -107
  48. data/lib/tasks/update.rb +13 -11
  49. data/lib/tasks.rb +38 -42
  50. metadata +7 -9
  51. data/bin/dev +0 -3
data/lib/tasks/add.rb CHANGED
@@ -1,46 +1,40 @@
1
+ # frozen_string_literal: true
2
+
1
3
  if defined?(DEBUG)
2
- puts DELIMITER
3
- puts __FILE__
4
+ puts DELIMITER
5
+ puts __FILE__
4
6
  end
5
7
 
6
- desc 'adds source files to git or subversion'
7
- task :add do Tasks.execute_task :add;end
8
+ desc "adds source files to git or subversion"
9
+ task :add do Tasks.execute_task :add; end
8
10
 
9
11
  class Add < Array
10
- def update
11
- if(File.exists?('.git') && File.exists?('.gitignore'))
12
- add_quiet 'git add --all'
13
- else
14
- if(defined?(SOURCE))
15
- if(File.exists?('.svn'))
16
- #---
17
- list_output = %x[svn list -R]
18
- status_output = %x[svn status]
19
- status_output = status_output.gsub(/\\/,"/")
20
- #---
21
- SOURCE.each{|f|
22
- if(File.exists?(f) && File.file?(f) && !list_output.include?(f))
23
- if(m = status_output.match(/^(?<action>.)\s+(?<file>#{f})$/i))
24
- if(m[:file] == f && m[:action] == '?')
25
- add_quiet "svn add \"#{f}\" --parents"
26
- end
27
- end
28
- end
29
- }
30
- end
31
- if(File.exists?('.git'))
32
- SOURCE.each{|f|
33
- if(File.exists?(f) && File.file?(f))
34
- status=Command.output("git status #{f} --short")
35
- if status.include?('??') || status.include?(' M ')
36
- add_quiet "git add #{f} -v"
37
- end
38
- end
39
- }
40
- end
41
- end
42
- end
12
+ def update
13
+ if File.exist?(".git") && File.exist?(".gitignore")
14
+ add_quiet "git add --all"
15
+ elsif defined?(SOURCE)
16
+ if File.exist?(".svn")
17
+ #---
18
+ list_output = `svn list -R`
19
+ status_output = `svn status`
20
+ status_output = status_output.gsub(/\\/, "/")
21
+ #---
22
+ SOURCE.each do |f|
23
+ if File.exist?(f) && File.file?(f) && !list_output.include?(f) && (m = status_output.match(/^(?<action>.)\s+(?<file>#{f})$/i)) && (m[:file] == f && m[:action] == "?")
24
+ add_quiet "svn add \"#{f}\" --parents"
25
+ end
26
+ end
27
+ end
28
+ if File.exist?(".git")
29
+ SOURCE.each do |f|
30
+ if File.exist?(f) && File.file?(f)
31
+ status = Command.output("git status #{f} --short")
32
+ add_quiet "git add #{f} -v" if status.include?("??") || status.include?(" M ")
33
+ end
34
+ end
35
+ end
36
+ end
43
37
 
44
- log_debug_info("Add") if defined?(DEBUG)
45
- end
46
- end
38
+ log_debug_info("Add") if defined?(DEBUG)
39
+ end
40
+ end
data/lib/tasks/analyze.rb CHANGED
@@ -1,20 +1,22 @@
1
+ # frozen_string_literal: true
2
+
1
3
  puts __FILE__ if defined?(DEBUG)
2
4
 
3
- desc 'performs analyze commands'
4
- task :analyze do Tasks.execute_task :analyze;end
5
+ desc "performs analyze commands"
6
+ task :analyze do Tasks.execute_task :analyze; end
5
7
 
6
8
  class Analyze < Array
7
- def update
8
- if(`gem list countloc`.include?('countloc ('))
9
- FileUtils.mkdir('doc') if(!File.exists?('doc'))
10
- add_quiet 'countloc -r * --html doc/countloc.html'
11
- end
9
+ def update
10
+ if `gem list countloc`.include?("countloc (")
11
+ FileUtils.mkdir("doc") unless File.exist?("doc")
12
+ add_quiet "countloc -r * --html doc/countloc.html"
13
+ end
12
14
 
13
- if defined?(DEBUG)
14
- puts
15
- puts "Analyze"
16
- pp self
17
- puts
18
- end
19
- end
20
- end
15
+ if defined?(DEBUG)
16
+ puts
17
+ puts "Analyze"
18
+ pp self
19
+ puts
20
+ end
21
+ end
22
+ end
data/lib/tasks/build.rb CHANGED
@@ -1,114 +1,112 @@
1
+ # frozen_string_literal: true
2
+
1
3
  puts __FILE__ if defined?(DEBUG)
2
4
 
3
- require_relative('../base/environment.rb')
5
+ require_relative("../base/environment")
4
6
 
5
- desc 'performs build commands'
6
- task :build do Tasks.execute_task :build;end
7
+ desc "performs build commands"
8
+ task :build do Tasks.execute_task :build; end
7
9
 
8
- if !defined?(SLN_FILES)
9
- SLN_FILES=FileList.new('*.sln','*/*.sln','*/*/*.sln')
10
- end
10
+ SLN_FILES = FileList.new("*.sln", "*/*.sln", "*/*/*.sln") unless defined?(SLN_FILES)
11
11
 
12
- WXS_FILES=FileList.new('**/*.wxs')
13
- SMARTASSEMBLY_FILES=FileList.new('**/*.saproj')
12
+ WXS_FILES = FileList.new("**/*.wxs")
13
+ SMARTASSEMBLY_FILES = FileList.new("**/*.saproj")
14
14
 
15
15
  class Build < Array
16
- def update
17
-
18
- #puts "SLN_FILES: #{SLN_FILES}" if(Environment.default.debug?)
19
-
20
- update_gemspec
21
- update_dotnet
22
- update_sln if Environment.windows?
23
- update_smartassembly if Environment.windows?
24
- #update_nuget if Environment.windows?
25
- update_wix if Environment.windows? && !defined?(NO_WIX)
26
- update_xcode if Environment.mac?
27
-
28
- log_debug_info("Build") if defined?(DEBUG)
29
- end
30
-
31
- def update_gemspec
32
- #puts "Build scanning for gemspec files" if Environment.default.debug?
33
- Dir.glob('*.gemspec'){|gemspec|
34
- add_quiet("gem build #{gemspec}") if !File.exist?(Gemspec.gemfile gemspec)
35
- }
16
+ def update
17
+ # puts "SLN_FILES: #{SLN_FILES}" if(Environment.default.debug?)
18
+
19
+ update_gemspec
20
+ update_dotnet
21
+ update_sln if Environment.windows?
22
+ update_smartassembly if Environment.windows?
23
+ # update_nuget if Environment.windows?
24
+ update_wix if Environment.windows? && !defined?(NO_WIX)
25
+ update_xcode if Environment.mac?
26
+
27
+ log_debug_info("Build") if defined?(DEBUG)
28
+ end
29
+
30
+ def update_gemspec
31
+ # puts "Build scanning for gemspec files" if Environment.default.debug?
32
+ Dir.glob("*.gemspec") do |gemspec|
33
+ add_quiet("gem build #{gemspec}") unless File.exist?(Gemspec.gemfile(gemspec))
34
+ end
35
+ end
36
+
37
+ def update_dotnet
38
+ # puts "Build scanning for project.json" if Environment.default.debug?
39
+ add_quiet "dotnet build" if File.exist?("project.json")
40
+ end
41
+
42
+ def update_sln
43
+ # puts "Build scanning for sln files" if Environment.default.debug?
44
+ SLN_FILES.each do |sln_file|
45
+ puts " #{sln_file}" if Environment.default.debug?
46
+ build_commands = MSBuild.get_build_commands sln_file
47
+ if !build_commands.nil?
48
+ build_commands.each do |c|
49
+ puts " build command #{c} discovered." if Environment.default.debug?
50
+ add_quiet(c)
51
+ end
52
+ elsif Environment.default.debug?
53
+ puts " no build command discovered."
54
+ end
55
+ end
56
+ end
57
+
58
+ def update_smartassembly
59
+ # puts "Build scanning for sa (smart assembly) files" if Environment.default.debug?
60
+ sa = "C:/Program Files/Red Gate/SmartAssembly 6/SmartAssembly.com"
61
+ if File.exist?("C:/Program Files/Red Gate/SmartAssembly 7/SmartAssembly.com")
62
+ sa = "C:/Program Files/Red Gate/SmartAssembly 7/SmartAssembly.com"
63
+ end
64
+ SMARTASSEMBLY_FILES.each do |saproj_file|
65
+ puts " #{saproj_file}" if Environment.default.debug?
66
+ if !File.exist?(sa)
67
+ puts "warning: #{sa} does not exist, skipping build command for #{saproj_file}"
68
+ else
69
+ add_quiet("\"#{sa}\" /build #{saproj_file}")
70
+ end
71
+ end
72
+ end
73
+
74
+ def update_wix
75
+ # puts "Build scanning for wxs <Product> files" if Environment.default.debug?
76
+ WXS_FILES.each do |wxs_file|
77
+ next unless IO.read(wxs_file).include?("<Product")
78
+
79
+ build_commands = Wix.get_build_commands wxs_file
80
+ next if build_commands.nil?
81
+
82
+ build_commands.each do |c|
83
+ add_quiet(c)
84
+ end
36
85
  end
37
86
 
38
- def update_dotnet
39
- #puts "Build scanning for project.json" if Environment.default.debug?
40
- if(File.exists?('project.json'))
41
- add_quiet "dotnet build"
42
- end
87
+ # puts "Build scanning for wxs <Bundle> files" if Environment.default.debug?
88
+ WXS_FILES.each do |wxs_file|
89
+ next unless IO.read(wxs_file).include?("<Bundle")
90
+
91
+ build_commands = Wix.get_build_commands wxs_file
92
+ next if build_commands.nil?
93
+
94
+ build_commands.each do |c|
95
+ add_quiet(c)
96
+ end
43
97
  end
98
+ end
99
+
100
+ def update_xcode
101
+ # puts "Build scanning for xcodeproj folders" if Environment.default.debug?
102
+ Dir.glob("**/*.xcodeproj").each do |dir|
103
+ puts dir if Environment.default.debug?
104
+ build_commands = XCodeBuild.get_build_commands dir
105
+ next if build_commands.nil?
44
106
 
45
- def update_sln
46
- #puts "Build scanning for sln files" if Environment.default.debug?
47
- SLN_FILES.each{|sln_file|
48
- puts " #{sln_file}" if Environment.default.debug?
49
- build_commands = MSBuild.get_build_commands sln_file
50
- if(!build_commands.nil?)
51
- build_commands.each{|c|
52
- puts " build command #{c} discovered." if Environment.default.debug?
53
- add_quiet(c)
54
- }
55
- else
56
- puts " no build command discovered." if Environment.default.debug?
57
- end
58
- }
59
- end
60
-
61
- def update_smartassembly
62
- #puts "Build scanning for sa (smart assembly) files" if Environment.default.debug?
63
- sa = 'C:/Program Files/Red Gate/SmartAssembly 6/SmartAssembly.com'
64
- sa = 'C:/Program Files/Red Gate/SmartAssembly 7/SmartAssembly.com' if File.exists?('C:/Program Files/Red Gate/SmartAssembly 7/SmartAssembly.com')
65
- SMARTASSEMBLY_FILES.each{|saproj_file|
66
- puts " #{saproj_file}" if Environment.default.debug?
67
- if(!File.exists?(sa))
68
- puts "warning: #{sa} does not exist, skipping build command for #{saproj_file}"
69
- else
70
- add_quiet("\"#{sa}\" /build #{saproj_file}")
71
- end
72
- }
73
- end
74
-
75
-
76
-
77
- def update_wix
78
- #puts "Build scanning for wxs <Product> files" if Environment.default.debug?
79
- WXS_FILES.each{|wxs_file|
80
- if(IO.read(wxs_file).include?('<Product'))
81
- build_commands = Wix.get_build_commands wxs_file
82
- if(!build_commands.nil?)
83
- build_commands.each{|c|
84
- add_quiet(c)
85
- }
86
- end
87
- end
88
- }
89
-
90
- #puts "Build scanning for wxs <Bundle> files" if Environment.default.debug?
91
- WXS_FILES.each{|wxs_file|
92
- if(IO.read(wxs_file).include?('<Bundle'))
93
- build_commands = Wix.get_build_commands wxs_file
94
- if(!build_commands.nil?)
95
- build_commands.each{|c|
96
- add_quiet(c)
97
- }
98
- end
99
- end
100
- }
101
- end
102
- def update_xcode
103
- #puts "Build scanning for xcodeproj folders" if Environment.default.debug?
104
- Dir.glob('**/*.xcodeproj').each{|dir|
105
- puts dir if Environment.default.debug?
106
- build_commands = XCodeBuild.get_build_commands dir
107
- if(!build_commands.nil?)
108
- build_commands.each{|c|
109
- build_commands << c
110
- }
111
- end
112
- }
113
- end
114
- end
107
+ build_commands.each do |c|
108
+ build_commands << c
109
+ end
110
+ end
111
+ end
112
+ end
data/lib/tasks/clean.rb CHANGED
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  puts __FILE__ if defined?(DEBUG)
2
4
 
3
- require 'rake/clean'
5
+ require "rake/clean"
4
6
  # Clean Files
5
- CLEAN.include('**/*.{sdf,sud,ncb,cache,user,wixobj,wixpdb,nupkg}')
7
+ CLEAN.include("**/*.{sdf,sud,ncb,cache,user,wixobj,wixpdb,nupkg}")
6
8
 
7
9
  # Clean Folders
8
- CLEAN.include('obj') if File.exists?('obj')
9
- CLEAN.include('tmp') if File.exists?('tmp')
10
+ CLEAN.include("obj") if File.exist?("obj")
11
+ CLEAN.include("tmp") if File.exist?("tmp")
data/lib/tasks/clobber.rb CHANGED
@@ -1,25 +1,27 @@
1
+ # frozen_string_literal: true
2
+
1
3
  puts __FILE__ if defined?(DEBUG)
2
4
 
3
- require 'rake/clean'
5
+ require "rake/clean"
4
6
  # CLOBBER Files
5
- CLOBBER.include('**/*.nupkg')
6
- CLOBBER.include('**/*.gem')
7
- CLOBBER.include('**/*.msi')
7
+ CLOBBER.include("**/*.nupkg")
8
+ CLOBBER.include("**/*.gem")
9
+ CLOBBER.include("**/*.msi")
8
10
 
9
11
  # CLOBBER Folders
10
- CLOBBER.include('bin/**/*')
11
- CLOBBER.include('bin') if File.exists?('bin')
12
- CLOBBER.include('**/bin')
13
- CLOBBER.include('doc') if File.exists?('doc')
14
- CLOBBER.include('obj') if File.exists?('obj')
15
- CLOBBER.include('**/obj')
16
- CLOBBER.include('lib') if File.exists?('lib')
17
- CLOBBER.include('packages') if File.exists?('packages')
18
- CLOBBER.include('**/.vs')
12
+ CLOBBER.include("bin/**/*")
13
+ CLOBBER.include("bin") if File.exist?("bin")
14
+ CLOBBER.include("**/bin")
15
+ CLOBBER.include("doc") if File.exist?("doc")
16
+ CLOBBER.include("obj") if File.exist?("obj")
17
+ CLOBBER.include("**/obj")
18
+ CLOBBER.include("lib") if File.exist?("lib")
19
+ CLOBBER.include("packages") if File.exist?("packages")
20
+ CLOBBER.include("**/.vs")
19
21
 
20
- CLOBBER.include('*.gem')
21
- CLOBBER.include('DTAR_*')
22
- CLOBBER.include('.vs') if File.exists?('.vs')
22
+ CLOBBER.include("*.gem")
23
+ CLOBBER.include("DTAR_*")
24
+ CLOBBER.include(".vs") if File.exist?(".vs")
23
25
 
24
- desc 'performs clobber commands'
25
- task :clobber => [:clean] do Tasks.execute_task :clobber;end
26
+ desc "performs clobber commands"
27
+ task clobber: [:clean] do Tasks.execute_task :clobber; end
data/lib/tasks/commit.rb CHANGED
@@ -1,52 +1,50 @@
1
+ # frozen_string_literal: true
2
+
1
3
  puts __FILE__ if defined?(DEBUG)
2
4
 
3
- desc 'commits source files to git or subversion'
4
- if(File.exists?('git'))
5
- task :commit=>[:add] do Tasks.execute_task :commit; end
6
- else
7
- task :commit=>[:add] do Tasks.execute_task :commit;end
5
+ desc "commits source files to git or subversion"
6
+ if File.exist?("git")
8
7
  end
8
+ task commit: [:add] do Tasks.execute_task :commit; end
9
9
 
10
10
  class Commit < Array
11
- def update
12
- message=""
13
- message=IO.read('commit.message').strip if File.exists?('commit.message')
11
+ def update
12
+ message = ""
13
+ message = IO.read("commit.message").strip if File.exist?("commit.message")
14
14
 
15
- if(File.exists?('.git') && `git config --list`.include?('user.name=') && Git.user_email.length > 0)
16
- if(!`git status`.include?('nothing to commit') &&
17
- !`git status`.include?('untracked files present') &&
18
- !`git status`.include?('no changes add to commit'))
19
- if(message.length==0)
20
- if(defined?(REQUIRE_COMMIT_MESSAGE))
21
- Commit.reset_commit_message
22
- raise "commit.message required to perform commit"
23
- else
24
- add_passive "git commit -m'all'"
25
- end
26
- else
27
- add_quiet "git commit -a -v --file commit.message"
28
- add_quiet "<%Commit.reset_commit_message%>"
29
- end
30
- end
31
- end
32
- if(File.exists?('.svn'))
33
- if(message.length==0)
34
- if(defined?(REQUIRE_COMMIT_MESSAGE))
35
- Commit.reset_commit_message
36
- raise "commit.message required to perform commit"
37
- else
38
- add_quiet 'svn commit -m"commit all"'
39
- end
40
- else
41
- add_quiet 'svn commit --file commit.message'
42
- add_quiet "<%Commit.reset_commit_message%>"
43
- end
44
- end
15
+ if File.exist?(".git") && `git config --list`.include?("user.name=") && Git.user_email.length.positive? && (!`git status`.include?("nothing to commit") &&
16
+ !`git status`.include?("untracked files present") &&
17
+ !`git status`.include?("no changes add to commit"))
18
+ if message.length.zero?
19
+ if defined?(REQUIRE_COMMIT_MESSAGE)
20
+ Commit.reset_commit_message
21
+ raise "commit.message required to perform commit"
22
+ else
23
+ add_passive "git commit -m'all'"
24
+ end
25
+ else
26
+ add_quiet "git commit -a -v --file commit.message"
27
+ add_quiet "<%Commit.reset_commit_message%>"
28
+ end
29
+ end
30
+ if File.exist?(".svn")
31
+ if message.length.zero?
32
+ if defined?(REQUIRE_COMMIT_MESSAGE)
33
+ Commit.reset_commit_message
34
+ raise "commit.message required to perform commit"
35
+ else
36
+ add_quiet 'svn commit -m"commit all"'
37
+ end
38
+ else
39
+ add_quiet "svn commit --file commit.message"
40
+ add_quiet "<%Commit.reset_commit_message%>"
41
+ end
42
+ end
45
43
 
46
- log_debug_info("Commit") if defined?(DEBUG)
47
- end
44
+ log_debug_info("Commit") if defined?(DEBUG)
45
+ end
48
46
 
49
- def self.reset_commit_message
50
- File.open('commit.message','w'){|f|f.write('')}
51
- end
52
- end
47
+ def self.reset_commit_message
48
+ File.open("commit.message", "w") { |f| f.write("") }
49
+ end
50
+ end
data/lib/tasks/default.rb CHANGED
@@ -1,62 +1,64 @@
1
- require 'rake'
2
- require_relative('info.rb')
3
- require_relative('../base/array.rb')
4
- require_relative('../base/dir.rb')
5
- require_relative('../base/environment.rb')
6
- require_relative('../base/projects.rb')
7
- require_relative('../base/project.rb')
8
- require_relative('../base/timer.rb')
1
+ # frozen_string_literal: true
2
+
3
+ require "rake"
4
+ require_relative("info")
5
+ require_relative("../base/array")
6
+ require_relative("../base/dir")
7
+ require_relative("../base/environment")
8
+ require_relative("../base/projects")
9
+ require_relative("../base/project")
10
+ require_relative("../base/timer")
9
11
 
10
12
  puts "defining DEFAULT TASK" if Environment.default.debug?
11
13
 
12
- work_up_to_date=false
13
- if(defined?(DEV))
14
+ work_up_to_date = false
15
+ if defined?(DEV)
14
16
  puts "DEFAULT: DEV is defined" if DEV.env.debug?
15
- project=DEV.projects.current
17
+ project = DEV.projects.current
16
18
  puts "project is nil" if DEV.env.debug? && project.nil?
17
- if(!project.nil?)
18
- if(project.work_up_to_date?)
19
+ unless project.nil?
20
+ if project.work_up_to_date?
19
21
  puts "project work is up to date" if DEV.env.debug?
20
- work_up_to_date=true
21
- else
22
- puts "project work is NOT up to date" if DEV.env.debug?
22
+ work_up_to_date = true
23
+ elsif DEV.env.debug?
24
+ puts "project work is NOT up to date"
23
25
  end
24
26
  end
25
27
  end
26
28
 
27
- if(defined?(NO_DEFAULT_TASK))
29
+ if defined?(NO_DEFAULT_TASK)
28
30
  puts "NO_DEFAULT_TASK is defined" if Environment.default.debug?
29
31
  else
30
- default_tasks=nil
31
- default_tasks=DEFAULT_TASKS if defined? DEFAULT_TASKS
32
- if(default_tasks.nil?)
33
- if(work_up_to_date)
34
- default_tasks=[]
35
- elsif(File.exists?('.git'))
36
- if(defined?(NO_AUTO_COMMIT))
37
- default_tasks=[:setup,:build,:test,:package,:publish,:clean]
32
+ default_tasks = nil
33
+ default_tasks = DEFAULT_TASKS if defined? DEFAULT_TASKS
34
+ if default_tasks.nil?
35
+ if work_up_to_date
36
+ default_tasks = []
37
+ elsif File.exist?(".git")
38
+ if defined?(NO_AUTO_COMMIT)
39
+ default_tasks = %i[setup build test package publish clean]
38
40
  else
39
- puts ':add,:commit,:push,:pull tasks are part of :default, to opt-out, define NO_AUTO_COMMIT'
40
- default_tasks=[:setup,:build,:test,:add,:commit,:package,:publish,:clean,:push,:pull]
41
+ puts ":add,:commit,:push,:pull tasks are part of :default, to opt-out, define NO_AUTO_COMMIT"
42
+ default_tasks = %i[setup build test add commit package publish clean push pull]
41
43
  end
42
- elsif File.exists?('.svn')
43
- default_tasks=[:setup,:build,:test,:add,:commit,:publish,:clean]
44
+ elsif File.exist?(".svn")
45
+ default_tasks = %i[setup build test add commit publish clean]
44
46
  else
45
- default_tasks=[:setup,:build,:test,:package,:publish]
47
+ default_tasks = %i[setup build test package publish]
46
48
  end
47
49
  end
48
50
 
49
51
  puts "default_tasks=#{default_tasks}" if Environment.default.debug?
50
- desc "default task #{default_tasks.to_s}"
52
+ desc "default task #{default_tasks}"
51
53
  task :default do
52
- default_tasks.each{|task|
53
- Rake::Task[task].invoke
54
- }
55
- project.mark_work_up_to_date if !project.nil?
56
- puts "[:default] completed in #{TIMER.elapsed_str}" if !Environment.default.colorize?
54
+ default_tasks.each do |task|
55
+ Rake::Task[task].invoke
56
+ end
57
+ project&.mark_work_up_to_date
58
+ puts "[:default] completed in #{TIMER.elapsed_str}" unless Environment.default.colorize?
57
59
  if Environment.default.colorize?
58
- require 'ansi/code'
59
- puts ANSI.white + ANSI.bold + ":default" + " completed in " + ANSI.yellow + "#{TIMER.elapsed_str}" + ANSI.reset
60
+ require "ansi/code"
61
+ puts "#{ANSI.white}#{ANSI.bold}:default completed in #{ANSI.yellow}#{TIMER.elapsed_str}#{ANSI.reset}"
60
62
  end
61
63
  end
62
- end
64
+ end
data/lib/tasks/doc.rb CHANGED
@@ -1,10 +1,12 @@
1
- desc 'performs documentation commands'
2
- task :doc do Tasks.execute_task :doc;end
1
+ # frozen_string_literal: true
2
+
3
+ desc "performs documentation commands"
4
+ task :doc do Tasks.execute_task :doc; end
3
5
 
4
6
  class Doc < Array
5
- def update
6
- if(Command.exit_code('yard --version'))
7
- add_quiet 'yard doc - LICENSE' if File.exists?('README.md') && File.exists?('LICENSE')
8
- end
9
- end
10
- end
7
+ def update
8
+ if Command.exit_code("yard --version") && (File.exist?("README.md") && File.exist?("LICENSE"))
9
+ add_quiet "yard doc - LICENSE"
10
+ end
11
+ end
12
+ end
data/lib/tasks/info.rb CHANGED
@@ -1,9 +1,10 @@
1
- desc 'displays project info'
1
+ # frozen_string_literal: true
2
+
3
+ desc "displays project info"
2
4
  task :info do
3
- Environment.default.info
4
- puts ' '
5
- #PROJECT.info
6
- puts ' '
7
- COMMANDS.info
5
+ Environment.default.info
6
+ puts " "
7
+ # PROJECT.info
8
+ puts " "
9
+ COMMANDS.info
8
10
  end
9
-