cocoapods-aqarahome 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d0e9066aa25a56bc22955678caf0a461972044139e3152d1c6723a32f51322dd
4
+ data.tar.gz: eb78f37bb214545deca2a5b33397748182de77a163b51d0b8c376a50dfe2c2d1
5
+ SHA512:
6
+ metadata.gz: c47666b94477aceca2c88320350c9e6d09d70fd0bec23eb08fe8771c8f438295d82aeb8e794bd6f70bbfeb720fae2e90a2dc7f634f5c1820f52e04e25f214050
7
+ data.tar.gz: b6081e63fd90ed6ce1561a73dce8fcd4c90765e2eb58e11bf4ff1203b60c1bba9dbc35ce890c37ed17d6b9628a5d6c983c544beafb02d3975b048dcf659d3e12
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ .DS_Store
2
+ pkg
3
+ .idea/
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cocoapods-aqarahome.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem 'cocoapods'
8
+
9
+ gem 'mocha'
10
+ gem 'bacon'
11
+ gem 'mocha-on-bacon'
12
+ gem 'prettybacon'
13
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,119 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cocoapods-aqarahome (0.0.1)
5
+ claide (>= 1.0.2, < 2.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ CFPropertyList (3.0.5)
11
+ rexml
12
+ activesupport (6.1.7)
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ i18n (>= 1.6, < 2)
15
+ minitest (>= 5.1)
16
+ tzinfo (~> 2.0)
17
+ zeitwerk (~> 2.3)
18
+ addressable (2.8.1)
19
+ public_suffix (>= 2.0.2, < 6.0)
20
+ algoliasearch (1.27.5)
21
+ httpclient (~> 2.8, >= 2.8.3)
22
+ json (>= 1.5.1)
23
+ atomos (0.1.3)
24
+ bacon (1.2.0)
25
+ claide (1.1.0)
26
+ cocoapods (1.11.3)
27
+ addressable (~> 2.8)
28
+ claide (>= 1.0.2, < 2.0)
29
+ cocoapods-core (= 1.11.3)
30
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
31
+ cocoapods-downloader (>= 1.4.0, < 2.0)
32
+ cocoapods-plugins (>= 1.0.0, < 2.0)
33
+ cocoapods-search (>= 1.0.0, < 2.0)
34
+ cocoapods-trunk (>= 1.4.0, < 2.0)
35
+ cocoapods-try (>= 1.1.0, < 2.0)
36
+ colored2 (~> 3.1)
37
+ escape (~> 0.0.4)
38
+ fourflusher (>= 2.3.0, < 3.0)
39
+ gh_inspector (~> 1.0)
40
+ molinillo (~> 0.8.0)
41
+ nap (~> 1.0)
42
+ ruby-macho (>= 1.0, < 3.0)
43
+ xcodeproj (>= 1.21.0, < 2.0)
44
+ cocoapods-core (1.11.3)
45
+ activesupport (>= 5.0, < 7)
46
+ addressable (~> 2.8)
47
+ algoliasearch (~> 1.0)
48
+ concurrent-ruby (~> 1.1)
49
+ fuzzy_match (~> 2.0.4)
50
+ nap (~> 1.0)
51
+ netrc (~> 0.11)
52
+ public_suffix (~> 4.0)
53
+ typhoeus (~> 1.0)
54
+ cocoapods-deintegrate (1.0.5)
55
+ cocoapods-downloader (1.6.3)
56
+ cocoapods-plugins (1.0.0)
57
+ nap
58
+ cocoapods-search (1.0.1)
59
+ cocoapods-trunk (1.6.0)
60
+ nap (>= 0.8, < 2.0)
61
+ netrc (~> 0.11)
62
+ cocoapods-try (1.2.0)
63
+ colored2 (3.1.2)
64
+ concurrent-ruby (1.1.10)
65
+ escape (0.0.4)
66
+ ethon (0.16.0)
67
+ ffi (>= 1.15.0)
68
+ ffi (1.15.5)
69
+ fourflusher (2.3.1)
70
+ fuzzy_match (2.0.4)
71
+ gh_inspector (1.1.3)
72
+ httpclient (2.8.3)
73
+ i18n (1.12.0)
74
+ concurrent-ruby (~> 1.0)
75
+ json (2.6.2)
76
+ minitest (5.16.3)
77
+ mocha (2.0.2)
78
+ ruby2_keywords (>= 0.0.5)
79
+ mocha-on-bacon (0.2.3)
80
+ mocha (>= 0.13.0)
81
+ molinillo (0.8.0)
82
+ nanaimo (0.3.0)
83
+ nap (1.1.0)
84
+ netrc (0.11.0)
85
+ prettybacon (0.0.2)
86
+ bacon (~> 1.2)
87
+ public_suffix (4.0.7)
88
+ rake (13.0.6)
89
+ rexml (3.2.5)
90
+ ruby-macho (2.5.1)
91
+ ruby2_keywords (0.0.5)
92
+ typhoeus (1.4.0)
93
+ ethon (>= 0.9.0)
94
+ tzinfo (2.0.5)
95
+ concurrent-ruby (~> 1.0)
96
+ xcodeproj (1.22.0)
97
+ CFPropertyList (>= 2.3.3, < 4.0)
98
+ atomos (~> 0.1.3)
99
+ claide (>= 1.0.2, < 2.0)
100
+ colored2 (~> 3.1)
101
+ nanaimo (~> 0.3.0)
102
+ rexml (~> 3.2.4)
103
+ zeitwerk (2.6.6)
104
+
105
+ PLATFORMS
106
+ arm64-darwin-21
107
+
108
+ DEPENDENCIES
109
+ bacon
110
+ bundler (~> 2.3.26)
111
+ cocoapods
112
+ cocoapods-aqarahome!
113
+ mocha
114
+ mocha-on-bacon
115
+ prettybacon
116
+ rake
117
+
118
+ BUNDLED WITH
119
+ 2.3.26
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2022 zhaoxifan <179988305@qq.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
@@ -0,0 +1,11 @@
1
+ # cocoapods-aqarahome
2
+
3
+ A description of cocoapods-aqarahome.
4
+
5
+ ## Installation
6
+
7
+ $ gem install cocoapods-aqarahome
8
+
9
+ ## Usage
10
+
11
+ $ pod spec aqarahome POD_NAME
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ def specs(dir)
4
+ FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
5
+ end
6
+
7
+ desc 'Runs all the specs'
8
+ task :specs do
9
+ sh "bundle exec bacon #{specs('**')}"
10
+ end
11
+
12
+ task :default => :specs
13
+
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cocoapods-aqarahome/gem_version.rb'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'cocoapods-aqarahome'
8
+ spec.version = CocoapodsAqarahome::VERSION
9
+ spec.authors = ['zhaoxifan']
10
+ spec.email = ['179988305@qq.com']
11
+ spec.description = %q{私有库每次都拉分支最新的commit}
12
+ spec.summary = %q{私有库不需要每次更新都在主工程的podfile更新}
13
+ spec.homepage = 'https://github.com/LuckZXF/cocoapods-aqarahome'
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
+
21
+ spec.add_development_dependency 'bundler', '~> 2.3.26'
22
+ spec.add_development_dependency 'rake'
23
+
24
+ spec.add_runtime_dependency 'claide', '>= 1.0.2', '< 2.0'
25
+
26
+ end
@@ -0,0 +1,31 @@
1
+
2
+ class String
3
+ # colorization
4
+ def colorize(color_code)
5
+ "\e[#{color_code}m#{self}\e[0m"
6
+ end
7
+
8
+ def red
9
+ colorize(31)
10
+ end
11
+
12
+ def green
13
+ colorize(32)
14
+ end
15
+
16
+ def yellow
17
+ colorize(33)
18
+ end
19
+
20
+ def blue
21
+ colorize(34)
22
+ end
23
+
24
+ def pink
25
+ colorize(35)
26
+ end
27
+
28
+ def light_blue
29
+ colorize(36)
30
+ end
31
+ end
@@ -0,0 +1,102 @@
1
+ module Pod
2
+ class Podfile
3
+ module DSL
4
+ require 'cocoapods-aqarahome/Utils/Color'
5
+ public
6
+
7
+ def dev_pods(pods, branch = 'aqara')
8
+ if branch.length > 0
9
+ # pods.each do |name|
10
+ # pod name, :git => "https://xyz.com/ios/#{name}.git", :branch => "#{branch}"
11
+ # end
12
+ pull_latest_code_and_resolve_conflict(pods)
13
+ # puts "lebbay: using remote pods with branch: #{branch}".green
14
+ else
15
+ # 自定义开发目录
16
+ development_path = Config.instance.dev_pods_path
17
+ pods.each do |name|
18
+ pod name, :path => "#{development_path}#{name}"
19
+ end
20
+ puts "lebbay: using local pods with path: #{development_path}xxx".green
21
+ end
22
+ end
23
+
24
+ def watch_up
25
+ puts '|========================================================================|'.red
26
+ (0..10).each do |i|
27
+ puts '| |'.red unless i == 5
28
+ puts '| '.red + '你小子注意更新私有库SDK'.green + ' |'.red unless i != 5
29
+ end
30
+ puts '|========================================================================|'.red
31
+ end
32
+
33
+ #--------------------------------------#
34
+
35
+ private
36
+
37
+ def pull_latest_code_and_resolve_conflict(pods)
38
+ # 1、Podfile.lock
39
+ puts "正在清理Podfile.lock中私有库的commit信息...".pink
40
+ rewrite_lock_file(pods, Config.instance.lockfile_path)
41
+ puts "Podfile.lock中私有库的commit信息已清除!".light_blue
42
+ # 2、Manifest.lock
43
+ puts "正在清理Manifest.lock中私有库的commit信息...".pink
44
+ rewrite_lock_file(pods, Config.instance.sandbox.manifest_path)
45
+ puts "Manifest.lock中私有库的commit信息已清除!".light_blue
46
+ end
47
+
48
+ def rewrite_lock_file(pods, lock_path)
49
+ return unless lock_path.exist?
50
+ lock_hash = Lockfile.from_file(lock_path).to_hash
51
+
52
+ # 1、PODS
53
+ lock_pods = lock_hash['PODS']
54
+ if lock_pods
55
+ target_pods = []
56
+ lock_pods.each do |pod|
57
+ if pod.is_a? Hash
58
+ first_key = pod.keys[0]
59
+ first_value = pod.values[0]
60
+ if (first_key.is_a? String) && (first_value.is_a? Array)
61
+ next if is_include_key_in_pods(first_key, pods)
62
+ dep_pods = first_value.reject { |dep_pod| is_include_key_in_pods(dep_pod, pods) }
63
+ target_pods << (dep_pods.count > 0 ? {first_key => dep_pods} : first_key)
64
+ next
65
+ end
66
+ elsif pod.is_a? String
67
+ next if is_include_key_in_pods(pod, pods)
68
+ end
69
+ target_pods << pod
70
+ end
71
+ lock_hash['PODS'] = target_pods
72
+ end
73
+
74
+ # 2、DEPENDENCIES
75
+ locak_dependencies = lock_hash['DEPENDENCIES']
76
+ if locak_dependencies
77
+ target_dependencies = []
78
+ locak_dependencies.each do |dependence|
79
+ if dependence.is_a? String
80
+ next if is_include_key_in_pods(dependence, pods)
81
+ end
82
+ target_dependencies << dependence
83
+ end
84
+ lock_hash['DEPENDENCIES'] = target_dependencies
85
+ end
86
+
87
+ Lockfile.new(lock_hash).write_to_disk(lock_path)
88
+ end
89
+
90
+ def is_include_key_in_pods(target_key, pods)
91
+ pods.each do |pod|
92
+ if target_key.include? pod
93
+ return true
94
+ end
95
+ end
96
+ return false
97
+ end
98
+
99
+ #--------------------------------------#
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,47 @@
1
+
2
+ require 'cocoapods-aqarahome/command/Podfile_Dev'
3
+ module CocoapodsAqarahome
4
+ class Command
5
+ # This is an example of a cocoapods plugin adding a top-level subcommand
6
+ # to the 'pod' command.
7
+ #
8
+ # You can also create subcommands of existing or new commands. Say you
9
+ # wanted to add a subcommand to `list` to show newly deprecated pods,
10
+ # (e.g. `pod list deprecated`), there are a few things that would need
11
+ # to change.
12
+ #
13
+ # - move this file to `lib/pod/command/list/deprecated.rb` and update
14
+ # the class to exist in the the Pod::Command::List namespace
15
+ # - change this class to extend from `List` instead of `Command`. This
16
+ # tells the plugin system that it is a subcommand of `list`.
17
+ # - edit `lib/cocoapods_plugins.rb` to require this file
18
+ #
19
+ # @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
20
+ # in the `plugins.json` file, once your plugin is released.
21
+ #
22
+ class Gen < Command
23
+ # summary
24
+ self.summary = '删除Podfile.lock和Manifest.lock 的git commit相关'
25
+
26
+ self.description = <<-DESC
27
+ 因为考虑到私有库更新后需要到主工程手动更新podfile文件
28
+ DESC
29
+
30
+ # self.arguments = 'NAME'
31
+
32
+ def initialize(argv)
33
+ @name = 'Aqarahome'
34
+ super
35
+ end
36
+
37
+ def validate!
38
+ super
39
+ help! 'A Pod name is required.' unless @name
40
+ end
41
+
42
+ def run
43
+ # Pod::Podfile::DSL.dev_pods(['LMDashboard'],'Aqara')
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,24 @@
1
+
2
+ module CocoapodsAqarahome
3
+ require 'colored2'
4
+ require 'claide'
5
+ # The primary Command for VFS.
6
+ class Command < CLAide::Command
7
+ require 'cocoapods-aqarahome/command/aqarahome'
8
+
9
+ self.abstract_command = false
10
+ self.command = 'aqarahome'
11
+ self.version = VERSION
12
+ self.description = 'Delete Pod.lock about git commit'
13
+ self.plugin_prefixes = %w[claide Aqarahome]
14
+
15
+ def initialize(argv)
16
+ super
17
+ return if ansi_output?
18
+
19
+ Colored2.disable!
20
+ String.send(:define_method, :colorize) { |string, _| string }
21
+ end
22
+
23
+ end
24
+ end
@@ -0,0 +1,3 @@
1
+ module CocoapodsAqarahome
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,10 @@
1
+
2
+
3
+ module CocoapodsAqarahome
4
+ require 'cocoapods-aqarahome/gem_version'
5
+ require 'cocoapods-aqarahome/command/Podfile_Dev'
6
+ require 'pathname'
7
+ require 'claide'
8
+ autoload :Command, 'cocoapods-aqarahome/command'
9
+ # autoload :Podfile, 'cocoapods-aqarahome/command/Podfile_Dev'
10
+ end
@@ -0,0 +1,9 @@
1
+ require 'cocoapods-aqarahome'
2
+ module Pod
3
+ # hook
4
+ @HooksManager = HooksManager
5
+ @HooksManager.register('cocoapods-aqarahome', :post_install) do |_, _options|
6
+ args = ['gen']
7
+ CocoapodsAqarahome::Command.run(args)
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
+
3
+ module Pod
4
+ describe Command::Aqarahome do
5
+ describe 'CLAide' do
6
+ it 'registers it self' do
7
+ Command.parse(%w{ aqarahome }).should.be.instance_of Command::Aqarahome
8
+ end
9
+ end
10
+ end
11
+ end
12
+
@@ -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,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-aqarahome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - zhaoxifan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-11-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 2.3.26
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.3.26
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: claide
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 1.0.2
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '2.0'
51
+ type: :runtime
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: 1.0.2
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '2.0'
61
+ description: 私有库每次都拉分支最新的commit
62
+ email:
63
+ - 179988305@qq.com
64
+ executables: []
65
+ extensions: []
66
+ extra_rdoc_files: []
67
+ files:
68
+ - ".gitignore"
69
+ - Gemfile
70
+ - Gemfile.lock
71
+ - LICENSE.txt
72
+ - README.md
73
+ - Rakefile
74
+ - cocoapods-aqarahome.gemspec
75
+ - lib/cocoapods-aqarahome.rb
76
+ - lib/cocoapods-aqarahome/Utils/Color.rb
77
+ - lib/cocoapods-aqarahome/command.rb
78
+ - lib/cocoapods-aqarahome/command/Podfile_Dev.rb
79
+ - lib/cocoapods-aqarahome/command/aqarahome.rb
80
+ - lib/cocoapods-aqarahome/gem_version.rb
81
+ - lib/cocoapods_plugin.rb
82
+ - spec/command/aqarahome_spec.rb
83
+ - spec/spec_helper.rb
84
+ homepage: https://github.com/LuckZXF/cocoapods-aqarahome
85
+ licenses:
86
+ - MIT
87
+ metadata: {}
88
+ post_install_message:
89
+ rdoc_options: []
90
+ require_paths:
91
+ - lib
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ requirements: []
103
+ rubygems_version: 3.3.26
104
+ signing_key:
105
+ specification_version: 4
106
+ summary: 私有库不需要每次更新都在主工程的podfile更新
107
+ test_files:
108
+ - spec/command/aqarahome_spec.rb
109
+ - spec/spec_helper.rb