Class: RubyProject

Inherits:
Generator show all
Defined in:
lib/generators/ruby_project.rb

Instance Method Summary collapse

Methods inherited from Generator

#initialize, #make_dir, #make_file, #pre_install

Constructor Details

This class inherits a constructor from Generator

Instance Method Details

#post_installObject



16
17
18
19
# File 'lib/generators/ruby_project.rb', line 16

def post_install
  puts `cd #{@base} && git init`
  puts `cd #{@base} && bundle install`
end

#runObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/ruby_project.rb', line 4

def run
  make_file("Gemfile") {
    "source 'http://rubygems.org'\ngem 'rspec'"
  }
  make_file(".rspec") {
    "--color"
  }
  make_file(".gitignore")
  make_dir("src")
  make_dir("spec")
end