cocoapods-xzlint 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7b8aec91c4c7071afca38b916c6d04630f5ee4b2bff43c5be671f5767094bb8d
4
+ data.tar.gz: f5c02670ff0ef10e2b2dc21ea5863868b34ba8b8a7207e72459b3239779dc93a
5
+ SHA512:
6
+ metadata.gz: 34e34b8e0368192646ff964fd5abe363815c99aacdc787a9e707edbb9dcba59f223e4d840a87c23fc2db1ad60beee8a33d4a0b884edf37f47312d371ad4d9363
7
+ data.tar.gz: 587021b93e9b9f1a365d5e7cd0ad99b92f52b265380e48ffc8d676b92f72aa3802ac2a35283df23aabff351688262e9e392554722ae86e68cedfda8b6f09a1d3
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-xzlint.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/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2019 liushuhua <liushuhua@xiaozhu.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-xzlint
2
+
3
+ A description of cocoapods-xzlint.
4
+
5
+ ## Installation
6
+
7
+ $ gem install cocoapods-xzlint
8
+
9
+ ## Usage
10
+
11
+ $ pod spec xzlint 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
+
data/TAGS ADDED
@@ -0,0 +1,32 @@
1
+
2
+ spec/spec_helper.rb,430
3
+ ROOT = Pathname.new(File.expand_path('../../', __FILE__))ROOT2,0
4
+ module PodPod19,0
5
+ module UIUI27,0
6
+ module UIPod::UI27,0
7
+ attr_accessor :outputoutput32,0
8
+ attr_accessor :outputoutput=32,0
9
+ attr_accessor :warningswarnings33,0
10
+ attr_accessor :warningswarnings=33,0
11
+ def puts(message = '')puts35,0
12
+ def warn(message = '', actions = [])warn39,0
13
+ def print(message)print43,0
14
+
15
+ spec/command/xzlint_spec.rb,19
16
+ module PodPod3,0
17
+
18
+ lib/cocoapods-xzlint/gem_version.rb,124
19
+ module CocoapodsXzlintCocoapodsXzlint1,0
20
+ VERSION = "0.0.1"VERSION2,0
21
+ VERSION = "0.0.1"CocoapodsXzlint::VERSION2,0
22
+
23
+ lib/cocoapods-xzlint/PodLibLintPlugin.rb,406
24
+ module PodPod3,0
25
+ class ValidatorValidator4,0
26
+ class ValidatorPod::Validator4,0
27
+ def method_for_loadmethod_for_load5,0
28
+ define_method(:translate_output_to_linter_messages) do |output|translate_output_to_linter_messages10,0
29
+ def result_typeresult_type22,0
30
+ def validated?validated?34,0
31
+ def results_messageresults_message39,0
32
+ def donot_allow_warnings(*args)donot_allow_warnings74,0
@@ -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-xzlint/gem_version.rb'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'cocoapods-xzlint'
8
+ spec.version = CocoapodsXzlint::VERSION
9
+ spec.authors = ['liushuhua']
10
+ spec.email = ['liushuhua@xiaozhu.com']
11
+ spec.description = %q{A short description of cocoapods-xzlint.}
12
+ spec.summary = %q{A longer description of cocoapods-xzlint.}
13
+ spec.homepage = 'https://github.com/EXAMPLE/cocoapods-xzlint'
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', '~> 1.3'
22
+ spec.add_development_dependency 'rake'
23
+ end
@@ -0,0 +1 @@
1
+ require 'cocoapods-xzlint/gem_version'
@@ -0,0 +1,82 @@
1
+
2
+ module Pod
3
+ class Validator
4
+ class << self
5
+ def method_for_load
6
+ puts "load plugin Validator"
7
+ end
8
+ end
9
+
10
+ origin_method = instance_method(:translate_output_to_linter_messages)
11
+ define_method(:translate_output_to_linter_messages) do |output|
12
+ origin_method.bind(self).call(output)
13
+ output.each do |message|
14
+ if message =~ /\S+:\d+:\d+: warning:/
15
+ if message.include?('is deprecated')
16
+ puts "find deprecated api --> #{message}"
17
+ donot_allow_warnings('xcodebuild',message)
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ def result_type
24
+ applicable_results = results
25
+ applicable_results = applicable_results.reject(&:public_only?) if ignore_public_only_results
26
+ types = applicable_results.map(&:type).uniq
27
+ if types.include?(:error) then :error
28
+ elsif types.include?(:notallowwarnings) then :notallowwarnings
29
+ elsif types.include?(:warning) then :warning
30
+ else :note
31
+ end
32
+ end
33
+
34
+ def validated?
35
+ puts "replace origin valudated method"
36
+ result_type != :error && result_type != :notallowwarnings && (result_type != :warning || allow_warnings)
37
+ end
38
+
39
+ def results_message
40
+ puts "replace origin results_message method"
41
+ message = ''
42
+ results.each do |result|
43
+ if result.platforms == [:ios]
44
+ platform_message = '[iOS] '
45
+ elsif result.platforms == [:osx]
46
+ platform_message = '[OSX] '
47
+ elsif result.platforms == [:watchos]
48
+ platform_message = '[watchOS] '
49
+ elsif result.platforms == [:tvos]
50
+ platform_message = '[tvOS] '
51
+ end
52
+
53
+ subspecs_message = ''
54
+ if result.is_a?(Result)
55
+ subspecs = result.subspecs.uniq
56
+ if subspecs.count > 2
57
+ subspecs_message = '[' + subspecs[0..2].join(', ') + ', and more...] '
58
+ elsif subspecs.count > 0
59
+ subspecs_message = '[' + subspecs.join(',') + '] '
60
+ end
61
+ end
62
+
63
+ case result.type
64
+ when :error then type = 'ERROR'
65
+ when :notallowwarnings then type = 'NOTALLOWWARNINGS'
66
+ when :warning then type = 'WARN'
67
+ when :note then type = 'NOTE'
68
+ else raise "#{result.type}" end
69
+ message << " - #{type.ljust(5)} | #{platform_message}#{subspecs_message}#{result.attribute_name}: #{result.message}\n"
70
+ end
71
+ message << "\n"
72
+ end
73
+
74
+ def donot_allow_warnings(*args)
75
+ add_result(:notallowwarnings,*args)
76
+ end
77
+ end
78
+ end
79
+
80
+ # Pod::HooksManager.register ('cocoapods-xzlint', :pre_install) do |installer_context|
81
+ # Pod::Validator.method_for_load
82
+ # end
@@ -0,0 +1,3 @@
1
+ module CocoapodsXzlint
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1 @@
1
+ require 'cocoapods-xzlint/PodLibLintPlugin'
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
+
3
+ module Pod
4
+ describe Command::Xzlint do
5
+ describe 'CLAide' do
6
+ it 'registers it self' do
7
+ Command.parse(%w{ xzlint }).should.be.instance_of Command::Xzlint
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,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-xzlint
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - liushuhua
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-08-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: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
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
+ description: A short description of cocoapods-xzlint.
42
+ email:
43
+ - liushuhua@xiaozhu.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - TAGS
54
+ - cocoapods-xzlint.gemspec
55
+ - lib/cocoapods-xzlint.rb
56
+ - lib/cocoapods-xzlint/PodLibLintPlugin.rb
57
+ - lib/cocoapods-xzlint/gem_version.rb
58
+ - lib/cocoapods_plugin.rb
59
+ - spec/command/xzlint_spec.rb
60
+ - spec/spec_helper.rb
61
+ homepage: https://github.com/EXAMPLE/cocoapods-xzlint
62
+ licenses:
63
+ - MIT
64
+ metadata: {}
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubygems_version: 3.0.3
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: A longer description of cocoapods-xzlint.
84
+ test_files:
85
+ - spec/command/xzlint_spec.rb
86
+ - spec/spec_helper.rb