Class: GemBootstrap::CLI

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/gem_bootstrap/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



24
25
26
# File 'lib/gem_bootstrap/cli.rb', line 24

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#copy_licenceObject

rubocop:enable all



50
51
52
# File 'lib/gem_bootstrap/cli.rb', line 50

def copy_licence
  copy_file "../../templates/MIT_LICENSE", "#{name}/LICENSE"
end

#create_git_projectObject

Create the git project to store our generated code



55
56
57
# File 'lib/gem_bootstrap/cli.rb', line 55

def create_git_project
  GemBootstrap::GitUtils.create_git_project(File.expand_path(name), name)
end

#create_lib_fileObject

rubocop:disable MethodLength, LineLength



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/gem_bootstrap/cli.rb', line 29

def create_lib_file
  template "../../templates/README.md",                        "#{name}/README.md"
  template "../../templates/CHANGELOGS.md",                    "#{name}/CHANGELOGS.md"
  template "../../templates/dot_yardopts",                     "#{name}/.yardopts"
  template "../../templates/dot_gitignore",                    "#{name}/.gitignore"
  template "../../templates/Gemfile",                          "#{name}/Gemfile"
  template "../../templates/Rakefile",                         "#{name}/Rakefile"
  template "../../templates/Guardfile",                        "#{name}/Guardfile"
  template "../../templates/dot_rubocop.yml",                  "#{name}/.rubocop.yml"
  template "../../templates/newgem.gemspec.tt",                "#{name}/#{name}.gemspec"
  template "../../templates/bin/newgem",                       "#{name}/bin/#{name}"
  template "../../templates/lib/newgem.rb",                    "#{name}/lib/#{name}.rb"
  template "../../templates/lib/newgem/version.rb",            "#{name}/lib/#{name}/version.rb"
  template "../../templates/lib/newgem/logger.rb",             "#{name}/lib/#{name}/logger.rb"
  template "../../templates/lib/newgem/cli.rb",                "#{name}/lib/#{name}/cli.rb"
  template "../../templates/lib/newgem/newgem.rb",             "#{name}/lib/#{name}/#{name}.rb"
  template "../../templates/test/test_helper.rb",              "#{name}/test/test_helper.rb"
  template "../../templates/test/lib/newgem/test_newgem.rb",   "#{name}/test/lib/#{name}/test_#{name}.rb"
end