Class: YKPod::YKGenCreate
- Inherits:
-
Object
- Object
- YKPod::YKGenCreate
- Includes:
- YKExchangeTool, YKLogTool
- Defined in:
- lib/cocoapods-ykutility/command/gen/yk_gen_create_action.rb
Instance Method Summary collapse
- #createAction ⇒ Object
-
#initialize(conf) ⇒ YKGenCreate
constructor
A new instance of YKGenCreate.
Methods included from YKExchangeTool
Methods included from YKLogTool
#ykError, #ykMessage, #ykNotice, #ykWarning
Constructor Details
#initialize(conf) ⇒ YKGenCreate
Returns a new instance of YKGenCreate.
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 |
# File 'lib/cocoapods-ykutility/command/gen/yk_gen_create_action.rb', line 17 def initialize(conf) @config = YKPod::YKCreatePodConfig @config = conf # name = conf.start_with?(conf.prefix) ? name : conf.prefix + name # @config.name = name l_path = @config.path @project_dir_dest = File.join(@config.path, @config.prefix_name) @example_dir_dest = File.join(@project_dir_dest, "Example") @template_pod_path = File.join(CocoapodsYkPodUtility::YK_GEN_TEMPLATE_PATH, @config.language) @template_example_path = File.join(CocoapodsYkPodUtility::YK_GEN_TEMPLATE_PATH, "example") @gitignore_file_path = File.join(CocoapodsYkPodUtility::YK_GEN_TEMPLATE_PATH, "gitignore") @register_pod_path = File.join(CocoapodsYkPodUtility::YK_GEN_BUSINESS_REGISTER_PATH, @config.language) time_str = Time.now.strftime("%Y/%m/%d") year_str = Time.now.strftime("%Y") # 关键字替换 @keyMap = { "YKRPC_POD_NAME" => @config.prefix_name, "YKRPC_AUTHOR_NAME" => @config., "YKRPC_AUTHOR_EMAIL" => @config., "YKRPC_CLASS_PREFIX" => @config.prefix, "YKRPC_CREATE_DATE" => time_str, "YKRPC_CREATE_YEAR" => year_str, } end |
Instance Method Details
#createAction ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/cocoapods-ykutility/command/gen/yk_gen_create_action.rb', line 48 def createAction() ykNotice "create gen project execute: \n name: #{@config.name} \n language: #{@config.language} \n with_demo: #{@config.with_demo} \n path: #{@config.path} \n author: #{@config.}\n author_email: #{@config.}" code = create_path exit!(code) unless code == 0 code = create_pod() exit!(code) unless code == 0 if @config.with_demo code = create_example exit!(code) unless code == 0 pod_install end end |