dev_commands 0.0.29 → 0.0.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/publish.rb +22 -2
  2. metadata +1 -1
@@ -21,8 +21,8 @@ class Publish < Array
21
21
  #Console.debug "adding publish commands.."
22
22
  add "svn mkdir #{svn_publish_uri} --parents -m\"publish\""
23
23
  add "svn checkout #{svn_publish_uri} #{local_dir}"
24
- add "<%Environment.copy_files(ARTIFACTS,'#{local_dir}')%>"
25
- add "<%Environment.svn_add_all('#{local_dir}')%>"
24
+ add "<%Publish.copy_files(ARTIFACTS,'#{local_dir}')%>"
25
+ add "<%Publish.svn_add_all('#{local_dir}')%>"
26
26
  add "svn commit #{local_dir}@ -m\"publish\""
27
27
  add "<%FileUtils.rm_r('#{local_dir}')%>"
28
28
  end
@@ -31,6 +31,26 @@ class Publish < Array
31
31
  end
32
32
  end
33
33
 
34
+ def self.copy_files files,dest
35
+ #Console.debug("Environment.copy_files([#{files.to_s}],'#{dest}'')")
36
+ files.each{|f|
37
+ if(File.directory?(dest))
38
+ dest_file = "#{dest}/#{f}"
39
+ #Console.debug "copying #{f} to #{dest_file}"
40
+ FileUtils.mkdir_p(File.dirname(dest_file)) if(!File.exists?(File.dirname(dest_file)))
41
+ FileUtils.cp(f,dest_file)
42
+ end
43
+ }
44
+ end
45
+
46
+ def self.svn_add_all dir
47
+ Dir.chdir(dir) do
48
+ Dir.glob('**/*').each{|f|
49
+ puts `svn add #{f} --parents` if(!File.directory?(f))
50
+ }
51
+ end
52
+ end
53
+
34
54
  def self.svn_latest_revision
35
55
  if(Dir.exists?(".svn"))
36
56
  `svn info`.scan(/Last Changed Rev: ([\d]+)/).each{|m|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.0.30
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: