pah 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/CHANGELOG.md +35 -2
  4. data/README.md +2 -9
  5. data/lib/pah/files/Gemfile +39 -46
  6. data/lib/pah/files/README.md +47 -0
  7. data/lib/pah/files/app/assets/javascripts/application.js +33 -0
  8. data/lib/pah/files/app/assets/stylesheets/_variables.scss +42 -0
  9. data/lib/pah/files/app/assets/stylesheets/application.scss +6 -0
  10. data/lib/pah/files/app/assets/stylesheets/form.scss +259 -0
  11. data/lib/pah/files/app/assets/stylesheets/general.scss +22 -0
  12. data/lib/pah/files/app/assets/stylesheets/reset.scss +64 -0
  13. data/lib/pah/files/app/assets/stylesheets/responsive.scss +108 -0
  14. data/lib/pah/files/app/views/application/_error_messages.html.haml +3 -3
  15. data/lib/pah/files/app/views/layouts/application.html.haml +3 -3
  16. data/lib/pah/files/config/initializers/jumpup_heroku.rb +3 -0
  17. data/lib/pah/files/lib/tasks/jumpup.rake +13 -0
  18. data/lib/pah/files/spec/support/vcr.rb +3 -2
  19. data/lib/pah/partials/_assets.rb +13 -0
  20. data/lib/pah/partials/_cleanup.rb +2 -3
  21. data/lib/pah/partials/_config.rb +36 -0
  22. data/lib/pah/partials/_git.rb +3 -1
  23. data/lib/pah/partials/_heroku.rb +15 -37
  24. data/lib/pah/partials/_jumpup.rb +12 -0
  25. data/lib/pah/partials/_layout.rb +9 -0
  26. data/lib/pah/partials/_locale.rb +5 -0
  27. data/lib/pah/partials/_readme.rb +9 -0
  28. data/lib/pah/partials/_rspec.rb +1 -1
  29. data/lib/pah/partials/_ruby_env.rb +5 -1
  30. data/lib/pah/partials/_unicorn.rb +3 -0
  31. data/lib/pah/template.rb +8 -6
  32. data/lib/pah/version.rb +1 -1
  33. data/pah.gemspec +2 -2
  34. metadata +30 -21
  35. data/lib/pah/files/app/assets/stylesheets/application.css.scss +0 -6
  36. data/lib/pah/files/app/assets/stylesheets/reset.css +0 -40
  37. data/lib/pah/files/lib/tasks/integration.rake +0 -109
  38. data/lib/pah/partials/_default.rb +0 -15
  39. data/lib/pah/partials/_integration.rb +0 -9
  40. data/lib/pah/partials/_stylesheets.rb +0 -9
@@ -0,0 +1,9 @@
1
+ puts "Adding layout files ...".magenta
2
+
3
+ copy_static_file 'app/views/layouts/application.html.haml'
4
+ copy_static_file 'app/views/application/_error_messages.html.haml'
5
+ copy_static_file 'app/views/application/_flash_messages.html.haml'
6
+
7
+ git :add => '.'
8
+ git :commit => "-aqm 'Add layout files.'"
9
+ puts "\n"
@@ -1,5 +1,9 @@
1
1
  puts "Adding locale... ".magenta
2
2
 
3
+ copy_static_file 'config/locales/pt-BR.yml'
4
+ git :add => 'config/locales/pt-BR.yml'
5
+ git :commit => "-qm 'Add pt-BR locale.'"
6
+
3
7
  time_zone_config = <<TIME_ZONE
4
8
 
5
9
  config.time_zone = 'Brasilia'
@@ -11,6 +15,7 @@ end
11
15
 
12
16
  locale_config = <<LOCALE
13
17
 
18
+ config.i18n.enforce_available_locales = true
14
19
  config.i18n.default_locale = :"pt-BR"
15
20
  config.i18n.locale = :"pt-BR"
16
21
  LOCALE
@@ -0,0 +1,9 @@
1
+ puts "Adding default README... ".magenta
2
+
3
+ copy_static_file 'README.md'
4
+ gsub_file 'README.md', /PROJECT/, @app_name
5
+
6
+ git :add => 'README.md'
7
+ git :commit => "-qm 'Adding README file.'"
8
+
9
+ puts "\n"
@@ -8,6 +8,6 @@ copy_static_file 'spec/spec_helper.rb'
8
8
  copy_static_file "spec/support/#{component}"
9
9
  end
10
10
 
11
- git :add => '.'
11
+ git :add => '--all'
12
12
  git :commit => "-aqm 'Configured RSpec.'"
13
13
  puts "\n"
@@ -1,6 +1,6 @@
1
1
  puts "Setting up ruby env ... ".magenta
2
2
 
3
- current_ruby = 'ruby-2.0.0'
3
+ current_ruby = 'ruby-2.1.0'
4
4
  current_gemset = @app_name
5
5
 
6
6
  copy_static_file '.ruby-version'
@@ -13,4 +13,8 @@ git :add => '.ruby-version'
13
13
  git :add => '.ruby-gemset'
14
14
  git :commit => "-qm 'Add .ruby-version and .ruby-gemset'"
15
15
 
16
+ copy_static_file '.env'
17
+ git :add => '.env'
18
+ git :commit => "-qm 'Add .env file'"
19
+
16
20
  puts "\n"
@@ -1,5 +1,7 @@
1
1
  puts "Configuring Unicorn... ".magenta
2
2
 
3
+ copy_static_file 'config/unicorn.rb'
4
+
3
5
  unicorn_configuration = <<UNICORN_CONFIGURATION
4
6
  # Run GC each 10 requests
5
7
  require "unicorn/oob_gc"
@@ -25,6 +27,7 @@ in_root do
25
27
  end
26
28
 
27
29
  git :add => 'config.ru'
30
+ git :add => 'config/unicorn.rb'
28
31
  git :commit => "-qm 'Configuring Unicorn.'"
29
32
 
30
33
  puts "\n"
data/lib/pah/template.rb CHANGED
@@ -27,15 +27,15 @@ def apply_n(partial)
27
27
  apply "#{@partials}/_#{partial}.rb"
28
28
  end
29
29
 
30
- def would_you_like?(question)
31
- answer = ask("#{question} [y,n]".red)
30
+ def will_you_like_to?(question)
31
+ answer = ask("Will you like to #{question} [y,n]".red)
32
32
  case answer.downcase
33
33
  when "yes", "y"
34
34
  true
35
35
  when "no", "n"
36
36
  false
37
37
  else
38
- would_you_like?(question)
38
+ will_you_like_to?(question)
39
39
  end
40
40
  end
41
41
 
@@ -49,14 +49,15 @@ puts "=========================================================\n"
49
49
 
50
50
  # TODO: timezone, Add rspec extensions
51
51
 
52
+ apply_n :config
52
53
  apply_n :git
53
54
  apply_n :ruby_env
54
55
  apply_n :cleanup
55
56
  apply_n :gems
56
57
  apply_n :database
57
58
  apply_n :rspec
58
- apply_n :default
59
- apply_n :stylesheets
59
+ apply_n :layout
60
+ apply_n :assets
60
61
  apply_n :secure_headers
61
62
  apply_n :secret_token
62
63
  apply_n :capybara
@@ -65,7 +66,8 @@ apply_n :letter_opener
65
66
  apply_n :locale
66
67
  apply_n :canonical_host
67
68
  apply_n :unicorn
68
- apply_n :integration
69
+ apply_n :jumpup
70
+ apply_n :readme
69
71
  apply_n :heroku
70
72
 
71
73
  # apply_n :omniauth # TODO: add spec support files
data/lib/pah/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pah
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
data/pah.gemspec CHANGED
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.required_ruby_version = '>= 2.0.0'
21
+ spec.required_ruby_version = '>= 2.1.0'
22
22
 
23
- spec.add_dependency 'rails', '4.0.0'
23
+ spec.add_dependency 'rails', '4.0.2'
24
24
  spec.add_dependency 'colored', '1.2'
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.3"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pah
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - HE:labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-05 00:00:00.000000000 Z
11
+ date: 2014-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0
19
+ version: 4.0.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.0
26
+ version: 4.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: colored
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -42,28 +42,28 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: A rails application template which born from Startup DEV and now is used
@@ -75,9 +75,9 @@ executables:
75
75
  extensions: []
76
76
  extra_rdoc_files: []
77
77
  files:
78
- - .gitignore
79
- - .ruby-gemset
80
- - .ruby-version
78
+ - ".gitignore"
79
+ - ".ruby-gemset"
80
+ - ".ruby-version"
81
81
  - CHANGELOG.md
82
82
  - CONTRIBUTING.md
83
83
  - Gemfile
@@ -91,15 +91,22 @@ files:
91
91
  - lib/pah/files/.ruby-version
92
92
  - lib/pah/files/Gemfile
93
93
  - lib/pah/files/Procfile
94
- - lib/pah/files/app/assets/stylesheets/application.css.scss
95
- - lib/pah/files/app/assets/stylesheets/reset.css
94
+ - lib/pah/files/README.md
95
+ - lib/pah/files/app/assets/javascripts/application.js
96
+ - lib/pah/files/app/assets/stylesheets/_variables.scss
97
+ - lib/pah/files/app/assets/stylesheets/application.scss
98
+ - lib/pah/files/app/assets/stylesheets/form.scss
99
+ - lib/pah/files/app/assets/stylesheets/general.scss
100
+ - lib/pah/files/app/assets/stylesheets/reset.scss
101
+ - lib/pah/files/app/assets/stylesheets/responsive.scss
96
102
  - lib/pah/files/app/views/application/_error_messages.html.haml
97
103
  - lib/pah/files/app/views/application/_flash_messages.html.haml
98
104
  - lib/pah/files/app/views/layouts/application.html.haml
99
105
  - lib/pah/files/config/database.yml
106
+ - lib/pah/files/config/initializers/jumpup_heroku.rb
100
107
  - lib/pah/files/config/locales/pt-BR.yml
101
108
  - lib/pah/files/config/unicorn.rb
102
- - lib/pah/files/lib/tasks/integration.rake
109
+ - lib/pah/files/lib/tasks/jumpup.rake
103
110
  - lib/pah/files/spec/acceptance/dummy_spec.rb
104
111
  - lib/pah/files/spec/spec_helper.rb
105
112
  - lib/pah/files/spec/support/README
@@ -115,23 +122,25 @@ files:
115
122
  - lib/pah/files/spec/support/suppress_log.rb
116
123
  - lib/pah/files/spec/support/uploaded_file.rb
117
124
  - lib/pah/files/spec/support/vcr.rb
125
+ - lib/pah/partials/_assets.rb
118
126
  - lib/pah/partials/_canonical_host.rb
119
127
  - lib/pah/partials/_capybara.rb
120
128
  - lib/pah/partials/_cleanup.rb
129
+ - lib/pah/partials/_config.rb
121
130
  - lib/pah/partials/_database.rb
122
- - lib/pah/partials/_default.rb
123
131
  - lib/pah/partials/_gems.rb
124
132
  - lib/pah/partials/_generators.rb
125
133
  - lib/pah/partials/_git.rb
126
134
  - lib/pah/partials/_heroku.rb
127
- - lib/pah/partials/_integration.rb
135
+ - lib/pah/partials/_jumpup.rb
136
+ - lib/pah/partials/_layout.rb
128
137
  - lib/pah/partials/_letter_opener.rb
129
138
  - lib/pah/partials/_locale.rb
139
+ - lib/pah/partials/_readme.rb
130
140
  - lib/pah/partials/_rspec.rb
131
141
  - lib/pah/partials/_ruby_env.rb
132
142
  - lib/pah/partials/_secret_token.rb
133
143
  - lib/pah/partials/_secure_headers.rb
134
- - lib/pah/partials/_stylesheets.rb
135
144
  - lib/pah/partials/_unicorn.rb
136
145
  - lib/pah/template.rb
137
146
  - lib/pah/version.rb
@@ -146,17 +155,17 @@ require_paths:
146
155
  - lib
147
156
  required_ruby_version: !ruby/object:Gem::Requirement
148
157
  requirements:
149
- - - '>='
158
+ - - ">="
150
159
  - !ruby/object:Gem::Version
151
- version: 2.0.0
160
+ version: 2.1.0
152
161
  required_rubygems_version: !ruby/object:Gem::Requirement
153
162
  requirements:
154
- - - '>='
163
+ - - ">="
155
164
  - !ruby/object:Gem::Version
156
165
  version: '0'
157
166
  requirements: []
158
167
  rubyforge_project:
159
- rubygems_version: 2.0.3
168
+ rubygems_version: 2.2.0
160
169
  signing_key:
161
170
  specification_version: 4
162
171
  summary: A rails application template which born from Startup DEV and now is used
@@ -1,6 +0,0 @@
1
- @import "bourbon";
2
- @import "reset";
3
-
4
- body {
5
- font-family: $helvetica;
6
- }
@@ -1,40 +0,0 @@
1
- /* Reset */
2
-
3
- html, body, div, h1, h2, h3, h4, ul, ol, li, form, fieldset, select, input, textarea, p {
4
- margin: 0;
5
- padding: 0;
6
- font-size: 100%;
7
- background: transparent;
8
- }
9
-
10
- a, ins { text-decoration: none; }
11
-
12
- del { text-decoration: line-through; }
13
-
14
- hr { display: none; }
15
-
16
- ul, ol { list-style: none; }
17
-
18
- img, fieldset { border: none; }
19
-
20
- h1, h2, h3, h4 { font-weight: normal; }
21
-
22
- em { font-style: italic; }
23
-
24
- strong { font-weight: bold; }
25
-
26
- table {
27
- border-collapse: collapse;
28
- border-spacing: 0;
29
- }
30
-
31
- article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
32
-
33
- abbr[title], dfn[title]{
34
- cursor: help;
35
- border-bottom: 1px dotted;
36
- }
37
-
38
- pre, code {
39
- font-family: monospace;
40
- }
@@ -1,109 +0,0 @@
1
- require 'colored' if Rails.env.development?
2
-
3
- def run_with_clean_env(command, capture_output=false)
4
- Bundler.with_clean_env { capture_output ? `#{command}` : sh(command) }
5
- end
6
-
7
- def confirm(message)
8
- print "\n#{message}\nAre you sure? [yN] "
9
- raise 'Ok. Bye...' unless STDIN.gets.chomp.downcase == 'y'
10
- end
11
-
12
- def has_database?(app)
13
- database_url = run_with_clean_env("heroku config -s --app #{app} | grep DATABASE_URL", true).strip
14
- not database_url.blank?
15
- end
16
-
17
- def backup(app)
18
- return unless has_database?(app)
19
- puts "--> Backing up database via Heroku".magenta
20
- run_with_clean_env("heroku pgbackups:capture --expire --app #{app}")
21
- end
22
-
23
- def migrate(app)
24
- return unless has_database?(app)
25
- puts "--> Migrating".magenta
26
- run_with_clean_env("heroku run rake db:migrate --app #{app}")
27
- end
28
-
29
- def seed(app)
30
- return unless has_database?(app)
31
- puts "--> Seeding".magenta
32
- run_with_clean_env("heroku run rake db:seed --app #{app}")
33
- end
34
-
35
- def restart(app)
36
- puts "--> Restarting".magenta
37
- run_with_clean_env("heroku restart --app #{app}")
38
- end
39
-
40
- def deploy(app)
41
- puts "--> Pushing".magenta
42
- run_with_clean_env("git push git@heroku.com:#{APP}.git HEAD:master")
43
- end
44
-
45
- namespace :integration do
46
- APP = 'PROJECT'
47
- USER = run_with_clean_env("git config --get user.name", true).strip
48
-
49
- namespace :heroku do
50
-
51
- desc "Add Heroku git remotes"
52
- task :add_remote do
53
- puts "--> Adding Heroku git remotes for app #{APP}".magenta
54
-
55
- remote = run_with_clean_env("git remote | grep heroku", true).strip
56
- run_with_clean_env("git remote add heroku git@heroku.com:#{APP}.git") if remote.blank?
57
- end
58
-
59
- desc "Check if there's someone else integrating the project"
60
- task :check do
61
- puts "--> Checking if there's already someone integrating to #{APP}".magenta
62
-
63
- var = run_with_clean_env("heroku config -s --app #{APP} | grep INTEGRATING_BY", true).strip
64
- integrating_by = var.split('=')[1]
65
-
66
- integrating_by.strip! unless integrating_by.blank?
67
-
68
- if integrating_by != USER and not integrating_by.blank?
69
- puts "--> Project is already being integrated by '#{integrating_by}', halting"
70
- exit
71
- end
72
- end
73
-
74
- desc "Lock the Heroku integration"
75
- task :lock do
76
- puts "--> Locking Heroku integration for you (#{USER})".magenta
77
- run_with_clean_env("heroku config:set INTEGRATING_BY='#{USER}' --app #{APP}")
78
- end
79
-
80
- desc "Unlock the Heroku integration"
81
- task :unlock do
82
- puts "--> Unlocking Heroku integration".magenta
83
- run_with_clean_env("heroku config:unset INTEGRATING_BY --app #{APP}")
84
- end
85
-
86
- desc "Deploy to heroku"
87
- task :deploy do
88
- backup(APP)
89
- deploy(APP)
90
- migrate(APP)
91
- seed(APP)
92
- restart(APP)
93
- end
94
- end
95
- end
96
-
97
- INTEGRATION_TASKS = %w(
98
- integration:heroku:add_remote
99
- integration:heroku:check
100
- integration:heroku:lock
101
- integration:start
102
- integration:bundle_install
103
- db:migrate
104
- spec
105
- integration:coverage_verify
106
- integration:finish
107
- integration:heroku:deploy
108
- integration:heroku:unlock
109
- )