pixelforce_cms 0.8 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/generators/pixelforce_cms/install_generator.rb +20 -8
- data/lib/generators/pixelforce_cms/templates/Gemfile +1 -1
- data/lib/generators/pixelforce_cms/templates/application/_chromeframe.html.haml +4 -0
- data/lib/generators/pixelforce_cms/templates/application/_footer.html.haml +2 -0
- data/lib/generators/pixelforce_cms/templates/application/_head.html.haml +23 -0
- data/lib/generators/pixelforce_cms/templates/application/_header.html.haml +2 -0
- data/lib/generators/pixelforce_cms/templates/deploy.rb +2 -0
- data/lib/generators/pixelforce_cms/templates/recipes/base.rb +16 -0
- data/lib/generators/pixelforce_cms/templates/recipes/templates/nginx_config.erb +29 -0
- data/lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb +55 -0
- data/lib/generators/pixelforce_cms/templates/recipes/unicorn.rb +22 -0
- data/lib/pixelforce_cms/version.rb +1 -1
- metadata +18 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 037ffbe77be770dba598fe0ccf8ffc4c24c7b88b
|
4
|
+
data.tar.gz: 468d3c0d6efc80280fa4143d65b46df37394b93f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddc96d447b222577656d62fb2abb141b9628c87a0246f45651569184556b05f58f8830e8fd96fcc34f3c84dcb42aeb8c8b0d8afb0b178baa85502f7a49248ea3
|
7
|
+
data.tar.gz: c6cc2632087cfcc8c4e133810cee03d678868ac2869aaffbc42f7b3e6806e3405892ed598b8c413554435f54bd9e9d3569fa68034c5b2659076d08cb409b3c35
|
data/README.md
CHANGED
@@ -7,25 +7,37 @@ module PixelforceCms
|
|
7
7
|
|
8
8
|
def copy_assets
|
9
9
|
copy_file "javascripts/application.js", "app/assets/javascripts/application.js"
|
10
|
-
copy_file "css/style.css.scss", '
|
11
|
-
copy_file "css/style.responsive.css.scss", '
|
10
|
+
copy_file "css/style.css.scss", 'app/assets/stylesheets/style.css.scss'
|
11
|
+
copy_file "css/style.responsive.css.scss", 'app/assets/stylesheets/style.responsive.css.scss'
|
12
12
|
copy_file "css/application/application.css", "app/assets/stylesheets/application/application.css"
|
13
|
-
copy_file "css/application/chromeframe.css.scss", '
|
14
|
-
copy_file "css/application/document.css.scss", '
|
15
|
-
copy_file "css/application/html5.css.scss", '
|
16
|
-
copy_file "css/application/index.css.scss", '
|
17
|
-
copy_file "css/application/variables.css.scss", "
|
18
|
-
copy_file "css/pages/home.css.scss", "
|
13
|
+
copy_file "css/application/chromeframe.css.scss", 'app/assets/stylesheets/application/chromeframe.css.scss'
|
14
|
+
copy_file "css/application/document.css.scss", 'app/assets/stylesheets/application/document.css.scss'
|
15
|
+
copy_file "css/application/html5.css.scss", 'app/assets/stylesheets/application/html5.css.scss'
|
16
|
+
copy_file "css/application/index.css.scss", 'app/assets/stylesheets/application/index.css.scss'
|
17
|
+
copy_file "css/application/variables.css.scss", "app/assets/stylesheets/application/variables.css.scss"
|
18
|
+
copy_file "css/pages/home.css.scss", "app/assets/stylesheets/pages/home.css.scss"
|
19
19
|
end
|
20
20
|
|
21
21
|
def copy_gemfile
|
22
22
|
copy_file "Gemfile", 'Gemfile'
|
23
23
|
end
|
24
24
|
|
25
|
+
def copy_receipt
|
26
|
+
copy_file "recipes/base.rb", "config/recipes/base.rb"
|
27
|
+
copy_file "recipes/unicorn.rb", "config/recipes/unicorn.rb"
|
28
|
+
copy_file "recipes/templates/nginx_config.erb", "config/recipes/templates/nginx_config.erb"
|
29
|
+
copy_file "recipes/templates/unicorn_init.erb", "config/recipes/templates/unicorn_init.erb"
|
30
|
+
end
|
31
|
+
|
25
32
|
def copy_controller_files
|
26
33
|
copy_file "pages_controller.rb", 'app/controllers/pages_controller.rb'
|
27
34
|
copy_file "application.html.haml", 'app/views/layouts/application.html.haml'
|
35
|
+
copy_file "application/_chromeframe.html.haml", 'app/views/application/_chromeframe.html.haml'
|
36
|
+
copy_file "application/_footer.html.haml", 'app/views/application/_footer.html.haml'
|
37
|
+
copy_file "application/_head.html.haml", 'app/views/application/_head.html.haml'
|
38
|
+
copy_file "application/_header.html.haml", 'app/views/application/_header.html.haml'
|
28
39
|
copy_file 'Capfile', 'Capfile'
|
40
|
+
remove_file 'app/views/layouts/application.html.erb'
|
29
41
|
create_file 'app/views/pages/index.html.haml'
|
30
42
|
@application_name = application_name
|
31
43
|
template 'deploy.rb', 'config/deploy.rb'
|
@@ -55,9 +55,9 @@ group :development, :test do
|
|
55
55
|
# Deploy with Capistrano
|
56
56
|
gem 'capistrano'
|
57
57
|
gem 'rvm-capistrano'
|
58
|
+
gem "capistrano-db-tasks", require: false, github: 'gkopylov/capistrano-db-tasks', ref: 'f3949cd'
|
58
59
|
gem 'factory_girl_rails'
|
59
60
|
gem 'thin'
|
60
|
-
gem 'mocha'
|
61
61
|
end
|
62
62
|
|
63
63
|
gem 'sass'
|
@@ -0,0 +1,4 @@
|
|
1
|
+
/[if lt IE 7 ]
|
2
|
+
%p.chromeframe
|
3
|
+
You are using an <strong>outdated</strong> browser.
|
4
|
+
Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.
|
@@ -0,0 +1,23 @@
|
|
1
|
+
%head
|
2
|
+
%meta{:charset => 'UTF-8'}
|
3
|
+
%meta{:content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}
|
4
|
+
= display_meta_tags site: 'Sitename',
|
5
|
+
keywords: '',
|
6
|
+
description: 'Website description',
|
7
|
+
separator: '|',
|
8
|
+
reverse: true
|
9
|
+
|
10
|
+
%meta{content: "PixelForce Systems", :name => "author"}
|
11
|
+
%meta{:content => "Copyright Sitename #{Date.today.year}. All Rights Reserved.", :name => "Copyright"}
|
12
|
+
|
13
|
+
%meta{:content => "width=640", :name => "viewport"}
|
14
|
+
%link{:href => "/favicon.ico", :rel => "shortcut icon"}
|
15
|
+
|
16
|
+
= render 'stylesheets'
|
17
|
+
= javascript_include_tag 'polyfills'
|
18
|
+
|
19
|
+
= csrf_meta_tag
|
20
|
+
|
21
|
+
/[if lt IE 9]
|
22
|
+
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
23
|
+
|
@@ -13,6 +13,8 @@ set :rails_env, 'production'
|
|
13
13
|
set :migrate_env, 'production'
|
14
14
|
set :use_sudo, false
|
15
15
|
set :deploy_via, :remote_cache
|
16
|
+
set :db_local_clean, true
|
17
|
+
set :locals_rails_env, "development"
|
16
18
|
|
17
19
|
# server "<%= @application_name %>.com.au", :app, :web, :db, :primary => true
|
18
20
|
server "119.9.13.249", :app, :web, :db, :primary => true
|
@@ -0,0 +1,16 @@
|
|
1
|
+
def template(from, to)
|
2
|
+
erb = File.read(File.expand_path("../templates/#{from}", __FILE__))
|
3
|
+
put ERB.new(erb).result(binding), to
|
4
|
+
end
|
5
|
+
|
6
|
+
def set_default(name, *args, &block)
|
7
|
+
set(name, *args, &block) unless exists?(name)
|
8
|
+
end
|
9
|
+
|
10
|
+
namespace :deploy do
|
11
|
+
desc "Install everything onto the server"
|
12
|
+
task :install do
|
13
|
+
run "#{sudo} apt-get -y update"
|
14
|
+
run "#{sudo} apt-get -y install curl git-core python-software-properties build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion"
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
upstream <%= application %> {
|
2
|
+
server unix:/tmp/<%= application %>.sock fail_timeout=0;
|
3
|
+
}
|
4
|
+
|
5
|
+
server {
|
6
|
+
listen 80;
|
7
|
+
server_name <%= server_address %>;
|
8
|
+
root /home/deploy/<%= application %>/current/public;
|
9
|
+
|
10
|
+
try_files $uri/index.html $uri @<%= application %>;
|
11
|
+
|
12
|
+
location ~* ^(/assets|/favicon.ico) {
|
13
|
+
access_log off;
|
14
|
+
expires max;
|
15
|
+
}
|
16
|
+
|
17
|
+
location @<%= application %> {
|
18
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
19
|
+
proxy_set_header Host $http_host;
|
20
|
+
proxy_redirect off;
|
21
|
+
proxy_buffering on;
|
22
|
+
proxy_set_header X-Real-IP $remote_addr;
|
23
|
+
proxy_pass http://<%= application %>;
|
24
|
+
}
|
25
|
+
|
26
|
+
error_page 500 502 503 504 /500.html;
|
27
|
+
client_max_body_size 1G;
|
28
|
+
keepalive_timeout 10;
|
29
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
### BEGIN INIT INFO
|
4
|
+
# Provides: unicorn
|
5
|
+
# Required-Start: $local_fs $remote_fs $network $syslog
|
6
|
+
# Required-Stop: $local_fs $remote_fs $network $syslog
|
7
|
+
# Default-Start: 2 3 4 5
|
8
|
+
# Default-Stop: 0 1 6
|
9
|
+
# Short-Description: starts the unicorn web server
|
10
|
+
# Description: starts unicorn
|
11
|
+
### END INIT INFO
|
12
|
+
|
13
|
+
USER="deploy"
|
14
|
+
DAEMON=unicorn
|
15
|
+
PROJECT_PATH="<%= deploy_to %>"
|
16
|
+
DAEMON_OPTS="-c $PROJECT_PATH/current/config/unicorn.rb -E production -D"
|
17
|
+
NAME=unicorn
|
18
|
+
DESC="Unicorn app for $USER"
|
19
|
+
PID="$PROJECT_PATH/shared/pids/unicorn.pid"
|
20
|
+
|
21
|
+
case "$1" in
|
22
|
+
start)
|
23
|
+
CD_TO_APP_DIR="cd $PROJECT_PATH/current"
|
24
|
+
START_DAEMON_PROCESS="bundle exec $DAEMON $DAEMON_OPTS"
|
25
|
+
|
26
|
+
echo -n "Starting $DESC: "
|
27
|
+
if [ `whoami` = 'root' ]; then
|
28
|
+
su - $USER -c "$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS"
|
29
|
+
else
|
30
|
+
$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS
|
31
|
+
fi
|
32
|
+
echo "$NAME."
|
33
|
+
;;
|
34
|
+
stop)
|
35
|
+
echo -n "Stopping $DESC: "
|
36
|
+
kill -QUIT `cat $PID`
|
37
|
+
echo "$NAME."
|
38
|
+
;;
|
39
|
+
restart)
|
40
|
+
echo -n "Restarting $DESC: "
|
41
|
+
kill -USR2 `cat $PID`
|
42
|
+
echo "$NAME."
|
43
|
+
;;
|
44
|
+
reload)
|
45
|
+
echo -n "Reloading $DESC configuration: "
|
46
|
+
kill -HUP `cat $PID`
|
47
|
+
echo "$NAME."
|
48
|
+
;;
|
49
|
+
*)
|
50
|
+
echo "Usage: $NAME {start|stop|restart|reload}" >&2
|
51
|
+
exit 1
|
52
|
+
;;
|
53
|
+
esac
|
54
|
+
|
55
|
+
exit 0
|
@@ -0,0 +1,22 @@
|
|
1
|
+
namespace :unicorn do
|
2
|
+
desc "Install unicorn"
|
3
|
+
|
4
|
+
desc "Setup unicorn configuration for this application"
|
5
|
+
task :setup, roles: :web do
|
6
|
+
template "unicorn_init.erb", "/tmp/unicorn"
|
7
|
+
run "#{sudo} mv /tmp/unicorn /etc/init.d/#{application}"
|
8
|
+
run "#{sudo} chmod +x /etc/init.d/#{application}"
|
9
|
+
run "#{sudo} update-rc.d #{application} defaults"
|
10
|
+
template "nginx_config.erb", "/tmp/nginx_config"
|
11
|
+
run "#{sudo} mv /tmp/nginx_config /etc/nginx/sites-enabled/#{application}"
|
12
|
+
run "#{sudo} rm -f /etc/nginx/sites-enabled/default"
|
13
|
+
end
|
14
|
+
# after "deploy:setup", "nginx:setup"
|
15
|
+
|
16
|
+
%w[start stop restart].each do |command|
|
17
|
+
desc "#{command} unicorn"
|
18
|
+
task command, roles: :web do
|
19
|
+
run "#{sudo} service #{application} #{command}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pixelforce_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Zhang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: ''
|
@@ -45,7 +45,7 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- .gitignore
|
48
|
+
- ".gitignore"
|
49
49
|
- Gemfile
|
50
50
|
- LICENSE.txt
|
51
51
|
- README.md
|
@@ -57,6 +57,10 @@ files:
|
|
57
57
|
- lib/generators/pixelforce_cms/templates/_form.erb
|
58
58
|
- lib/generators/pixelforce_cms/templates/admin_controller.rb
|
59
59
|
- lib/generators/pixelforce_cms/templates/application.html.haml
|
60
|
+
- lib/generators/pixelforce_cms/templates/application/_chromeframe.html.haml
|
61
|
+
- lib/generators/pixelforce_cms/templates/application/_footer.html.haml
|
62
|
+
- lib/generators/pixelforce_cms/templates/application/_head.html.haml
|
63
|
+
- lib/generators/pixelforce_cms/templates/application/_header.html.haml
|
60
64
|
- lib/generators/pixelforce_cms/templates/base_controller.rb
|
61
65
|
- lib/generators/pixelforce_cms/templates/css/application/application.css
|
62
66
|
- lib/generators/pixelforce_cms/templates/css/application/chromeframe.css.scss
|
@@ -73,6 +77,10 @@ files:
|
|
73
77
|
- lib/generators/pixelforce_cms/templates/javascripts/application.js
|
74
78
|
- lib/generators/pixelforce_cms/templates/new.html.haml
|
75
79
|
- lib/generators/pixelforce_cms/templates/pages_controller.rb
|
80
|
+
- lib/generators/pixelforce_cms/templates/recipes/base.rb
|
81
|
+
- lib/generators/pixelforce_cms/templates/recipes/templates/nginx_config.erb
|
82
|
+
- lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
|
83
|
+
- lib/generators/pixelforce_cms/templates/recipes/unicorn.rb
|
76
84
|
- lib/pixelforce_cms.rb
|
77
85
|
- lib/pixelforce_cms/version.rb
|
78
86
|
- pixelforce_cms.gemspec
|
@@ -86,17 +94,17 @@ require_paths:
|
|
86
94
|
- lib
|
87
95
|
required_ruby_version: !ruby/object:Gem::Requirement
|
88
96
|
requirements:
|
89
|
-
- -
|
97
|
+
- - ">="
|
90
98
|
- !ruby/object:Gem::Version
|
91
99
|
version: '0'
|
92
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
101
|
requirements:
|
94
|
-
- -
|
102
|
+
- - ">="
|
95
103
|
- !ruby/object:Gem::Version
|
96
104
|
version: '0'
|
97
105
|
requirements: []
|
98
106
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
107
|
+
rubygems_version: 2.1.10
|
100
108
|
signing_key:
|
101
109
|
specification_version: 4
|
102
110
|
summary: ''
|