Class: OrmDev::CreateHelper

Inherits:
Object
  • Object
show all
Extended by:
Pod::Executable
Defined in:
lib/ormdev/source/core/create_helper.rb

Constant Summary collapse

ORMDEV_GIT_TEMPLATE_URL =

ORMDEV_TEMPLATE_URL = ‘gitee.com/mvn/pod-template.git’.freeze

'https://gitee.com/mvn/pod-fast-template.git'.freeze
ORMDEV_ZIP_TEMPLATE_URL =
'http://112.65.142.83:7788/ceshi/tmpl/pod-fast-template.zip'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, fast = false, template_url = nil) ⇒ CreateHelper

Returns a new instance of CreateHelper.



18
19
20
21
22
23
24
25
26
# File 'lib/ormdev/source/core/create_helper.rb', line 18

def initialize(name, fast = false, template_url = nil)
  @project_name  = name
  @fast_build = fast
  if @fast_build then
    @template_url = template_url || ORMDEV_ZIP_TEMPLATE_URL
  else
    @template_url = template_url || ORMDEV_GIT_TEMPLATE_URL
  end
end

Instance Attribute Details

#fast_buildObject (readonly)

Returns the value of attribute fast_build.



14
15
16
# File 'lib/ormdev/source/core/create_helper.rb', line 14

def fast_build
  @fast_build
end

#project_nameObject (readonly)

Returns the value of attribute project_name.



15
16
17
# File 'lib/ormdev/source/core/create_helper.rb', line 15

def project_name
  @project_name
end

#template_urlObject (readonly)

Returns the value of attribute template_url.



16
17
18
# File 'lib/ormdev/source/core/create_helper.rb', line 16

def template_url
  @template_url
end

Instance Method Details

#setup(skip = false) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ormdev/source/core/create_helper.rb', line 28

def setup(skip = false)
  OrmDev::SHUtil.run_command('pod repo update orm','更验证Pod',false)
  abort('插件名已存在'.red) if system("pod search #{@project_name} --no-pager --ios")
  # if @fast_build then
  clone_template
  configure_template(skip)
  print_info
  # else
  # create_command = "pod lib create #{@project_name} --template-url=#{@template_url}"
  # OrmDev::SHUtil.run_command(create_command,'创建ORM插件工程')
  # end
end