Class: SpreeCmd::Extension

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

Instance Method Summary collapse

Instance Method Details

#final_bannerObject



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/spree_cmd/extension.rb', line 31

def final_banner
  say %{
    #{'*' * 80}

    Your extension has been generated with a gemspec dependency on Spree #{spree_version}.

    For more information on the versioning of Spree.
    See https://guides.spreecommerce.com/developer/extensions_tutorial.html#versioning-your-extension

    #{'*' * 80}
  }
end

#generateObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/spree_cmd/extension.rb', line 10

def generate
  use_prefix 'spree_'

  empty_directory file_name

  directory 'app', "#{file_name}/app"
  directory 'lib', "#{file_name}/lib"
  directory 'bin', "#{file_name}/bin"

  template 'extension.gemspec', "#{file_name}/#{file_name}.gemspec"
  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 'config/routes.rb', "#{file_name}/config/routes.rb"
  template 'config/locales/en.yml', "#{file_name}/config/locales/en.yml"
  template 'rspec', "#{file_name}/.rspec"
  template 'spec/spec_helper.rb.tt', "#{file_name}/spec/spec_helper.rb"
end