fir-cli-batch 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
+ SHA1:
3
+ metadata.gz: 4c328736a1b752e44c59ddfa7d28ccf218273639
4
+ data.tar.gz: 75d5e9f528bb95945dc40d84e5aa3629d3cff843
5
+ SHA512:
6
+ metadata.gz: 77318299da11595ca3029590e09aa43fec29fffecd7981756a702dcffd0543f1bea6c8e9857dd20bf7555fd5ebe6ab959063e582a4e092b0cad49c3a3711ff2b
7
+ data.tar.gz: daf91648ba65d405bef416c06db4ae7a7c88126533b7aa507ce558e3963bc111facf66f5f6d58070f7cb48773a8520850f2d711de7b73ed21620cf3b1f051c72
data/.gitignore ADDED
@@ -0,0 +1,85 @@
1
+ # Created by https://www.gitignore.io
2
+
3
+ ### Ruby ###
4
+ *.gem
5
+ *.rbc
6
+ /.config
7
+ /coverage/
8
+ /InstalledFiles
9
+ /pkg/
10
+ /spec/reports/
11
+ /test/tmp/
12
+ /test/version_tmp/
13
+ /tmp/
14
+
15
+ ## Specific to RubyMotion:
16
+ .dat*
17
+ .repl_history
18
+ build/
19
+
20
+ ## Documentation cache and generated files:
21
+ /.yardoc/
22
+ /_yardoc/
23
+ /doc/
24
+ /rdoc/
25
+
26
+ ## Environment normalisation:
27
+ /.bundle/
28
+ /lib/bundler/man/
29
+
30
+ # for a library or gem, you might want to ignore these files since the code is
31
+ # intended to run in multiple environments; otherwise, check them in:
32
+ # Gemfile.lock
33
+ # .ruby-version
34
+ # .ruby-gemset
35
+
36
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
37
+ .rvmrc
38
+
39
+
40
+ ### Linux ###
41
+ *~
42
+
43
+ # KDE directory preferences
44
+ .directory
45
+
46
+
47
+ ### OSX ###
48
+ .DS_Store
49
+ .AppleDouble
50
+ .LSOverride
51
+
52
+ # Icon must end with two \r
53
+ Icon
54
+
55
+ # Thumbnails
56
+ ._*
57
+
58
+ # Files that might appear on external disk
59
+ .Spotlight-V100
60
+ .Trashes
61
+
62
+ # Directories potentially created on remote AFP share
63
+ .AppleDB
64
+ .AppleDesktop
65
+ Network Trash Folder
66
+ Temporary Items
67
+ .apdisk
68
+
69
+
70
+ ### SublimeText ###
71
+ # cache files for sublime text
72
+ *.tmlanguage.cache
73
+ *.tmPreferences.cache
74
+ *.stTheme.cache
75
+
76
+ # workspace files are user-specific
77
+ *.sublime-workspace
78
+
79
+ # project files should be checked into the repository, unless a significant
80
+ # proportion of contributors will probably not be using SublimeText
81
+ # *.sublime-project
82
+
83
+ # sftp configuration file
84
+ sftp-config.json
85
+
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://ruby.taobao.org/'
2
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,39 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ fir-cli-batch (0.0.1)
5
+ fir-cli (~> 0.0.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ CFPropertyList (2.2.8)
11
+ fir-cli (0.0.7)
12
+ lagunitas (= 0.0.1)
13
+ paint (~> 0.9.0)
14
+ pngdefry (= 0.1.1)
15
+ rest_client (~> 1.8.2)
16
+ ruby_apk (~> 0.7.1)
17
+ thor (~> 0.19.1)
18
+ user_config (= 0.0.4)
19
+ lagunitas (0.0.1)
20
+ CFPropertyList
21
+ pngdefry (>= 0.1.0)
22
+ zip
23
+ netrc (0.7.9)
24
+ paint (0.9.0)
25
+ pngdefry (0.1.1)
26
+ rest_client (1.8.2)
27
+ netrc (~> 0.7.7)
28
+ ruby_apk (0.7.1)
29
+ rubyzip (< 1.0.0)
30
+ rubyzip (0.9.9)
31
+ thor (0.19.1)
32
+ user_config (0.0.4)
33
+ zip (2.0.2)
34
+
35
+ PLATFORMS
36
+ ruby
37
+
38
+ DEPENDENCIES
39
+ fir-cli-batch!
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 idy0013@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
@@ -0,0 +1,4 @@
1
+ FIR.im 批量上传工具
2
+
3
+
4
+
@@ -0,0 +1,16 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'fir-cli-batch'
7
+ s.version = '0.0.1'
8
+ s.date = '2014-11-25'
9
+ s.summary = 'FIR.im 批量处理工具'
10
+ s.description = 'FIR.im 批量处理工具,支持 ios 和 android'
11
+ s.author = 'FIR.im'
12
+ s.email = 'fir-cli@fir.im'
13
+ s.license = 'MIT'
14
+ s.files = `git ls-files -z`.split("\x0")
15
+ s.require_paths = ['./']
16
+ end
data/fir-cli-batch.rb ADDED
@@ -0,0 +1,2 @@
1
+ Dir[File.dirname(__FILE__) + '/lib/*.rb'].each {|f| require f }
2
+ Dir[File.dirname(__FILE__) + '/lib/fir-cli-commands/*.rb'].each {|f| require f }
@@ -0,0 +1,25 @@
1
+ module Fir
2
+ class Cli < Thor
3
+ desc 'batpub FOLDER_1, FOLDER_2, ...', '批量上传指定文件夹中的全部文件'
4
+ option :resign, :aliases => '-r', :desc => '是否以企业签名发布', :type => :boolean
5
+ option :token, :aliases => '-t', :desc => '用户令牌'
6
+ option :email, :aliases => '-e', :desc => '邮件地址'
7
+ option :verbose, :aliases => '-v', :desc => '设置输出级别 v, vv, vvv'
8
+ option :quiet, :aliases => '-q', :desc => '安静模式,不输出任何选项'
9
+ def batpub(*dirs)
10
+ puts "! #{ Paint['至少需要输入提供一个文件夹', :red] }" if dirs.length == 0
11
+ dirs.each do |dir|
12
+ Dir.foreach(dir) do |f|
13
+ if _is_ipa(f) || _is_apk(f)
14
+ _puts "> 正在发布 #{ f }"
15
+ begin
16
+ publish File.join dir, f
17
+ rescue Exception => e
18
+ _puts "! #{ f } 失败:#{ e.to_s }"
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ module Fir
2
+ class Cli < Thor
3
+ desc 'batres FOLDER_1, FOLDER_2, ...', '批量上传指定文件夹中的全部文件'
4
+ option :email, :aliases => '-e', :desc => '邮件地址'
5
+ option :prefix, :aliases => '-p', :desc => '为签名后的文件添加前缀'
6
+ option :suffix, :aliases => '-s', :desc => '为签名后的文件添加后缀', :default => '.resigned'
7
+ option :verbose, :aliases => '-v', :desc => '设置输出级别 v, vv, vvv'
8
+ option :quiet, :aliases => '-q', :desc => '安静模式,不输出任何选项'
9
+ def batres(*dirs)
10
+ puts "! #{ Paint['至少需要输入提供一个文件夹', :red] }" if dirs.length == 0
11
+ dirs.each do |dir|
12
+ Dir.foreach(dir) do |f|
13
+ extname = File.extname f
14
+ basename = File.basename f, extname
15
+ if _is_ipa(f) || _is_apk(f)
16
+ _puts "> 正在处理 #{ f }"
17
+ begin
18
+ resign File.join(dir, f).to_s, File.join(dir, "#{ options[:prefix] }basename#{ options[:suffix] }#{ extname }").to_s
19
+ rescue e
20
+ _puts "! #{ f } 失败:#{ e.to_s }"
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fir-cli-batch
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - FIR.im
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-25 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: FIR.im 批量处理工具,支持 ios 和 android
14
+ email: fir-cli@fir.im
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - .gitignore
20
+ - Gemfile
21
+ - Gemfile.lock
22
+ - LICENSE.txt
23
+ - README.md
24
+ - fir-cli-batch.gemspec
25
+ - fir-cli-batch.rb
26
+ - lib/fir-cli-commands/batpub.rb
27
+ - lib/fir-cli-commands/batres.rb
28
+ homepage:
29
+ licenses:
30
+ - MIT
31
+ metadata: {}
32
+ post_install_message:
33
+ rdoc_options: []
34
+ require_paths:
35
+ - ./
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ requirements: []
47
+ rubyforge_project:
48
+ rubygems_version: 2.0.14
49
+ signing_key:
50
+ specification_version: 4
51
+ summary: FIR.im 批量处理工具
52
+ test_files: []