/
git.rb
38 lines (30 loc) · 1022 Bytes
/
git.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Application template recipe for the rails_apps_composer. Check for a newer version here:
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/git.rb
after_everything do
say_wizard "Git recipe running 'after everything'"
# Git should ignore some files
remove_file '.gitignore'
get "https://github.com/RailsApps/rails3-application-templates/raw/master/files/gitignore.txt", ".gitignore"
if recipes.include? 'omniauth'
append_file '.gitignore' do <<-TXT
# keep OmniAuth service provider secrets out of the Git repo
config/initializers/omniauth.rb
TXT
end
end
# Initialize new Git repo
git :init
git :add => '.'
git :commit => "-aqm 'new Rails app generated by rails_apps_composer'"
# Create a git branch
git :checkout => ' -b working_branch'
git :add => '.'
git :commit => "-m 'Initial commit of working_branch'"
end
__END__
name: Git
description: "Set up Git and commit the initial repository."
author: RailsApps
exclusive: scm
category: other
tags: [scm]