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 +4 -4
- data/README.md +21 -1
- data/lib/cocoapods-uploader/command/maven/maven.rb +19 -39
- data/lib/cocoapods-uploader/gem_version.rb +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: d07a715e2ad93c3189a744b0bbccae152b4ba05a
|
4
|
+
data.tar.gz: f7a55baa648627db22c5699c86cd37dec0b4820c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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}.
|
36
|
-
|
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
|
51
|
-
|
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 #{
|
54
|
-
end
|
55
|
-
if File.exist?(file)
|
56
|
-
FileUtils.rm(file)
|
56
|
+
puts "Compress to File #{archive}"
|
57
57
|
end
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
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
|
|