bootup 0.0.1alpha
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +69 -0
- data/Rakefile +2 -0
- data/bootup.gemspec +17 -0
- data/lib/bootup/engine.rb +5 -0
- data/lib/bootup/version.rb +3 -0
- data/lib/bootup.rb +6 -0
- data/lib/generators/bootup/USAGE +8 -0
- data/lib/generators/bootup/bootup_generator.rb +59 -0
- data/lib/generators/bootup/templates/Gemfile +36 -0
- data/lib/generators/bootup/templates/Guardfile +23 -0
- data/lib/generators/bootup/templates/application.css +18 -0
- data/lib/generators/bootup/templates/application.js +27 -0
- data/lib/generators/bootup/templates/database.yml.erb +24 -0
- data/lib/generators/bootup/templates/spec_helper.rb +38 -0
- metadata +63 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Rahul Jayaraman
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# Bootup
|
2
|
+
|
3
|
+
Provides a rails generator to install essential gems required to start a new rails app.
|
4
|
+
|
5
|
+
The following assumptions are made about the environment:
|
6
|
+
|
7
|
+
1. Postgres is installed & configured. (Yes, also assuming that postgres would be used with the application)
|
8
|
+
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
gem 'bootup', git: "git://github.com/recklessrahul/bootup.git"
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
Run
|
23
|
+
|
24
|
+
'rails g bootup'
|
25
|
+
or
|
26
|
+
|
27
|
+
'rails g bootup *APP_NAME*'
|
28
|
+
|
29
|
+
*Note:* If *APP_NAME* is not supplied, the root folder name would be used as *APP_NAME*.
|
30
|
+
|
31
|
+
## What does the generator install?
|
32
|
+
|
33
|
+
The following gems would be installed:
|
34
|
+
|
35
|
+
1. rails 3.2.3
|
36
|
+
2. pg
|
37
|
+
3. jquery-rails
|
38
|
+
4. simple_form (Generator would be run automatically)
|
39
|
+
5. thin
|
40
|
+
6. twitter-bootstrap-rails (Generator would be run automatically)
|
41
|
+
7. sorcery
|
42
|
+
8. jquery-datatables-rails (Automatically included in application.js & initialized to #datatables)
|
43
|
+
|
44
|
+
Group Test:
|
45
|
+
1. spork (Pre-configured with my personal preferences for pre-fork & each_run blocks)
|
46
|
+
2. faker
|
47
|
+
3. capybara
|
48
|
+
4. launchy
|
49
|
+
5. factory_girl_rails
|
50
|
+
6. database_cleaner
|
51
|
+
|
52
|
+
Group Development & Test:
|
53
|
+
1. rspec-rails(Generator would be run automatically. Spec file replaced)
|
54
|
+
2. guard-rspec (Initialized. Guard watches views & runs request specs)
|
55
|
+
3. rb-inotify
|
56
|
+
4. libnotify (for Linux)
|
57
|
+
5. rb-fsevent (for Mac)
|
58
|
+
6. growl (for Mac)
|
59
|
+
7. annotate
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
## Contributing
|
64
|
+
|
65
|
+
1. Fork it
|
66
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
67
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
68
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
69
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/bootup.gemspec
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/bootup/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Rahul Jayaraman"]
|
6
|
+
gem.email = ["recklessrahul@gmail.com"]
|
7
|
+
gem.description = %q{Helps create a new rails app quickly}
|
8
|
+
gem.summary = %q{Installs essential gems like twitter_bootstrap_rails, simple_for, rspec-rails, guard, spork, jquery_datatables_rails etc.}
|
9
|
+
gem.homepage = "https://github.com/recklessrahul/bootup"
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "bootup"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Bootup::VERSION
|
17
|
+
end
|
data/lib/bootup.rb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
Description:
|
2
|
+
This generator helps you setup your new rails application quickly by installing some basic gems you would frequently use.
|
3
|
+
|
4
|
+
Example:
|
5
|
+
rails generate bootup #Would pick up APP_NAME automatically from the root folder
|
6
|
+
or
|
7
|
+
rails generate bootup APP_NAME
|
8
|
+
|
@@ -0,0 +1,59 @@
|
|
1
|
+
class BootupGenerator < Rails::Generators::Base
|
2
|
+
source_root File.expand_path('../templates', __FILE__)
|
3
|
+
argument :app_name, type: :string, default: Rails.application.class.parent
|
4
|
+
|
5
|
+
def generate_bootup
|
6
|
+
log :generate, "Booting #{app_name}"
|
7
|
+
|
8
|
+
log :generate, "Copying Gemfile"
|
9
|
+
copy_file "Gemfile", "Gemfile"
|
10
|
+
|
11
|
+
log :generate, "Running Bundler"
|
12
|
+
inside Rails.root do
|
13
|
+
run "bundle install"
|
14
|
+
end
|
15
|
+
|
16
|
+
log :generate, "Removing public/index.."
|
17
|
+
inside Rails.root do
|
18
|
+
run "rm public/index.html"
|
19
|
+
end
|
20
|
+
|
21
|
+
log :generate, "Initializing database.yml"
|
22
|
+
template 'database.yml.erb', 'config/database.yml'
|
23
|
+
|
24
|
+
log :generate, "Creating database"
|
25
|
+
rake("db:create")
|
26
|
+
|
27
|
+
log :generate, "Installing Twitter Bootstrap"
|
28
|
+
generate "bootstrap:install"
|
29
|
+
|
30
|
+
log :generate, "Copy application.js & initialize datatables to #datatables - Remember to change sorting"
|
31
|
+
copy_file "application.js", "app/assets/javascripts/application.js"
|
32
|
+
|
33
|
+
log :generate, "Copying stylesheets"
|
34
|
+
copy_file "application.css", "app/assets/stylesheets/application.css"
|
35
|
+
|
36
|
+
log :generate, "Installing Simple Form"
|
37
|
+
generate "simple_form:install --bootstrap"
|
38
|
+
|
39
|
+
tests = ask("Would you like to get rid of the default testing framework & install Rspec with Guard?")
|
40
|
+
if tests == 'y' or tests == 'yes'
|
41
|
+
log :generate, "Removing Tests.."
|
42
|
+
inside Rails.root do
|
43
|
+
run "rm -rf test/"
|
44
|
+
end
|
45
|
+
|
46
|
+
log :generate, "Setting up Rspec.."
|
47
|
+
generate "rspec:install"
|
48
|
+
|
49
|
+
log :generate, "Setting up Guard with a custom guardfile.."
|
50
|
+
copy_file "Guardfile", "Guardfile"
|
51
|
+
|
52
|
+
log :generate, "Setting up spork"
|
53
|
+
copy_file "spec_helper.rb", "spec/spec_helper.rb"
|
54
|
+
else
|
55
|
+
log :generate, "Skipping removal of tests"
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rails', '3.2.3'
|
4
|
+
gem 'pg'
|
5
|
+
gem 'jquery-rails'
|
6
|
+
gem 'simple_form'
|
7
|
+
gem 'thin'
|
8
|
+
gem 'twitter-bootstrap-rails'
|
9
|
+
gem 'bootstrap-datepicker-rails'
|
10
|
+
gem 'sorcery'
|
11
|
+
gem 'jquery-datatables-rails'
|
12
|
+
|
13
|
+
group :assets do
|
14
|
+
gem 'sass-rails', '~> 3.2.3'
|
15
|
+
gem 'coffee-rails', '~> 3.2.1'
|
16
|
+
gem 'uglifier', '>= 1.0.3'
|
17
|
+
end
|
18
|
+
|
19
|
+
group :test do
|
20
|
+
gem 'spork'
|
21
|
+
gem 'faker'
|
22
|
+
gem 'capybara', '~> 1.1.0'
|
23
|
+
gem 'launchy'
|
24
|
+
gem 'factory_girl_rails'
|
25
|
+
gem 'database_cleaner'
|
26
|
+
end
|
27
|
+
|
28
|
+
group :development, :test do
|
29
|
+
gem 'rspec-rails'
|
30
|
+
gem 'guard-rspec'
|
31
|
+
gem 'rb-inotify', :require => false
|
32
|
+
gem 'libnotify' if RUBY_PLATFORM =~ /linux/i
|
33
|
+
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
|
34
|
+
gem 'growl' if RUBY_PLATFORM =~ /darwin/i
|
35
|
+
gem 'annotate', ">=2.5.0"
|
36
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard 'rspec' do
|
5
|
+
watch(%r{^spec/.+_spec\.rb$})
|
6
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
7
|
+
watch('spec/spec_helper.rb') { "spec" }
|
8
|
+
|
9
|
+
# Rails example
|
10
|
+
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
11
|
+
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
12
|
+
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
13
|
+
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
14
|
+
watch('config/routes.rb') { "spec/routing" }
|
15
|
+
|
16
|
+
# Capybara features specs
|
17
|
+
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
|
18
|
+
|
19
|
+
# Turnip features and steps
|
20
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
21
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require_self
|
12
|
+
*= require dataTables/jquery.dataTables.bootstrap
|
13
|
+
*= require_tree .
|
14
|
+
*/
|
15
|
+
|
16
|
+
.center {
|
17
|
+
text-align: center;
|
18
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require twitter/bootstrap
|
16
|
+
//= require bootstrap-datepicker
|
17
|
+
//= require dataTables/jquery.dataTables
|
18
|
+
//= require dataTables/jquery.dataTables.bootstrap
|
19
|
+
//= require_tree .
|
20
|
+
|
21
|
+
$(document).ready(function(){
|
22
|
+
$('#datatables').dataTable({
|
23
|
+
"sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
|
24
|
+
"sPaginationType": "bootstrap",
|
25
|
+
"aaSorting": [[ 5, "desc" ]]
|
26
|
+
});
|
27
|
+
});
|
@@ -0,0 +1,24 @@
|
|
1
|
+
development:
|
2
|
+
adapter: postgresql
|
3
|
+
database: <%= app_name %>_development
|
4
|
+
username: rahul
|
5
|
+
encoding: utf8
|
6
|
+
pool: 5
|
7
|
+
timeout: 5000
|
8
|
+
|
9
|
+
test:
|
10
|
+
adapter: postgresql
|
11
|
+
database: <%= app_name %>_test
|
12
|
+
username: rahul
|
13
|
+
encoding: utf8
|
14
|
+
pool: 5
|
15
|
+
timeout: 5000
|
16
|
+
|
17
|
+
production:
|
18
|
+
adapter: postgresql
|
19
|
+
database: <%= app_name %>_production
|
20
|
+
username: rahul
|
21
|
+
encoding: utf8
|
22
|
+
pool: 5
|
23
|
+
timeout: 5000
|
24
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'spork'
|
3
|
+
Spork.prefork do
|
4
|
+
ENV["RAILS_ENV"] ||= 'test'
|
5
|
+
require File.expand_path("../../config/environment", __FILE__)
|
6
|
+
require 'rspec/rails'
|
7
|
+
require 'rspec/autorun'
|
8
|
+
require 'capybara/rspec'
|
9
|
+
|
10
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
14
|
+
config.use_transactional_fixtures = false
|
15
|
+
config.infer_base_class_for_anonymous_controllers = false
|
16
|
+
config.order = "random"
|
17
|
+
config.include FactoryGirl::Syntax::Methods
|
18
|
+
config.include Capybara::DSL
|
19
|
+
ActiveSupport::Dependencies.clear
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
Spork.each_run do
|
25
|
+
FactoryGirl.reload
|
26
|
+
Dir[File.join(File.dirname(__FILE__), '..', 'app', 'helpers', '*.rb')].each do |file|
|
27
|
+
require file
|
28
|
+
end
|
29
|
+
RSpec.configure do |config|
|
30
|
+
config.before(:each) do
|
31
|
+
DatabaseCleaner.start
|
32
|
+
end
|
33
|
+
|
34
|
+
config.after(:each) do
|
35
|
+
DatabaseCleaner.clean
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bootup
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1alpha
|
5
|
+
prerelease: 5
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Rahul Jayaraman
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-11-26 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Helps create a new rails app quickly
|
15
|
+
email:
|
16
|
+
- recklessrahul@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- .gitignore
|
22
|
+
- Gemfile
|
23
|
+
- LICENSE
|
24
|
+
- README.md
|
25
|
+
- Rakefile
|
26
|
+
- bootup.gemspec
|
27
|
+
- lib/bootup.rb
|
28
|
+
- lib/bootup/engine.rb
|
29
|
+
- lib/bootup/version.rb
|
30
|
+
- lib/generators/bootup/USAGE
|
31
|
+
- lib/generators/bootup/bootup_generator.rb
|
32
|
+
- lib/generators/bootup/templates/Gemfile
|
33
|
+
- lib/generators/bootup/templates/Guardfile
|
34
|
+
- lib/generators/bootup/templates/application.css
|
35
|
+
- lib/generators/bootup/templates/application.js
|
36
|
+
- lib/generators/bootup/templates/database.yml.erb
|
37
|
+
- lib/generators/bootup/templates/spec_helper.rb
|
38
|
+
homepage: https://github.com/recklessrahul/bootup
|
39
|
+
licenses: []
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ! '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>'
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.3.1
|
56
|
+
requirements: []
|
57
|
+
rubyforge_project:
|
58
|
+
rubygems_version: 1.8.15
|
59
|
+
signing_key:
|
60
|
+
specification_version: 3
|
61
|
+
summary: Installs essential gems like twitter_bootstrap_rails, simple_for, rspec-rails,
|
62
|
+
guard, spork, jquery_datatables_rails etc.
|
63
|
+
test_files: []
|