cocoapods-lazy 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/cocoapods-lazy +6 -0
- data/lib/cocoapods-lazy.rb +60 -0
- data/lib/cocoapods-lazy/podfile_lock.rb +13 -0
- data/lib/cocoapods-lazy/repository.rb +27 -0
- data/lib/cocoapods-lazy/version.rb +3 -0
- metadata +106 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d87ba143103b95aefc36a1b32a72b940caaab827
|
4
|
+
data.tar.gz: 6727705de861acbd677e6871faae26301e176f2f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 81be5ca2843d006332947e9e4617faf132fe76830c3c29c05f244770b1234e67cc47e94b9426dc798a160a26b4f83c09d312254edcf1aa2fbea20b352dc5cf99
|
7
|
+
data.tar.gz: 867dce4e9d8b32dafc4e52005df326ded1b3417b3f37f292377d25e77b24559b117980e79588e9f8c84a9a285e75ea269e5122156cf5fdcc7e9e456a35112ab2
|
data/bin/cocoapods-lazy
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'cocoapods-lazy/version'
|
2
|
+
require 'cocoapods-lazy/podfile_lock'
|
3
|
+
require 'cocoapods-lazy/repository'
|
4
|
+
require 'cocoapods'
|
5
|
+
|
6
|
+
module CocoapodsLazy
|
7
|
+
class Invoker
|
8
|
+
def self.invoke(argv)
|
9
|
+
use_case = UseCase.new()
|
10
|
+
case
|
11
|
+
when argv.include?('install')
|
12
|
+
use_case.install
|
13
|
+
when argv.include?('update')
|
14
|
+
use_case.update()
|
15
|
+
when argv.include?('store')
|
16
|
+
use_case.store()
|
17
|
+
else
|
18
|
+
raise "Unknown command!"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class UseCase
|
24
|
+
def initialize()
|
25
|
+
@repository = Repository.new("PodStore.env")
|
26
|
+
end
|
27
|
+
|
28
|
+
def install
|
29
|
+
puts "Check local prebuild"
|
30
|
+
if read_podfile_checksum() != read_manifest_checksum()
|
31
|
+
puts 'Drop pods'
|
32
|
+
`rm -rf Pods`
|
33
|
+
@repository.download(name: read_podfile_checksum())
|
34
|
+
else
|
35
|
+
puts 'Pods is actual'
|
36
|
+
end
|
37
|
+
Pod::Command.run(ARGV)
|
38
|
+
store() if read_podfile_checksum() != read_manifest_checksum()
|
39
|
+
end
|
40
|
+
|
41
|
+
def update
|
42
|
+
Pod::Command.run(ARGV)
|
43
|
+
store()
|
44
|
+
end
|
45
|
+
|
46
|
+
def store
|
47
|
+
@repository.upload(name: read_podfile_checksum())
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def read_podfile_checksum
|
53
|
+
PodfileLock.new("Podfile.lock").checksum
|
54
|
+
end
|
55
|
+
|
56
|
+
def read_manifest_checksum
|
57
|
+
PodfileLock.new("./Pods/Manifest.lock").checksum
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'dotenv'
|
2
|
+
|
3
|
+
class Repository
|
4
|
+
def initialize(file)
|
5
|
+
Dotenv.load("#{file}")
|
6
|
+
@user = ENV['STORE_USER']
|
7
|
+
@password = ENV['STORE_PASSWORD']
|
8
|
+
@base_url = ENV['BASE_URL']
|
9
|
+
end
|
10
|
+
|
11
|
+
def download(name:)
|
12
|
+
zip_name = "#{name}.zip"
|
13
|
+
url = @base_url + zip_name
|
14
|
+
puts `curl --fail -v -u #{@user}:#{@password} #{url} --output #{zip_name}`
|
15
|
+
`unzip #{zip_name}`
|
16
|
+
`rm -rf #{zip_name}`
|
17
|
+
end
|
18
|
+
|
19
|
+
def upload(name:)
|
20
|
+
zip_name = "#{name}.zip"
|
21
|
+
url = @base_url + zip_name
|
22
|
+
puts "Make zip: #{zip_name}"
|
23
|
+
`zip -9 -r -y #{zip_name} Pods`
|
24
|
+
puts "Storing to #{url}"
|
25
|
+
`curl --fail -v -u #{@user}:#{@password} --upload-file #{zip_name} #{url}`
|
26
|
+
end
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-lazy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Artem Mylnikov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-06-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dotenv
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.7.4
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.7.4
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: cocoapods
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.6'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
description: Share pods dir to team
|
70
|
+
email:
|
71
|
+
- ajjnix@gmail.com
|
72
|
+
executables:
|
73
|
+
- cocoapods-lazy
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- bin/cocoapods-lazy
|
78
|
+
- lib/cocoapods-lazy.rb
|
79
|
+
- lib/cocoapods-lazy/podfile_lock.rb
|
80
|
+
- lib/cocoapods-lazy/repository.rb
|
81
|
+
- lib/cocoapods-lazy/version.rb
|
82
|
+
homepage: https://github.com/ajjnix/cocoapods-lazy
|
83
|
+
licenses:
|
84
|
+
- MIT
|
85
|
+
metadata: {}
|
86
|
+
post_install_message:
|
87
|
+
rdoc_options: []
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
requirements: []
|
101
|
+
rubyforge_project:
|
102
|
+
rubygems_version: 2.5.2.3
|
103
|
+
signing_key:
|
104
|
+
specification_version: 4
|
105
|
+
summary: Gem for store and share pods
|
106
|
+
test_files: []
|