brainopia (owner)

Revisions

gist: 75610 Download_button fork
public
Public Clone URL: git://gist.github.com/75610.git
Embed All Files: show embed
Ruby #
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Initialize git
git :init
git :submodule => "init"
 
# Link to local copy of edge rails
inside('vendor') { run 'ln -s ~/code/rails/rails rails' }
 
# Generate Simple controller
generate :controller, :simple
route "map.site '/:action/:id', :controller => 'simple'"
 
# Delete unnecessary files
run "rm README"
run "rm -fr doc"
run "rm -fr test"
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
run "rm public/images/rails.png"
run "rm -f public/javascripts/*"
 
# Download jQuery
run "curl -s -L http://jqueryjs.googlecode.com/files/jquery-1.3.2.js > public/javascripts/jquery.js"
 
# Copy database.yml for version control use
run "cp config/database.yml config/database.example.yml"
 
# Set up .gitignore files
run "touch tmp/.gitignore log/.gitignore"
file '.gitignore', <<-END
.DS_Store
log/*.log
log/*.pid
db/*.db
db/*.sqlite3
db/schema.rb
config/database.yml
tmp/**/*
doc/
test/
END
 
# Install submoduled plugins
plugin 'resource_controller', :git => 'git://github.com/giraffesoft/resource_controller.git', :submodule => true
plugin 'smurf', :git => 'git://github.com/thumblemonks/smurf.git', :submodule => true
 
plugin 'rails-settings', :git => 'git://github.com/Squeegy/rails-settings.git', :submodule => true
generate :settings_migration
rake 'db:migrate'
file 'config/initializers/settings.rb'
 
# Install render engines
gem 'haml'
run 'haml --rails .'
gem 'chriseppstein-compass', :lib => 'compass'
run 'compass --rails -f blueprint --sass-dir app/stylesheets --css-dir public/stylesheets .'
 
# Set up a starting application layout
file 'app/views/layouts/application.html.haml', <<-END
!!!
%html{ html_attrs('ru') }
%head
%meta{ 'http-equiv' => 'content-type', :content => 'text/html', :charset => 'utf-8' }
= stylesheet_link_tag 'screen', :cache => 'base'
/[if IE]
= stylesheet_link_tag 'ie', :cache => 'ie'
%title
%body
.container
= yield
= javascript_include_tag 'jquery', :cache => 'base'
END
 
# Support for the Russian language
gem 'yaroslav-russian', :lib => 'russian'
 
# Prepare testing environment
if yes?("Do you want rspec?")
  gem 'rspec-rails'
  generate 'rspec'
  gem 'thoughtbot-factory_girl'
  gem 'faker'
end
 
# Initial git commit
git :add => '.'
git :commit => "-a -m 'Initial commit'"