Class: OrmDev::RunHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/ormdev/source/core/run_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ RunHelper

Returns a new instance of RunHelper.



11
12
13
14
# File 'lib/ormdev/source/core/run_helper.rb', line 11

def initialize(path)
  @podspec_path = path;
  @spec = Pod::Specification.from_file(path)
end

Instance Attribute Details

#podspec_pathObject (readonly)

Returns the value of attribute podspec_path.



9
10
11
# File 'lib/ormdev/source/core/run_helper.rb', line 9

def podspec_path
  @podspec_path
end

#specObject (readonly)

Returns the value of attribute spec.



8
9
10
# File 'lib/ormdev/source/core/run_helper.rb', line 8

def spec
  @spec
end

Instance Method Details

#setup(no_version_control) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/ormdev/source/core/run_helper.rb', line 16

def setup(no_version_control)
  task_start_time = Time.now
  time_info_logs = ["开始运行:#{task_start_time}"]
  start_time = task_start_time

  check_environment
  current_time = Time.new
  time_info_logs << "检查运行环境:#{current_time - start_time}"
  start_time = current_time

  if no_version_control then
    archive_zip_source
    current_time = Time.new
    time_info_logs << "源码没有版本控制,归档到本机WebServer:#{current_time - start_time}"
    start_time = current_time
  end

  pod_package_framwork
  current_time = Time.new
  time_info_logs << "打包静态库:#{current_time - start_time}"
  start_time = current_time

  result = archive_zip_framwork
  current_time = Time.new
  time_info_logs << "压缩静态framework:#{current_time - start_time}"
  start_time = current_time

  # lint_zip_framwork
  # current_time = Time.new
  # time_info_logs << "验证静态framework:#{current_time - start_time}秒"
  # start_time = current_time

  time_info_logs << "#{@spec.name}总耗时:#{Time.new - task_start_time}"
  puts time_info_logs
  result
end