Class: SolidusDevSupport::Extension

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/solidus_dev_support/extension.rb

Constant Summary collapse

PREFIX =
'solidus_'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



124
125
126
# File 'lib/solidus_dev_support/extension.rb', line 124

def self.source_root
  "#{__dir__}/templates/extension"
end

Instance Method Details

#generate(raw_path = '.') ⇒ Object



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
42
43
44
45
# File 'lib/solidus_dev_support/extension.rb', line 16

def generate(raw_path = '.')
  self.path = raw_path

  empty_directory path

  directory 'app', "#{path}/app"
  directory 'lib', "#{path}/lib"
  directory 'bin', "#{path}/bin"
  directory '.circleci', "#{path}/.circleci"
  directory '.github', "#{path}/.github"

  Dir["#{path}/bin/*"].each do |bin|
    make_executable bin
  end

  template 'CHANGELOG.md', "#{path}/CHANGELOG.md"
  template 'extension.gemspec', "#{path}/#{file_name}.gemspec"
  template 'Gemfile', "#{path}/Gemfile"
  template 'gitignore', "#{path}/.gitignore"
  template 'gem_release.yml.tt', "#{path}/.gem_release.yml"
  template 'LICENSE', "#{path}/LICENSE"
  template 'Rakefile', "#{path}/Rakefile"
  template 'README.md', "#{path}/README.md"
  template 'config/routes.rb', "#{path}/config/routes.rb"
  template 'config/locales/en.yml', "#{path}/config/locales/en.yml"
  template 'rspec', "#{path}/.rspec"
  template 'spec/spec_helper.rb.tt', "#{path}/spec/spec_helper.rb"
  template 'rubocop.yml', "#{path}/.rubocop.yml"
  template 'github_changelog_generator', "#{path}/.github_changelog_generator"
end