dev 2.1.73 → 2.1.74

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37d9a4d48c4d24a9b64d542e093da48dcb3de727
4
- data.tar.gz: d1c88dc7549b184752f128d1427c4422f83dc8ed
3
+ metadata.gz: aa749868a59f071bbcbe24b51ecacc37e95783a8
4
+ data.tar.gz: 7e0454ee592e03aa61c67fead4e945aa2341b6a3
5
5
  SHA512:
6
- metadata.gz: 8fece183cb976c5ce10226bbc0b0897a39482b38ced60d945990cae86ca90c3d8b2143d651b3aba626735043600dc328b63b83751d94efc0d4a2b46ab449db00
7
- data.tar.gz: 59c25e95452d8c2ac15b9f115e658a54af5a616793a27f0b7c8b0082d3e76df148eab5b504c038740a09dd6f03efd8bf4648fdaea151130fbe7562028e8c1c02
6
+ metadata.gz: 9b76a5cd0c1e78a06af14669082578500dc3c5e45213eb82ee4188078122762d8f17fe824e70dc74da18a57a8c37463daf67d460b0995221579983b5b834eb1a
7
+ data.tar.gz: d56bf9cbae686ceb4019b49e89e9bba7dcb325a070a683248c62f71afec3298daf49be24039cef59b1020b085869eeadabab14dfc3ac3df9783d00c7140ed90b
data/lib/apps/zip.rb ADDED
@@ -0,0 +1,61 @@
1
+ puts __FILE__ if defined?(DEBUG)
2
+
3
+ require 'zip'
4
+ require 'fileutils'
5
+
6
+ module Zip
7
+ extend self
8
+ # exports a zip file to a destination directory
9
+ # zip_file full path to a zip file to be exported
10
+ # destination directory where the zip file contents are to be placed
11
+ def self.export zip_file, destination
12
+ raise "#{zip_file} does not exist." unless(::File.exists?(zip_file))
13
+
14
+ unzip(zip_file, destination) unless(Dir.exists?(destination))
15
+ sleep(0.5) # I guess we need to give the OS some time to get things in order?
16
+ end
17
+
18
+ # publish a directory to a file path
19
+ # source_dir is the directory with the files to be published
20
+ # destination is the zip file path
21
+ # source_glob is a string or array of glob directives to specify files in source_dir to be publish
22
+ # source_glob defaults to '**/*' to publish all files in the source_dir
23
+ def self.publish source_dir, destination, source_filelist=FileList.new('**/*')
24
+ Dir.mktmpdir do |dir| # Build zip file locally
25
+ tmp_file_name = "#{dir}/#{::File.basename(destination)}"
26
+
27
+ zip(source_dir, source_filelist, tmp_file_name)
28
+
29
+ destination_dir = ::File.dirname(destination)
30
+ FileUtils.mkpath(destination_dir) unless(Dir.exists?(destination_dir))
31
+
32
+ FileUtils.cp(tmp_file_name, destination)
33
+ end
34
+ end
35
+
36
+ private
37
+ def self.zip(base_directory, files_to_archive, zip_file)
38
+ FileUtils.mkpath(::File.dirname(zip_file)) unless(Dir.exists?(::File.dirname(zip_file)))
39
+ io = Zip::File.open(zip_file, Zip::File::CREATE);
40
+
41
+ files_to_archive.each do |file|
42
+ io.get_output_stream(file) { |f| f.puts(::File.open("#{base_directory}/#{file}", "rb").read())}
43
+ end
44
+
45
+ io.close();
46
+ end
47
+
48
+ def self.unzip(zip_file, destination)
49
+ FileUtils.mkpath(destination) unless(Dir.exists?(destination))
50
+ Zip::File.open(zip_file) do |files|
51
+ files.each do |entry|
52
+ destination_file = "#{destination}/#{entry.name}"
53
+
54
+ directory = ::File.dirname(destination_file)
55
+ FileUtils.mkpath(directory) unless(Dir.exists?(directory))
56
+
57
+ entry.extract(destination_file)
58
+ end
59
+ end
60
+ end
61
+ end
data/lib/apps.rb CHANGED
@@ -1,3 +1,3 @@
1
- puts __FILE__ if defined?(DEBUG)
2
-
3
- ['git','msbuild','nuget','svn','wix','xcodebuild'].each{|name| require_relative("apps/#{name}.rb")}
1
+ puts __FILE__ if defined?(DEBUG)
2
+
3
+ ['git','msbuild','nuget','svn','wix','xcodebuild','zip'].each{|name| require_relative("apps/#{name}.rb")}
data/lib/tasks/setup.rb CHANGED
@@ -71,6 +71,14 @@ class Setup < Array
71
71
  }
72
72
  end
73
73
 
74
+ if(defined?(ZIP_EXPORTS))
75
+ ZIP_EXPORTS.each{|k,v|
76
+ #puts "Here: #{k} -> #{v}"
77
+ directory = "#{Command.dev_root}/dep/#{k}"
78
+ Zip.export(v, directory) unless(Dir.exists?(directory))
79
+ }
80
+ end
81
+
74
82
  if(defined?(VERSION))
75
83
  #puts "updating nuspec files for VERSION #{VERSION}" if env.debug?
76
84
  Dir.glob('*.nuspec').each{|nuspec|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.73
4
+ version: 2.1.74
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-03 00:00:00.000000000 Z
11
+ date: 2017-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubyzip
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 1.2.1
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 1.2.1
55
69
  description: development tasks
56
70
  email: lou.parslow@gmail.com
57
71
  executables:
@@ -69,6 +83,7 @@ files:
69
83
  - lib/apps/svn.rb
70
84
  - lib/apps/wix.rb
71
85
  - lib/apps/xcodebuild.rb
86
+ - lib/apps/zip.rb
72
87
  - lib/base.rb
73
88
  - lib/base/array.rb
74
89
  - lib/base/command.rb