dev_tasks 0.0.155 → 0.0.156
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/README +1 -3
- data/lib/add.rb +3 -4
- data/lib/build.rb +2 -8
- data/lib/commandarray.rb +9 -0
- data/lib/commands.rb +1 -1
- data/lib/commit.rb +2 -6
- data/lib/publish.rb +2 -1
- data/lib/pull.rb +3 -18
- data/lib/push.rb +2 -10
- data/lib/setup.rb +2 -5
- data/lib/spec.json +1 -1
- data/lib/test.rb +3 -5
- data/lib/upgrade.rb +2 -8
- data/lib/verify.rb +2 -9
- metadata +2 -1
data/README
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
=dev_tasks {<img src="https://badge.fury.io/rb/dev_tasks.png" alt="Gem Version" />}[http://badge.fury.io/rb/dev_tasks]
|
2
|
-
A gem that defines a set of tasks to aid in development of ruby and C
|
2
|
+
A gem that defines a set of rake tasks to aid in the development of ruby,C# and C++ projects.
|
3
3
|
|
4
4
|
==Installation
|
5
5
|
The gem can be installed by the single command
|
@@ -8,8 +8,6 @@ The gem can be installed by the single command
|
|
8
8
|
==Usage
|
9
9
|
This is an example of a simple usage
|
10
10
|
require 'dev_tasks'
|
11
|
-
task :default => [:dev_tasks_default] do
|
12
|
-
end
|
13
11
|
|
14
12
|
==Tasks
|
15
13
|
dev_tasks performs a discovery step when it is loaded to determine
|
data/lib/add.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require_relative './commandarray.rb'
|
2
|
+
|
3
|
+
class Add < CommandArray
|
2
4
|
|
3
5
|
def update
|
4
6
|
if(Dir.exists?(".git"))
|
@@ -8,7 +10,4 @@ class Add < Array
|
|
8
10
|
end
|
9
11
|
end
|
10
12
|
|
11
|
-
def add command
|
12
|
-
self << command if(!include?(command))
|
13
|
-
end
|
14
13
|
end
|
data/lib/build.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
require_relative './color.rb'
|
2
|
+
require_relative './commandarray.rb'
|
2
3
|
require_relative './msbuild.rb'
|
3
4
|
|
4
|
-
class Build <
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
end
|
5
|
+
class Build < CommandArray
|
8
6
|
|
9
7
|
def update
|
10
8
|
if(defined?(DEV_TASKS))
|
@@ -27,8 +25,4 @@ class Build < Array
|
|
27
25
|
}
|
28
26
|
end
|
29
27
|
end
|
30
|
-
|
31
|
-
def add command
|
32
|
-
self << command if(!include?(command))
|
33
|
-
end
|
34
28
|
end
|
data/lib/commandarray.rb
ADDED
data/lib/commands.rb
CHANGED
@@ -14,7 +14,7 @@ class Commands < Hash
|
|
14
14
|
attr_accessor :build
|
15
15
|
|
16
16
|
def initialize
|
17
|
-
self[:pull] = Pull.new
|
17
|
+
self[:pull] = Pull.new if(Environment.scm=='git' && Environment.scm_origin.length > 0)
|
18
18
|
self[:upgrade] = Upgrade.new
|
19
19
|
self[:setup] = Setup.new
|
20
20
|
self[:build] = Build.new
|
data/lib/commit.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
+
require_relative('./commandarray.rb')
|
1
2
|
require_relative('./environment.rb')
|
2
3
|
|
3
|
-
class Commit <
|
4
|
-
|
4
|
+
class Commit < CommandArray
|
5
5
|
def update
|
6
6
|
if(Dir.exists?(".git"))
|
7
7
|
if(!`git status`.include?('nothing to commit') || `git status`.include?('untracked files present'))
|
@@ -20,8 +20,4 @@ class Commit < Array
|
|
20
20
|
self.add "<%DEV_TASKS[:commands][:verify].update%>"
|
21
21
|
end
|
22
22
|
end
|
23
|
-
|
24
|
-
def add command
|
25
|
-
self << command if(!include?(command))
|
26
|
-
end
|
27
23
|
end
|
data/lib/publish.rb
CHANGED
data/lib/pull.rb
CHANGED
@@ -1,30 +1,15 @@
|
|
1
|
+
require_relative('./commandarray.rb')
|
1
2
|
require_relative('./environment.rb')
|
2
3
|
require 'time'
|
3
4
|
|
4
|
-
class Pull <
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
update
|
8
|
-
end
|
9
|
-
|
5
|
+
class Pull < CommandArray
|
10
6
|
def update
|
11
|
-
if(Environment.scm=='git')
|
7
|
+
if(Environment.scm=='git' && Environment.scm_origin.length > 0)
|
12
8
|
if(Timer.elapsed_exceeds?("last_pull",60*60*2))
|
13
9
|
#if(Timer.get_elapsed("last_pull").nil? || Timer.get_elapsed("last_pull") > 60*60*2)
|
14
10
|
self.add "<%`git pull 2>&1`%>"
|
15
11
|
self.add "<%Timer.set_timestamp('last_pull')%>"
|
16
12
|
end
|
17
|
-
# last_pull_time=nil
|
18
|
-
# last_pull_time = Time.parse(File.read('log/last_pull').strip) if(File.exist?('log/last_pull'))
|
19
|
-
# if(last_pull_time.nil? || (last_pull_time-Time.now) > 60*60*2)
|
20
|
-
# self.add "<%`git pull 2>&1`%>"
|
21
|
-
# self.add "<%Dir.mkdir('log') if(!File.exists?('log'))%>"
|
22
|
-
# self.add "<%File.open('log/last_pull','w'){|f|f.puts(Time.now.to_s)}%>"
|
23
|
-
# end
|
24
13
|
end
|
25
14
|
end
|
26
|
-
|
27
|
-
def add command
|
28
|
-
self << command if(!include?(command))
|
29
|
-
end
|
30
15
|
end
|
data/lib/push.rb
CHANGED
@@ -1,18 +1,10 @@
|
|
1
|
+
require_relative('./push.rb')
|
1
2
|
require_relative('./environment.rb')
|
2
3
|
|
3
|
-
class Push <
|
4
|
-
|
5
|
-
def initialize
|
6
|
-
update
|
7
|
-
end
|
8
|
-
|
4
|
+
class Push < CommandArray
|
9
5
|
def update
|
10
6
|
if(Environment.scm=='git')
|
11
7
|
self.add "<%`git push 2>&1`%>"
|
12
8
|
end
|
13
9
|
end
|
14
|
-
|
15
|
-
def add command
|
16
|
-
self << command if(!include?(command))
|
17
|
-
end
|
18
10
|
end
|
data/lib/setup.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
class Setup <
|
1
|
+
require_relative('./commandarray.rb')
|
2
|
+
class Setup < CommandArray
|
3
3
|
|
4
4
|
def update
|
5
5
|
if(defined?(DEV_TASKS))
|
@@ -13,7 +13,4 @@ class Setup < Array
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
def add command
|
17
|
-
self << command if(!include?(command))
|
18
|
-
end
|
19
16
|
end
|
data/lib/spec.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"name":"dev_tasks","version":"0.0.
|
1
|
+
{"name":"dev_tasks","version":"0.0.156"}
|
data/lib/test.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require_relative('./commandarray.rb')
|
2
|
+
|
3
|
+
class Test < CommandArray
|
2
4
|
|
3
5
|
def update
|
4
6
|
# rspec tests, 'rspec --pattern="**/*.spec"'
|
@@ -23,10 +25,6 @@ class Test < Array
|
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
26
|
-
def add command
|
27
|
-
self << command if(!include?(command))
|
28
|
-
end
|
29
|
-
|
30
28
|
def self.nunit_console
|
31
29
|
"C:\\Program Files (x86)\\NUnit 2.6.3\\bin\\nunit-console.exe"
|
32
30
|
end
|
data/lib/upgrade.rb
CHANGED
@@ -1,10 +1,7 @@
|
|
1
|
+
require_relative('./commandarray.rb')
|
1
2
|
require_relative('./environment.rb')
|
2
3
|
|
3
|
-
class Upgrade <
|
4
|
-
|
5
|
-
def initialize
|
6
|
-
update
|
7
|
-
end
|
4
|
+
class Upgrade < CommandArray
|
8
5
|
|
9
6
|
def update
|
10
7
|
if(Environment.scm=='git' && Environment.branch=='develop')
|
@@ -52,7 +49,4 @@ class Upgrade < Array
|
|
52
49
|
end
|
53
50
|
end
|
54
51
|
|
55
|
-
def add command
|
56
|
-
self << command if(!include?(command))
|
57
|
-
end
|
58
52
|
end
|
data/lib/verify.rb
CHANGED
@@ -1,11 +1,8 @@
|
|
1
|
+
require_relative('./commandarray.rb')
|
1
2
|
require_relative('./environment.rb')
|
2
3
|
require_relative('./console.rb')
|
3
4
|
|
4
|
-
class Verify <
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
update
|
8
|
-
end
|
5
|
+
class Verify < CommandArray
|
9
6
|
|
10
7
|
def update
|
11
8
|
|
@@ -36,8 +33,4 @@ class Verify < Array
|
|
36
33
|
end
|
37
34
|
end
|
38
35
|
end
|
39
|
-
|
40
|
-
def add command
|
41
|
-
self << command if(!include?(command))
|
42
|
-
end
|
43
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dev_tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.156
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- lib/artifacts.x.rb
|
102
102
|
- lib/build.rb
|
103
103
|
- lib/color.rb
|
104
|
+
- lib/commandarray.rb
|
104
105
|
- lib/commands.rb
|
105
106
|
- lib/commit.rb
|
106
107
|
- lib/console.rb
|