gct 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f33cd23ef73a09b073cd132f8337670547d8f5cef687267b8c69cbf24446e5d1
4
- data.tar.gz: 5044bb4a4344a6b15d7d2153604edb03d29bba06afe2b84da051b06753c80795
3
+ metadata.gz: fa28dc842327c6ec08bd44600b7457a533b14274ab3020861c012f427a2a9192
4
+ data.tar.gz: d8abd745b04e82728101ff0129a920265cbc5acd79f87ae5360d9e41ae9c724f
5
5
  SHA512:
6
- metadata.gz: 75aaaae41eebf3c7044cd9c1bc8fb0ff5036e516385cfa222d7b2f31ee13318de76bc9ae7a9cafab27d9d46782cfc789b1b0ad9af3055bce8f9481cf03fb3041
7
- data.tar.gz: 7412ca3a838d40585cbdd02342e0093b9ea503b9db84080514c38bdf22489623710543b585380beae69ca06227c5ba70a5a1772aedd584fff07f09f7e42ab4f7
6
+ metadata.gz: 8256de21008be3552722b25e62108a9b53a383c4937ed33a15d2ed8611677cf8e757f5f4e815bef0cd0746875e55885df041c6f245f96c17f7f915c1b6a53617
7
+ data.tar.gz: f2d0db217f7cb89a5236933c0005f99d44f80e7b2e77a4cf6ff4f25333c5297c0da17334e8068b61378cd10a31f4bd72fe2f7e3504013d687fee132aa9ffb6c9
@@ -0,0 +1,60 @@
1
+ module Gct
2
+ class Command
3
+ class Build < Command
4
+ class R < Build
5
+
6
+ self.summary = '运行R脚本'
7
+ self.description = <<-DESC
8
+ 运行R脚本.
9
+ DESC
10
+
11
+ self.arguments = [
12
+ ]
13
+
14
+ def initialize(argv)
15
+ super
16
+ end
17
+
18
+ def validate!
19
+ super
20
+ end
21
+
22
+ def run
23
+ buildR
24
+ end
25
+
26
+ def buildR
27
+ proj = ''
28
+ Dir.entries(Dir.pwd).each do |sub|
29
+ if sub.include? '.xcodeproj'
30
+ proj = sub
31
+ end
32
+ end
33
+
34
+ if proj == ''
35
+ puts '没有找到.xcodeproj文件'.red
36
+ else
37
+ project_path = File.join(File.dirname(__FILE__), "./" + proj)
38
+ project = Xcodeproj::Project.open(project_path)
39
+
40
+ objects = project.objects
41
+ findR = false
42
+ objects.each do |obj|
43
+ if obj.instance_of?(Xcodeproj::Project::Object::PBXShellScriptBuildPhase) and obj.name == "[GCT] create R"
44
+ findR = true
45
+ script_export = "export project_path=$(cd `dirname $0`; pwd) \nexport PODS_ROOT=${project_path}\"/Pods\" \nexport SRCROOT=${project_path} \n"
46
+ exe_script = script_export + obj.shell_script
47
+ system exe_script
48
+ end
49
+
50
+ end
51
+ if !findR
52
+ puts "没有找到 '[GCT] create R' 脚本".red
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+
@@ -0,0 +1,13 @@
1
+ require 'gct/command/build/r'
2
+
3
+ module Gct
4
+ class Command
5
+ class Build < Command
6
+ self.abstract_command = true
7
+ self.summary = '编译'
8
+ self.description = <<-DESC
9
+ 编译R等文件
10
+ DESC
11
+ end
12
+ end
13
+ end
data/lib/gct/command.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'colored2'
2
2
  require 'claide'
3
3
  require 'molinillo/errors'
4
+ require 'xcodeproj'
4
5
 
5
6
  module Molinillo
6
7
  class ResolverError
@@ -19,6 +20,7 @@ module Gct
19
20
  require 'gct/command/config'
20
21
  require 'gct/command/analyze'
21
22
  require 'gct/command/op'
23
+ require 'gct/command/build'
22
24
 
23
25
  self.abstract_command = true
24
26
  self.command = 'gct'
data/lib/gct/version.rb CHANGED
@@ -2,5 +2,5 @@ module Gct
2
2
  # freeze 冻结对象,将对象变成一个常量
3
3
  # unless 右边的代码块成立,才会运行左边的代码块
4
4
  # defined? 是用来判断本地变量是否存在,也可用来判断是否存在方法
5
- VERSION = "0.1.2".freeze unless defined? Gct::VERSION
5
+ VERSION = "0.1.3".freeze unless defined? Gct::VERSION
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - jieming
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-30 00:00:00.000000000 Z
11
+ date: 2020-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -113,6 +113,8 @@ files:
113
113
  - lib/gct.rb
114
114
  - lib/gct/command.rb
115
115
  - lib/gct/command/analyze.rb
116
+ - lib/gct/command/build.rb
117
+ - lib/gct/command/build/r.rb
116
118
  - lib/gct/command/config.rb
117
119
  - lib/gct/command/config/get.rb
118
120
  - lib/gct/command/config/set.rb