22
23
24
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
52
53
54
55
56
57
|
# File 'lib/cenit_cmd/collection.rb', line 22
def generate
@collection_name = @file_name
use_prefix 'cenit-collection-'
@user_name = options[:user_name] || git_config['user.name']
@user_email = options[:user_email] || git_config['user.email']
@github_username = options[:github_username] || git_config['github.user']
@summary = options[:summary] || "Shared Collection #{@file_name} to be use in Cenit"
@description = options[:description] || @summary
@homepage = options[:homepage] || "https://github.com/#{@github_username}/#{@file_name}"
return unless validate_argument
empty_directory file_name
directory 'lib', "#{file_name}/lib"
empty_directory "#{file_name}/lib/cenit/collection/#{collection_name}/connections"
empty_directory "#{file_name}/lib/cenit/collection/#{collection_name}/webhooks"
empty_directory "#{file_name}/lib/cenit/collection/#{collection_name}/connection_roles"
empty_directory "#{file_name}/lib/cenit/collection/#{collection_name}/events"
empty_directory "#{file_name}/lib/cenit/collection/#{collection_name}/flows"
empty_directory "#{file_name}/lib/cenit/collection/#{collection_name}/translators"
empty_directory "#{file_name}/spec/support"
empty_directory "#{file_name}/spec/support/sample"
template 'Gemfile', "#{file_name}/Gemfile"
template 'gitignore', "#{file_name}/.gitignore"
template 'LICENSE', "#{file_name}/LICENSE"
template 'Rakefile', "#{file_name}/Rakefile"
template 'README.md', "#{file_name}/README.md"
template 'rspec', "#{file_name}/.rspec"
template 'spec/spec_helper.rb.tt', "#{file_name}/spec/spec_helper.rb"
@generated = true
end
|