dream_template 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +21 -0
- data/README.textile +81 -0
- data/base.rb +146 -0
- data/install.rb +2 -0
- data/modules/action_mailer_optional_tls.rb +28 -0
- data/modules/capistrano.rb +10 -0
- data/modules/compass.rb +24 -0
- data/modules/cucumber.rb +58 -0
- data/modules/friendly_id.rb +13 -0
- data/modules/git.rb +27 -0
- data/modules/haml.rb +6 -0
- data/modules/optimization.rb +17 -0
- data/modules/paperclip.rb +12 -0
- data/modules/prepare.rb +11 -0
- data/modules/rails_xss.rb +15 -0
- data/modules/rspec.rb +53 -0
- data/modules/static_pages.rb +28 -0
- data/modules/theme.rb +48 -0
- data/modules/whenever.rb +13 -0
- data/modules/will_paginate.rb +7 -0
- metadata +74 -0
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2010 Dreamr (James OKelly)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
data/README.textile
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
h1. Dream Template Rails App Bootstrapper
|
2
|
+
|
3
|
+
**Cause greenfield sucks, use what works, and slowly swap it out**
|
4
|
+
Brought to you by **"Ruby Loves Me!":http://www.rubyloves.me**
|
5
|
+
|
6
|
+
This template can be used stand-alone, however, it goes hand in hand with my dream_gens project.....
|
7
|
+
|
8
|
+
h4. "dream_template":http://github.com/dreamr/dream_template
|
9
|
+
|
10
|
+
The easiest path to to create your rails app with this template, then install the dream_gens gem and you are ready to go with cucumber, rspec, and more with autospec!
|
11
|
+
|
12
|
+
h2. Genesis
|
13
|
+
|
14
|
+
I build apps fast. So just about everything I do is "greenfield". Many developers love the concept of an empty palette. I myself find it quite tiring to set things up step by step, and learn new technologies to replace what works just fine. That being said you will notice I implement new stuff, I'm just not a fan of replacing things for trend's sake. eg. Rspec+Remarkable is pretty damn cool. TestUnit still sux.
|
15
|
+
|
16
|
+
h2. Wiki Index
|
17
|
+
|
18
|
+
h3. Module explanations and use
|
19
|
+
|
20
|
+
* "prepare":http://wiki.github.com/dreamr/dream_template/moduleprepare
|
21
|
+
* "git":http://wiki.github.com/dreamr/dream_template/modulegit
|
22
|
+
* "optimization":http://wiki.github.com/dreamr/dream_template/moduleoptimization
|
23
|
+
* "capistrano":http://wiki.github.com/dreamr/dream_template/modulecapistrano
|
24
|
+
* "rspec":http://wiki.github.com/dreamr/dream_template/modulerspec
|
25
|
+
* "cucumber":
|
26
|
+
* "haml":
|
27
|
+
* "theme":
|
28
|
+
* "compass":
|
29
|
+
* "formtastic":
|
30
|
+
* "static_pages":
|
31
|
+
* "rails_xss":
|
32
|
+
* "will_paginate":
|
33
|
+
* "whenever":
|
34
|
+
* "action_mailer_optional_tls":
|
35
|
+
* "paperclip":
|
36
|
+
* "friendly_id":
|
37
|
+
|
38
|
+
|
39
|
+
h2. Template details
|
40
|
+
|
41
|
+
h3. Presentation layer
|
42
|
+
* *Haml*
|
43
|
+
* *Sass*
|
44
|
+
* *Compass*
|
45
|
+
* *Rlm theme*
|
46
|
+
|
47
|
+
h3. Test suite
|
48
|
+
* *RSpec* powered by *spork*
|
49
|
+
* *Cucumber* powered by spork
|
50
|
+
* *Remarkable* matchers for rspec
|
51
|
+
* *Rlm matchers* for rspec & cucumber
|
52
|
+
* *Factory girl* for factories
|
53
|
+
|
54
|
+
h3. Optimization plugins
|
55
|
+
* *Memorylogic* for memory
|
56
|
+
* *Oink* for memory
|
57
|
+
* *Rails indexes* for indexes
|
58
|
+
|
59
|
+
h3. Utility plugins
|
60
|
+
* *Xilence* to kill rjs backtraces
|
61
|
+
|
62
|
+
h2. Example useage
|
63
|
+
|
64
|
+
Just create a new Rails application and add the *-m* option with the URL to base.rb
|
65
|
+
|
66
|
+
<code>
|
67
|
+
rails rails_app_name -m http://github.com/dreamr/dream_template/raw/master/base.rb
|
68
|
+
</code>
|
69
|
+
|
70
|
+
Please checkout the wiki "here":http://wiki.github.com/dreamr/dream_template/ for information on each module that is included and how to use them.
|
71
|
+
|
72
|
+
h2. Contributions
|
73
|
+
|
74
|
+
Maintainer: "dreamr":http://github.com/dreamr
|
75
|
+
|
76
|
+
h3. Contributers
|
77
|
+
|
78
|
+
* "meskyanichi":http://github.com/meskyanichi
|
79
|
+
* "jsilver":http://github.com/jsilver
|
80
|
+
|
81
|
+
Fork, make a patch, notify me, get here.
|
data/base.rb
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
# Author:
|
2
|
+
# Dreamr - Ruby Loves . Me
|
3
|
+
#
|
4
|
+
# Description:
|
5
|
+
# The Ruby Loves . Me Rails stack
|
6
|
+
#
|
7
|
+
# GEMS
|
8
|
+
# - RSpec: Set gem dependencies, installs gems, generate the Spec folder and files
|
9
|
+
# - Factory Girl: Sets gem dependency, installs gem, creates the factories file in the spec/ folder
|
10
|
+
# - Formtastic: Sets gem dependency, installs gem, generates the formtastic stylesheet
|
11
|
+
# - HAML: Sets gem dependency, installs gem
|
12
|
+
# - Will Paginate: Sets gem dependency, installs gem
|
13
|
+
# - Authlogic: Sets gem dependency, installs gem
|
14
|
+
# - Delayed Job: Sets gem dependency, installs gem, updates Rakefile
|
15
|
+
# - Whenever: Sets gem dependency, installs gem, generates schedule.rb file in the config folder
|
16
|
+
# - Backup: Sets gem dependency, installs gem, generates backup.rake in lib/tasks and backup.rb in the config folder, generates migration file
|
17
|
+
# - Friendly Id: Sets gem dependency, installs gem, generates migration file
|
18
|
+
#
|
19
|
+
# PLUGINS
|
20
|
+
# - jQuery: installs jQuery and removes prototype js files (be unobstrusive)
|
21
|
+
# - Exception Notifier: Installs Exception Notifier
|
22
|
+
# - Rails XSS: Installs Rails XSS
|
23
|
+
# - Action Mailer Optional TLS: Installs Action Mailer Optional TLS (To Enable Gmail for Action Mailer)
|
24
|
+
# - Validation Reflection: Installs Validation Reflection for Formtastic
|
25
|
+
#
|
26
|
+
# OTHER GENERATES
|
27
|
+
# - RLM Theme
|
28
|
+
# - Capistrano Template (After initializing Capistrano with the capify command)
|
29
|
+
#
|
30
|
+
# DATABASE
|
31
|
+
# - Creates
|
32
|
+
# - Migrates
|
33
|
+
#
|
34
|
+
# FILES
|
35
|
+
# - Removes the README
|
36
|
+
# - Removes the index.html from the public folder
|
37
|
+
# - Adds configuration for Action Mailer Optional TLS to config/environment.rb,
|
38
|
+
# config/environments/development.rb and config/environments/produtcion.rb
|
39
|
+
# so Gmail can be used with Action Mailer.
|
40
|
+
#
|
41
|
+
# GIT
|
42
|
+
# - Creates a .gitignore file containing essential file ignoration
|
43
|
+
# - Initializes a new Git Repository
|
44
|
+
# - Does an initial commit
|
45
|
+
# - Does a commit for every installed module
|
46
|
+
|
47
|
+
# == Helper Methods ==============================
|
48
|
+
|
49
|
+
# Methods for storing modules that are requested
|
50
|
+
|
51
|
+
REPO = "http://github.com/dreamr/dream_template"
|
52
|
+
SUDO_CMD = "sudo "
|
53
|
+
SUDO_GEM = true
|
54
|
+
|
55
|
+
def modules
|
56
|
+
@modules ||= Array.new
|
57
|
+
@modules
|
58
|
+
end
|
59
|
+
|
60
|
+
# Shortcut for loading modules
|
61
|
+
def load_module(m)
|
62
|
+
load_template("#{REPO}/raw/master/modules/#{m}.rb")
|
63
|
+
end
|
64
|
+
|
65
|
+
# Shortcut for download files
|
66
|
+
def download_file(f)
|
67
|
+
run("curl -O #{REPO}/raw/master/files/#{f}")
|
68
|
+
end
|
69
|
+
|
70
|
+
def install_gems
|
71
|
+
run("sudo rake 'gems:install'")
|
72
|
+
end
|
73
|
+
|
74
|
+
# Shortcut for doing commits
|
75
|
+
def commit(m)
|
76
|
+
git(:add => '.')
|
77
|
+
git(:commit => "-a -m 'Rails Template Commit: #{m}'")
|
78
|
+
end
|
79
|
+
|
80
|
+
# Inserts text into a file
|
81
|
+
def inject_file(path, regexp, *args, &block)
|
82
|
+
content = File.read(path).gsub(regexp, *args, &block)
|
83
|
+
File.open(path, 'wb') { |file| file.write(content) }
|
84
|
+
end
|
85
|
+
|
86
|
+
# Ensures the specified gem is installed
|
87
|
+
def ensure_gem_installed(name)
|
88
|
+
run("sudo gem install #{name} --no-ri --no-rdoc") unless Gem.available?(name)
|
89
|
+
end
|
90
|
+
|
91
|
+
def wack_default_routes!
|
92
|
+
code = <<-EOS
|
93
|
+
ActionController::Routing::Routes.draw do |map|
|
94
|
+
end
|
95
|
+
EOS
|
96
|
+
run "echo '' > config/routes.rb"
|
97
|
+
run "echo '#{code}' > config/routes.rb"
|
98
|
+
end
|
99
|
+
|
100
|
+
def wack_app_controller!
|
101
|
+
code = <<-EOS
|
102
|
+
class ApplicationController < ActionController::Base
|
103
|
+
helper :all
|
104
|
+
protect_from_forgery
|
105
|
+
filter_parameter_logging :password
|
106
|
+
end
|
107
|
+
EOS
|
108
|
+
run "echo '' > app/controllers/application_controller.rb"
|
109
|
+
run "echo '#{code}' > app/controllers/application_controller.rb"
|
110
|
+
end
|
111
|
+
|
112
|
+
# == Installation Start ==============================
|
113
|
+
# Get sudo password out of the way
|
114
|
+
run 'sudo ls -ls'
|
115
|
+
|
116
|
+
# Load default modules
|
117
|
+
load_module "prepare"
|
118
|
+
load_module "git"
|
119
|
+
load_module "optimization"
|
120
|
+
load_module "capistrano"
|
121
|
+
load_module "rspec"
|
122
|
+
load_module "cucumber"
|
123
|
+
load_module "haml"
|
124
|
+
load_module "theme"
|
125
|
+
load_module "compass"
|
126
|
+
load_module "formtastic"
|
127
|
+
load_module "static_pages"
|
128
|
+
load_module "rails_xss"
|
129
|
+
load_module "will_paginate"
|
130
|
+
load_module "whenever"
|
131
|
+
load_module "action_mailer_optional_tls"
|
132
|
+
load_module "paperclip"
|
133
|
+
load_module "friendly_id"
|
134
|
+
|
135
|
+
p "Rubyloves.me template applied."
|
136
|
+
|
137
|
+
# build css files
|
138
|
+
run "compass"
|
139
|
+
|
140
|
+
p "Stylesheets generated."
|
141
|
+
|
142
|
+
# migrate the database
|
143
|
+
run "rake db:migrate"
|
144
|
+
|
145
|
+
p "Database updated."
|
146
|
+
|
data/install.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Install the Action Mailer Optional TLS plugin
|
2
|
+
plugin 'action_mailer_optional_tls',
|
3
|
+
:git => 'git://github.com/collectiveidea/action_mailer_optional_tls.git'
|
4
|
+
|
5
|
+
# Download the configuration
|
6
|
+
inside('config') do
|
7
|
+
download_file('action_mailer_optional_tls/mail.rb')
|
8
|
+
end
|
9
|
+
|
10
|
+
# Add Gmail Support to Environment.rb
|
11
|
+
open('config/environment.rb', 'a') do |file|
|
12
|
+
file << "\n\nrequire File.join(RAILS_ROOT, 'config', 'mail')"
|
13
|
+
end
|
14
|
+
|
15
|
+
# Set default Action Mailer url in development
|
16
|
+
open('config/environments/development.rb', 'a') do |file|
|
17
|
+
file << "\n\nconfig.action_mailer.default_url_options = { :host => 'localhost:3000' }"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Set default Action Mailer url in production
|
21
|
+
open('config/environments/production.rb', 'a') do |file|
|
22
|
+
file << "\n\nconfig.action_mailer.default_url_options = { :host => 'CHANGEME' }"
|
23
|
+
end
|
24
|
+
|
25
|
+
commit <<-EOS
|
26
|
+
Installed action_mailer_optional_tls plugin
|
27
|
+
Configured action_mailer_optional_tls in environments
|
28
|
+
EOS
|
data/modules/compass.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Set the Compass gem
|
2
|
+
gem 'chriseppstein-compass',
|
3
|
+
:lib => false,
|
4
|
+
:version => '>= 0.8.17'
|
5
|
+
|
6
|
+
# Install the Gems
|
7
|
+
install_gems
|
8
|
+
|
9
|
+
# Copies in compass sass main files
|
10
|
+
inside("app/stylesheets") do
|
11
|
+
download_file("compass/screen.sass")
|
12
|
+
download_file("compass/print.sass")
|
13
|
+
download_file("compass/ie.sass")
|
14
|
+
end
|
15
|
+
|
16
|
+
# Copies in compass sass partial files
|
17
|
+
inside("app/stylesheets/partials") do
|
18
|
+
download_file("compass/_base.sass")
|
19
|
+
end
|
20
|
+
|
21
|
+
commit <<-EOS
|
22
|
+
Installed compass gem and added gem dep
|
23
|
+
Added compass sass
|
24
|
+
EOS
|
data/modules/cucumber.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# Set the Cucumber Gem
|
2
|
+
gem 'cucumber',
|
3
|
+
:version => '>= 0.5.1'
|
4
|
+
|
5
|
+
# Set the Cucumber Rails Gem
|
6
|
+
gem 'cucumber-rails',
|
7
|
+
:version => '>= 0.2.2',
|
8
|
+
:lib => false
|
9
|
+
|
10
|
+
# Set the Capybara Gem
|
11
|
+
gem 'capybara',
|
12
|
+
:version => '>= 0.2.0'
|
13
|
+
|
14
|
+
# Set the Nokogiri Gem
|
15
|
+
gem 'nokogiri',
|
16
|
+
:version => '>= 1.4.1',
|
17
|
+
:lib => false
|
18
|
+
|
19
|
+
# Set the Pickle Gem
|
20
|
+
gem 'pickle',
|
21
|
+
:version => '>= 0.2.1',
|
22
|
+
:lib => false
|
23
|
+
|
24
|
+
# Set the Pickle Gem
|
25
|
+
gem 'pickler',
|
26
|
+
:version => '>= 0.1.3',
|
27
|
+
:lib => false
|
28
|
+
|
29
|
+
gem 'database_cleaner',
|
30
|
+
:lib => false
|
31
|
+
|
32
|
+
# Install the Gems
|
33
|
+
install_gems
|
34
|
+
|
35
|
+
# Install cucumber
|
36
|
+
generate("cucumber --capybara")
|
37
|
+
|
38
|
+
# Install pickle
|
39
|
+
generate("pickle")
|
40
|
+
|
41
|
+
# Install our cucumber env files
|
42
|
+
inside("features/support") do
|
43
|
+
download_file("cucumber/env.rb")
|
44
|
+
end
|
45
|
+
|
46
|
+
# Install our cucumber step files
|
47
|
+
inside("features/step_definitions") do
|
48
|
+
download_file("cucumber/common_matchers.rb")
|
49
|
+
end
|
50
|
+
|
51
|
+
commit <<-EOS
|
52
|
+
Installed Cucumber & deps
|
53
|
+
Rake cucumber generator
|
54
|
+
Installed Pickler
|
55
|
+
Installed Pickle
|
56
|
+
Added custom_matchers
|
57
|
+
Added custom env.rb
|
58
|
+
EOS
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Set the Friendly ID Gem
|
2
|
+
gem "friendly_id"
|
3
|
+
|
4
|
+
# Install the Gem
|
5
|
+
install_gems
|
6
|
+
|
7
|
+
# Generate the migration files for Friendly ID
|
8
|
+
generate("friendly_id")
|
9
|
+
|
10
|
+
commit <<-EOS
|
11
|
+
Added friendly_id Gem Depedency.
|
12
|
+
Generated Friendly ID migration files.
|
13
|
+
EOS
|
data/modules/git.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Ensure that Git is installed
|
2
|
+
ensure_gem_installed("git")
|
3
|
+
|
4
|
+
git :init
|
5
|
+
|
6
|
+
# Create a Git Ignore File
|
7
|
+
file ".gitignore", <<-EOS
|
8
|
+
.DS_Store
|
9
|
+
log/*.log
|
10
|
+
tmp/**/*
|
11
|
+
vendor/gems/**/*
|
12
|
+
config/database.yml
|
13
|
+
db/schema.rb
|
14
|
+
db/*.sqlite3
|
15
|
+
public/assets
|
16
|
+
public/system
|
17
|
+
public/javascripts/cache*
|
18
|
+
public/stylesheets/*.css
|
19
|
+
coverage/*
|
20
|
+
features_rcov/*
|
21
|
+
coverage.data
|
22
|
+
rerun.txt
|
23
|
+
*.swp
|
24
|
+
EOS
|
25
|
+
|
26
|
+
|
27
|
+
commit "Base Setup."
|
data/modules/haml.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Install the memorylogic plugin to find memory issues
|
2
|
+
plugin 'memorylogic',
|
3
|
+
:git => 'git://github.com/binarylogic/memorylogic.git'
|
4
|
+
|
5
|
+
# Install the oink plugin to find memory issues
|
6
|
+
plugin 'oink',
|
7
|
+
:git => 'git://github.com/noahd1/oink.git'
|
8
|
+
|
9
|
+
# Install the rails indexes plugin to track down needed indexes
|
10
|
+
plugin 'rails_indexes',
|
11
|
+
:git => 'git://github.com/eladmeidar/rails_indexes.git'
|
12
|
+
|
13
|
+
# Install the xilence plugin to silence rjs backtraces
|
14
|
+
plugin 'xilence',
|
15
|
+
:git => 'git://github.com/inem/xilence.git'
|
16
|
+
|
17
|
+
commit "Installed memorylogic, oink, rails_indexes, and xilence to aid in optimizing code"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Sets the Paperclip Gem
|
2
|
+
gem "paperclip"
|
3
|
+
|
4
|
+
# Install the Gems
|
5
|
+
install_gems
|
6
|
+
|
7
|
+
# Download Custom Capistrano Deployment Recipe
|
8
|
+
inside('lib/tasks') do
|
9
|
+
download_file('paperclip/paperclip_tasks.rake')
|
10
|
+
end
|
11
|
+
|
12
|
+
commit "Installed Paperclip, Added Paperclip Rake Tasks."
|
data/modules/prepare.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Install the Rails XSS Plugin
|
2
|
+
plugin 'rails_xss',
|
3
|
+
:git => 'git://github.com/NZKoz/rails_xss.git'
|
4
|
+
|
5
|
+
# Set the Erubis Gem Dependency (for Rails XSS)
|
6
|
+
gem "erubis"
|
7
|
+
|
8
|
+
# Install the Gem
|
9
|
+
install_gems
|
10
|
+
|
11
|
+
commit <<-EOS
|
12
|
+
Installed the Rails XSS plugin.
|
13
|
+
Installed the Erubis Gem and added it as a dependency.
|
14
|
+
EOS
|
15
|
+
|
data/modules/rspec.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# Ensure that Spork is installed
|
2
|
+
ensure_gem_installed("spork")
|
3
|
+
|
4
|
+
# Ensure that Faker is installed
|
5
|
+
ensure_gem_installed("faker")
|
6
|
+
|
7
|
+
# Ensure ZenTest is installed
|
8
|
+
ensure_gem_installed("ZenTest")
|
9
|
+
|
10
|
+
# Set the RSpec Gem
|
11
|
+
gem "rspec", :lib => false, :version => ">= 1.2.0"
|
12
|
+
|
13
|
+
# Set the RSpec for Rails Gem
|
14
|
+
gem "rspec-rails", :lib => false, :version => ">= 1.2.0"
|
15
|
+
|
16
|
+
# Set the Factory Girl Gem
|
17
|
+
gem 'factory_girl', :version => '>= 1.2.3'
|
18
|
+
|
19
|
+
# Set the Remarkable Rails Gem
|
20
|
+
gem 'remarkable_rails', :version => '>= 3.1.11'
|
21
|
+
|
22
|
+
# Install the Gems
|
23
|
+
install_gems
|
24
|
+
|
25
|
+
# Generate the inital RSpec folders and files
|
26
|
+
generate("rspec")
|
27
|
+
|
28
|
+
# Replace spec helper with ours
|
29
|
+
inside("spec") do
|
30
|
+
download_file("rspec/spec_helper.rb")
|
31
|
+
run "mkdir spec_helpers"
|
32
|
+
end
|
33
|
+
|
34
|
+
# Copy in the spec helpers
|
35
|
+
inside("spec/spec_helpers") do
|
36
|
+
download_file("rspec/mailer_spec_helper.rb")
|
37
|
+
download_file("rspec/view_spec_helper.rb")
|
38
|
+
end
|
39
|
+
|
40
|
+
# Create the factory folder
|
41
|
+
inside("spec") do
|
42
|
+
run "mkdir factories"
|
43
|
+
end
|
44
|
+
|
45
|
+
# Delete test folder
|
46
|
+
run "rm -rf test"
|
47
|
+
|
48
|
+
commit <<-EOS
|
49
|
+
Added Rspec, Rspec Rails and Factory Girl Gem Dependencies
|
50
|
+
Generated initial RSpec folders and files
|
51
|
+
Created factories folder
|
52
|
+
Deleted test directory.
|
53
|
+
EOS
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Copies in our controller
|
2
|
+
inside("app/controllers") do
|
3
|
+
download_file("static_pages/static_pages_controller.rb")
|
4
|
+
end
|
5
|
+
|
6
|
+
# Copies in our controller spec
|
7
|
+
inside("spec/controllers") do
|
8
|
+
download_file("static_pages/static_pages_controller_spec.rb")
|
9
|
+
end
|
10
|
+
|
11
|
+
# Copies in our homepage view
|
12
|
+
inside("app/views/static_pages") do
|
13
|
+
download_file("static_pages/home.html.haml")
|
14
|
+
end
|
15
|
+
|
16
|
+
# inject our routing
|
17
|
+
route "map.home '/', :controller => :static_pages, :action => :home\n\tmap.root :home"
|
18
|
+
|
19
|
+
commit <<-EOS
|
20
|
+
Added static pages:
|
21
|
+
* controller
|
22
|
+
* spec verifying home is a success response
|
23
|
+
* home haml view
|
24
|
+
* Injected route for homepage
|
25
|
+
EOS
|
26
|
+
|
27
|
+
|
28
|
+
|
data/modules/theme.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Copies in our theme
|
2
|
+
inside("app/views/layouts") do
|
3
|
+
download_file("theme/theme.html.haml")
|
4
|
+
end
|
5
|
+
|
6
|
+
# Copies in our compass config
|
7
|
+
inside("config") do
|
8
|
+
download_file("theme/compass.config")
|
9
|
+
end
|
10
|
+
|
11
|
+
# Copies in our theme helpers
|
12
|
+
inside("app/helpers") do
|
13
|
+
download_file("theme/theme_helper.rb")
|
14
|
+
download_file("theme/flash_helper.rb")
|
15
|
+
end
|
16
|
+
|
17
|
+
# Removes all javascript files from javascript folder
|
18
|
+
%w(prototype controls dragdrop effects).each do |file|
|
19
|
+
run "rm -f public/javascripts/#{file}.js"
|
20
|
+
end
|
21
|
+
|
22
|
+
# Injects the javascript_include_tag for jQuery into the theme.html.haml file
|
23
|
+
inject_file('app/views/layouts/theme.html.haml', /= yield\(:javascript\)/) do |match|
|
24
|
+
"= javascript_include_tag 'jquery-1.3.2.min'\n\t\t#{match}"
|
25
|
+
end
|
26
|
+
|
27
|
+
# Injects the elayout into application_controller.rb
|
28
|
+
inject_file('app/controllers/application_controller.rb', /class ApplicationController < ActionController::Base/) do |match|
|
29
|
+
"#{match}\n\tlayout 'theme'\n"
|
30
|
+
end
|
31
|
+
|
32
|
+
# Copies in theme sass partial files
|
33
|
+
inside("app/stylesheets/partials") do
|
34
|
+
download_file("theme/_html.sass")
|
35
|
+
download_file("theme/_flashes.sass")
|
36
|
+
download_file("theme/_theme.sass")
|
37
|
+
download_file("theme/_layout.sass")
|
38
|
+
end
|
39
|
+
|
40
|
+
commit <<-EOS
|
41
|
+
Added theme layout
|
42
|
+
Added compass config
|
43
|
+
Added theme and flash helpers
|
44
|
+
Added JQuery min
|
45
|
+
Added Removed prototype js files
|
46
|
+
Added theme sass partials
|
47
|
+
EOS
|
48
|
+
|
data/modules/whenever.rb
ADDED
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dream_template
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dreamr (James OKelly)
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-01-01 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: " Rapid rails development template (haml, sass, compass, rspec, remarkable, factorygirl, and more!)\n"
|
17
|
+
email: james@rubyloves.me
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- LICENSE
|
26
|
+
- README.textile
|
27
|
+
- base.rb
|
28
|
+
- install.rb
|
29
|
+
- modules/action_mailer_optional_tls.rb
|
30
|
+
- modules/capistrano.rb
|
31
|
+
- modules/compass.rb
|
32
|
+
- modules/cucumber.rb
|
33
|
+
- modules/friendly_id.rb
|
34
|
+
- modules/git.rb
|
35
|
+
- modules/haml.rb
|
36
|
+
- modules/optimization.rb
|
37
|
+
- modules/paperclip.rb
|
38
|
+
- modules/prepare.rb
|
39
|
+
- modules/rails_xss.rb
|
40
|
+
- modules/rspec.rb
|
41
|
+
- modules/static_pages.rb
|
42
|
+
- modules/theme.rb
|
43
|
+
- modules/whenever.rb
|
44
|
+
- modules/will_paginate.rb
|
45
|
+
has_rdoc: true
|
46
|
+
homepage: http://wiki.github.com/dreamr/dream_template/
|
47
|
+
licenses: []
|
48
|
+
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options:
|
51
|
+
- --charset=UTF-8
|
52
|
+
require_paths:
|
53
|
+
- modules
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: "0"
|
59
|
+
version:
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: "1.3"
|
65
|
+
version:
|
66
|
+
requirements: []
|
67
|
+
|
68
|
+
rubyforge_project:
|
69
|
+
rubygems_version: 1.3.5
|
70
|
+
signing_key:
|
71
|
+
specification_version: 3
|
72
|
+
summary: Rapid rails development template (haml, sass, compass, rspec, remarkable, factorygirl, and more!)
|
73
|
+
test_files: []
|
74
|
+
|