cocoapods-uploader 0.0.1 → 0.0.2

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: 56d37f19929d427ba4f13996b09d14ae0782fba3
4
- data.tar.gz: fd4d3fc9ccd591d0d9eee822110b2474aefe02cf
3
+ metadata.gz: d07a715e2ad93c3189a744b0bbccae152b4ba05a
4
+ data.tar.gz: f7a55baa648627db22c5699c86cd37dec0b4820c
5
5
  SHA512:
6
- metadata.gz: 475771f351b91e5dab804b3f6027761ba6c663ff305ca859d21d41287d4040a3b026803ab54bfab9711edbde9bcd109341483ddbc6a3ea6a2c3aa54856a5586d
7
- data.tar.gz: 7b77905760bc4ef020acb241737ab74423199e45039832e876ff30141e409ea04b7db4c3b8bd1a4b49074a9f720b7b6d0c6134aa217bf23f04d17600510efcb9
6
+ metadata.gz: c123d277dd2add20687bd63211546c15d7eda3ea9d75c87c3179527b7505e372382bc4c20c4171774084a1d1202177a1f14da03217729001f9c44e1d0072c763
7
+ data.tar.gz: 93ab4e427ef4e9e360d45b590e579ff1b0d341120c97e140f9a865078abcb8f6c2af19917823e51964e2cb3381d8c0227126621104ef3ddcfd7e33d0b962845b
data/README.md CHANGED
@@ -8,4 +8,24 @@ cocoapods-uploader is a tool that help upload file/dir to remote repository.
8
8
 
9
9
  ## Usage
10
10
 
11
- - setting
11
+ - setting
12
+
13
+ $ pod upload maven set HOST REPO [USER] [PASSWORD] [SUFFIX]
14
+
15
+ etc:
16
+
17
+ $ pod upload maven set http://mvn.xxxx.com test sanping.li xxx /artifactory/service/local/repositories/+repo+/content/
18
+
19
+
20
+ - upload
21
+
22
+ $ pod upload maven PATH SPEC
23
+
24
+ etc:
25
+
26
+ $ pod upload maven ios Test.podspec
27
+
28
+
29
+ ## Author
30
+
31
+ [https://github.com/supern](https://github.com/supern)
@@ -6,6 +6,8 @@ require 'fileutils'
6
6
  module Pod
7
7
  class Command
8
8
  class Maven < Upload
9
+ attr_accessor :path, :spec
10
+
9
11
  self.summary = 'Upload file/dir to remote maven repository.'
10
12
 
11
13
  self.description = <<-DESC
@@ -32,8 +34,8 @@ module Pod
32
34
  version = Specification.from_file(@spec).version
33
35
  name = Specification.from_file(@spec).name
34
36
 
35
- file_name = "#{name}.gz"
36
- compress_file(@path,file_name)
37
+ file_name = "#{name}.zip"
38
+ compress(@path.dup,file_name)
37
39
 
38
40
  setting = Pod::Setting.new
39
41
  setting.open
@@ -47,46 +49,24 @@ module Pod
47
49
 
48
50
  private
49
51
 
50
- def compress_file(path,file_name)
51
- file = "./#{file_name}"
52
+ def compress(path,file_name)
53
+ path.sub!(%r[/$],'')
54
+ archive = File.join(File.dirname(path),file_name)
52
55
  if Pod::Config.instance.verbose?
53
- puts "Compress File #{file}"
54
- end
55
- if File.exist?(file)
56
- FileUtils.rm(file)
56
+ puts "Compress to File #{archive}"
57
57
  end
58
- entries = [path]#Dir.entries(path) - %w(. ..)
59
- Zip::File.open(file, ::Zip::File::CREATE) do |io|
60
- write_entries entries, '', io
61
- end
62
- end
63
-
64
- def write_entries(entries, inpath, io)
65
- entries.each do |e|
66
- entry_path = inpath == '' ? e : File.join(inpath, e)
67
- zip_path = File.join('.', entry_path)
68
-
69
- if Pod::Config.instance.verbose?
70
- puts "Deflating #{zip_path}"
58
+ FileUtils.rm archive, :force=>true
59
+
60
+ Zip::OutputStream.open(archive) do |zip|
61
+ Dir["#{path}/**/**"].reject{|f|f==archive}.each do |file|
62
+ if Pod::Config.instance.verbose?
63
+ puts "Deflating #{file}"
64
+ end
65
+ entry = Zip::Entry.new("", file)
66
+ entry.gather_fileinfo_from_srcpath(file)
67
+ zip.put_next_entry(entry, nil, nil, Zip::Entry::DEFLATED, Zlib::BEST_COMPRESSION)
68
+ entry.write_to_zip_output_stream(zip)
71
69
  end
72
-
73
- if File.directory? zip_path
74
- recursively_deflate_directory(zip_path, io, entry_path)
75
- else
76
- put_into_archive(zip_path, io, entry_path)
77
- end
78
- end
79
- end
80
-
81
- def recursively_deflate_directory(zip_path, io, entry_path)
82
- io.mkdir entry_path
83
- subdir = Dir.entries(zip_path) - %w(. ..)
84
- write_entries subdir, entry_path, io
85
- end
86
-
87
- def put_into_archive(zip_path, io, entry_path)
88
- io.get_output_stream(entry_path) do |f|
89
- f.puts(File.open(zip_path, 'rb').read)
90
70
  end
91
71
  end
92
72
 
@@ -1,3 +1,3 @@
1
1
  module CocoapodsUploader
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-uploader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - supern_lee