Top Level Namespace
Defined Under Namespace
Modules: BB, CocoapodsBbPodassistant, Pod
Classes: Dir
Constant Summary
collapse
- DEFAULT =
0
- LOCAL =
1
- REMOTE_GIT =
2
- REMOTE_VERSION =
3
- REMOTE_BRANCH =
4
- REMOTE_TAG =
5
- YAML_CONFIG_LIST_KEY =
"list"
- YAML_CONFIG_REMOVE_KEY =
"remove"
- YAML_CONFIG_DEPENDENCIES_KEY =
"dependencies"
Instance Method Summary
collapse
Instance Method Details
#configGitPath(gitPath) ⇒ Object
Git Command ########################################
4
5
6
|
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 4
def configGitPath(gitPath)
@gitPath = gitPath
end
|
#git_branch_exists?(branch) ⇒ Boolean
60
61
62
63
64
65
66
|
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 60
def git_branch_exists?(branch)
if branch
branchs = git_cmd('branch','-a').split("\n")
branchs.include?(branch) || branchs.include?(' remotes/origin/' + branch) || branchs.include?('remotes/origin/' + branch)
end
return true
end
|
#git_checkout_and_pull(stable_source, stable_branch = nil, stable_tag = nil) ⇒ Object
git_cmd(‘pull’,‘–all’) #fommate git command
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/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 25
def git_checkout_and_pull(stable_source, stable_branch = nil, stable_tag = nil)
if stable_branch || stable_tag
if stable_branch
unless git_branch_exists?(stable_branch)
err_msg = "- Error: #{stable_source} did not exit branch #{stable_branch}"
Pod::UI.puts "#{err_msg}".send(:red)
exit -9006
end
git_cmd('checkout',stable_branch) git_cmd('reset','--hard',"origin/#{stable_branch}") end
if stable_tag
unless git_tag_exists?(stable_tag)
err_msg = "- Error: #{stable_source} did not exit tag #{stable_tag}"
Pod::UI.puts "#{err_msg}".send(:red)
exit -9007
end
git_cmd('checkout',stable_tag) end
else
protechBranch = git_cmd('symbolic-ref','refs/remotes/origin/HEAD').split("/").last.strip || "main"
git_cmd('checkout',protechBranch)
git_cmd('reset','--hard',"origin/#{protechBranch}") end
end
|
#git_clone(source, path) ⇒ Object
68
69
70
71
72
73
|
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 68
def git_clone(source, path)
puts "git clone source:#{source} path:#{path}"
UI.section("Cloning `#{source}` into `#{path}`.") do
Dir.chdir(path) { git! ['clone', source] } end
end
|
#git_cmd(*args) ⇒ Object
8
9
10
11
12
|
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 8
def git_cmd(*args)
Dir.chdir(File.join(@gitPath)) {
return git! args
}
end
|
#git_fetch ⇒ Object
18
19
20
|
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 18
def git_fetch
git_cmd('fetch') end
|
#git_pull ⇒ Object
22
23
24
|
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 22
def git_pull
end
|
#git_reset ⇒ Object
14
15
16
|
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 14
def git_reset
git_cmd('reset','--hard') end
|
#git_tag_exists?(tag) ⇒ Boolean
53
54
55
56
57
58
|
# File 'lib/cocoapods-bb-PodAssistant/helpers/git_cmd_helper.rb', line 53
def git_tag_exists?(tag)
if tag
git_cmd('tag').split("\n").include?(tag)
end
return true
end
|