pah 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +8 -0
  4. data/CHANGELOG.md +30 -0
  5. data/CONTRIBUTING.md +22 -0
  6. data/README.md +46 -30
  7. data/Rakefile +4 -0
  8. data/features/assets.feature +13 -0
  9. data/features/bullet.feature +7 -0
  10. data/features/canonical_host.feature +9 -0
  11. data/features/capybara.feature +10 -0
  12. data/features/database.feature +16 -0
  13. data/features/env.feature +19 -0
  14. data/features/gemfile.feature +10 -0
  15. data/features/generators.feature +18 -0
  16. data/features/git.feature +12 -0
  17. data/features/heroku.feature +6 -0
  18. data/features/jumpup.feature +13 -0
  19. data/features/layout.feature +12 -0
  20. data/features/letter_opener.feature +10 -0
  21. data/features/locale.feature +29 -0
  22. data/features/newrelic.feature +13 -0
  23. data/features/public.feature +20 -0
  24. data/features/puma.feature +11 -0
  25. data/features/rack_deflater.feature +10 -0
  26. data/features/rack_timeout.feature +7 -0
  27. data/features/rails_works.feature +17 -0
  28. data/features/readme.feature +14 -0
  29. data/features/remove_unused_files.feature +7 -0
  30. data/features/rollbar.feature +13 -0
  31. data/features/rspec.feature +13 -0
  32. data/features/run_specs.feature +15 -0
  33. data/features/runner.feature +28 -0
  34. data/features/secret_token.feature +34 -0
  35. data/features/secure_headers.feature +14 -0
  36. data/features/sendgrid.feature +14 -0
  37. data/features/simple_form.feature +6 -0
  38. data/features/step_definitions/create_simple_app.rb +10 -0
  39. data/features/step_definitions/file.rb +9 -0
  40. data/features/step_definitions/file_content.rb +14 -0
  41. data/features/support/bin/heroku +36 -0
  42. data/features/support/env.rb +9 -0
  43. data/features/support/file_helpers.rb +12 -0
  44. data/lib/pah/files/Gemfile +19 -18
  45. data/lib/pah/files/Procfile +1 -1
  46. data/lib/pah/files/README.md +56 -35
  47. data/lib/pah/files/app/assets/stylesheets/_variables.scss +9 -12
  48. data/lib/pah/files/app/assets/stylesheets/application.scss +5 -4
  49. data/lib/pah/files/app/assets/stylesheets/form.scss +33 -44
  50. data/lib/pah/files/app/assets/stylesheets/general.scss +10 -18
  51. data/lib/pah/files/app/assets/stylesheets/reset.scss +26 -15
  52. data/lib/pah/files/app/assets/stylesheets/responsive.scss +14 -25
  53. data/lib/pah/files/app/views/application/{_error_messages.html.haml → _error_messages.html.slim} +2 -3
  54. data/lib/pah/files/app/views/application/{_flash_messages.html.haml → _flash_messages.html.slim} +1 -1
  55. data/lib/pah/files/app/views/layouts/application.html.slim +51 -0
  56. data/lib/pah/files/config/initializers/database_connection.rb +9 -6
  57. data/lib/pah/files/config/locales/pt-BR.yml +8 -10
  58. data/lib/pah/files/config/newrelic.yml +227 -0
  59. data/lib/pah/files/config/puma.rb +17 -0
  60. data/lib/pah/files/spec/spec_helper.rb +14 -10
  61. data/lib/pah/files/spec/support/capybara.rb +1 -1
  62. data/lib/pah/partials/_bin.rb +4 -0
  63. data/lib/pah/partials/_canonical_host.rb +3 -3
  64. data/lib/pah/partials/_database.rb +1 -3
  65. data/lib/pah/partials/_gems.rb +15 -7
  66. data/lib/pah/partials/_generators.rb +1 -3
  67. data/lib/pah/partials/_heroku.rb +3 -10
  68. data/lib/pah/partials/_layout.rb +4 -4
  69. data/lib/pah/partials/_letter_opener.rb +1 -3
  70. data/lib/pah/partials/_locale.rb +2 -6
  71. data/lib/pah/partials/_newrelic.rb +6 -0
  72. data/lib/pah/partials/_puma.rb +2 -0
  73. data/lib/pah/partials/_rack_deflater.rb +8 -0
  74. data/lib/pah/partials/_readme.rb +1 -0
  75. data/lib/pah/partials/_rollbar.rb +13 -3
  76. data/lib/pah/partials/_rspec.rb +0 -1
  77. data/lib/pah/partials/_ruby_env.rb +1 -1
  78. data/lib/pah/partials/_secret_token.rb +4 -7
  79. data/lib/pah/partials/_secure_headers.rb +3 -3
  80. data/lib/pah/partials/_sendgrid.rb +19 -0
  81. data/lib/pah/partials/_simple_form.rb +1 -3
  82. data/lib/pah/template.rb +10 -3
  83. data/lib/pah/version.rb +2 -2
  84. data/pah.gemspec +2 -0
  85. metadata +115 -9
  86. data/lib/pah/files/app/views/layouts/application.html.haml +0 -63
  87. data/lib/pah/files/spec/support/deferred_garbage_collection.rb +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 381988670dd59fdf9d0daffa4a1ee370f4799778
4
- data.tar.gz: 8b8fd9c1b9b87edc742296522d51005cac9bd920
3
+ metadata.gz: 68719a71087c3d679e4a5cf0a6e0030ba9febe6e
4
+ data.tar.gz: db41369b629689e32fcef5d329523783d1ff0806
5
5
  SHA512:
6
- metadata.gz: 7be8672bab5fd2b2b7136ef811765f501416aaa337801bddb67fb49e0d02c2331b2ff55ea70c372a43b8d1ebcedff8551805a3bddd95001626035c4933de17e2
7
- data.tar.gz: 52b9b073da89a1ffdc308dd0a73945a80ab9bbe8180012fd0151d3ea89eff8e07bac4f42dc26018f401ec3d5642c78204658a80725f7a8c6e1da9082d152721a
6
+ metadata.gz: 3703e095bff01b40166ae757e81df9cea0a7071a101297732bb45d0f13c301322c11e4de83a552d8e673b17226146de42a579d5ca1db89796aff09b64df269e0
7
+ data.tar.gz: 931a01534fe713bcd913623bb59580afda2f5dae73067875a2a8ea5a0168ab56b217fefd842b5515fca7696957efdfad19856c7d2fc4284f7eb691063bb31449
@@ -1 +1 @@
1
- 2.1.1
1
+ 2.1.2
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.2
4
+ before_script:
5
+ - git config --global user.email "johndoe@example.com"
6
+ - git config --global user.name "John Doe"
7
+ - echo 'export rvm_ignore_gemset_flag=1' >> $HOME/.rvmrc
8
+ - export rvm_ignore_gemset_flag=1
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.14 (May 30, 2014)
4
+
5
+ ### improvements
6
+
7
+ - Update rails version to `4.1.1`
8
+ - Set ruby 2.1.2 as default
9
+ - Better config of RSpec mocks
10
+ - Update RSpec to 3.0.0.beta2
11
+ - Better default README
12
+ - Use `rack-timeout` from github (ref.: https://github.com/kch/rack-timeout/issues/41)
13
+ - Add `config/puma.rb` with Puma app server configuration
14
+ - Add `preload_app!` directive for Puma workers
15
+ - Add `ENV['MIN_THREADS']`, `ENV['MAX_THREADS']`, `ENV['PUMA_WORKERS']`, for Puma configuration.
16
+ - Add `ActiveRecord::Base.establish_connection` on worker boot specific setup
17
+ - Load Puma configuration file on Procfile web process
18
+ - Replace Haml with Slim
19
+ - Transfer `$main-color`, `$text`, `$darker-color`, `$lighter-color` SASS variables to `_variables.scss` partial.
20
+ - Add SendGrid setup
21
+ - Import `_variables.scss` only once, on `application.scss`
22
+ - Use `email_spec` from GitHub to avoid warnings raised by latest rspec
23
+ - Add Rack::Deflater
24
+ - Include **Newrelic** on the list of default addons
25
+ - Add filter_run and run_all_when_everything_filtered on RSpec config
26
+
27
+ ### bug fixes
28
+
29
+ - Remove duplicated error messages section on locale file
30
+ - Abort application generation in case problems are detected when installing gems
31
+ - Remove the .disabled class on _form.scss. Issue #322
3
32
 
4
33
  ## 0.0.13 (March 21, 2014)
5
34
 
@@ -38,6 +67,7 @@
38
67
  - Set ruby 2.1.1 as default
39
68
  - Add custom error pages
40
69
  - Update jumpup.rake to comply jumpup gem.
70
+ - Remove `deferred_garbage_collection.rb`.
41
71
 
42
72
  ### bug fixes
43
73
 
@@ -6,6 +6,15 @@ We love pull requests. Here's a quick guide:
6
6
 
7
7
  1. Create your feature branch (`git checkout -b my-new-feature`)
8
8
 
9
+ 1. Run the tests. We only take pull requests with passing tests, and it's great
10
+ to know that you have a clean slate: `bundle && rake`
11
+
12
+ 1. Add a test for your change. Only refactoring and documentation changes
13
+ require no new tests. If you are adding functionality or fixing a bug, we need
14
+ a test!
15
+
16
+ 1. Make the test pass.
17
+
9
18
  1. Update [CHANGELOG.md](https://github.com/Helabs/pah/blob/master/CHANGELOG.md) with a brief description of your changes under the `unreleased` heading.
10
19
 
11
20
  1. Commit your changes (`git commit -am 'Added some feature'`)
@@ -20,3 +29,16 @@ day). We may suggest some changes or improvements or alternatives.
20
29
 
21
30
  Some things that will increase the chance that your pull request is accepted is to follow the practices described on [Ruby style guide](https://github.com/bbatsov/ruby-style-guide), [Rails style guide](https://github.com/bbatsov/rails-style-guide) and [Better Specs](http://betterspecs.org/).
22
31
 
32
+ ## General rules
33
+
34
+ - Small features and versions upgrades should be done only via PR (without opening an issue before)
35
+ - Larger features should be discussed on issues before opening a PR
36
+ - Every PR of new features/gems should come with the specs/feature of the change
37
+
38
+ ## Removing gems
39
+
40
+ Pah is an opinionated Rails template. All gems are our recommendations to recurring problems based on our experience. For example, when writing tests that need to access network we recommend using VCR and WebMock.
41
+ If you want to make a PR to add/remove gem X, please follow the steps below:
42
+
43
+ 1. Make a PR to our blog and explain the gem's pros and cons, how to use, the tricks etc.
44
+ 1. Make a PR to remove gem X
data/README.md CHANGED
@@ -1,49 +1,52 @@
1
- # Pah
1
+ # PAH
2
+ [![Build Status][travis_badge]][travis]
2
3
  [![RubyGems][gem_version_badge]][ruby_gems]
3
4
  [![Code Climate][code_climate_badge]][code_climate]
4
5
  [![Gemnasium][gemnasium_badge]][gemnasium]
5
6
 
6
- A rails application template which was born from [Startup DEV][startupdev] and now is used to start most projects at [HE:labs][helabs].
7
+ A Rails application template which was born from [Startup DEV][startupdev] and now is used to start most projects at [HE:labs][helabs].
8
+
9
+ ## Dependencies
10
+
11
+ * Heroku Toolbelt - https://toolbelt.heroku.com/
12
+ * phantomjs - http://phantomjs.org/download.html
7
13
 
8
14
  ## Instalation
9
15
 
10
- Install Pah at the command prompt:
16
+ Install PAH with the command:
11
17
 
12
- gem install pah
18
+ ```bash
19
+ $ gem install pah
20
+ ```
13
21
 
14
- If using [RVM see this tips](https://github.com/Helabs/pah/wiki/Using-Pah-with-RVM).
22
+ If you're using [RVM see those tips](https://github.com/Helabs/pah/wiki/Using-Pah-with-RVM).
15
23
 
16
24
  ## Usage
17
25
 
18
26
  Run:
19
27
 
20
- pah projectname
21
-
22
- This will create a Rails 4.0 app in `projectname` with ruby 2.1.1. This script creates a new git repository. It is not meant to be used against an existing repo.
23
-
24
- ### RVM
25
-
26
- If using the rvm is recomended before using pah, create and use a gemset, with the project name.
27
-
28
28
  ```bash
29
- $ rvm use 2.1.1@projectname --create
29
+ $ pah projectname
30
30
  ```
31
31
 
32
- Pah automatically create the .ruby-version and .ruby-gemset files.
32
+ This will create a Rails 4.1.1 with Ruby 2.1.2. This script creates a new git repository in the folder `projectname`.
33
33
 
34
- ## Dependencies
34
+ :warning: PAH not meant to be used against an existing repo.
35
35
 
36
- ### heroku toolbelt
36
+ ### RVM
37
37
 
38
- Install from: https://toolbelt.heroku.com/
38
+ If you're using RVM, create and use a gemset (with the project name) before running PAH:
39
39
 
40
- ### phantomjs
40
+ ```bash
41
+ $ rvm use 2.1.2@projectname --create
42
+ $ pah projectname
43
+ ```
41
44
 
42
- Install from: http://phantomjs.org/download.html
45
+ PAH automatically create the .ruby-version and .ruby-gemset files.
43
46
 
44
47
  ## Versioning
45
48
 
46
- Pah follow the [Semantic Versioning](http://semver.org/).
49
+ PAH follows the [Semantic Versioning](http://semver.org/) standard.
47
50
 
48
51
  ## Issues
49
52
 
@@ -56,22 +59,34 @@ Please see [CONTRIBUTING.md](https://github.com/Helabs/pah/blob/master/CONTRIBUT
56
59
  ## Maintainers
57
60
 
58
61
  - [Mauro George](https://github.com/maurogeorge)
62
+ - [Thiago Belem](https://github.com/TiuTalk)
63
+
64
+ ## Roadmap
65
+
66
+ - Improve the specs and test coverage
67
+ - Refactor the templates/partials logic
68
+ - Extract "utils" to somewhere else outside the template.rb
69
+ - Make sure all the generated files are not beign overriden with older versions (like spec_helper, applications config & etc), don't copy files.. build them
70
+ - Remove all the default CSS/views/controllers that are not necessary for a new project
71
+ - Remove the old and unused spec/support files
72
+ - Release version 1.0
59
73
 
60
74
  ## Release
61
75
 
62
76
  Follow this steps to release a new version of the gem.
63
77
 
64
78
  1. Test if everything is running ok;
65
- 1. Change version of the gem on `VERSION` constant;
66
- 1. Add the release date on the `CHANGELOG`;
67
- 1. Do a commit "Bump version x.x.x", follow the semantic version;
68
- 1. Run `$ rake release`, this will send the gem to the rubygems;
69
- 1. Check if the gem is on the rubygems and the tags are correct on the github;
79
+ 2. Change version of the gem on `VERSION` constant;
80
+ 3. Add the release date on the `CHANGELOG`;
81
+ 4. Do a commit "Bump version x.x.x", follow the semantic version;
82
+ 5. Run `$ rake release`, this will send the gem to the rubygems;
83
+ 6. Check if the gem is on the rubygems and the tags are correct on the github;
70
84
 
71
- ## Credits
85
+ ## Made with love by HE:labs
72
86
 
73
- Pah is maintained and funded by [HE:labs](http://helabs.com.br/opensource/).
74
- Thank you to all the [contributors](https://github.com/Helabs/pah/graphs/contributors).
87
+ ![HE:labs](http://helabs.com.br/images/logo.png)
88
+
89
+ This gem was created and is maintained by [HE:labs](https://github.com/Helabs).
75
90
 
76
91
  [startupdev]: http://startupdev.com.br
77
92
  [helabs]: http://helabs.com.br
@@ -81,4 +96,5 @@ Thank you to all the [contributors](https://github.com/Helabs/pah/graphs/contrib
81
96
  [code_climate_badge]: https://codeclimate.com/github/Helabs/pah.png
82
97
  [gemnasium]: https://gemnasium.com/Helabs/pah
83
98
  [gemnasium_badge]: https://gemnasium.com/Helabs/pah.png
84
-
99
+ [travis]: https://travis-ci.org/Helabs/pah
100
+ [travis_badge]: https://travis-ci.org/Helabs/pah.svg?branch=master
data/Rakefile CHANGED
@@ -1 +1,5 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new
5
+ task default: :cucumber
@@ -0,0 +1,13 @@
1
+ Feature: Assets
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Have correct files
6
+ Then I have a app/assets/javascripts/application.js
7
+ Then I have a app/assets/stylesheets/_variables.scss
8
+ Then I have a app/assets/stylesheets/application.scss
9
+ Then I have a app/assets/stylesheets/reset.scss
10
+ Then I have a app/assets/stylesheets/general.scss
11
+ Then I have a app/assets/stylesheets/form.scss
12
+ Then I have a app/assets/stylesheets/responsive.scss
13
+ Then I dont have a app/assets/stylesheets/application.css
@@ -0,0 +1,7 @@
1
+ Feature: Bullet
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Have correct files
6
+ Then I have a config/initializers/bullet.rb
7
+
@@ -0,0 +1,9 @@
1
+ Feature: Canonical Host
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Have correct files
6
+ Then I have the file config.ru and contents of this file should include:
7
+ """
8
+ use Rack::CanonicalHost, ENV['CANONICAL_HOST'] if ENV['CANONICAL_HOST']
9
+ """
@@ -0,0 +1,10 @@
1
+ Feature: Capybara
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Have correct files
6
+ Then I have a spec/support/acceptance_helpers.rb
7
+ Then I have a spec/support/acceptance_macros.rb
8
+ Then I have a spec/support/capybara.rb
9
+ Then I have a spec/support/shared_connection.rb
10
+ Then I have a spec/acceptance/dummy_spec.rb
@@ -0,0 +1,16 @@
1
+ Feature: Database
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Have correct files
6
+ Then I have the file config/database.yml and contents of this file should include:
7
+ """
8
+ database: myapp_development
9
+ """
10
+ Then I have the file config/database.yml and contents of this file should include:
11
+ """
12
+ database: myapp_test
13
+ """
14
+ Then I have a db/schema.rb
15
+
16
+
@@ -0,0 +1,19 @@
1
+ Feature: Env files
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Create env files
6
+ Then I have the file .ruby-version and contents of this file should be:
7
+ """
8
+ 2.1.2
9
+
10
+ """
11
+ Then I have the file .ruby-gemset and contents of this file should be:
12
+ """
13
+ myapp
14
+
15
+ """
16
+ Then I have the file .env and contents of this file should include:
17
+ """
18
+ PORT: 3000
19
+ """
@@ -0,0 +1,10 @@
1
+ Feature: Gemfile
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Correct gems on gemfile
6
+ Then I have the file Gemfile and contents of this file should include:
7
+ """
8
+ gem 'rails', '4.1.1'
9
+ """
10
+
@@ -0,0 +1,18 @@
1
+ Feature: Generators
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Have correct files
6
+ Then I have the file config/application.rb and contents of this file should include:
7
+ """
8
+ config.generators do |g|
9
+ """
10
+ Then I have the file config/application.rb and contents of this file should include:
11
+ """
12
+ config.app_generators do |g|
13
+ """
14
+ Then I have the file config/application.rb and contents of this file should include:
15
+ """
16
+ config.assets.initialize_on_precompile = false
17
+ """
18
+
@@ -0,0 +1,12 @@
1
+ Feature: Git repository
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Create a git repo
6
+ Then I have a .git
7
+ When I cd to "myapp"
8
+ And I run `git status`
9
+ Then the stdout should contain:
10
+ """
11
+ nothing to commit
12
+ """
@@ -0,0 +1,6 @@
1
+ Feature: Heroku
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Have correct files
6
+ Then I have a Procfile
@@ -0,0 +1,13 @@
1
+ Feature: Jumpup
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Have correct files
6
+ Then I have a lib/tasks/jumpup.rake
7
+ Then I have a config/initializers/jumpup_heroku.rb
8
+ Then I have the file config/initializers/jumpup_heroku.rb and contents of this file should include:
9
+ """
10
+ config.app = 'myapp'
11
+ """
12
+
13
+
@@ -0,0 +1,12 @@
1
+ Feature: Layout
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Have correct files
6
+ Then I have a app/views/layouts/application.html.slim
7
+ Then I have a app/views/application/_error_messages.html.slim
8
+ Then I have a app/views/application/_flash_messages.html.slim
9
+ Then I have the file app/views/layouts/application.html.slim and contents of this file should include:
10
+ """
11
+ = page_title(app_name: 'example')
12
+ """
@@ -0,0 +1,10 @@
1
+ Feature: Letter Opener
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Have correct files
6
+ Then I have the file config/environments/development.rb and contents of this file should include:
7
+ """
8
+ config.action_mailer.delivery_method = :letter_opener
9
+ """
10
+
@@ -0,0 +1,29 @@
1
+ Feature: Locale
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Have correct files
6
+ Then I have a config/locales/pt-BR.yml
7
+ Then I have a config/locales/app.pt-BR.yml
8
+ Then I have the file config/application.rb and contents of this file should include:
9
+ """
10
+ config.time_zone = 'Brasilia'
11
+ """
12
+ Then I have the file config/application.rb and contents of this file should include:
13
+ """
14
+ config.i18n.enforce_available_locales = true
15
+ """
16
+ Then I have the file config/application.rb and contents of this file should include:
17
+ """
18
+ config.i18n.default_locale = :"pt-BR"
19
+ """
20
+ Then I have the file config/application.rb and contents of this file should include:
21
+ """
22
+ config.i18n.locale = :"pt-BR"
23
+ """
24
+
25
+
26
+
27
+
28
+
29
+
@@ -0,0 +1,13 @@
1
+ Feature: Newrelic
2
+ Background:
3
+ Given I have created a app with pah
4
+
5
+ Scenario: Have correct files
6
+ Then I have the file Gemfile and contents of this file should include:
7
+ """
8
+ gem 'newrelic_rpm'
9
+ """
10
+ Then I have the file config/newrelic.yml and contents of this file should include:
11
+ """
12
+ app_name: myapp
13
+ """