cocoapods-mexdups 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +22 -0
- data/README.md +11 -0
- data/Rakefile +13 -0
- data/cocoapods-mexdups.gemspec +23 -0
- data/lib/cocoapods-mexdups/command/mexdups.rb +70 -0
- data/lib/cocoapods-mexdups/command.rb +1 -0
- data/lib/cocoapods-mexdups/gem_version.rb +3 -0
- data/lib/cocoapods-mexdups.rb +1 -0
- data/lib/cocoapods_plugin.rb +1 -0
- data/spec/command/mexdups_spec.rb +12 -0
- data/spec/spec_helper.rb +50 -0
- metadata +106 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6a346077fd2adadd3e961fb311cdf9d2fdcefc8f6a64d1180cf1b1059262eb84
|
4
|
+
data.tar.gz: e99d5f55757457180a2c25f15bbb04427df11a51d0a0b93815c257c5b10f9e5d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 227bf8f74f782f62717466b1a61b0f6ecfe17b792da512ff34eff83f3cb3fdbadaf1f64ef8b6879eac89f9caed637c5e78f323b4e4b96ff5dc3aa8a7d80e7306
|
7
|
+
data.tar.gz: 692064d244af97fa5b3e8016ec2c84b0858365479163dc725afd5418f7be9f555adb4aca1ae47ac2cbf7a4011ca981e73065b09071bbf7597973a532334d4e47
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2022 ashine <ashinecitic@gmail.com>
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'cocoapods-mexdups/gem_version.rb'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'cocoapods-mexdups'
|
8
|
+
spec.version = CocoapodsMexdups::VERSION
|
9
|
+
spec.authors = ['ashine']
|
10
|
+
spec.email = ['ashinecitic@gmail.com']
|
11
|
+
spec.description = '指定Pod目录和壳工程目录,搜索并移除壳工程目录已存在的重复文件'
|
12
|
+
spec.summary = '根据pod组件移除壳工程中的重复文件,先输入pod文件夹,再输入工程文件夹'
|
13
|
+
spec.homepage = 'https://github.com/JHshine/cocoapods-mexdups'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
spec.add_development_dependency 'cocoapods', '>= 1.1.1', '< 2.0'
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
# This is an example of a cocoapods plugin adding a top-level subcommand
|
4
|
+
# to the 'pod' command.
|
5
|
+
#
|
6
|
+
# You can also create subcommands of existing or new commands. Say you
|
7
|
+
# wanted to add a subcommand to `list` to show newly deprecated pods,
|
8
|
+
# (e.g. `pod list deprecated`), there are a few things that would need
|
9
|
+
# to change.
|
10
|
+
#
|
11
|
+
# - move this file to `lib/pod/command/list/deprecated.rb` and update
|
12
|
+
# the class to exist in the the Pod::Command::List namespace
|
13
|
+
# - change this class to extend from `List` instead of `Command`. This
|
14
|
+
# tells the plugin system that it is a subcommand of `list`.
|
15
|
+
# - edit `lib/cocoapods_plugins.rb` to require this file
|
16
|
+
#
|
17
|
+
# @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
|
18
|
+
# in the `plugins.json` file, once your plugin is released.
|
19
|
+
#
|
20
|
+
class Mexdups < Command
|
21
|
+
|
22
|
+
require 'fileutils'
|
23
|
+
require 'find'
|
24
|
+
|
25
|
+
self.summary = '根据pod组件移除壳工程中的重复文件,先输入pod文件夹,再输入工程文件夹'
|
26
|
+
|
27
|
+
self.description = <<-DESC
|
28
|
+
指定Pod目录和壳工程目录,搜索并移除壳工程目录已存在的重复文件
|
29
|
+
DESC
|
30
|
+
|
31
|
+
# 接收两个目录路径
|
32
|
+
def initialize(argv)
|
33
|
+
@pod_folder = argv.shift_argument
|
34
|
+
@shell_folder = argv.shift_argument
|
35
|
+
super
|
36
|
+
end
|
37
|
+
|
38
|
+
def validate!
|
39
|
+
super
|
40
|
+
help! 'pod folder is required.' unless @pod_folder
|
41
|
+
help! 'shell folder is required.' unless @shell_folder
|
42
|
+
end
|
43
|
+
|
44
|
+
def run
|
45
|
+
# FileUtils.rm_r 'Pods', :force => true
|
46
|
+
# TOOD: 列举pod folder中的所有文件名
|
47
|
+
|
48
|
+
pod_file_map = {}
|
49
|
+
|
50
|
+
Find.find(@pod_folder) do |path|
|
51
|
+
unless Dir.exist? path
|
52
|
+
pod_file_map[(File.basename path)] = true
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
Find.find(@shell_folder) do |path|
|
57
|
+
unless Dir.exist? path
|
58
|
+
file_name = File.basename(path)
|
59
|
+
if pod_file_map[file_name] == true
|
60
|
+
UI.puts "发现重复文件 #{file_name}"
|
61
|
+
FileUtils.rm_f path
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-mexdups/command/mexdups'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-mexdups/gem_version'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-mexdups/command'
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
|
3
|
+
$:.unshift((ROOT + 'lib').to_s)
|
4
|
+
$:.unshift((ROOT + 'spec').to_s)
|
5
|
+
|
6
|
+
require 'bundler/setup'
|
7
|
+
require 'bacon'
|
8
|
+
require 'mocha-on-bacon'
|
9
|
+
require 'pretty_bacon'
|
10
|
+
require 'pathname'
|
11
|
+
require 'cocoapods'
|
12
|
+
|
13
|
+
Mocha::Configuration.prevent(:stubbing_non_existent_method)
|
14
|
+
|
15
|
+
require 'cocoapods_plugin'
|
16
|
+
|
17
|
+
#-----------------------------------------------------------------------------#
|
18
|
+
|
19
|
+
module Pod
|
20
|
+
|
21
|
+
# Disable the wrapping so the output is deterministic in the tests.
|
22
|
+
#
|
23
|
+
UI.disable_wrap = true
|
24
|
+
|
25
|
+
# Redirects the messages to an internal store.
|
26
|
+
#
|
27
|
+
module UI
|
28
|
+
@output = ''
|
29
|
+
@warnings = ''
|
30
|
+
|
31
|
+
class << self
|
32
|
+
attr_accessor :output
|
33
|
+
attr_accessor :warnings
|
34
|
+
|
35
|
+
def puts(message = '')
|
36
|
+
@output << "#{message}\n"
|
37
|
+
end
|
38
|
+
|
39
|
+
def warn(message = '', actions = [])
|
40
|
+
@warnings << "#{message}\n"
|
41
|
+
end
|
42
|
+
|
43
|
+
def print(message)
|
44
|
+
@output << message
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
#-----------------------------------------------------------------------------#
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-mexdups
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ashine
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-03-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cocoapods
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.1.1
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.0'
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.1.1
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: bundler
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.3'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.3'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
description: 指定Pod目录和壳工程目录,搜索并移除壳工程目录已存在的重复文件
|
62
|
+
email:
|
63
|
+
- ashinecitic@gmail.com
|
64
|
+
executables: []
|
65
|
+
extensions: []
|
66
|
+
extra_rdoc_files: []
|
67
|
+
files:
|
68
|
+
- ".gitignore"
|
69
|
+
- Gemfile
|
70
|
+
- LICENSE.txt
|
71
|
+
- README.md
|
72
|
+
- Rakefile
|
73
|
+
- cocoapods-mexdups.gemspec
|
74
|
+
- lib/cocoapods-mexdups.rb
|
75
|
+
- lib/cocoapods-mexdups/command.rb
|
76
|
+
- lib/cocoapods-mexdups/command/mexdups.rb
|
77
|
+
- lib/cocoapods-mexdups/gem_version.rb
|
78
|
+
- lib/cocoapods_plugin.rb
|
79
|
+
- spec/command/mexdups_spec.rb
|
80
|
+
- spec/spec_helper.rb
|
81
|
+
homepage: https://github.com/JHshine/cocoapods-mexdups
|
82
|
+
licenses:
|
83
|
+
- MIT
|
84
|
+
metadata: {}
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
requirements: []
|
100
|
+
rubygems_version: 3.2.32
|
101
|
+
signing_key:
|
102
|
+
specification_version: 4
|
103
|
+
summary: 根据pod组件移除壳工程中的重复文件,先输入pod文件夹,再输入工程文件夹
|
104
|
+
test_files:
|
105
|
+
- spec/command/mexdups_spec.rb
|
106
|
+
- spec/spec_helper.rb
|