anticuado 0.2.12 → 0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -2
- data/anticuado.gemspec +1 -0
- data/lib/anticuado/base.rb +24 -0
- data/lib/anticuado/ios/cocoapods.rb +25 -2
- data/lib/anticuado/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0609518668ff2779883e9191014e5c92d276aec8'
|
4
|
+
data.tar.gz: 192d84ff647088e45d843645bbeda02b2eb464a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea636dc1dd30ff5aa0eba95ccf5c7cf507ef0bc637b565cb19aeec5d68339e6b4e42a3bdc6aa8c7584d1209138a897028ac54af545e795e23fe7231acefcaf60
|
7
|
+
data.tar.gz: bab8a04f8ca1483f9ce8c8715377683ed0fd9b667f9dc24035bf5685cd0782eda7b744ca2674ce4ad6dc8a9e411456e717eefa0290d3c52205939d626a6e7e21
|
data/.travis.yml
CHANGED
data/anticuado.gemspec
CHANGED
data/lib/anticuado/base.rb
CHANGED
@@ -7,5 +7,29 @@ module Anticuado
|
|
7
7
|
def self.format(_outdated)
|
8
8
|
raise NotImplementedError
|
9
9
|
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def self.update_with_prefix(pod_file_in:, pod_file_out: nil, libraries:, prefix:)
|
14
|
+
pod_file_out = pod_file_in if pod_file_out.nil?
|
15
|
+
current_pod = File.read(pod_file_in)
|
16
|
+
|
17
|
+
result = current_pod.each_line.reduce("") do |memo, line|
|
18
|
+
memo << if line.strip.start_with?(prefix)
|
19
|
+
key = get_key libraries, line
|
20
|
+
key.nil? ? line : line.sub(/[0-9|.]+/, libraries[key])
|
21
|
+
else
|
22
|
+
line
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
File.write(pod_file_out, result)
|
27
|
+
result
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.get_key(libraries, line)
|
31
|
+
libraries.each_key { |k| return k if line.include?(k.to_s) }
|
32
|
+
nil
|
33
|
+
end
|
10
34
|
end
|
11
35
|
end
|
@@ -1,16 +1,29 @@
|
|
1
1
|
module Anticuado
|
2
2
|
module IOS
|
3
3
|
class CocoaPods < Anticuado::Base
|
4
|
+
# @param [String] project Name of library.
|
5
|
+
# @return [String] The result of command `pod outdated`.
|
6
|
+
def self.update_lock(library: nil)
|
7
|
+
return puts "have no pod command" if `which pod`.empty?
|
8
|
+
|
9
|
+
if library
|
10
|
+
`pod update #{library}`
|
11
|
+
else
|
12
|
+
`pod update`
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
4
16
|
# @param [String] project Path to project directory.
|
5
17
|
# @return [String] The result of command `pod outdated`.
|
6
18
|
def self.outdated(project = nil)
|
7
19
|
return puts "have no pod command" if `which pod`.empty?
|
8
|
-
|
9
|
-
`pod install`
|
10
20
|
|
11
21
|
if project
|
22
|
+
|
23
|
+
`pod install --project-directory=#{project}`
|
12
24
|
`pod outdated --project-directory=#{project}`
|
13
25
|
else
|
26
|
+
`pod install`
|
14
27
|
`pod outdated`
|
15
28
|
end
|
16
29
|
end
|
@@ -36,6 +49,16 @@ module Anticuado
|
|
36
49
|
end
|
37
50
|
}.compact
|
38
51
|
end
|
52
|
+
|
53
|
+
# @param [String] pod_file_in The file path to Podfile you'd like to update
|
54
|
+
# @param [String] pod_file_out The file path to new Podfile updated. Default is nil and then `pod_file_in` is used
|
55
|
+
# as the file path
|
56
|
+
# @param [Hash] library_name The library name you'd like to update
|
57
|
+
# {library_name: "version", library_name2: "version"}
|
58
|
+
# @return [String] new Podfile
|
59
|
+
def self.update(pod_file_in:, pod_file_out: nil, libraries:)
|
60
|
+
update_with_prefix(pod_file_in: pod_file_in, pod_file_out: pod_file_out, libraries: libraries, prefix: "pod ")
|
61
|
+
end
|
39
62
|
end # class CocoaPods
|
40
63
|
end # module IOS
|
41
64
|
end # module Anticuado
|
data/lib/anticuado/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anticuado
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuaki MATSUO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -91,7 +91,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
91
|
requirements:
|
92
92
|
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version: '
|
94
|
+
version: '2.1'
|
95
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
97
|
- - ">="
|