Class: Retter::Generator::Base

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

Direct Known Subclasses

Creator

Constant Summary collapse

TEMPLATES =
%w(
  Retterfile
  Gemfile
  config.ru
  index.html
  layouts/entries.html.haml
  layouts/entry.html.haml
  layouts/article.html.haml
  layouts/profile.html.haml
  layouts/index.html.haml
  layouts/retter.html.haml
)
FILES =
%w(
  .gitignore
  retters/.gitkeep
  images/.gitkeep
  entries/.gitkeep
  tmp/cache/.gitkeep
  javascripts/.gitkeep
  stylesheets/base.css
  stylesheets/retter.css
  stylesheets/pygments.css

  stylesheets/orange.css
  images/orange/bg_body.jpg
  images/orange/bg_entry.jpg
  images/orange/bg_header.png
)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



44
45
46
# File 'lib/retter/generator/base.rb', line 44

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#bundle_installObject



58
59
60
61
62
63
64
# File 'lib/retter/generator/base.rb', line 58

def bundle_install
  Dir.chdir name do
    cli = Bundler::CLI.new

    cli.install
  end
end

#create_filesObject



48
49
50
51
52
53
54
55
56
# File 'lib/retter/generator/base.rb', line 48

def create_files
  FILES.each do |file|
    copy_file %(skel/#{file}), %(#{name}/#{file})
  end

  TEMPLATES.each do |file|
    template %(skel/#{file}), %(#{name}/#{file})
  end
end