cocoapods-alibaba-cainiao-environment 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: 1bb300d99d069f7251774f2290468e89787dde223b6ed3812cbcfc8fb9f470f2
4
+ data.tar.gz: 6b5aabc9e054df13e978dbc9458e6818d5ffccd7800e10fc6739a4666303799a
5
+ SHA512:
6
+ metadata.gz: 0fb126b9ca9e38e3758be445132156fb016d352913af3674f0e100e402d10e8f0018b204c544593f538602ecf7cea6a04d992d545f8d241bd053629d5e8af341
7
+ data.tar.gz: 2ee80582b8b94adf1df14835786010265896f7b486d0dece66776c46cb27b1f1fda6e5e2aee396503c59c079d66b89b0ea842a35c545e2cdc613d6bf5fe921e7
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ source "http://gems.alibaba-inc.com"
2
+
3
+ # Specify your gem's dependencies in cocoapods-alibaba-cainiao-environment.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
+ gem 'aliyun-sdk'
14
+
15
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,97 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cocoapods-alibaba-cainiao-environment (0.0.1)
5
+
6
+ GEM
7
+ remote: http://gems.alibaba-inc.com/
8
+ specs:
9
+ CFPropertyList (3.0.0)
10
+ activesupport (4.2.11.1)
11
+ i18n (~> 0.7)
12
+ minitest (~> 5.1)
13
+ thread_safe (~> 0.3, >= 0.3.4)
14
+ tzinfo (~> 1.1)
15
+ atomos (0.1.3)
16
+ bacon (1.2.0)
17
+ claide (1.0.2)
18
+ cocoapods (1.5.3)
19
+ activesupport (>= 4.0.2, < 5)
20
+ claide (>= 1.0.2, < 2.0)
21
+ cocoapods-core (= 1.5.3)
22
+ cocoapods-deintegrate (>= 1.0.2, < 2.0)
23
+ cocoapods-downloader (>= 1.2.0, < 2.0)
24
+ cocoapods-plugins (>= 1.0.0, < 2.0)
25
+ cocoapods-search (>= 1.0.0, < 2.0)
26
+ cocoapods-stats (>= 1.0.0, < 2.0)
27
+ cocoapods-trunk (>= 1.3.0, < 2.0)
28
+ cocoapods-try (>= 1.1.0, < 2.0)
29
+ colored2 (~> 3.1)
30
+ escape (~> 0.0.4)
31
+ fourflusher (~> 2.0.1)
32
+ gh_inspector (~> 1.0)
33
+ molinillo (~> 0.6.5)
34
+ nap (~> 1.0)
35
+ ruby-macho (~> 1.1)
36
+ xcodeproj (>= 1.5.7, < 2.0)
37
+ cocoapods-core (1.5.3)
38
+ activesupport (>= 4.0.2, < 6)
39
+ fuzzy_match (~> 2.0.4)
40
+ nap (~> 1.0)
41
+ cocoapods-deintegrate (1.0.4)
42
+ cocoapods-downloader (1.2.2)
43
+ cocoapods-plugins (1.0.0)
44
+ nap
45
+ cocoapods-search (1.0.0)
46
+ cocoapods-stats (1.1.0)
47
+ cocoapods-trunk (1.3.1)
48
+ nap (>= 0.8, < 2.0)
49
+ netrc (~> 0.11)
50
+ cocoapods-try (1.1.0)
51
+ colored2 (3.1.2)
52
+ concurrent-ruby (1.1.5)
53
+ escape (0.0.4)
54
+ fourflusher (2.0.1)
55
+ fuzzy_match (2.0.4)
56
+ gh_inspector (1.1.3)
57
+ i18n (0.9.5)
58
+ concurrent-ruby (~> 1.0)
59
+ metaclass (0.0.4)
60
+ minitest (5.8.3)
61
+ mocha (1.9.0)
62
+ metaclass (~> 0.0.1)
63
+ mocha-on-bacon (0.2.3)
64
+ mocha (>= 0.13.0)
65
+ molinillo (0.6.6)
66
+ nanaimo (0.2.6)
67
+ nap (1.1.0)
68
+ netrc (0.11.0)
69
+ prettybacon (0.0.2)
70
+ bacon (~> 1.2)
71
+ rake (10.4.2)
72
+ ruby-macho (1.4.0)
73
+ thread_safe (0.3.6)
74
+ tzinfo (1.2.5)
75
+ thread_safe (~> 0.1)
76
+ xcodeproj (1.11.0)
77
+ CFPropertyList (>= 2.3.3, < 4.0)
78
+ atomos (~> 0.1.3)
79
+ claide (>= 1.0.2, < 2.0)
80
+ colored2 (~> 3.1)
81
+ nanaimo (~> 0.2.6)
82
+
83
+ PLATFORMS
84
+ ruby
85
+
86
+ DEPENDENCIES
87
+ bacon
88
+ bundler
89
+ cocoapods
90
+ cocoapods-alibaba-cainiao-environment!
91
+ mocha
92
+ mocha-on-bacon
93
+ prettybacon
94
+ rake
95
+
96
+ BUNDLED WITH
97
+ 2.0.2
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2019 亿刀 <laiqiang.zlq@taobao.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-alibaba-cainiao-environment
2
+
3
+ A description of cocoapods-alibaba-cainiao-environment.
4
+
5
+ ## Installation
6
+
7
+ $ gem install cocoapods-alibaba-cainiao-environment
8
+
9
+ ## Usage
10
+
11
+ $ pod spec environment 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,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-alibaba-cainiao-environment/gem_version.rb'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'cocoapods-alibaba-cainiao-environment'
8
+ spec.version = CocoapodsAlibabaCainiaoEnvironment::VERSION
9
+ spec.authors = ['亿刀']
10
+ spec.email = ['laiqiang.zlq@taobao.com']
11
+ spec.description = %q{A short description of cocoapods-alibaba-cainiao-environment.}
12
+ spec.summary = %q{A longer description of cocoapods-alibaba-cainiao-environment.}
13
+ spec.homepage = 'https://github.com/EXAMPLE/cocoapods-alibaba-cainiao-environment'
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'
22
+ spec.add_development_dependency 'rake'
23
+ end
@@ -0,0 +1,2 @@
1
+ require 'cocoapods-alibaba-cainiao-environment/gem_version'
2
+ require 'cocoapods-alibaba-cainiao-environment/environment'
@@ -0,0 +1 @@
1
+ require 'cocoapods-alibaba-cainiao-environment/command/environment'
@@ -0,0 +1,44 @@
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 Environment < Command
21
+ self.summary = 'Short description of cocoapods-alibaba-cainiao-environment.'
22
+
23
+ self.description = <<-DESC
24
+ Longer description of cocoapods-alibaba-cainiao-environment.
25
+ DESC
26
+
27
+ self.arguments = 'NAME'
28
+
29
+ def initialize(argv)
30
+ @name = argv.shift_argument
31
+ super
32
+ end
33
+
34
+ def validate!
35
+ super
36
+ help! 'A Pod name is required.' unless @name
37
+ end
38
+
39
+ def run
40
+ UI.puts "Add your implementation for the cocoapods-alibaba-cainiao-environment plugin in #{__FILE__}"
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1 @@
1
+ require 'cocoapods-alibaba-cainiao-environment/modify-aliyun-oss'
@@ -0,0 +1,3 @@
1
+ module CocoapodsAlibabaCainiaoEnvironment
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,63 @@
1
+ require 'aliyun/oss'
2
+
3
+ module Pod
4
+ class Specification
5
+ class << Specification
6
+ alias_method :old_from_string, :from_file
7
+
8
+ def from_file(path, subspec_name = nil)
9
+ Dir.chdir(path.parent.directory? ? path.parent : Dir.pwd) do
10
+ case path.extname
11
+ when '.json'
12
+ else
13
+ old_from_string(path, subspec_name)
14
+ return
15
+ end
16
+ end
17
+
18
+ # puts 'gggggggggg ' + path.to_s
19
+ path = Pathname.new(path)
20
+ unless path.exist?
21
+ raise Informative, "No podspec exists at path `#{path}`."
22
+ end
23
+
24
+ string = File.open(path, 'r:utf-8', &:read)
25
+ # Work around for Rubinius incomplete encoding in 1.9 mode
26
+ if string.respond_to?(:encoding) && string.encoding.name != 'UTF-8'
27
+ string.encode!('UTF-8')
28
+ end
29
+
30
+ podObject = JSON.parse(string)
31
+
32
+ if (podObject['source'] && podObject['source']['http'])
33
+ # puts path.to_s
34
+ process_source_http_url(podObject['source']['http'])
35
+ end
36
+
37
+ from_string(string, path, subspec_name)
38
+ end
39
+
40
+ def process_source_http_url(url)
41
+ if url != nil then
42
+ if url.include? 'test-user2.oss-cn-beijing.aliyuncs.com' then
43
+ uri = URI.parse(url)
44
+ oss_file_object_key = uri.path
45
+ client = Aliyun::OSS::Client.new(endpoint: $endpoint,
46
+ access_key_id: $access_key_id,
47
+ access_key_secret: $access_key_secret);
48
+
49
+ bucket = client.get_bucket('test-user2')
50
+ uri = URI.parse(url)
51
+ oss_url = bucket.object_url(uri.path[1...uri.path.length])
52
+ puts 'oss_url = ' + oss_url
53
+
54
+ return oss_url
55
+ end
56
+ end
57
+
58
+ return url
59
+ end
60
+
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,14 @@
1
+ puts 'cainiao plugin of pod run'
2
+
3
+ require 'cocoapods-alibaba-cainiao-environment/command'
4
+ require 'cocoapods-alibaba-cainiao-environment/environment.rb'
5
+
6
+ # module CocoapodsGitHooks
7
+ # Pod::HooksManager.register('cocoapods-cainiao', :post_install) do |context|
8
+ # # GitHooksSync.new.sync()
9
+ # end
10
+ # Pod::HooksManager.register('cocoapods-cainiao', :post_update) do |context|
11
+ # # GitHooksSync.new.sync()
12
+ # end
13
+ # end
14
+
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
+
3
+ module Pod
4
+ describe Command::Environment do
5
+ describe 'CLAide' do
6
+ it 'registers it self' do
7
+ Command.parse(%w{ environment }).should.be.instance_of Command::Environment
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,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cocoapods-alibaba-cainiao-environment
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - 亿刀
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-10-25 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: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
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-alibaba-cainiao-environment.
42
+ email:
43
+ - laiqiang.zlq@taobao.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - Gemfile
49
+ - Gemfile.lock
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - cocoapods-alibaba-cainiao-environment.gemspec
54
+ - lib/cocoapods-alibaba-cainiao-environment.rb
55
+ - lib/cocoapods-alibaba-cainiao-environment/command.rb
56
+ - lib/cocoapods-alibaba-cainiao-environment/command/environment.rb
57
+ - lib/cocoapods-alibaba-cainiao-environment/environment.rb
58
+ - lib/cocoapods-alibaba-cainiao-environment/gem_version.rb
59
+ - lib/cocoapods-alibaba-cainiao-environment/modify-aliyun-oss.rb
60
+ - lib/cocoapods_plugin.rb
61
+ - spec/command/environment_spec.rb
62
+ - spec/spec_helper.rb
63
+ homepage: https://github.com/EXAMPLE/cocoapods-alibaba-cainiao-environment
64
+ licenses:
65
+ - MIT
66
+ metadata: {}
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 2.7.6
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: A longer description of cocoapods-alibaba-cainiao-environment.
87
+ test_files:
88
+ - spec/command/environment_spec.rb
89
+ - spec/spec_helper.rb