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



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

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

#runObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# 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("lib")
  make_dir("spec")
  make_dir("spec/unit")
  make_dir("spec/integration")
end