Class: Toolshed::Git::Github
Constant Summary
DEFAULT_BRANCH_FROM, DEFAULT_GIT_TOOL
Instance Attribute Summary collapse
Attributes inherited from Base
#from_remote_branch_name, #from_remote_name, #to_remote_branch_name, #to_remote_name, #validator
Class Method Summary
collapse
Instance Method Summary
collapse
branch_name, branch_name_from_id, branched_from, checkout, clean_branch_name, delete, git_submodule_command, push
Methods inherited from Base
#create_branch
Constructor Details
#initialize(options = {}) ⇒ Github
9
10
11
12
13
14
15
16
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
|
# File 'lib/toolshed/git/github.rb', line 9
def initialize(options={})
super(options)
username = Toolshed::Client::github_username
password = Toolshed::Client::github_password
token = Toolshed::Client::github_token
unless (options[:username].nil?)
username = options[:username]
end
unless (options[:password].nil?)
password = options[:password]
end
unless (token.nil?)
username = token
password = nil
end
unless (options[:token].nil?)
username = options[:token]
password = nil
end
@auth = { username: username, password: password }
self.default_options = {
:headers => {
"User-Agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1309.0 Safari/537.17",
},
basic_auth: @auth,
}
end
|
Instance Attribute Details
#default_options ⇒ Object
Returns the value of attribute default_options.
7
8
9
|
# File 'lib/toolshed/git/github.rb', line 7
def default_options
@default_options
end
|
Class Method Details
.create_instance ⇒ Object
.password ⇒ Object
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'lib/toolshed/git/github.rb', line 81
def self.password
password = Toolshed::Client::github_password
if (password.nil?)
system "stty -echo"
puts "Github password? "
password = $stdin.gets.chomp.strip
system "stty echo"
end
return password
end
|
.username ⇒ Object
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/toolshed/git/github.rb', line 70
def self.username
username = Toolshed::Client::github_username
if (username.nil?)
puts "Github username? "
username = $stdin.gets.chomp.strip
end
return username
end
|
Instance Method Details
#create_pull_request(title, body, options = {}) ⇒ Object
#list_branches(options = {}) ⇒ Object