Sha256: 3c1f18bd2f82aa5295d3e6ca113c8154322977e2f1c6ae737b672725bd1102ac
Contents?: true
Size: 1.47 KB
Versions: 2
Compression:
Stored size: 1.47 KB
Contents
# coding: utf-8 require 'thor/group' require 'grit' require 'bundler' require 'bundler/cli' require 'retter' class Newretter < Thor::Group FILES = %w( .gitignore Gemfile Retterfile config.ru layouts/entries.html.haml layouts/entry.html.haml layouts/profile.html.haml layouts/index.html.haml layouts/retter.html.haml images/.gitkeep index.html entries/.gitkeep javascripts/.gitkeep stylesheets/application.css retters/.gitkeep ) include Thor::Actions argument :name def self.source_root File.dirname(__FILE__) end def create_files FILES.each do |file| template("skel/#{file}", "#{name}/#{file}") end end def bundle_install pwd = Dir.pwd FileUtils.cd name Bundler::CLI.new.install FileUtils.cd pwd end def git_init Grit::Repo.init "#{Dir.pwd}/#{name}" end def notice_how_to_use editor = ENV['EDITOR'] say "-- Thanks for flying Retter :-> --\n", :green say <<-EOM, :green Setting $EDITOR: retter *requires* $EDITOR variable. example: echo "export EDITOR=vim" >> ~/.zshenv # or ~/.bash_profile . ~/.zshenv EOM say " Current your $EDITOR is #{editor ? editor : 'undefined'}.\n", :red say <<-EOM, :green Setting $RETTER_HOME: You can use retter command anywhere, If you set $RETTER_HOME variable. example: echo "export RETTER_HOME=#{Dir.pwd}/#{name}" >> ~/.zshenv ... See also: retter usage retter help EOM end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
retter-0.0.3 | lib/generator/newretter.rb |
retter-0.0.2 | lib/generator/newretter.rb |