stool 0.2.14 → 0.2.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9d27028fa541aed46bab078b79debc53e027e9d
4
- data.tar.gz: 92276702958f56348226459b19ca53e4cba78fe5
3
+ metadata.gz: 87ce71d8fcc4286cb5fa84fd4a7ca9397703028e
4
+ data.tar.gz: c3e7e54042e2c04271ba7642cbb16725fe661e86
5
5
  SHA512:
6
- metadata.gz: 621a50637adc174bbda67e1df977cdfe689cc89e32d7d7a038f74d9f9b10d3980e40d35f3a26e04043d0b363dd61f63279ebcbc41e135d49ed5157cad861a42a
7
- data.tar.gz: 99e3244502c08b6b0c173bc7e012cb1b3d2277e197b74e202732579580f35bf90d434622483c07f9b1ffefeb1bc47894bc327b7e97aa69ff07c4c6d650b349a0
6
+ metadata.gz: 1665e260f4aed0db0961103fa93350c6fcc13e43e714596ef0abf61fc0fb4c1891a1166860e90492f7288764eacb9bf9b4202394f6617f4bdd283e82b6a4d3e7
7
+ data.tar.gz: 116425580ececb65cb91f9d163c1e5bad396cf7215f8f3f317ed44e62b07ce5c01a366572b3872c5be6a9df9d03a2fb557cd954e26e258f295536af422769a5a
@@ -1,4 +1,6 @@
1
1
  #私有库的池,池中有多个lib
2
+
3
+ require 'active_support/core_ext/string/strip'
2
4
  require 'Core/PoolInfo'
3
5
 
4
6
  module Stool
@@ -1,5 +1,6 @@
1
1
  require 'Core/LibInfo'
2
2
  require "spreadsheet/excel"
3
+ require 'colored2'
3
4
 
4
5
  module Stool
5
6
  class Command
@@ -13,52 +14,70 @@ module Stool
13
14
  # ]
14
15
 
15
16
  def initialize(argv)
16
- @phenixRepo = File.join(Dir.home,'.cocoapods/repos/phenix')
17
+ if @@config.checkRepos.count > 0
18
+ Spreadsheet.client_encoding="utf-8"
19
+ #创建表格对象
20
+ @book = Spreadsheet::Workbook.new
21
+ end
17
22
  super
18
23
  end
19
24
 
20
25
  def run
21
- puts `pod repo update phenix`
22
- #获取最高版本的pod
26
+ @@config.checkRepos.map { |e|
27
+ summary_repo e
28
+ }
29
+ #在指定路径下面创建test1.xls表格,并写book对象
30
+ path = File.join(Config.logsDirPath,'pod_summary.xls')
31
+ Dir.chdir(Config.logsDirPath)
32
+ @book.write path
33
+
34
+ puts "已经生成Excel文件<#{path}>"
35
+
36
+ `open #{path}`
37
+ end
38
+
39
+ #统计某一个pod库
40
+ def summary_repo(repo)
41
+ repoPath = File.join(Dir.home,'.cocoapods/repos',repo)
42
+
43
+ unless Dir.exist?(repoPath)
44
+ puts "#{repoPath} does not exist!!".red
45
+ return
46
+ end
47
+
48
+ puts `pod repo update #{repo}`
23
49
 
24
- Spreadsheet.client_encoding="utf-8"
25
- #创建表格对象
26
- book=Spreadsheet::Workbook.new
27
50
  #创建工作表
28
- sheet1=book.create_worksheet :name => "pod_summary"
51
+ sheet1 = @book.create_worksheet :name => "pod_summary_" + repo
29
52
  #在表格第一行设置分类
30
53
  sheet1.row(0)[0]="名字"
31
54
  sheet1.row(0)[1]="简介"
32
55
  sheet1.row(0)[1]="主页"
33
56
 
57
+ Dir.chdir(repoPath)
58
+
34
59
  libs = []
35
- Dir.entries(@phenixRepo).sort.uniq.each do |dir|
36
- if dir[0].eql?('t') || dir[0].eql?('T')
37
- arr = Dir.entries(File.join(@phenixRepo,dir)).sort
60
+ Dir.entries(repoPath).sort.uniq.each do |dir|
61
+ unless dir['.']
62
+ arr = Dir.entries(File.join(repoPath,dir)).sort
38
63
  if arr.last
39
64
  puts
40
- fname = Dir.entries(File.join(@phenixRepo,dir,arr.last)).last
41
- libinfo = LibInfo.loadFromPath(File.join(@phenixRepo,dir,arr.last))
65
+ fname = Dir.entries(File.join(repoPath,dir,arr.last)).last
66
+ libinfo = LibInfo.loadFromPath(File.join(repoPath,dir,arr.last))
42
67
  if libinfo
43
68
  libs.push(libinfo)
44
69
  end
45
70
  end
46
71
  end
47
72
  end
48
- puts Dir.entries(@phenixRepo).count
73
+
74
+ puts Dir.entries(repoPath).count
49
75
 
50
76
  libs.each_with_index {|lib,idx|
51
77
  sheet1.row(idx+1)[0]= lib.name
52
78
  sheet1.row(idx+1)[1]= lib.summary
53
79
  sheet1.row(idx+1)[2]= lib.homepage
54
- # sheet1.row(i+1)[0]= libs[i].name
55
- # sheet1.row(i+1)[1]= libs[i].summary
56
80
  }
57
- #在指定路径下面创建test1.xls表格,并写book对象
58
- path = File.join(Dir.home,'pod_summary.xls')
59
- book.write path
60
- puts "已经生成Excel文件<#{path}>"
61
- `open #{path}`
62
81
  end
63
82
 
64
83
  end
@@ -18,11 +18,14 @@ module Stool
18
18
  attr_accessor :tasks
19
19
  #cocoapods的repo缓存路径
20
20
  attr_accessor :repoCachePath
21
+ #repo pod库的统计
22
+ attr_accessor :checkRepos
21
23
 
22
24
  def initialize
23
25
  @repoCachePath = File.join(Dir.home,'.cocoapods/repos')
24
26
  @pools = []
25
27
  @tasks = []
28
+ @checkRepos = []
26
29
  super
27
30
  end
28
31
 
@@ -40,18 +43,14 @@ module Stool
40
43
  #添加一个本地libPool
41
44
  def addPool
42
45
  pInfo = PoolInfo.new()
43
-
44
46
  @pools.push(pInfo)
45
-
46
47
  yield pInfo if block_given?
47
48
  end
48
49
 
49
50
  #添加一个workspace
50
51
  def addTask
51
52
  tInfo = TaskInfo.new()
52
-
53
53
  @tasks.push(tInfo)
54
-
55
54
  yield tInfo if block_given?
56
55
  end
57
56
 
@@ -118,21 +117,5 @@ module Stool
118
117
  f.write(demo)
119
118
  end
120
119
 
121
- #Todo::
122
- # def pools
123
- # puts "*** pools === #{pools}"
124
- # unless @pools
125
- # @pools = []
126
- # end
127
- # @pools
128
- # end
129
- #
130
- # def tasks
131
- # unless @tasks
132
- # @tasks = []
133
- # end
134
- # @tasks
135
- # end
136
-
137
120
  end
138
121
  end
@@ -25,11 +25,25 @@ module Pod
25
25
  end
26
26
  end
27
27
 
28
+ class Tvos
29
+ def method_missing(method_id, *arguments, &block)
30
+ # puts "***" + "method_id = #{method_id}"
31
+ end
32
+ end
33
+
34
+ class Watchos
35
+ def method_missing(method_id, *arguments, &block)
36
+ # puts "***" + "method_id = #{method_id}"
37
+ end
38
+ end
39
+
28
40
  class Spec
29
41
  attr_accessor :name
30
42
  attr_accessor :version
31
43
  attr_accessor :ios
32
44
  attr_accessor :osx
45
+ attr_accessor :tvos
46
+ attr_accessor :watchos
33
47
  #简介
34
48
  attr_accessor :summary
35
49
  attr_accessor :homepage
@@ -45,6 +59,8 @@ module Pod
45
59
  def initialize
46
60
  @ios = Ios.new()
47
61
  @osx = Osx.new()
62
+ @tvos = Tvos.new()
63
+ @watchos = Watchos.new()
48
64
  yield self if block_given?
49
65
  end
50
66
 
data/lib/stool/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Stool
2
- VERSION = "0.2.14"
2
+ VERSION = "0.2.15"
3
3
  end
metadata CHANGED
@@ -1,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14
4
+ version: 0.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fiend
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-19 00:00:00.000000000 Z
11
+ date: 2018-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 4.0.2
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 4.0.2
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5'
13
33
  - !ruby/object:Gem::Dependency
14
34
  name: atomos
15
35
  requirement: !ruby/object:Gem::Requirement