pah 0.0.12 → 0.0.13

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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/CHANGELOG.md +47 -0
  4. data/CONTRIBUTING.md +6 -31
  5. data/README.md +17 -2
  6. data/bin/pah +2 -1
  7. data/lib/pah/files/.env +1 -0
  8. data/lib/pah/files/Gemfile +35 -28
  9. data/lib/pah/files/Procfile +1 -1
  10. data/lib/pah/files/README.md +15 -9
  11. data/lib/pah/files/app/assets/javascripts/application.js +6 -6
  12. data/lib/pah/files/app/assets/stylesheets/application.scss +4 -6
  13. data/lib/pah/files/app/assets/stylesheets/general.scss +38 -5
  14. data/lib/pah/files/app/views/layouts/application.html.haml +16 -14
  15. data/lib/pah/files/config/initializers/bullet.rb +14 -0
  16. data/lib/pah/files/config/initializers/database_connection.rb +12 -0
  17. data/lib/pah/files/config/initializers/rack_timeout.rb +1 -0
  18. data/lib/pah/files/config/locales/app.pt-BR.yml +13 -0
  19. data/lib/pah/files/config/locales/pt-BR.yml +21 -6
  20. data/lib/pah/files/config/locales/simple_form.pt-BR.yml +25 -0
  21. data/lib/pah/files/lib/tasks/jumpup.rake +3 -6
  22. data/lib/pah/files/public/404.html +69 -0
  23. data/lib/pah/files/public/500.html +59 -0
  24. data/lib/pah/files/spec/acceptance/dummy_spec.rb +1 -1
  25. data/lib/pah/files/spec/support/acceptance_helpers.rb +2 -2
  26. data/lib/pah/files/spec/support/acceptance_macros.rb +4 -4
  27. data/lib/pah/files/spec/support/capybara.rb +1 -1
  28. data/lib/pah/files/spec/support/database_cleaner.rb +18 -0
  29. data/lib/pah/files/spec/support/factory_girl.rb +10 -0
  30. data/lib/pah/files/spec/support/vcr.rb +6 -7
  31. data/lib/pah/partials/_assets.rb +4 -5
  32. data/lib/pah/partials/_bullet.rb +6 -0
  33. data/lib/pah/partials/_canonical_host.rb +2 -5
  34. data/lib/pah/partials/_capybara.rb +2 -5
  35. data/lib/pah/partials/_cleanup.rb +3 -11
  36. data/lib/pah/partials/_database.rb +5 -7
  37. data/lib/pah/partials/_gems.rb +4 -6
  38. data/lib/pah/partials/_generators.rb +2 -5
  39. data/lib/pah/partials/_git.rb +2 -6
  40. data/lib/pah/partials/_heroku.rb +11 -8
  41. data/lib/pah/partials/_jumpup.rb +3 -7
  42. data/lib/pah/partials/_layout.rb +4 -5
  43. data/lib/pah/partials/_letter_opener.rb +2 -5
  44. data/lib/pah/partials/_locale.rb +6 -7
  45. data/lib/pah/partials/_public.rb +9 -4
  46. data/lib/pah/partials/_puma.rb +4 -0
  47. data/lib/pah/partials/_rack_timeout.rb +4 -0
  48. data/lib/pah/partials/_readme.rb +2 -6
  49. data/lib/pah/partials/_rollbar.rb +5 -0
  50. data/lib/pah/partials/_rspec.rb +12 -8
  51. data/lib/pah/partials/_ruby_env.rb +6 -10
  52. data/lib/pah/partials/_secret_token.rb +3 -7
  53. data/lib/pah/partials/_secure_headers.rb +3 -5
  54. data/lib/pah/partials/_simple_form.rb +11 -0
  55. data/lib/pah/template.rb +35 -26
  56. data/lib/pah/version.rb +2 -1
  57. data/pah.gemspec +2 -2
  58. metadata +20 -10
  59. data/lib/pah/files/config/unicorn.rb +0 -43
  60. data/lib/pah/files/spec/support/omniauth.rb +0 -27
  61. data/lib/pah/files/spec/support/paperclip.rb +0 -4
  62. data/lib/pah/partials/_unicorn.rb +0 -33
@@ -0,0 +1,14 @@
1
+ if defined? Bullet
2
+ Bullet.enable = true
3
+ Bullet.rails_logger = true
4
+ Bullet.console = true
5
+ Bullet.add_footer = true
6
+ # Bullet.alert = true
7
+ # Bullet.bullet_logger = true
8
+ # Bullet.growl = true
9
+ # Bullet.xmpp = { :account => 'bullets_account@jabber.org',
10
+ # :password => 'bullets_password_for_jabber',
11
+ # :receiver => 'your_account@jabber.org',
12
+ # :show_online_status => true }
13
+ # Bullet.airbrake = true
14
+ end
@@ -0,0 +1,12 @@
1
+ Rails.application.config.after_initialize do
2
+ ActiveRecord::Base.connection_pool.disconnect!
3
+
4
+ ActiveSupport.on_load(:active_record) do
5
+ if Rails.application.config.database_configuration
6
+ config = Rails.application.config.database_configuration[Rails.env]
7
+ config['reaping_frequency'] = ENV['DB_REAP_FREQ'] || 10 # seconds
8
+ config['pool'] = ENV['DB_POOL'] || 5
9
+ ActiveRecord::Base.establish_connection(config)
10
+ end
11
+ end
12
+ end
@@ -0,0 +1 @@
1
+ Rack::Timeout.timeout = Integer(ENV['RACK_TIMEOUT'] || 10) # seconds
@@ -0,0 +1,13 @@
1
+ pt-BR:
2
+ models_and_attributes: &models_and_attributes
3
+ # models:
4
+ # event:
5
+ # one: Evento
6
+ # other: Eventos
7
+ # attributes:
8
+ # event:
9
+ # name: Nome
10
+ activerecord:
11
+ <<: *models_and_attributes
12
+ activemodel:
13
+ <<: *models_and_attributes
@@ -9,7 +9,7 @@ pt-BR:
9
9
  - Sex
10
10
  - Sáb
11
11
  abbr_month_names:
12
- -
12
+ -
13
13
  - Jan
14
14
  - Fev
15
15
  - Mar
@@ -32,10 +32,10 @@ pt-BR:
32
32
  - Sábado
33
33
  formats:
34
34
  default: ! '%d/%m/%Y'
35
- long: ! '%d de %B de %Y'
35
+ long: ! '%d %B %Y'
36
36
  short: ! '%d de %B'
37
37
  month_names:
38
- -
38
+ -
39
39
  - Janeiro
40
40
  - Fevereiro
41
41
  - Março
@@ -100,6 +100,7 @@ pt-BR:
100
100
  messages:
101
101
  accepted: deve ser aceito
102
102
  blank: não pode ficar em branco
103
+ present: deve ficar em branco
103
104
  confirmation: não está de acordo com a confirmação
104
105
  empty: não pode ficar vazio
105
106
  equal_to: deve ser igual a %{count}
@@ -115,6 +116,9 @@ pt-BR:
115
116
  not_an_integer: não é um número inteiro
116
117
  odd: deve ser ímpar
117
118
  record_invalid: ! 'A validação falhou: %{errors}'
119
+ restrict_dependent_destroy:
120
+ one: "Não é possível excluir o registro pois existe um %{record} dependente"
121
+ many: "Não é possível excluir o registro pois existem %{record} dependentes"
118
122
  taken: já está em uso
119
123
  too_long: ! 'é muito longo (máximo: %{count} caracteres)'
120
124
  too_short: ! 'é muito curto (mínimo: %{count} caracteres)'
@@ -194,9 +198,10 @@ pt-BR:
194
198
  time:
195
199
  am: ''
196
200
  formats:
197
- default: ! '%A, %d de %B de %Y, %H:%M h'
198
- long: ! '%A, %d de %B de %Y, %H:%M h'
199
- short: ! '%d/%m, %H:%M h'
201
+ default: ! '%a, %d de %B de %Y, %H:%M:%S %z'
202
+ long: ! '%d de %B de %Y, %H:%M'
203
+ short: ! '%d de %B, %H:%M'
204
+ simple: ! '%d/%m/%Y'
200
205
  pm: ''
201
206
  # remove these aliases after 'activemodel' and 'activerecord' namespaces are removed from Rails repository
202
207
  activemodel:
@@ -205,3 +210,13 @@ pt-BR:
205
210
  activerecord:
206
211
  errors:
207
212
  <<: *errors
213
+ errors:
214
+ messages:
215
+ already_confirmed: já foi confirmado
216
+ confirmation_period_expired: É necessário ser confirmado detro do periodo %{period}, por favor requisite um novo usuário.
217
+ expired: expirou, por favor solicite uma nova
218
+ not_found: não encontrado
219
+ not_locked: não foi bloqueado
220
+ not_saved:
221
+ one: 'Não foi possível salvar %{resource}: 1 erro'
222
+ other: 'Não foi possível salvar %{resource}: %{count} erros.'
@@ -0,0 +1,25 @@
1
+ pt-BR:
2
+ simple_form:
3
+ "yes": 'Sim'
4
+ "no": 'Não'
5
+ required:
6
+ text: 'obrigatório'
7
+ mark: '*'
8
+ # You can uncomment the line below if you need to overwrite the whole required html.
9
+ # When using html, text and mark won't be used.
10
+ # html: '<abbr title="required">*</abbr>'
11
+ error_notification:
12
+ default_message: "Por favor, verifique os problemas abaixo:"
13
+ # Labels and hints examples
14
+ # labels:
15
+ # defaults:
16
+ # password: 'Password'
17
+ # user:
18
+ # new:
19
+ # email: 'E-mail to sign in.'
20
+ # edit:
21
+ # email: 'E-mail.'
22
+ # hints:
23
+ # defaults:
24
+ # username: 'User name to sign in.'
25
+ # password: 'No special characters, please.'
@@ -1,13 +1,10 @@
1
1
  INTEGRATION_TASKS = %w(
2
- jumpup:heroku:add_remote
3
- jumpup:heroku:check
4
- jumpup:heroku:lock
2
+ jumpup:heroku:start
5
3
  jumpup:start
6
4
  jumpup:bundle_install
7
5
  db:migrate
8
6
  spec
9
7
  jumpup:coverage_verify
10
8
  jumpup:finish
11
- jumpup:heroku:deploy
12
- jumpup:heroku:unlock
13
- )
9
+ jumpup:heroku:finish
10
+ )
@@ -0,0 +1,69 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Erro 404</title>
6
+ </head>
7
+ <body>
8
+ <style>
9
+ * {
10
+ -webkit-box-sizing: border-box;
11
+ -moz-box-sizing: border-box;
12
+ box-sizing: border-box;
13
+ }
14
+ body,html{
15
+ background-color: #f4f4f4;
16
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
17
+ position: relative;
18
+ min-height: 100%;
19
+ height: 100%;
20
+ }
21
+
22
+ .container{
23
+ background-color: #fff;
24
+ border: 1px solid #e5e5e5;
25
+ left: 50%;
26
+ padding: 20px;
27
+ position: absolute;
28
+ text-align: center;
29
+ top: 50%;
30
+ -ms-transform: translateY(-60%) translateX(-50%);
31
+ -webkit-transform: translateY(-60%) translateX(-50%);
32
+ transform: translateY(-60%) translateX(-50%);
33
+ width: 60%;
34
+ -webkit-border-radius: 4px;
35
+ -moz-border-radius: 4px;
36
+ border-radius: 4px;
37
+ }
38
+
39
+ .container h1{
40
+ color: #a84d4d;
41
+ font-size: 100px;
42
+ font-weight: 200;
43
+ margin: 0;
44
+ }
45
+
46
+ .container a{
47
+ color: #1c81d7;
48
+ text-decoration: none;
49
+ }
50
+
51
+ .container p{
52
+ color: #6c6c6c;
53
+ font-size: 18px;
54
+ }
55
+
56
+ .container p.text-small{
57
+ font-size: 14px;
58
+ opacity: 0.85;
59
+ }
60
+ </style>
61
+
62
+ <div class="container">
63
+ <h1>404</h1>
64
+ <p>Hmmm... Não achamos a página que você está procurando.</p>
65
+ <p class="text-small">Volte para a <a href="/">home</a>.</p>
66
+ </div>
67
+
68
+ </body>
69
+ </html>
@@ -0,0 +1,59 @@
1
+ <style>
2
+ * {
3
+ -webkit-box-sizing: border-box;
4
+ -moz-box-sizing: border-box;
5
+ box-sizing: border-box;
6
+ }
7
+ body,html{
8
+ background-color: #f4f4f4;
9
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
10
+ position: relative;
11
+ min-height: 100%;
12
+ height: 100%;
13
+ }
14
+
15
+ .container{
16
+ background-color: #fff;
17
+ border: 1px solid #e5e5e5;
18
+ left: 50%;
19
+ padding: 20px;
20
+ position: absolute;
21
+ text-align: center;
22
+ top: 50%;
23
+ -ms-transform: translateY(-60%) translateX(-50%);
24
+ -webkit-transform: translateY(-60%) translateX(-50%);
25
+ transform: translateY(-60%) translateX(-50%);
26
+ width: 60%;
27
+ -webkit-border-radius: 4px;
28
+ -moz-border-radius: 4px;
29
+ border-radius: 4px;
30
+ }
31
+
32
+ .container h1{
33
+ color: #a84d4d;
34
+ font-size: 100px;
35
+ font-weight: 200;
36
+ margin: 0;
37
+ }
38
+
39
+ .container a{
40
+ color: #1c81d7;
41
+ text-decoration: none;
42
+ }
43
+
44
+ .container p{
45
+ color: #6c6c6c;
46
+ font-size: 18px;
47
+ }
48
+
49
+ .container p.text-small{
50
+ font-size: 14px;
51
+ opacity: 0.85;
52
+ }
53
+ </style>
54
+
55
+ <div class="container">
56
+ <h1>500</h1>
57
+ <p>Erro interno no servidor. :,(</p>
58
+ <p class="text-small">Tente novamente mais tarde!</p>
59
+ </div>
@@ -1,7 +1,7 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  require 'spec_helper'
3
3
 
4
- describe "Homepage", :type => :request do
4
+ describe "Homepage", type: :request do
5
5
  xit {
6
6
  visit root_path
7
7
  page.should have_content('Copyright &copy; 2012 App')
@@ -12,7 +12,7 @@ module AcceptanceHelpers
12
12
  page.evaluate_script "window.confirm = window.original_confirm_function"
13
13
  end
14
14
  def fill_in_autocomplete(capybara_selector, jquery_selector, value)
15
- fill_in capybara_selector, :with => value
15
+ fill_in capybara_selector, with: value
16
16
  page.execute_script %Q{$('#{jquery_selector}').keydown()}
17
17
  end
18
18
  def choose_autocomplete(text)
@@ -22,5 +22,5 @@ module AcceptanceHelpers
22
22
  end
23
23
 
24
24
  RSpec.configure do |config|
25
- config.include AcceptanceHelpers, :type => :request
25
+ config.include AcceptanceHelpers, type: :request
26
26
  end
@@ -2,15 +2,15 @@
2
2
  module AcceptanceMacros
3
3
  def login!
4
4
  before(:each) do
5
- @current_user = User.make(:email => 'x@example.com', :password => 'senha123', :password_confirmation => 'senha123')
5
+ @current_user = User.make(email: 'x@example.com', password: 'senha123', password_confirmation: 'senha123')
6
6
  visit new_user_session_path
7
- fill_in 'Email', :with => 'x@example.com'
8
- fill_in 'Senha', :with => 'senha123'
7
+ fill_in 'Email', with: 'x@example.com'
8
+ fill_in 'Senha', with: 'senha123'
9
9
  click_button 'Entrar'
10
10
  end
11
11
  end
12
12
  end
13
13
 
14
14
  RSpec.configure do |config|
15
- config.extend AcceptanceMacros, :type => :request
15
+ config.extend AcceptanceMacros, type: :request
16
16
  end
@@ -4,5 +4,5 @@ require 'capybara/poltergeist'
4
4
 
5
5
  Capybara.javascript_driver = :poltergeist
6
6
  RSpec.configure do |config|
7
- config.include Capybara::DSL, :example_group => { :file_path => /\bspec\/acceptance\// }
7
+ config.include Capybara::DSL, example_group: { file_path: /\bspec\/acceptance\// }
8
8
  end
@@ -0,0 +1,18 @@
1
+ RSpec.configure do |config|
2
+ config.before(:suite) do
3
+ DatabaseCleaner.strategy = :transaction
4
+ DatabaseCleaner.clean_with(:truncation)
5
+ end
6
+
7
+ config.before(:each, js: true) do
8
+ DatabaseCleaner.strategy = :deletion
9
+ end
10
+
11
+ config.before(:each) do
12
+ DatabaseCleaner.start
13
+ end
14
+
15
+ config.after(:each) do
16
+ DatabaseCleaner.clean
17
+ end
18
+ end
@@ -0,0 +1,10 @@
1
+ RSpec.configure do |config|
2
+ config.before(:suite) do
3
+ begin
4
+ DatabaseCleaner.start
5
+ FactoryGirl.lint
6
+ ensure
7
+ DatabaseCleaner.clean
8
+ end
9
+ end
10
+ end
@@ -1,8 +1,7 @@
1
- # require 'vcr'
2
- #
3
- # VCR.configure do |c|
4
- # c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
5
- # c.hook_into :webmock
6
- # c.configure_rspec_metadata!
7
- # end
1
+ require 'vcr'
8
2
 
3
+ VCR.configure do |c|
4
+ c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
5
+ c.hook_into :webmock
6
+ c.configure_rspec_metadata!
7
+ end
@@ -1,5 +1,3 @@
1
- puts "Adding asset files ...".magenta
2
-
3
1
  copy_static_file 'app/assets/javascripts/application.js'
4
2
  copy_static_file 'app/assets/stylesheets/_variables.scss'
5
3
  copy_static_file 'app/assets/stylesheets/application.scss'
@@ -7,7 +5,8 @@ copy_static_file 'app/assets/stylesheets/reset.scss'
7
5
  copy_static_file 'app/assets/stylesheets/general.scss'
8
6
  copy_static_file 'app/assets/stylesheets/form.scss'
9
7
  copy_static_file 'app/assets/stylesheets/responsive.scss'
8
+ remove_file 'app/assets/stylesheets/application.css'
10
9
 
11
- git :add => '--all'
12
- git :commit => "-aqm 'Add asset files.'"
13
- puts "\n"
10
+ git rm: 'app/assets/stylesheets/application.css'
11
+ git add: 'app/assets/'
12
+ git_commit 'Add asset files.'
@@ -0,0 +1,6 @@
1
+ puts "Adding bullet... ".magenta
2
+
3
+ copy_static_file 'config/initializers/bullet.rb'
4
+
5
+ git add: 'config/initializers/bullet.rb'
6
+ git_commit 'Adding bullet config.'
@@ -1,4 +1,3 @@
1
- puts "Configuring canonical hosts... ".magenta
2
1
  rack_canonical = <<CANONICAL
3
2
 
4
3
  #Run heroku config:add CANONICAL_HOST=yourdomain.com
@@ -8,7 +7,5 @@ CANONICAL
8
7
  in_root do
9
8
  inject_into_file 'config.ru', rack_canonical, {after: "require ::File.expand_path('../config/environment', __FILE__)", verbose: false}
10
9
  end
11
- git :add => 'config.ru'
12
- git :commit => "-qm 'Adding rack-canonical-host.'"
13
-
14
- puts "\n"
10
+ git add: 'config.ru'
11
+ git_commit 'Add rack-canonical-host.'
@@ -1,11 +1,8 @@
1
- puts "Adding capybara helpers...".magenta
2
-
3
1
  copy_static_file 'spec/support/acceptance_helpers.rb'
4
2
  copy_static_file 'spec/support/acceptance_macros.rb'
5
3
  copy_static_file 'spec/support/capybara.rb'
6
4
  copy_static_file 'spec/support/shared_connection.rb'
7
5
  copy_static_file 'spec/acceptance/dummy_spec.rb'
8
6
 
9
- git :add => '.'
10
- git :commit => "-aqm 'Add capybara helpers.'"
11
- puts "\n"
7
+ git add: 'spec/'
8
+ git_commit 'Add capybara helpers.'