pah 0.0.10 → 0.0.11
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.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +35 -2
- data/README.md +2 -9
- data/lib/pah/files/Gemfile +39 -46
- data/lib/pah/files/README.md +47 -0
- data/lib/pah/files/app/assets/javascripts/application.js +33 -0
- data/lib/pah/files/app/assets/stylesheets/_variables.scss +42 -0
- data/lib/pah/files/app/assets/stylesheets/application.scss +6 -0
- data/lib/pah/files/app/assets/stylesheets/form.scss +259 -0
- data/lib/pah/files/app/assets/stylesheets/general.scss +22 -0
- data/lib/pah/files/app/assets/stylesheets/reset.scss +64 -0
- data/lib/pah/files/app/assets/stylesheets/responsive.scss +108 -0
- data/lib/pah/files/app/views/application/_error_messages.html.haml +3 -3
- data/lib/pah/files/app/views/layouts/application.html.haml +3 -3
- data/lib/pah/files/config/initializers/jumpup_heroku.rb +3 -0
- data/lib/pah/files/lib/tasks/jumpup.rake +13 -0
- data/lib/pah/files/spec/support/vcr.rb +3 -2
- data/lib/pah/partials/_assets.rb +13 -0
- data/lib/pah/partials/_cleanup.rb +2 -3
- data/lib/pah/partials/_config.rb +36 -0
- data/lib/pah/partials/_git.rb +3 -1
- data/lib/pah/partials/_heroku.rb +15 -37
- data/lib/pah/partials/_jumpup.rb +12 -0
- data/lib/pah/partials/_layout.rb +9 -0
- data/lib/pah/partials/_locale.rb +5 -0
- data/lib/pah/partials/_readme.rb +9 -0
- data/lib/pah/partials/_rspec.rb +1 -1
- data/lib/pah/partials/_ruby_env.rb +5 -1
- data/lib/pah/partials/_unicorn.rb +3 -0
- data/lib/pah/template.rb +8 -6
- data/lib/pah/version.rb +1 -1
- data/pah.gemspec +2 -2
- metadata +30 -21
- data/lib/pah/files/app/assets/stylesheets/application.css.scss +0 -6
- data/lib/pah/files/app/assets/stylesheets/reset.css +0 -40
- data/lib/pah/files/lib/tasks/integration.rake +0 -109
- data/lib/pah/partials/_default.rb +0 -15
- data/lib/pah/partials/_integration.rb +0 -9
- data/lib/pah/partials/_stylesheets.rb +0 -9
@@ -0,0 +1,22 @@
|
|
1
|
+
@charset "utf-8";
|
2
|
+
@import "variables";
|
3
|
+
|
4
|
+
|
5
|
+
/* General Styles */
|
6
|
+
|
7
|
+
body {
|
8
|
+
font-family: $sans_serif;
|
9
|
+
}
|
10
|
+
|
11
|
+
.holder {
|
12
|
+
width: 960px;
|
13
|
+
margin: auto;
|
14
|
+
}
|
15
|
+
|
16
|
+
/*
|
17
|
+
.holder {
|
18
|
+
padding: 0 12% 0 12%;
|
19
|
+
margin: auto;
|
20
|
+
}
|
21
|
+
*/
|
22
|
+
|
@@ -0,0 +1,64 @@
|
|
1
|
+
@charset "utf-8";
|
2
|
+
|
3
|
+
|
4
|
+
/* Reset */
|
5
|
+
|
6
|
+
body,
|
7
|
+
h1, h2, h3, h4,
|
8
|
+
form, input, textarea, label, a, img {
|
9
|
+
vertical-align: baseline;
|
10
|
+
font-style: normal;
|
11
|
+
list-style-type: none;
|
12
|
+
padding: 0;
|
13
|
+
margin: 0;
|
14
|
+
border: 0;
|
15
|
+
}
|
16
|
+
|
17
|
+
article, aside, details,
|
18
|
+
figcaption, figure,
|
19
|
+
footer, header, hgroup,
|
20
|
+
menu, nav, section { display: block; }
|
21
|
+
|
22
|
+
p { margin: 0 0 20px 0; }
|
23
|
+
|
24
|
+
hr {
|
25
|
+
height: 1px;
|
26
|
+
border: 10px solid #eee;
|
27
|
+
margin: 10px 0 10px 0;
|
28
|
+
}
|
29
|
+
|
30
|
+
em,
|
31
|
+
dfn { font-style: italic; }
|
32
|
+
|
33
|
+
b,
|
34
|
+
strong { font-weight: bold; }
|
35
|
+
|
36
|
+
table {
|
37
|
+
border-collapse: collapse;
|
38
|
+
border-spacing: 0;
|
39
|
+
}
|
40
|
+
|
41
|
+
fieldset {
|
42
|
+
border: 1px solid #eee;
|
43
|
+
margin: 0;
|
44
|
+
padding: 5px;
|
45
|
+
}
|
46
|
+
|
47
|
+
button,
|
48
|
+
html input[type="button"],
|
49
|
+
input[type="submit"] { cursor: pointer; }
|
50
|
+
|
51
|
+
button,
|
52
|
+
input {
|
53
|
+
line-height: normal;
|
54
|
+
font-weight: normal;
|
55
|
+
}
|
56
|
+
|
57
|
+
abbr[title],
|
58
|
+
dfn[title]{
|
59
|
+
cursor: help;
|
60
|
+
border-bottom: 1px dotted;
|
61
|
+
}
|
62
|
+
|
63
|
+
pre,
|
64
|
+
code { font-family: monospace; }
|
@@ -0,0 +1,108 @@
|
|
1
|
+
@charset "utf-8";
|
2
|
+
@import "variables";
|
3
|
+
|
4
|
+
|
5
|
+
/* Viewport Config */
|
6
|
+
|
7
|
+
html,
|
8
|
+
body {
|
9
|
+
width: 100%;
|
10
|
+
overflow-x: hidden;
|
11
|
+
}
|
12
|
+
|
13
|
+
@viewport {
|
14
|
+
zoom: 1.0;
|
15
|
+
width: extend-to-zoom;
|
16
|
+
}
|
17
|
+
|
18
|
+
@-ms-viewport {
|
19
|
+
width: extend-to-zoom;
|
20
|
+
zoom: 1.0;
|
21
|
+
}
|
22
|
+
|
23
|
+
|
24
|
+
/*
|
25
|
+
Max Width, 960px
|
26
|
+
Media Queries for Tablets and Kindle.
|
27
|
+
*/
|
28
|
+
|
29
|
+
@media (max-width:960px) {
|
30
|
+
|
31
|
+
.holder {
|
32
|
+
width: 700px;
|
33
|
+
}
|
34
|
+
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
/*
|
39
|
+
Max Width, 686px
|
40
|
+
Media Queries for Smartphones.
|
41
|
+
*/
|
42
|
+
|
43
|
+
@media only screen and (max-width: 686px) {
|
44
|
+
|
45
|
+
.holder {
|
46
|
+
width: 90%;
|
47
|
+
padding: 0 5% 0 5%;
|
48
|
+
}
|
49
|
+
|
50
|
+
.simple_form {
|
51
|
+
label {
|
52
|
+
width: auto;
|
53
|
+
display: block;
|
54
|
+
text-align: left;
|
55
|
+
float: none;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
/* Fixed and Responsive Form */
|
61
|
+
|
62
|
+
.form-fixed {
|
63
|
+
|
64
|
+
.checkbox {
|
65
|
+
margin-left: 0;
|
66
|
+
margin-bottom: 0;
|
67
|
+
}
|
68
|
+
|
69
|
+
.radio_buttons {
|
70
|
+
margin-bottom: 0;
|
71
|
+
clear: both;
|
72
|
+
.control-label { margin-right: 0; }
|
73
|
+
}
|
74
|
+
|
75
|
+
.form-inputs {
|
76
|
+
|
77
|
+
input[type="text"],
|
78
|
+
input[type="password"],
|
79
|
+
input[type="email"],
|
80
|
+
input[type="tel"],
|
81
|
+
input[type="number"],
|
82
|
+
textarea {
|
83
|
+
width: 95%;
|
84
|
+
padding-left: 2%;
|
85
|
+
padding-right: 2%;
|
86
|
+
}
|
87
|
+
|
88
|
+
textarea {
|
89
|
+
min-width: 95%;
|
90
|
+
max-width: 95%;
|
91
|
+
}
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
.form-actions {
|
96
|
+
margin-top: 20px;
|
97
|
+
margin-left: 0;
|
98
|
+
}
|
99
|
+
|
100
|
+
.hint {
|
101
|
+
width: 95%;
|
102
|
+
padding: 10px 2% 10px 2%;
|
103
|
+
left: 0;
|
104
|
+
}
|
105
|
+
|
106
|
+
}
|
107
|
+
|
108
|
+
}
|
@@ -47,15 +47,15 @@
|
|
47
47
|
#logo<
|
48
48
|
= link_to "Logo", "/"
|
49
49
|
= render 'flash_messages'
|
50
|
-
|
51
|
-
|
50
|
+
|
51
|
+
.holder
|
52
52
|
%section{:role => "main"}
|
53
53
|
= yield
|
54
54
|
|
55
55
|
- if content_for?(:sidebar)
|
56
56
|
%aside
|
57
57
|
= yield(:sidebar)
|
58
|
-
|
58
|
+
|
59
59
|
%footer
|
60
60
|
%p
|
61
61
|
= "Copyright © #{Time.zone.now.year} App".html_safe
|
@@ -0,0 +1,13 @@
|
|
1
|
+
puts "Adding asset files ...".magenta
|
2
|
+
|
3
|
+
copy_static_file 'app/assets/javascripts/application.js'
|
4
|
+
copy_static_file 'app/assets/stylesheets/_variables.scss'
|
5
|
+
copy_static_file 'app/assets/stylesheets/application.scss'
|
6
|
+
copy_static_file 'app/assets/stylesheets/reset.scss'
|
7
|
+
copy_static_file 'app/assets/stylesheets/general.scss'
|
8
|
+
copy_static_file 'app/assets/stylesheets/form.scss'
|
9
|
+
copy_static_file 'app/assets/stylesheets/responsive.scss'
|
10
|
+
|
11
|
+
git :add => '--all'
|
12
|
+
git :commit => "-aqm 'Add asset files.'"
|
13
|
+
puts "\n"
|
@@ -4,10 +4,9 @@ remove_file "README.rdoc"
|
|
4
4
|
remove_file "app/views/layouts/application.html.erb"
|
5
5
|
|
6
6
|
inside "public" do
|
7
|
-
|
8
|
-
remove_file "robots.txt"
|
7
|
+
remove_file "robots.txt"
|
9
8
|
end
|
10
9
|
|
11
|
-
git :add => '
|
10
|
+
git :add => '--all'
|
12
11
|
git :commit => "-aqm 'Removed unnecessary files left over from initial app generation.'"
|
13
12
|
puts "\n"
|
@@ -0,0 +1,36 @@
|
|
1
|
+
@config = {}
|
2
|
+
|
3
|
+
# heroku questions
|
4
|
+
def create_heroku_app
|
5
|
+
say "Refreshing Heroku user credentials".magenta
|
6
|
+
unless system "heroku auth:login"
|
7
|
+
puts "Could not login to Heroku, halting"
|
8
|
+
exit
|
9
|
+
end
|
10
|
+
|
11
|
+
created = false
|
12
|
+
while not created
|
13
|
+
@config[:heroku][:name] = ask "What do you want to call your Heroku app? (#{@app_name.gsub('_','')})".red
|
14
|
+
@config[:heroku][:name] = @app_name.gsub('_','') if @config[:heroku][:name].blank?
|
15
|
+
|
16
|
+
say "Creating Heroku app '#{@config[:heroku][:name]}.herokuapp.com'".magenta
|
17
|
+
|
18
|
+
created = system "heroku create #{@config[:heroku][:name]}"
|
19
|
+
|
20
|
+
unless created
|
21
|
+
puts "Heroku '#{@config[:heroku][:name]}' app already exists or could not be created, please provide a new name"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
@config[:heroku] = Hash.new
|
28
|
+
if (@config[:heroku][:create?] = will_you_like_to? "create Heroku apps?".red)
|
29
|
+
@config[:heroku][:deploy?] = will_you_like_to? "deploy immediately?".red
|
30
|
+
|
31
|
+
@config[:heroku][:domain] = ask "Add custom domain (customdomain.com) or leave blank:".red
|
32
|
+
|
33
|
+
create_heroku_app
|
34
|
+
|
35
|
+
@config[:heroku][:collaborators] = ask "Add collaborators? Type the email's separated by comma (,):".red
|
36
|
+
end
|
data/lib/pah/partials/_git.rb
CHANGED
data/lib/pah/partials/_heroku.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
class HerokuApp < Rails::Generators::AppGenerator
|
2
2
|
DEFAULT_ADDONS = %w(pgbackups:auto-month loggly:mole sendgrid:starter)
|
3
3
|
|
4
|
-
attr_reader :name, :description
|
4
|
+
attr_reader :name, :description, :config
|
5
5
|
|
6
|
-
def initialize(
|
7
|
-
@
|
6
|
+
def initialize(config)
|
7
|
+
@config = config
|
8
|
+
@name = @config[:heroku][:name]
|
8
9
|
@description = description
|
9
10
|
|
10
|
-
create
|
11
11
|
add_secret_token
|
12
12
|
add_timezone_config
|
13
13
|
add_addons
|
@@ -16,25 +16,6 @@ class HerokuApp < Rails::Generators::AppGenerator
|
|
16
16
|
check_collaborators
|
17
17
|
end
|
18
18
|
|
19
|
-
def create
|
20
|
-
created = false
|
21
|
-
default = @name
|
22
|
-
|
23
|
-
while not created do
|
24
|
-
@name = ask "What do you want to call your Heroku #{description}? (#{default})", :red
|
25
|
-
@name = @name.present? ? name : default
|
26
|
-
|
27
|
-
say "Creating Heroku app '#{name}.herokuapp.com'".magenta
|
28
|
-
created = system "heroku create #{name}"
|
29
|
-
|
30
|
-
unless created
|
31
|
-
puts "Heroku '#{name}' app already exists or could not be created, please provide a new name"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
@app
|
36
|
-
end
|
37
|
-
|
38
19
|
def add_addons
|
39
20
|
DEFAULT_ADDONS.each { |addon| add_heroku_addon(addon) }
|
40
21
|
end
|
@@ -46,7 +27,7 @@ class HerokuApp < Rails::Generators::AppGenerator
|
|
46
27
|
|
47
28
|
def add_heroku_git_remote
|
48
29
|
say "Adding Heroku git remote for deploy to '#{name}'.".magenta
|
49
|
-
git remote
|
30
|
+
system "git remote add heroku git@heroku.com:#{name}.git"
|
50
31
|
end
|
51
32
|
|
52
33
|
def add_heroku_addon(addon)
|
@@ -69,19 +50,20 @@ class HerokuApp < Rails::Generators::AppGenerator
|
|
69
50
|
|
70
51
|
def open
|
71
52
|
say "Pushing application to heroku...".magenta
|
72
|
-
|
53
|
+
|
54
|
+
system "git push heroku master"
|
73
55
|
|
74
56
|
system "heroku open --app #{name}"
|
75
57
|
end
|
76
58
|
|
77
59
|
private
|
78
60
|
def check_canonical_domain
|
79
|
-
domain =
|
61
|
+
domain = @config[:heroku][:domain]
|
80
62
|
add_canonical_domain(domain) unless domain.blank?
|
81
63
|
end
|
82
64
|
|
83
65
|
def check_collaborators
|
84
|
-
collaborators =
|
66
|
+
collaborators = @config[:heroku][:collaborators]
|
85
67
|
|
86
68
|
if collaborators.present?
|
87
69
|
collaborators.split(",").map(&:strip).each { |email| add_collaborator(email) }
|
@@ -90,18 +72,14 @@ class HerokuApp < Rails::Generators::AppGenerator
|
|
90
72
|
end
|
91
73
|
|
92
74
|
say "Configuring Heroku application...".magenta
|
93
|
-
if would_you_like? "Create Heroku apps?".red
|
94
75
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
exit
|
99
|
-
end
|
76
|
+
copy_static_file 'Procfile'
|
77
|
+
git :add => 'Procfile'
|
78
|
+
git :commit => "-qm 'Add Procfile'"
|
100
79
|
|
101
|
-
|
102
|
-
config['deploy'] = would_you_like? "Deploy immediately?".red
|
80
|
+
if @config[:heroku][:create?]
|
103
81
|
|
104
|
-
production_app = HerokuApp.new
|
82
|
+
production_app = HerokuApp.new @config
|
105
83
|
|
106
|
-
production_app.open if config[
|
84
|
+
production_app.open if @config[:heroku][:deploy?]
|
107
85
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
puts "Setting up Jumpup... ".magenta
|
2
|
+
|
3
|
+
copy_static_file 'lib/tasks/jumpup.rake'
|
4
|
+
copy_static_file 'config/initializers/jumpup_heroku.rb'
|
5
|
+
|
6
|
+
gsub_file 'config/initializers/jumpup_heroku.rb', /PROJECT/, (@config[:heroku][:name] || @app_name)
|
7
|
+
|
8
|
+
git :add => 'lib/tasks/jumpup.rake'
|
9
|
+
git :add => 'config/initializers/jumpup_heroku.rb'
|
10
|
+
git :commit => "-qm 'Adding jumpup tasks and configuration.'"
|
11
|
+
|
12
|
+
puts "\n"
|