Class: Preseason::Recipe::Git

Inherits:
Preseason::Recipe show all
Defined in:
lib/preseason/recipe/git.rb

Instance Attribute Summary collapse

Attributes inherited from Preseason::Recipe

#config

Instance Method Summary collapse

Methods inherited from Preseason::Recipe

#initialize, #post_install_hook, #recipe_root

Methods included from Colorize

#ask, #readme, #yes?

Methods included from GeneratorContext

#method_missing

Constructor Details

This class inherits a constructor from Preseason::Recipe

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Preseason::GeneratorContext

Instance Attribute Details

#github_usernameObject (readonly)

Returns the value of attribute github_username.



2
3
4
# File 'lib/preseason/recipe/git.rb', line 2

def github_username
  @github_username
end

#public_repoObject (readonly)

Returns the value of attribute public_repo.



2
3
4
# File 'lib/preseason/recipe/git.rb', line 2

def public_repo
  @public_repo
end

#repo_nameObject (readonly)

Returns the value of attribute repo_name.



2
3
4
# File 'lib/preseason/recipe/git.rb', line 2

def repo_name
  @repo_name
end

Instance Method Details

#prepareObject



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

def prepare
  remove_file 'README.rdoc'
  create_file 'README.md', parse_template('readme/README.md.erb')

  run 'rake db:migrate'
  run 'git init'
  run 'git add .'
  run 'git commit -m "Initial commit"'

  publish_to_github if github?
end