cocoapods-ykutility 0.0.13 → 0.0.15

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: c4b79fd9f7903656dadce1185190adc88e55a314292b0454f77719bf50b8790e
4
- data.tar.gz: c7659edbf4c293ba187c1314a3aede0abfeb9ddcdf002ecdff0b64b1de8b132d
3
+ metadata.gz: 5982e97115a674d15ff828e0910f335cd3139718d0cc78b26a0fe479c87b1b76
4
+ data.tar.gz: fd15dfd38bf166495a210141b1f7cf4ed5815385626f023c3c27dfe10f80d4ab
5
5
  SHA512:
6
- metadata.gz: 82ff382f1800c1bf4b9c68140b0dca9c721df2f9394b2dfefb959d3fd3ae2c8f7981cfac22ee435aca9c24e8577c5c1ce801c35ef03978bd1911d849c51298d9
7
- data.tar.gz: 65e65eca2963857a404af1a60a79f85127a3bd5dd1e7e0b2d71e39d3c29a83db9cc35ed6b667de5f513ba7f57db6ebc569c7e5e2f14c838a0853dcb94a0af4f2
6
+ metadata.gz: 0e4cbc2d579f13ce39b3bba3b5b63abdbdd09f9e30a5e5f8061537c2dd6595e74e1911fbd4e5f256548992dae32b077785e3bc6bc061fdbec6c72cd806c10bb0
7
+ data.tar.gz: 10691d43f0a0faaf2dbd46e4a7a19b9b7c3dbde11fc3e9dd4581c185c54329626b06b376851dc4ba32b08f34a6e9f587dfe49f6bd398bc91abd808dbf26a6c95
@@ -26,6 +26,7 @@ module YKPod
26
26
 
27
27
  @template_pod_path = File.join(CocoapodsYkPodUtility::YK_POD_TEMPLATE_PATH, @config.language)
28
28
  @template_example_path = File.join(CocoapodsYkPodUtility::YK_POD_TEMPLATE_PATH, "example")
29
+ @register_pod_path = File.join(CocoapodsYkPodUtility::YK_POD_BUSINESS_REGISTER_PATH, @config.language)
29
30
 
30
31
  time_str = Time.now.strftime("%Y/%m/%d")
31
32
  year_str = Time.now.strftime("%Y")
@@ -46,7 +47,7 @@ module YKPod
46
47
  code = create_path
47
48
  exit!(code) unless code == 0
48
49
 
49
- code = create_pod
50
+ code = create_pod()
50
51
  exit!(code) unless code == 0
51
52
 
52
53
  if @config.with_demo
@@ -73,6 +74,7 @@ module YKPod
73
74
  pod_dir_cache = File.join(@project_dir_dest, "#{@config.prefix_name}_cache")
74
75
  pod_dir_dest = File.join(@project_dir_dest)
75
76
  FileUtils.copy_entry(@template_pod_path, pod_dir_cache)
77
+ prepare_business_pod_files(pod_dir_cache)
76
78
 
77
79
  # 改文件夹
78
80
  file_arr = updateFileDirs(pod_dir_cache, 'YKRPC_POD_NAME',@config.prefix_name)
@@ -85,11 +87,35 @@ module YKPod
85
87
  return 0
86
88
  end
87
89
 
90
+ def prepare_business_pod_files(pod_dir_cache)
91
+ return unless @config.with_register == true
92
+ FileUtils.copy_entry(@register_pod_path, pod_dir_cache)
93
+ # 添加私有依赖
94
+ spec_file_path = File.join(pod_dir_cache, "YKRPC_POD_NAME.podspec")
95
+
96
+ # 在倒数第二行插入新语句
97
+ # s.dependency "YKRouterComponent"
98
+ # s.dependency "YKModuleServiceComponent.swift" #swift 服务中间件, 如果是纯oc组件,请注释此中间件
99
+ de_router = "spec.dependency \"YKRouterComponent\"\n"
100
+ de_service = "spec.dependency \"YKModuleServiceComponent"
101
+ if @config.language == "swift"
102
+ de_service += ".swift\" #swift 服务中间件\n"
103
+ else
104
+ de_service += "\" #oc 服务中间件\n"
105
+ end
106
+
107
+ lines = File.readlines(spec_file_path)
108
+ lines.insert(-2, de_router)
109
+ lines.insert(-2, de_service)
110
+ File.open(spec_file_path, 'w') { |file| file.puts(lines.join) }
111
+ end
112
+
88
113
  def create_example()
89
114
  ykNotice "create example"
90
115
  example_dir_cache = File.join(@project_dir_dest, "Example_cache")
91
116
 
92
117
  FileUtils.copy_entry(@template_example_path, example_dir_cache)
118
+ prepare_business_pod_source(example_dir_cache)
93
119
 
94
120
  # 改文件夹
95
121
  file_arr = updateFileDirs(example_dir_cache, 'YKRPC_POD_NAME', @config.prefix_name)
@@ -103,6 +129,19 @@ module YKPod
103
129
  return 0
104
130
  end
105
131
 
132
+
133
+ def prepare_business_pod_source(example_dir_cache)
134
+ return unless @config.with_register == true
135
+ pod_file_cache = File.join(example_dir_cache, "podfile")
136
+
137
+
138
+ # 在第二行插入新语句
139
+ source_pri = "http://gitlab.y" + "ea" + "hk" + "a.com/App/iOS/YeahkaNativeComSpecsIndex.git"
140
+ lines = File.readlines(pod_file_cache)
141
+ lines.insert(2, "source \"#{source_pri}\"\n")
142
+ File.open(pod_file_cache, 'w') { |file| file.puts(lines.join) }
143
+ end
144
+
106
145
  def pod_install
107
146
  ykNotice "open project"
108
147
  Dir.chdir(@example_dir_dest) do
@@ -3,12 +3,13 @@
3
3
  module YKPod
4
4
 
5
5
  class YKCreatePodConfig
6
- attr_accessor :name, :language, :with_demo, :author, :author_email, :prefix, :path
6
+ attr_accessor :name, :language, :with_demo, :with_register, :author, :author_email, :prefix, :path
7
7
 
8
8
  def initialize()
9
9
  @name = ""
10
10
  @language = ""
11
11
  @with_demo = true
12
+ @with_register = false
12
13
  @author = open("|git config --global user.name").gets.strip.gsub('.', '')
13
14
  @author_email = open("|git config --global user.email").gets.strip
14
15
  @prefix = "YK"
@@ -27,6 +27,7 @@ module Pod
27
27
  ['--email=EMAIL', 'Email'],
28
28
  ['--prefix=PREFIX', 'Prefix header'],
29
29
  ['--pod-path=PATH', 'Pod created at path'],
30
+ ['--business', 'With service/router register template'],
30
31
  ].concat(super)
31
32
  end
32
33
 
@@ -36,6 +37,7 @@ module Pod
36
37
  @config.name = argv.shift_argument
37
38
  @config.language = (["objc", "oc"].include? argv.option('language', "swift").downcase) ? "objc" : "swift"
38
39
  @config.with_demo = !argv.flag?('no-demo', false)
40
+ @config.with_register = argv.flag?('business', false)
39
41
  @config.author = argv.option('author', open("|git config --global user.name").gets).strip.gsub('.', '')
40
42
  @config.author_email = argv.option('email', open("|git config --global user.email").gets).strip
41
43
  @config.prefix = argv.option('prefix', "YK")
@@ -1,4 +1,5 @@
1
1
  module CocoapodsYkPodUtility
2
- VERSION = "0.0.13"
2
+ VERSION = '0.0.15'
3
3
  YK_POD_TEMPLATE_PATH = File.expand_path(File.join(__FILE__, '../../../podTemplate'))
4
+ YK_POD_BUSINESS_REGISTER_PATH = File.expand_path(File.join(__FILE__, '../../../podTemplate/register'))
4
5
  end
@@ -0,0 +1,16 @@
1
+ //
2
+ // YKRPC_POD_NAMERegisterRouter.h
3
+ // YKRPC_POD_NAME
4
+ //
5
+ // Created by YKPRC_AUTHOR_NAME on YKPRC_CREATE_DATE.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ @interface YKRPC_POD_NAMERegisterRouter : NSObject
13
+
14
+ @end
15
+
16
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,27 @@
1
+ //
2
+ // YKRPC_POD_NAMERegisterRouter.m
3
+ // YKRPC_POD_NAME
4
+ //
5
+ // Created by YKPRC_AUTHOR_NAME on YKPRC_CREATE_DATE.
6
+ //
7
+
8
+ #import "YKRPC_POD_NAMERegisterRouter.h"
9
+ #import <YKRouterComponent/YKRouterComponentHeader.h>
10
+
11
+ @interface YKRPC_POD_NAMERegisterRouter()<YKRouterComponentRegisterProtocol>
12
+
13
+ @end
14
+
15
+ @implementation YKRPC_POD_NAMERegisterRouter
16
+
17
+ + (void)ykRouterRegisterExecute {
18
+ [[YKRouterComponent shareInstance] ykRegisterUrlPartterns:@"XXXRouterStr" error:nil action:^(YKRouterUrlRequest * _Nonnull urlRequest, YKRouterUrlCompletion _Nonnull completetion) {
19
+ // xxxVC *vc = [[xxxVC alloc] init];
20
+ // UIViewController *topVC = urlRequest.fromVC ? urlRequest.fromVC : [UIViewController topController];
21
+ // [topVC.navigationController pushViewController:vc animated:YES];
22
+ }];
23
+ }
24
+
25
+
26
+ @end
27
+
@@ -0,0 +1,15 @@
1
+ //
2
+ // YKRPC_POD_NAMERegisterService.h
3
+ // YKRPC_POD_NAME
4
+ //
5
+ // Created by YKPRC_AUTHOR_NAME on YKPRC_CREATE_DATE.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ /**
11
+ Service Register for the module.
12
+ */
13
+ @interface YKRPC_POD_NAMERegisterService : NSObject
14
+
15
+ @end
@@ -0,0 +1,27 @@
1
+ //
2
+ // YKRPC_POD_NAMERegisterService.m
3
+ // YKRPC_POD_NAME
4
+ //
5
+ // Created by YKPRC_AUTHOR_NAME on YKPRC_CREATE_DATE.
6
+ //
7
+
8
+ #import "YKRPC_POD_NAMERegisterService.h"
9
+ #import <YKModuleServiceComponent/YKModuleServiceComponentHeader.h>
10
+
11
+ @interface YKRPC_POD_NAMERegisterService()<YKModuleServiceRegisterProtocol, SUAdvertisementServiceProtocol>
12
+ @end
13
+ @implementation SUAdvertisementServiceRegister
14
+
15
+ + (void)ykModuleServiceRegistAction {
16
+ YKModuleServiceRegisterExecute(SUAdvertisementServiceRegister.class, @protocol(SUAdvertisementServiceProtocol), nil);
17
+ }
18
+
19
+ @end
20
+
21
+ #pragma mark - xxxxServiceProtocol method
22
+ // @interface YKRPC_POD_NAMERegisterService(serProtocol)<xxxxServiceProtocol>
23
+ // +(void)xxxxAction {
24
+ // // service execute code
25
+ //
26
+ // }
27
+ // @end
@@ -0,0 +1,19 @@
1
+ //
2
+ // YKRPC_POD_NAMERegisterRouter.swift
3
+ // YKRPC_POD_NAME
4
+ //
5
+ // Created by YKPRC_AUTHOR_NAME on YKPRC_CREATE_DATE.
6
+ //
7
+
8
+ import YKRouterComponent
9
+
10
+ private class YKRPC_POD_NAMERegisterRouter: NSObject, YKRouterComponentRegisterProtocol {
11
+ public static func ykRouterRegisterExecute() {
12
+ // YKRouterRegisterUrlParttern("xxxxxxRouterString", nil) { (req: YKRouterUrlRequest, com: YKRouterUrlCompletion?) in
13
+ // let topVC = req.fromVC ?? UIViewController.getTopVC()
14
+ // let vc = REUserProfileVC()
15
+ // topVC?.navigationController?.pushViewController(vc, animated: true)
16
+ // }
17
+ }
18
+ }
19
+
@@ -0,0 +1,20 @@
1
+ //
2
+ // YKRPC_POD_NAMERegisterService.swift
3
+ // YKRPC_POD_NAME
4
+ //
5
+ // Created by YKPRC_AUTHOR_NAME on YKPRC_CREATE_DATE.
6
+ //
7
+ import YKModuleServiceComponentSwift
8
+
9
+ private class YKRPC_POD_NAMERegisterService: NSObject, YKModuleServiceRegisterProtocol {
10
+ static func ykModuleServiceRegistAction() {
11
+ // YKModuleServiceComponent().ykRegistModule(REHomeServiceRegist.self, protocol: XXXXProtocol.self, err: nil)
12
+ }
13
+ }
14
+
15
+ // extension YKRPC_POD_NAMERegisterService: XXXXProtocol {
16
+ // static mehtod for XXXXProtocol
17
+ // static func xxxxx() -> xxxxxObjc {
18
+ // return XXXXX()
19
+ // }
20
+ // }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-ykutility
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - stephen.chen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-13 00:00:00.000000000 Z
11
+ date: 2023-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jazzy
@@ -112,6 +112,13 @@ files:
112
112
  - podTemplate/objc/YKRPC_POD_NAME/Private/.gitkeep
113
113
  - podTemplate/objc/YKRPC_POD_NAME/Public/YKRPC_POD_NAME.h
114
114
  - podTemplate/objc/YKRPC_POD_NAME/Public/YKRPC_POD_NAME.m
115
+ - podTemplate/register/objc/YKRPC_POD_NAME/Private/Register/YKRPC_POD_NAMERegisterRouter.h
116
+ - podTemplate/register/objc/YKRPC_POD_NAME/Private/Register/YKRPC_POD_NAMERegisterRouter.m
117
+ - podTemplate/register/objc/YKRPC_POD_NAME/Private/Register/YKRPC_POD_NAMERegisterService.h
118
+ - podTemplate/register/objc/YKRPC_POD_NAME/Private/Register/YKRPC_POD_NAMERegisterService.m
119
+ - podTemplate/register/swift/YKRPC_POD_NAME/Private/.gitkeep
120
+ - podTemplate/register/swift/YKRPC_POD_NAME/Private/register/YKRPC_POD_NAMERegisterRouter.swift
121
+ - podTemplate/register/swift/YKRPC_POD_NAME/Private/register/YKRPC_POD_NAMERegisterService.swift
115
122
  - podTemplate/swift/LICENSE
116
123
  - podTemplate/swift/README.md
117
124
  - podTemplate/swift/YKRPC_POD_NAME.podspec
@@ -137,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
144
  - !ruby/object:Gem::Version
138
145
  version: '0'
139
146
  requirements: []
140
- rubygems_version: 3.1.6
147
+ rubygems_version: 3.0.3.1
141
148
  signing_key:
142
149
  specification_version: 4
143
150
  summary: 一款cocoapods插件,用于创建定制化标准组件.