kookeeper 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. metadata +11 -111
  3. data/.github/ISSUE_TEMPLATE.md +0 -20
  4. data/.gitignore +0 -50
  5. data/.travis.yml +0 -19
  6. data/CODE_OF_CONDUCT.md +0 -46
  7. data/CONTRIBUTING.md +0 -70
  8. data/Gemfile +0 -10
  9. data/Gemfile.lock +0 -125
  10. data/LICENSE +0 -21
  11. data/README.md +0 -113
  12. data/Rakefile +0 -2
  13. data/big_keeper.gemspec +0 -50
  14. data/bin/big +0 -14
  15. data/bin/koo +0 -14
  16. data/bin/setup +0 -8
  17. data/docs/en-US/FEATURE.md +0 -0
  18. data/docs/en-US/README.md +0 -54
  19. data/docs/zh-CN/BIGKEEPER_FILE.md +0 -84
  20. data/docs/zh-CN/FEATURE&HOTFIX.md +0 -88
  21. data/docs/zh-CN/IMAGE.md +0 -0
  22. data/docs/zh-CN/PODFILE.md +0 -43
  23. data/docs/zh-CN/README.md +0 -113
  24. data/docs/zh-CN/RECOMMEND.md +0 -22
  25. data/docs/zh-CN/RELEASE.md +0 -60
  26. data/docs/zh-CN/SPEC.md +0 -39
  27. data/lib/big_keeper/command/client.rb +0 -50
  28. data/lib/big_keeper/command/feature&hotfix/delete.rb +0 -40
  29. data/lib/big_keeper/command/feature&hotfix/finish.rb +0 -54
  30. data/lib/big_keeper/command/feature&hotfix/list.rb +0 -63
  31. data/lib/big_keeper/command/feature&hotfix/publish.rb +0 -56
  32. data/lib/big_keeper/command/feature&hotfix/pull.rb +0 -26
  33. data/lib/big_keeper/command/feature&hotfix/push.rb +0 -27
  34. data/lib/big_keeper/command/feature&hotfix/rebase.rb +0 -32
  35. data/lib/big_keeper/command/feature&hotfix/start.rb +0 -74
  36. data/lib/big_keeper/command/feature&hotfix/switch.rb +0 -46
  37. data/lib/big_keeper/command/feature&hotfix/update.rb +0 -66
  38. data/lib/big_keeper/command/feature&hotfix.rb +0 -167
  39. data/lib/big_keeper/command/image/image.rb +0 -0
  40. data/lib/big_keeper/command/image.rb +0 -28
  41. data/lib/big_keeper/command/init.rb +0 -36
  42. data/lib/big_keeper/command/pod/podfile.rb +0 -72
  43. data/lib/big_keeper/command/pod.rb +0 -55
  44. data/lib/big_keeper/command/release/finish.rb +0 -36
  45. data/lib/big_keeper/command/release/home.rb +0 -92
  46. data/lib/big_keeper/command/release/module.rb +0 -65
  47. data/lib/big_keeper/command/release/publish.rb +0 -4
  48. data/lib/big_keeper/command/release/start.rb +0 -78
  49. data/lib/big_keeper/command/release.rb +0 -100
  50. data/lib/big_keeper/command/spec/add.rb +0 -9
  51. data/lib/big_keeper/command/spec/analyze.rb +0 -88
  52. data/lib/big_keeper/command/spec/delete.rb +0 -9
  53. data/lib/big_keeper/command/spec/list.rb +0 -19
  54. data/lib/big_keeper/command/spec/search.rb +0 -9
  55. data/lib/big_keeper/command/spec/sync.rb +0 -12
  56. data/lib/big_keeper/command/spec.rb +0 -78
  57. data/lib/big_keeper/dependency/dep_gradle_operator.rb +0 -74
  58. data/lib/big_keeper/dependency/dep_operator.rb +0 -48
  59. data/lib/big_keeper/dependency/dep_pod_operator.rb +0 -130
  60. data/lib/big_keeper/dependency/dep_service.rb +0 -14
  61. data/lib/big_keeper/dependency/dep_type.rb +0 -33
  62. data/lib/big_keeper/model/gitflow_type.rb +0 -43
  63. data/lib/big_keeper/model/library_model.rb +0 -116
  64. data/lib/big_keeper/model/operate_type.rb +0 -30
  65. data/lib/big_keeper/model/podfile_model.rb +0 -33
  66. data/lib/big_keeper/service/git_service.rb +0 -211
  67. data/lib/big_keeper/service/module_service.rb +0 -224
  68. data/lib/big_keeper/service/stash_service.rb +0 -45
  69. data/lib/big_keeper/util/bigkeeper_parser.rb +0 -260
  70. data/lib/big_keeper/util/cache_operator.rb +0 -118
  71. data/lib/big_keeper/util/code_operator.rb +0 -37
  72. data/lib/big_keeper/util/command_line_util.rb +0 -9
  73. data/lib/big_keeper/util/file_operator.rb +0 -33
  74. data/lib/big_keeper/util/git_operator.rb +0 -242
  75. data/lib/big_keeper/util/gitflow_operator.rb +0 -51
  76. data/lib/big_keeper/util/gradle_content_generator.rb +0 -26
  77. data/lib/big_keeper/util/gradle_file_operator.rb +0 -339
  78. data/lib/big_keeper/util/gradle_module_operator.rb +0 -70
  79. data/lib/big_keeper/util/info_plist_operator.rb +0 -46
  80. data/lib/big_keeper/util/leancloud_logger.rb +0 -84
  81. data/lib/big_keeper/util/list_generator.rb +0 -101
  82. data/lib/big_keeper/util/lockfile_parser.rb +0 -143
  83. data/lib/big_keeper/util/logger.rb +0 -47
  84. data/lib/big_keeper/util/pod_operator.rb +0 -70
  85. data/lib/big_keeper/util/podfile_detector.rb +0 -102
  86. data/lib/big_keeper/util/podfile_module.rb +0 -63
  87. data/lib/big_keeper/util/podfile_operator.rb +0 -125
  88. data/lib/big_keeper/util/verify_operator.rb +0 -17
  89. data/lib/big_keeper/util/version_config_operator.rb +0 -29
  90. data/lib/big_keeper/util/xcode_operator.rb +0 -15
  91. data/lib/big_keeper/version.rb +0 -3
  92. data/lib/big_keeper.rb +0 -81
  93. data/resources/banner.png +0 -0
  94. data/resources/command.png +0 -0
  95. data/resources/keynote/big-keeper-readme-analyze.key +0 -0
  96. data/resources/keynote/big-keeper-readme-example.key +0 -0
  97. data/resources/keynote/big-keeper-readme-feature.key +0 -0
  98. data/resources/keynote/big-keeper-readme-release.key +0 -0
  99. data/resources/readme/big-keeper-readme.001.png +0 -0
  100. data/resources/template/Bigkeeper +0 -23
@@ -1,19 +0,0 @@
1
- require 'logger'
2
- require 'json'
3
-
4
- module BigKeeper
5
- def self.spec_list(path, user, options)
6
- BigkeeperParser.parse("#{path}/Bigkeeper")
7
-
8
- module_dic = BigkeeperParser.parse_modules
9
- module_list = Array.new
10
- module_dic.keys.each do | key |
11
- dic = Hash["module_name" => key,
12
- "git" => module_dic[key][:git],
13
- "pulls" => module_dic[key][:pulls]]
14
- module_list << dic
15
- end
16
- json = JSON.pretty_generate(module_list)
17
- puts json
18
- end
19
- end
@@ -1,9 +0,0 @@
1
- require 'big_keeper/util/bigkeeper_parser'
2
- require 'big_keeper/dependency/dep_type'
3
- require 'big_keeper/util/logger'
4
-
5
- module BigKeeper
6
- def self.spec_search
7
- Logger.default('Coming soon.')
8
- end
9
- end
@@ -1,12 +0,0 @@
1
- require 'big_keeper/util/bigkeeper_parser'
2
- require 'big_keeper/dependency/dep_type'
3
- require 'big_keeper/util/logger'
4
-
5
- module BigKeeper
6
- def self.spec_sync(path, version, user, module_name)
7
- # Parse Bigkeeper file
8
- BigkeeperParser.parse("#{path}/Bigkeeper")
9
-
10
- Logger.default('Coming soon.')
11
- end
12
- end
@@ -1,78 +0,0 @@
1
- require 'big_keeper/command/spec/analyze'
2
- require 'big_keeper/command/spec/list'
3
- require 'big_keeper/command/spec/add'
4
- require 'big_keeper/command/spec/delete'
5
- require 'big_keeper/command/spec/search'
6
- require 'big_keeper/command/spec/sync'
7
- require 'big_keeper/util/leancloud_logger'
8
-
9
- module BigKeeper
10
-
11
- def self.spec_command
12
- desc 'Spec operations'
13
-
14
- command :spec do |spec|
15
- spec.switch [:a,:all]
16
- spec.desc 'Analyze spec dependency infomation.'
17
- spec.command :analyze do |analyze|
18
- analyze.action do |global_options, options, args|
19
- LeanCloudLogger.instance.set_command("spec/analyze")
20
-
21
- path = File.expand_path(global_options[:path])
22
- is_all = options[:all]
23
- module_names = args
24
- spec_analyze(path, is_all, module_names)
25
- end
26
- end
27
-
28
- spec.desc 'List all the specs.'
29
- spec.command :list do | list |
30
- list.action do |global_options, options, args|
31
- LeanCloudLogger.instance.set_command("spec/list")
32
-
33
- path = File.expand_path(global_options[:path])
34
- version = global_options[:ver]
35
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
36
-
37
- spec_list(path, user, options)
38
- end
39
- end
40
-
41
- spec.desc 'Sync Module dependency from Home.'
42
- spec.command :sync do | sync|
43
- sync.action do |global_options, options, args|
44
- LeanCloudLogger.instance.set_command("spec/sync")
45
-
46
- path = File.expand_path(global_options[:path])
47
- version = global_options[:ver]
48
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
49
- module_name = args
50
-
51
- spec_sync(path, version, user, module_name)
52
- end
53
- end
54
-
55
- spec.desc 'Add a spec (Coming soon).'
56
- spec.command :add do |add|
57
- add.action do
58
- spec_add()
59
- end
60
- end
61
-
62
- spec.desc 'Delete a spec (Coming soon).'
63
- spec.command :delete do |delete|
64
- delete.action do
65
- spec_delete()
66
- end
67
- end
68
-
69
- spec.desc 'Search a spec with name (Coming soon).'
70
- spec.command :search do |search|
71
- search.action do
72
- spec_search()
73
- end
74
- end
75
-
76
- end
77
- end
78
- end
@@ -1,74 +0,0 @@
1
- require 'big_keeper/dependency/dep_operator'
2
- require 'big_keeper/util/gradle_module_operator'
3
- require 'big_keeper/util/gradle_file_operator'
4
- require 'big_keeper/model/operate_type'
5
- require 'big_keeper/util/version_config_operator'
6
-
7
- module BigKeeper
8
- # Operator for podfile
9
- class DepGradleOperator < DepOperator
10
-
11
- BUILD_GRADLE = "app/build.gradle"
12
- SETTINGS_GRADLE = "settings.gradle"
13
-
14
- def backup
15
- end
16
-
17
- def recover
18
- build_file = "#{@path}/#{BUILD_GRADLE}"
19
- settings_file = "#{@path}/#{SETTINGS_GRADLE}"
20
- GradleFileOperator.new(@path, @user).recover_bigkeeper_config_file(build_file)
21
- GradleFileOperator.new(@path, @user).recover_bigkeeper_config_file(settings_file)
22
-
23
- cache_operator = CacheOperator.new(@path)
24
- cache_operator.clean
25
- end
26
-
27
- def update_module_config(module_name, module_operate_type)
28
- if ModuleOperateType::ADD == module_operate_type
29
- GradleModuleOperator.new(@path, @user, module_name).update_module(ModuleOperateType::ADD)
30
- elsif ModuleOperateType::DELETE == module_operate_type
31
- GradleModuleOperator.new(@path, @user, module_name).recover()
32
- elsif ModuleOperateType::FINISH == module_operate_type
33
- GradleModuleOperator.new(@path, @user, module_name).update_module(ModuleOperateType::FINISH)
34
- elsif ModuleOperateType::PUBLISH == module_operate_type
35
- GradleModuleOperator.new(@path, @user, module_name).recover()
36
- end
37
- end
38
-
39
- def install(modules, type, should_update)
40
- if OperateType::START == type || OperateType::UPDATE == type || OperateType::SWITCH == type || OperateType::FINISH == type
41
- GradleFileOperator.new(@path, @user).update_home_depends("#{@path}/#{BUILD_GRADLE}", "#{@path}/#{SETTINGS_GRADLE}",type)
42
- elsif OperateType::PUBLISH == type
43
- recover()
44
- end
45
- end
46
-
47
- def release_module_start(modules, module_name, version)
48
- module_full_path = BigkeeperParser.module_full_path(@path, @user, module_name)
49
- version_config_file = "#{module_full_path}/doc/config/version-config.gradle"
50
- version = "#{version}-SNAPSHOT" unless version.include?'SNAPSHOT'
51
- VersionConfigOperator.change_version(version_config_file, modules, version)
52
- end
53
-
54
- def release_module_finish(modules, module_name, version)
55
- module_full_path = BigkeeperParser.module_full_path(@path, @user, module_name)
56
- version_config_file = "#{module_full_path}/doc/config/version-config.gradle"
57
- VersionConfigOperator.change_version(version_config_file, modules, version)
58
- end
59
-
60
- def release_home_start(modules, version)
61
- version_config_file = "#{@path}/doc/config/version-config.gradle"
62
- version = "#{version}-SNAPSHOT" unless version.include?'SNAPSHOT'
63
- VersionConfigOperator.change_version(version_config_file, modules, version)
64
- end
65
-
66
- def release_home_finish(modules, version)
67
- version_config_file = "#{@path}/doc/config/version-config.gradle"
68
- VersionConfigOperator.change_version(version_config_file, modules, version)
69
- end
70
-
71
- def open
72
- end
73
- end
74
- end
@@ -1,48 +0,0 @@
1
- module BigKeeper
2
- # Operator for podfile
3
- class DepOperator
4
- @path
5
- @user
6
-
7
- def initialize(path, user)
8
- @path = path
9
- @user = user
10
- end
11
-
12
- def backup
13
- raise "You should override this method in subclass."
14
- end
15
-
16
- def recover
17
- raise "You should override this method in subclass."
18
- end
19
-
20
- def update_module_config(module_name, module_operate_type)
21
- raise "You should override this method in subclass."
22
- end
23
-
24
- def release_module_start(modules, module_name, version)
25
- raise "You should override this method in subclass."
26
- end
27
-
28
- def release_module_finish(modules, module_name, version)
29
- raise "You should override this method in subclass."
30
- end
31
-
32
- def release_home_start(modules, version)
33
- raise "You should override this method in subclass."
34
- end
35
-
36
- def release_home_finish(modules, version)
37
- raise "You should override this method in subclass."
38
- end
39
-
40
- def install(modules, type, should_update)
41
- raise "You should override this method in subclass."
42
- end
43
-
44
- def open
45
- raise "You should override this method in subclass."
46
- end
47
- end
48
- end
@@ -1,130 +0,0 @@
1
- require 'big_keeper/dependency/dep_operator'
2
-
3
- require 'big_keeper/util/pod_operator'
4
- require 'big_keeper/util/xcode_operator'
5
- require 'big_keeper/util/cache_operator'
6
- require 'big_keeper/util/file_operator'
7
-
8
- module BigKeeper
9
- # Operator for podfile
10
- class DepPodOperator < DepOperator
11
- def backup
12
- CacheOperator.new(@path).save('Podfile')
13
- end
14
-
15
- def recover
16
- cache_operator = CacheOperator.new(@path)
17
- cache_operator.load('Podfile')
18
- cache_operator.clean
19
- end
20
-
21
- def update_module_config(module_name, module_operate_type)
22
- file = "#{@path}/Podfile"
23
- temp_file = Tempfile.new('.Podfile.tmp', :encoding => 'UTF-8')
24
-
25
- begin
26
- File.open(file, 'r', :encoding => 'UTF-8') do |file|
27
- file.each_line do |line|
28
- temp_file.puts generate_module_config(line, module_name, module_operate_type)
29
- end
30
- end
31
- temp_file.close
32
- FileUtils.mv(temp_file.path, file)
33
- ensure
34
- temp_file.close
35
- temp_file.unlink
36
- end
37
- end
38
-
39
- def install(modules, type, should_update)
40
- PodOperator.pod_install(@path, should_update)
41
- end
42
-
43
- def open
44
- XcodeOperator.open_workspace(@path)
45
- end
46
-
47
- def generate_module_config(line, module_name, module_operate_type)
48
- line.sub(/(\s*)pod(\s*)('|")#{module_name}((\/[_a-zA-Z0-9]+)?)('|")([\s\S]*)/){
49
- if ModuleOperateType::ADD == module_operate_type
50
- module_path = BigkeeperParser.module_path(@user, module_name)
51
- "#{$1}pod '#{module_name}#{$4}', :path => '#{module_path}'"
52
- elsif ModuleOperateType::DELETE == module_operate_type
53
- origin_config_of_module = origin_config_of_module(module_name)
54
- if origin_config_of_module.empty?
55
- line
56
- else
57
- origin_config_of_module
58
- end
59
- elsif ModuleOperateType::FINISH == module_operate_type
60
- module_git = BigkeeperParser.module_git(module_name)
61
- branch_name = GitOperator.new.current_branch(@path)
62
- "#{$1}pod '#{module_name}#{$4}', :git => '#{module_git}', :branch => '#{branch_name}'"
63
- elsif ModuleOperateType::PUBLISH == module_operate_type
64
- module_git = BigkeeperParser.module_git(module_name)
65
- branch_name = GitOperator.new.current_branch(@path)
66
- base_branch_name = GitflowType.base_branch(GitService.new.current_branch_type(@path))
67
- "#{$1}pod '#{module_name}#{$4}', :git => '#{module_git}', :branch => '#{base_branch_name}'"
68
- elsif ModuleOperateType::RELEASE == module_operate_type
69
- module_git = BigkeeperParser.module_git(module_name)
70
- lastest_tag, is_spec = find_lastest_tag(module_name)
71
- if is_spec == true
72
- Logger.default("#{module_name} lastest tag is #{lastest_tag}, this tag has published.")
73
- "#{$1}pod '#{module_name}#{$4}', '#{lastest_tag}'"
74
- else
75
- Logger.default("#{module_name} lastest tag is #{lastest_tag}, this tag not publish.")
76
- "#{$1}pod '#{module_name}#{$4}', :git => '#{module_git}', :tag => '#{lastest_tag}'"
77
- end
78
- else
79
- line
80
- end
81
- }
82
- end
83
-
84
- def origin_config_of_module(module_name)
85
- origin_config = ''
86
-
87
- File.open("#{@path}/.bigkeeper/Podfile", 'r', :encoding => 'UTF-8') do |file|
88
- file.each_line do |line|
89
- if line =~ /(\s*)pod(\s*)('|")#{module_name}('|")([\s\S]*)/
90
- origin_config = line
91
- break
92
- end
93
- end
94
- end
95
-
96
- origin_config.chop
97
- end
98
-
99
- def find_lastest_tag(module_name)
100
- username = FileOperator.new.current_username
101
- tags_repos_pwd = Array.new
102
- tags_spec_list = Array.new
103
- tags_module_list = Array.new
104
-
105
- IO.popen("find /Users/#{username}/.cocoapods/repos -type d -name #{module_name}") do |io|
106
- io.each do |line|
107
- tags_repos_pwd.push(line) if line.include? "#{module_name}"
108
- end
109
- end
110
- for pwd in tags_repos_pwd do
111
- path = pwd.chomp
112
- IO.popen("cd '#{path}'; ls") do |io|
113
- io.each do |line|
114
- tags_spec_list.push(line)
115
- end
116
- end
117
- end
118
-
119
- tags_module_list = GitOperator.new.tag_list(BigkeeperParser.module_full_path(@path, @user, module_name))
120
- last_tag = tags_module_list[tags_module_list.length - 1]
121
- if tags_module_list.include?(last_tag) && tags_spec_list.include?(last_tag)
122
- return [last_tag.chomp, true]
123
- else
124
- return [last_tag.chomp, false]
125
- end
126
- end
127
-
128
- private :generate_module_config, :origin_config_of_module, :find_lastest_tag
129
- end
130
- end
@@ -1,14 +0,0 @@
1
- require 'big_keeper/util/git_operator'
2
- require 'big_keeper/model/gitflow_type'
3
- require 'big_keeper/model/operate_type'
4
- require 'big_keeper/util/logger'
5
- require 'big_keeper/dependency/dep_type'
6
-
7
- module BigKeeper
8
- # Operator for podfile
9
- class DepService
10
- def self.dep_operator(path, user)
11
- DepType.operator(path, user)
12
- end
13
- end
14
- end
@@ -1,33 +0,0 @@
1
- require 'big_keeper/dependency/dep_operator'
2
- require 'big_keeper/dependency/dep_pod_operator'
3
- require 'big_keeper/dependency/dep_gradle_operator'
4
- require 'big_keeper/util/file_operator'
5
-
6
- module BigKeeper
7
- module DepType
8
- NONE = 0
9
- COCOAPODS = 1
10
- GRADLE = 2
11
-
12
- def self.type(path)
13
- if FileOperator.definitely_exists?("#{path}/Podfile")
14
- COCOAPODS
15
- elsif FileOperator.definitely_exists?("#{path}/build.gradle")
16
- GRADLE
17
- else
18
- NONE
19
- end
20
- end
21
-
22
- def self.operator(path, user)
23
- operator_type = type(path)
24
- if COCOAPODS == operator_type
25
- DepPodOperator.new(path, user)
26
- elsif GRADLE == operator_type
27
- DepGradleOperator.new(path, user)
28
- else
29
- DepOperator.new(path, user)
30
- end
31
- end
32
- end
33
- end
@@ -1,43 +0,0 @@
1
- module BigKeeper
2
- module GitflowType
3
- FEATURE = 1
4
- HOTFIX = 2
5
- RELEASE = 3
6
-
7
- def self.name(type)
8
- if FEATURE == type
9
- "feature"
10
- elsif HOTFIX == type
11
- "hotfix"
12
- elsif RELEASE == type
13
- "release"
14
- else
15
- "feature"
16
- end
17
- end
18
-
19
- def self.command(type)
20
- if FEATURE == type
21
- :feature
22
- elsif HOTFIX == type
23
- :hotfix
24
- elsif RELEASE == type
25
- :release
26
- else
27
- :feature
28
- end
29
- end
30
-
31
- def self.base_branch(type)
32
- if FEATURE == type
33
- "develop"
34
- elsif HOTFIX == type
35
- "master"
36
- elsif RELEASE == type
37
- "develop"
38
- else
39
- "master"
40
- end
41
- end
42
- end
43
- end
@@ -1,116 +0,0 @@
1
- require 'big_keeper/util/file_operator'
2
- require 'big_keeper/util/code_operator'
3
-
4
-
5
- module BigKeeper
6
- class LibraryModel
7
- attr_accessor :name, :file_list, :header_file_list, :keyword_list, :spec_library
8
- def initialize(name)
9
- @name = name
10
- @file_list = []
11
- @header_file_list = []
12
- @spec_library = []
13
- @keyword_list = []
14
- end
15
-
16
- def get_all_public_file(path)
17
- all_header = FileOperator.find_all_header_file("#{path}/Pods/#{@name}")
18
- for file_path in all_header do
19
- @header_file_list[@header_file_list.size] = file_path
20
- file_name = File.basename(file_path)
21
- @keyword_list[@keyword_list.size] = file_name
22
- in_note = false
23
- File.foreach(file_path) { |line|
24
- hash = Hash.new
25
- hash["in_note"]=in_note
26
- hash["line"]=line
27
- OCCodeOperator.in_note_code(hash)
28
- in_note = hash["in_note"]
29
- line = hash["line"]
30
- if line.empty?
31
- next
32
- end
33
- if line.include?("@interface ")
34
- line[0,line.index("@interface ")+11]=""
35
- column = line.split(/:/)
36
- if column.size > 1
37
- class_name = column[0]
38
- if class_name.include?("<")
39
- class_name = class_name[0, class_name.index("<")]
40
- end
41
- class_name = class_name.strip
42
- if (@keyword_list.include?(class_name+".h"))
43
- @keyword_list.delete(class_name+".h")
44
- end
45
- @keyword_list[@keyword_list.size] = class_name
46
- end
47
- end
48
- }
49
- end
50
- # if @name == ""
51
- # puts @keyword_list
52
- # end
53
- @file_list = FileOperator.find_all_code_file("#{path}/Pods/#{@name}")
54
- end
55
-
56
- def spec_dependece_library(library_keywords_hash)
57
- if library_keywords_hash.include?(@name)
58
- library_keywords_hash.delete(@name)
59
- end
60
-
61
- for file_path in @file_list do
62
- # note for coding
63
- in_note = false
64
- File.foreach(file_path) { |line|
65
- hash = Hash.new
66
- hash["in_note"]=in_note
67
- hash["line"]=line
68
- OCCodeOperator.in_note_code(hash)
69
- in_note = hash["in_note"]
70
- line = hash["line"]
71
- if line.empty?
72
- next
73
- end
74
- library_keywords_hash.each {|library_name, keyword_list|
75
- is_dependence = false
76
- tip = ""
77
- for keyword in keyword_list do
78
- if line.include?(keyword)
79
- last_char = '.'
80
- last_index = line.index(keyword)-1
81
- if last_index >= 0
82
- last_char = line[last_index]
83
- end
84
- next_char = '.'
85
- next_index = line.index(keyword)+keyword.size
86
- if next_index < line.size
87
- next_char = line[next_index]
88
- end
89
- if !(((next_char<='z'&&next_char>='a')||(next_char<='Z'&&next_char>='A')||(next_char<='9'&&next_char>='0')||next_char=='_')||((last_char<='z'&&last_char>='a')||(last_char<='Z'&&last_char>='A')||(last_char<='9'&&last_char>='0')||last_char=='_'))
90
- if keyword.include?(".h") && line.include?("import") && line.include?("/"+keyword+">")
91
- dependence_library_name = line[line.index("<")+1...line.index("/"+keyword+">")]
92
- if dependence_library_name == library_name
93
- tip = " [file]:"+File.basename(file_path)+" [line]: "+line.strip+" [keyword]: "+keyword
94
- is_dependence = true
95
- break
96
- end
97
- else
98
- tip = " [file]:"+File.basename(file_path)+" [line]: "+line.strip+" [keyword]: "+keyword
99
- is_dependence = true
100
- break
101
- end
102
- end
103
- end
104
- end
105
- if is_dependence
106
- @spec_library[@spec_library.size] = library_name+tip
107
- library_keywords_hash.delete(library_name)
108
- end
109
- }
110
-
111
- }
112
- end
113
- end
114
-
115
- end
116
- end
@@ -1,30 +0,0 @@
1
- module BigKeeper
2
- module OperateType
3
- START = 1
4
- UPDATE = 2
5
- SWITCH = 3
6
- FINISH = 4
7
- PUBLISH = 5
8
- RELEASE = 6
9
-
10
- def self.name(type)
11
- if START == type
12
- "start"
13
- elsif UPDATE == type
14
- "update"
15
- elsif SWITCH == type
16
- "switch"
17
- else
18
- name
19
- end
20
- end
21
- end
22
-
23
- module ModuleOperateType
24
- ADD = 1
25
- DELETE = 2
26
- FINISH = 3
27
- PUBLISH = 4
28
- RELEASE = 5
29
- end
30
- end
@@ -1,33 +0,0 @@
1
-
2
- module BigKeeper
3
-
4
- class PodfileModel
5
- attr_accessor :name, :git, :path, :configurations, :branch,:tag, :comment
6
- def initialize(sentence)
7
- if sentence.include?('#')
8
- list = sentence.split('#')
9
- @comment = list[1]
10
- sentence = list[0]
11
- end
12
-
13
- sentence_slip_list = sentence.split(',')
14
- return if sentence_slip_list.size.zero?
15
- for piece in sentence_slip_list do
16
- if /:git =>/ =~ piece
17
- @git = $~.post_match.strip
18
- elsif /:path =>/ =~ piece
19
- @path = $~.post_match.strip
20
- elsif /:configurations =>/ =~ piece
21
- @configurations = $~.post_match.strip
22
- elsif /:branch =>/ =~ piece
23
- @branch = $~.post_match.strip
24
- elsif /:tag =>/ =~ piece
25
- @tag = $~.post_match.strip
26
- elsif /pod /=~ piece
27
- @name = $~.post_match.delete("'\n ")
28
- end
29
- # p %Q{model name:#{@name},git:#{@git},path:#{@path},config:#{@configurations},branch:#{@branch},tag:#{@tag},comment:#{@comment}}
30
- end
31
- end
32
- end
33
- end