jnewland (owner)

Fork Of

gist: 33337 by peterc Fully featured Rails templa...

Revisions

gist: 93545 Download_button fork
public
Public Clone URL: git://gist.github.com/93545.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# rails foo_name -m http://gist.github.com/93545.txt
# rake rails:template LOCATION=http://gist.github.com/93545.txt
 
# Delete unnecessary files
  run "rm README"
  run "rm public/index.html"
 
# Set up git repository
  git :init
  git :add => '.'
  
# Copy database.yml for distribution use
  run "cp config/database.yml config/database.yml.example"
  
# Set up .gitignore files
  run "touch tmp/.gitignore log/.gitignore vendor/.gitignore"
  run %{find . -type d -empty | grep -v "vendor" | grep -v ".git" | grep -v "tmp" | xargs -I xxx touch xxx/.gitignore}
  file '.gitignore', <<-END
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
END
 
# Install submoduled plugins
  plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git', :submodule => true
  plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git', :submodule => true
  plugin 'cucumber',
:git => "git://github.com/aslakhellesoy/cucumber.git", :submodule => true
  plugin 'asset_packager', :git => 'git://github.com/sbecker/asset_packager.git', :submodule => true
  plugin 'open_id_authentication', :git => 'git://github.com/rails/open_id_authentication.git', :submodule => true
  plugin 'role_requirement', :git => 'git://github.com/timcharper/role_requirement.git', :submodule => true
  plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git', :submodule => true
  plugin 'acts_as_taggable_redux', :git => 'git://github.com/geemus/acts_as_taggable_redux.git', :submodule => true
  plugin 'aasm', :git => 'git://github.com/rubyist/aasm.git', :submodule => true
  plugin 'mile_marker', :git => "git://github.com/thoughtbot/mile_marker.git", :submodule => true
 
# Install all gems
  gem 'RedCloth', :lib => 'redcloth', :version => '~> 3.0.4'
  gem 'mislav-will_paginate', :version => '~> 2.2.3', :lib => 'will_paginate', :source => 'http://gems.github.com'
  gem 'ruby-openid', :lib => 'openid'
  gem 'sqlite3-ruby', :lib => 'sqlite3'
  gem 'hpricot', :source => 'http://code.whytheluckystiff.net'
  gem 'term-ansicolor', :lib => false
  gem 'treetop', :lib => false
  gem 'diff-lcs', :lib => false
  gem 'nokogiri', :lib => false
  gem 'builder', :lib => false
  rake('gems:install', :sudo => true)
 
# Set up sessions, RSpec, user model, OpenID, etc, and run migrations
  rake('db:sessions:create')
  generate('cucumber')
  generate("authenticated", "user session")
  generate("roles", "Role User")
  generate("rspec")
  rake('acts_as_taggable:db:create')
  rake('open_id_authentication:db:create')
  rake('db:migrate')
 
initializer 'errors.rb',
%q{# Example:
# begin
# some http call
# rescue *HTTP_ERRORS => error
# notify_hoptoad error
# end
HTTP_ERRORS = [Timeout::Error,
Errno::EINVAL,
Errno::ECONNRESET,
EOFError,
Net::HTTPBadResponse,
Net::HTTPHeaderSyntaxError,
Net::ProtocolError]
SMTP_SERVER_ERRORS = [TimeoutError,
IOError,
Net::SMTPUnknownError,
Net::SMTPServerBusy,
Net::SMTPAuthenticationError]
SMTP_CLIENT_ERRORS = [Net::SMTPFatalError,
Net::SMTPSyntaxError]
SMTP_ERRORS = SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS
}
 
initializer 'requires.rb',
%q{require 'redcloth'
Dir[File.join(RAILS_ROOT, 'lib', 'extensions', '*.rb')].each do |f|
require f
end
Dir[File.join(RAILS_ROOT, 'lib', '*.rb')].each do |f|
require f
end
}
 
# Initialize submodules
  git :submodule => "init"
 
# Commit all work so far to the repository
  git :add => '.'
  git :commit => "-a -m 'Initial commit'"
 
# Success!
  puts "SUCCESS!"