dev_tasks 0.0.14 → 0.0.15
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/dev_tasks.rb +33 -2
- data/lib/spec.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61f7f93e8ab64618147de9f178ac5efff643a209
|
4
|
+
data.tar.gz: 3c9fe43e38fff6458c00182fffe175acd6f5e432
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09352334bbfd133d4a33afcdbe3f5f88a14e8ced6201427042aa03b0a329d85fea4975a6c3c8a309e225c86bc8d41df0bbb4446dc846c477bcc54bad2443357e
|
7
|
+
data.tar.gz: 29a9bedaa8dfb3c4886cb3f5ba17d924332bbbed4ce0ec84d334a4d97267e544a0090378272f92ce856e12389bc16637f693338423fd3ee93ad5b85f4943f36e
|
data/lib/dev_tasks.rb
CHANGED
@@ -13,6 +13,22 @@ CLEAN.include("*.gem")
|
|
13
13
|
|
14
14
|
class DevTasks < Hash
|
15
15
|
|
16
|
+
def initialize
|
17
|
+
#hash = JSON.parse File.read("#{File.dirname(__FILE__)}/spec.json")
|
18
|
+
#self[:dev_tasks_gem]=JSON.parse File.read("#{File.dirname(__FILE__)}/spec.json")
|
19
|
+
|
20
|
+
self[:name]=Rake.application.original_dir.split('/').last
|
21
|
+
self[:scm]=DevTasks.scm
|
22
|
+
if(self[:scm]=='git')
|
23
|
+
branches=`git branch`.split(/\n/)
|
24
|
+
branches.each{|b|
|
25
|
+
self[:branch]=b.gsub('*','').strip
|
26
|
+
}
|
27
|
+
end
|
28
|
+
self[:dev_root]=DevTasks.dev_root
|
29
|
+
update
|
30
|
+
end
|
31
|
+
|
16
32
|
def add hash
|
17
33
|
hash.each do |key,value|
|
18
34
|
self[key]=value if !has_key?(key)
|
@@ -67,11 +83,26 @@ class DevTasks < Hash
|
|
67
83
|
end
|
68
84
|
end
|
69
85
|
|
86
|
+
def self.dev_root
|
87
|
+
["DEV_HOME","DEV_ROOT","USERPROFILE","HOME"].each {|v|
|
88
|
+
return ENV[v].gsub('\\','/') unless ENV[v].nil?
|
89
|
+
}
|
90
|
+
dir="~"
|
91
|
+
dir=ENV["HOME"] unless ENV["HOME"].nil?
|
92
|
+
dir=ENV["USERPROFILE"].gsub('\\','/') unless ENV["USERPROFILE"].nil?
|
93
|
+
dir=ENV["DEV_ROOT"].gsub('\\','/') unless ENV["DEV_ROOT"].nil?
|
94
|
+
|
95
|
+
return dir
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.scm
|
99
|
+
return "git" if(Dir.exists?(".git"))
|
100
|
+
return "svn" if(Dir.exists?(".svn"))
|
101
|
+
"none"
|
102
|
+
end
|
70
103
|
end
|
71
104
|
|
72
105
|
DEV_TASKS=DevTasks.new
|
73
|
-
DEV_TASKS.add JSON.parse File.read("#{File.dirname(__FILE__)}/spec.json")
|
74
|
-
DEV_TASKS.update
|
75
106
|
|
76
107
|
desc 'displays information about current rake directory'
|
77
108
|
task :info do
|
data/lib/spec.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"name":"dev_tasks","version":"0.0.
|
1
|
+
{"name":"dev_tasks","version":"0.0.15"}
|