Class: Boppers::Generator::Plugin

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/boppers/generator/plugin.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



10
11
12
# File 'lib/boppers/generator/plugin.rb', line 10

def self.source_root
  File.join(__dir__, "plugin")
end

Instance Method Details

#copy_filesObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/boppers/generator/plugin.rb', line 14

def copy_files
  template "gemspec.erb", "#{plugin_name}.gemspec"
  copy_file "gems.rb"
  copy_file ".gitignore"
  copy_file ".rubocop.yml"
  copy_file ".travis.yml"
  copy_file "CODE_OF_CONDUCT.md"
  copy_file "LICENSE.txt"
  copy_file "Rakefile"
  template "README.erb", "README.md"
end

#copy_lib_filesObject



26
27
28
29
30
# File 'lib/boppers/generator/plugin.rb', line 26

def copy_lib_files
  template "lib/entry.erb", "lib/#{plugin_name}.rb"
  template "lib/main.erb", "lib/boppers/#{name}.rb"
  template "lib/version.erb", "lib/boppers/#{name}/version.rb"
end

#copy_test_filesObject



32
33
34
35
36
37
# File 'lib/boppers/generator/plugin.rb', line 32

def copy_test_files
  template "test/test_helper.erb", "test/test_helper.rb"

  test_file_name = name.tr("-", "_")
  template "test/test_file.erb", "test/boppers/#{test_file_name}_test.rb"
end

#run_commandsObject



39
40
41
42
43
44
# File 'lib/boppers/generator/plugin.rb', line 39

def run_commands
  inside destination_root do
    run "git init"
    run "bundle install"
  end
end