bootstrappers 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +17 -0
- data/README.md +19 -2
- data/TODO.md +8 -3
- data/lib/bootstrappers/app_builder.rb +22 -0
- data/lib/bootstrappers/generators/app_generator.rb +6 -0
- data/lib/bootstrappers/version.rb +1 -1
- data/templates/Gemfile_additions +16 -8
- data/templates/capistrano/Capfile +5 -0
- data/templates/capistrano/deploy/assets.rb +30 -0
- data/templates/capistrano/deploy_rb.erb +66 -0
- data/templates/common/_user_nav.html.erb +7 -2
- data/templates/stylesheets/common.css.scss +27 -1
- metadata +7 -4
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,28 @@
|
|
1
|
+
alpha
|
2
|
+
|
3
|
+
0.1.0 (Nov 12, 2012)
|
4
|
+
* add powder to Gemfile
|
5
|
+
* add capistrano-ext to Gemfile
|
6
|
+
* customized_error_pages
|
7
|
+
* add carrierwave, carrierwave-meta
|
8
|
+
* add open_graph_helper
|
9
|
+
* add capistrano deploy file
|
10
|
+
* add pry, pry-remote
|
11
|
+
* add Facebook like in menu bar
|
12
|
+
* add .social css & .group self clearfix
|
13
|
+
|
1
14
|
0.0.9 (Nov 12, 2012)
|
2
15
|
* fix application.css double loading css
|
3
16
|
* bootstrap-helper bump to 2.1.2
|
17
|
+
|
4
18
|
0.0.8 (Oct 12, 2012)
|
5
19
|
* fix db config replace problem
|
20
|
+
|
6
21
|
0.0.7 (Oct 10, 2012)
|
7
22
|
* fix typo, add more guides
|
23
|
+
|
8
24
|
0.0.6 (Oct 10, 2012)
|
9
25
|
* will ask your database config password first
|
26
|
+
|
10
27
|
0.0.5 (Oct 8, 2012)
|
11
28
|
* announce project
|
data/README.md
CHANGED
@@ -20,20 +20,37 @@ To see the latest and greatest gems, look at Suspenders' template/Gemfile_additi
|
|
20
20
|
|
21
21
|
It includes application gems like:
|
22
22
|
|
23
|
+
### View / SCSS
|
23
24
|
* [Bootstrap SCSS](https://github.com/anjlab/bootstrap-rails)
|
24
25
|
* [Bootstrap Helper](https://github.com/xdite/bootstrap-helper)
|
25
26
|
* [SimpleForm](https://github.com/plataformatec/simple_form)
|
26
27
|
* [WillPaginate](https://github.com/mislav/will_paginate/)
|
27
28
|
* [Compass](http://compass-style.org/)
|
29
|
+
|
30
|
+
### Photo Uplaod
|
31
|
+
|
32
|
+
* [CarrierWave](https://github.com/jnicklas/carrierwave)
|
33
|
+
|
34
|
+
### Social / SEO
|
35
|
+
|
28
36
|
* [SeoHelper](https://github.com/techbang/seo_helper)
|
37
|
+
* [OpenGraphHelper](https://github.com/techbang/open_graph_helper)
|
38
|
+
|
39
|
+
### Deploy
|
40
|
+
|
29
41
|
* [Capistrano](https://github.com/capistrano/capistrano)
|
30
42
|
* [Cape](https://github.com/njonsson/cape)
|
31
|
-
* [Magic encoding](https://github.com/m-ryan/magic_encoding)
|
32
|
-
* [Settingslogic](https://github.com/binarylogic/settingslogic)
|
33
43
|
* [Airbrake](https://github.com/airbrake/airbrake)
|
34
44
|
* [NewRelic RPM](https://github.com/newrelic/rpm)
|
35
45
|
* [Turbo Sprockets for Rails 3.2.x](https://github.com/ndbroadbent/turbo-sprockets-rails3) Speeds up your Rails 3 rake assets:precompile by only recompiling changed assets
|
36
46
|
|
47
|
+
### CommandLine
|
48
|
+
* [Magic encoding](https://github.com/m-ryan/magic_encoding)
|
49
|
+
* [Annotate](https://github.com/ctran/annotate_models)
|
50
|
+
* [Settingslogic](https://github.com/binarylogic/settingslogic)
|
51
|
+
* [Pry](http://pryrepl.org/)
|
52
|
+
|
53
|
+
|
37
54
|
|
38
55
|
## Remind
|
39
56
|
|
data/TODO.md
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
## TODO
|
2
2
|
|
3
|
-
* Capistrano Task
|
4
|
-
- rvm
|
5
3
|
* Search
|
6
4
|
- ransack
|
7
5
|
* OmniAuth
|
8
6
|
- Facebook
|
9
7
|
* Devise
|
10
8
|
- Login Form refactor
|
9
|
+
- replace sender to Setting.email_sender
|
11
10
|
* Cancan
|
12
11
|
* Testing Tool
|
13
12
|
* Command Line Tool
|
@@ -19,4 +18,10 @@
|
|
19
18
|
- menu
|
20
19
|
- ajax
|
21
20
|
* <https://speakerdeck.com/ken_c_lo/zurui-design>
|
22
|
-
* lib/tasks/dev.rake
|
21
|
+
* lib/tasks/dev.rake
|
22
|
+
* carrierwave
|
23
|
+
- uploader template
|
24
|
+
* add .social to navbar
|
25
|
+
* Capistrano
|
26
|
+
- multistage
|
27
|
+
* Amazon SES
|
@@ -82,6 +82,13 @@ module Bootstrappers
|
|
82
82
|
|
83
83
|
end
|
84
84
|
|
85
|
+
def create_capistrano_files
|
86
|
+
template 'capistrano/deploy_rb.erb', 'config/deploy.rb',:force => true
|
87
|
+
template 'capistrano/Capfile', 'Capfile',:force => true
|
88
|
+
empty_directory 'config/deploy'
|
89
|
+
directory 'capistrano/deploy', 'config/deploy'
|
90
|
+
end
|
91
|
+
|
85
92
|
def create_database
|
86
93
|
bundle_command 'exec rake db:create'
|
87
94
|
end
|
@@ -91,6 +98,21 @@ module Bootstrappers
|
|
91
98
|
generate 'devise User'
|
92
99
|
end
|
93
100
|
|
101
|
+
def customize_error_pages
|
102
|
+
meta_tags =<<-EOS
|
103
|
+
<meta charset='utf-8' />
|
104
|
+
<meta name='ROBOTS' content='NOODP' />
|
105
|
+
EOS
|
106
|
+
style_tags =<<-EOS
|
107
|
+
<link href='/assets/application.css' media='all' rel='stylesheet' type='text/css' />
|
108
|
+
EOS
|
109
|
+
%w(500 404 422).each do |page|
|
110
|
+
inject_into_file "public/#{page}.html", meta_tags, :after => "<head>\n"
|
111
|
+
replace_in_file "public/#{page}.html", /<style.+>.+<\/style>/mi, style_tags.strip
|
112
|
+
replace_in_file "public/#{page}.html", /<!--.+-->\n/, ''
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
94
116
|
def build_settings_from_config
|
95
117
|
|
96
118
|
template 'setting.rb', 'app/models/setting.rb',:force => true
|
@@ -22,6 +22,7 @@ module Bootstrappers
|
|
22
22
|
invoke :create_common_stylesheets
|
23
23
|
invoke :add_common_js_library
|
24
24
|
invoke :customize_gemfile
|
25
|
+
invoke :setup_capistrano
|
25
26
|
invoke :setup_database
|
26
27
|
invoke :configure_app
|
27
28
|
invoke :create_initializers
|
@@ -73,6 +74,11 @@ module Bootstrappers
|
|
73
74
|
bundle_command 'install'
|
74
75
|
end
|
75
76
|
|
77
|
+
def setup_capistrano
|
78
|
+
build :create_capistrano_files
|
79
|
+
say 'Setting up capinstrano'
|
80
|
+
end
|
81
|
+
|
76
82
|
def setup_database
|
77
83
|
say 'Setting up database'
|
78
84
|
|
data/templates/Gemfile_additions
CHANGED
@@ -1,18 +1,22 @@
|
|
1
1
|
|
2
|
-
gem
|
2
|
+
gem "seo_helper", "~> 1.0"
|
3
|
+
gem "open_graph_helper"
|
3
4
|
|
4
|
-
gem "
|
5
|
+
gem "rmagick"
|
6
|
+
gem "carrierwave"
|
7
|
+
gem "carrierwave-meta"
|
5
8
|
|
6
|
-
gem
|
7
|
-
gem "bootstrap_helper", '>= 2.1.2'
|
9
|
+
gem "settingslogic"
|
8
10
|
|
11
|
+
gem "anjlab-bootstrap-rails", ">= 2.1", :require => "bootstrap-rails"
|
12
|
+
gem "bootstrap_helper", ">= 2.1.2"
|
9
13
|
gem "simple_form", "2.0.3"
|
10
14
|
gem "will_paginate", "3.0.3"
|
11
15
|
|
12
|
-
gem
|
13
|
-
gem 'airbrake'
|
16
|
+
gem "high_voltage"
|
14
17
|
|
15
|
-
gem
|
18
|
+
gem "airbrake"
|
19
|
+
gem "turbo-sprockets-rails3"
|
16
20
|
|
17
21
|
group :assets do
|
18
22
|
gem "compass-rails"
|
@@ -20,11 +24,15 @@ end
|
|
20
24
|
|
21
25
|
group :development do
|
22
26
|
gem "capistrano"
|
27
|
+
gem "capistrano-ext"
|
23
28
|
gem "cape"
|
24
29
|
gem "magic_encoding"
|
25
30
|
gem "annotate"
|
31
|
+
gem "powder"
|
32
|
+
gem "pry-nav"
|
33
|
+
gem "pry-remote"
|
26
34
|
end
|
27
35
|
|
28
36
|
group :production do
|
29
|
-
gem
|
37
|
+
gem "newrelic_rpm"
|
30
38
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
# from https://github.com/AF83/capistrano-af83/blob/master/lib/capistrano/af83/deploy/assets.rb
|
4
|
+
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb)
|
5
|
+
|
6
|
+
namespace :deploy do
|
7
|
+
namespace :assets do
|
8
|
+
|
9
|
+
desc <<-DESC
|
10
|
+
Run the asset precompilation rake task. You can specify the full path \
|
11
|
+
to the rake executable by setting the rake variable. You can also \
|
12
|
+
specify additional environment variables to pass to rake via the \
|
13
|
+
asset_env variable. The defaults are:
|
14
|
+
|
15
|
+
set :rake, "rake"
|
16
|
+
set :rails_env, "production"
|
17
|
+
set :asset_env, "RAILS_GROUPS=assets"
|
18
|
+
set :assets_dependencies, fetch(:assets_dependencies) + %w(config/locales/js)
|
19
|
+
DESC
|
20
|
+
task :precompile, :roles => :web, :except => { :no_release => true } do
|
21
|
+
from = source.next_revision(current_revision)
|
22
|
+
if capture("cd #{latest_release} && #{source.local.log(from)} #{assets_dependencies.join ' '} | wc -l").to_i > 0
|
23
|
+
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
|
24
|
+
else
|
25
|
+
logger.info "Skipping asset pre-compilation because there were no asset changes"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
default_environment["PATH"] = "/opt/ruby/bin:/usr/local/bin:/usr/bin:/bin"
|
3
|
+
|
4
|
+
set :application, "<%= app_name %>"
|
5
|
+
set :repository, "git@github.com:example/#{application}.git"
|
6
|
+
set :deploy_to, "/home/apps/#{application}"
|
7
|
+
|
8
|
+
set :branch, "master"
|
9
|
+
set :scm, :git
|
10
|
+
|
11
|
+
set :user, "apps"
|
12
|
+
set :group, "apps"
|
13
|
+
|
14
|
+
set :deploy_to, "/home/apps/#{application}"
|
15
|
+
set :runner, "apps"
|
16
|
+
set :deploy_via, :remote_cache
|
17
|
+
set :git_shallow_clone, 1
|
18
|
+
|
19
|
+
role :web, "<%= app_name %>.com" # Your HTTP server, Apache/etc
|
20
|
+
role :app, "<%= app_name %>.com" # This may be the same as your `Web` server
|
21
|
+
role :db, "<%= app_name %>.com" , :primary => true # This is where Rails migrations will run
|
22
|
+
|
23
|
+
set :deploy_env, "production"
|
24
|
+
set :rails_env, "production"
|
25
|
+
set :scm_verbose, true
|
26
|
+
set :use_sudo, false
|
27
|
+
|
28
|
+
|
29
|
+
namespace :deploy do
|
30
|
+
|
31
|
+
desc "Restart passenger process"
|
32
|
+
task :restart, :roles => [:web], :except => { :no_release => true } do
|
33
|
+
run "touch #{current_path}/tmp/restart.txt"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
namespace :my_tasks do
|
39
|
+
task :symlink, :roles => [:web] do
|
40
|
+
run "mkdir -p #{deploy_to}/shared/log"
|
41
|
+
run "mkdir -p #{deploy_to}/shared/pids"
|
42
|
+
|
43
|
+
symlink_hash = {
|
44
|
+
"#{shared_path}/config/database.yml" => "#{release_path}/config/database.yml",
|
45
|
+
"#{shared_path}/config/s3.yml" => "#{release_path}/config/s3.yml",
|
46
|
+
"#{shared_path}/uploads" => "#{release_path}/public/uploads",
|
47
|
+
}
|
48
|
+
|
49
|
+
symlink_hash.each do |source, target|
|
50
|
+
run "ln -sf #{source} #{target}"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
namespace :remote_rake do
|
59
|
+
desc "Run a task on remote servers, ex: cap staging rake:invoke task=cache:clear"
|
60
|
+
task :invoke do
|
61
|
+
run "cd #{deploy_to}/current; RAILS_ENV=#{rails_env} bundle exec rake #{ENV['task']}"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
after "deploy:finalize_update", "my_tasks:symlink"
|
66
|
+
|
@@ -1,6 +1,11 @@
|
|
1
1
|
<ul class="nav pills pull-right">
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
<li>
|
4
|
+
<div class="social"> <%= fb_like(Setting.domain) %> </div>
|
5
|
+
</li>
|
6
|
+
|
7
|
+
<% if current_user %>
|
8
|
+
|
4
9
|
<li class="dropdown">
|
5
10
|
<%= link_to "/accoount" , :class => "dropdown-toggle", :data => { :toogle => "dropdown" } do %>
|
6
11
|
<%= current_user.email %>
|
@@ -1,3 +1,29 @@
|
|
1
1
|
@import "bootstrap-setting";
|
2
2
|
@import "twitter/bootstrap";
|
3
|
-
@import "bootstrap-override";
|
3
|
+
@import "bootstrap-override";
|
4
|
+
|
5
|
+
.social{
|
6
|
+
float:left;
|
7
|
+
width: 90px;
|
8
|
+
padding: 5px;
|
9
|
+
padding-top: 10px;
|
10
|
+
border-right: none;
|
11
|
+
}
|
12
|
+
.social > div {
|
13
|
+
height: 20px;
|
14
|
+
}
|
15
|
+
.social > div > * {
|
16
|
+
display: block;
|
17
|
+
float: left;
|
18
|
+
}
|
19
|
+
|
20
|
+
.group:before, .group:after {
|
21
|
+
content: "";
|
22
|
+
display: table;
|
23
|
+
}
|
24
|
+
.group:after {
|
25
|
+
clear: both;
|
26
|
+
}
|
27
|
+
.group {
|
28
|
+
zoom: 1; /* IE6&7 */
|
29
|
+
}
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
|
9
|
-
version: 0.0.9
|
9
|
+
version: 0.1.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- xdite
|
@@ -74,6 +74,9 @@ files:
|
|
74
74
|
- templates/README.md.erb
|
75
75
|
- templates/bootstrappers_gitignore
|
76
76
|
- templates/bootstrappers_layout.html.erb.erb
|
77
|
+
- templates/capistrano/Capfile
|
78
|
+
- templates/capistrano/deploy/assets.rb
|
79
|
+
- templates/capistrano/deploy_rb.erb
|
77
80
|
- templates/common/_bootstrap_modal.html.erb
|
78
81
|
- templates/common/_facebook_js.erb
|
79
82
|
- templates/common/_footer.html.erb
|
@@ -106,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
109
|
requirements:
|
107
110
|
- - ">="
|
108
111
|
- !ruby/object:Gem::Version
|
109
|
-
hash:
|
112
|
+
hash: 2118108688503437794
|
110
113
|
segments:
|
111
114
|
- 0
|
112
115
|
version: "0"
|
@@ -115,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
118
|
requirements:
|
116
119
|
- - ">="
|
117
120
|
- !ruby/object:Gem::Version
|
118
|
-
hash:
|
121
|
+
hash: 2118108688503437794
|
119
122
|
segments:
|
120
123
|
- 0
|
121
124
|
version: "0"
|