26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/jenkins/plugin/cli/new.rb', line 26
def create_pluginspec
git_name = %x[git config user.name].chomp
git_email = %x[git config user.email].chomp
developer_id = git_email.split('@', 2).first || ''
git_name = 'TODO: Put your realname here' if git_name.empty?
git_email = '[email protected]' if git_email.empty?
display_name_components = repository_name.split(/[-_]/).collect { |w| w.capitalize }
opts = {
:developer_id => developer_id.empty? ? 'TODO: Put your jenkins-ci.org username here.' : developer_id,
:developer_name => "#{git_name} <#{git_email}>",
:display_name => display_name_components.join(' ')
}
template('templates/pluginspec.tt', "#{repository_name}/#{name}.pluginspec", opts)
end
|