pah 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +8 -0
- data/CHANGELOG.md +30 -0
- data/CONTRIBUTING.md +22 -0
- data/README.md +46 -30
- data/Rakefile +4 -0
- data/features/assets.feature +13 -0
- data/features/bullet.feature +7 -0
- data/features/canonical_host.feature +9 -0
- data/features/capybara.feature +10 -0
- data/features/database.feature +16 -0
- data/features/env.feature +19 -0
- data/features/gemfile.feature +10 -0
- data/features/generators.feature +18 -0
- data/features/git.feature +12 -0
- data/features/heroku.feature +6 -0
- data/features/jumpup.feature +13 -0
- data/features/layout.feature +12 -0
- data/features/letter_opener.feature +10 -0
- data/features/locale.feature +29 -0
- data/features/newrelic.feature +13 -0
- data/features/public.feature +20 -0
- data/features/puma.feature +11 -0
- data/features/rack_deflater.feature +10 -0
- data/features/rack_timeout.feature +7 -0
- data/features/rails_works.feature +17 -0
- data/features/readme.feature +14 -0
- data/features/remove_unused_files.feature +7 -0
- data/features/rollbar.feature +13 -0
- data/features/rspec.feature +13 -0
- data/features/run_specs.feature +15 -0
- data/features/runner.feature +28 -0
- data/features/secret_token.feature +34 -0
- data/features/secure_headers.feature +14 -0
- data/features/sendgrid.feature +14 -0
- data/features/simple_form.feature +6 -0
- data/features/step_definitions/create_simple_app.rb +10 -0
- data/features/step_definitions/file.rb +9 -0
- data/features/step_definitions/file_content.rb +14 -0
- data/features/support/bin/heroku +36 -0
- data/features/support/env.rb +9 -0
- data/features/support/file_helpers.rb +12 -0
- data/lib/pah/files/Gemfile +19 -18
- data/lib/pah/files/Procfile +1 -1
- data/lib/pah/files/README.md +56 -35
- data/lib/pah/files/app/assets/stylesheets/_variables.scss +9 -12
- data/lib/pah/files/app/assets/stylesheets/application.scss +5 -4
- data/lib/pah/files/app/assets/stylesheets/form.scss +33 -44
- data/lib/pah/files/app/assets/stylesheets/general.scss +10 -18
- data/lib/pah/files/app/assets/stylesheets/reset.scss +26 -15
- data/lib/pah/files/app/assets/stylesheets/responsive.scss +14 -25
- data/lib/pah/files/app/views/application/{_error_messages.html.haml → _error_messages.html.slim} +2 -3
- data/lib/pah/files/app/views/application/{_flash_messages.html.haml → _flash_messages.html.slim} +1 -1
- data/lib/pah/files/app/views/layouts/application.html.slim +51 -0
- data/lib/pah/files/config/initializers/database_connection.rb +9 -6
- data/lib/pah/files/config/locales/pt-BR.yml +8 -10
- data/lib/pah/files/config/newrelic.yml +227 -0
- data/lib/pah/files/config/puma.rb +17 -0
- data/lib/pah/files/spec/spec_helper.rb +14 -10
- data/lib/pah/files/spec/support/capybara.rb +1 -1
- data/lib/pah/partials/_bin.rb +4 -0
- data/lib/pah/partials/_canonical_host.rb +3 -3
- data/lib/pah/partials/_database.rb +1 -3
- data/lib/pah/partials/_gems.rb +15 -7
- data/lib/pah/partials/_generators.rb +1 -3
- data/lib/pah/partials/_heroku.rb +3 -10
- data/lib/pah/partials/_layout.rb +4 -4
- data/lib/pah/partials/_letter_opener.rb +1 -3
- data/lib/pah/partials/_locale.rb +2 -6
- data/lib/pah/partials/_newrelic.rb +6 -0
- data/lib/pah/partials/_puma.rb +2 -0
- data/lib/pah/partials/_rack_deflater.rb +8 -0
- data/lib/pah/partials/_readme.rb +1 -0
- data/lib/pah/partials/_rollbar.rb +13 -3
- data/lib/pah/partials/_rspec.rb +0 -1
- data/lib/pah/partials/_ruby_env.rb +1 -1
- data/lib/pah/partials/_secret_token.rb +4 -7
- data/lib/pah/partials/_secure_headers.rb +3 -3
- data/lib/pah/partials/_sendgrid.rb +19 -0
- data/lib/pah/partials/_simple_form.rb +1 -3
- data/lib/pah/template.rb +10 -3
- data/lib/pah/version.rb +2 -2
- data/pah.gemspec +2 -0
- metadata +115 -9
- data/lib/pah/files/app/views/layouts/application.html.haml +0 -63
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68719a71087c3d679e4a5cf0a6e0030ba9febe6e
|
4
|
+
data.tar.gz: db41369b629689e32fcef5d329523783d1ff0806
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3703e095bff01b40166ae757e81df9cea0a7071a101297732bb45d0f13c301322c11e4de83a552d8e673b17226146de42a579d5ca1db89796aff09b64df269e0
|
7
|
+
data.tar.gz: 931a01534fe713bcd913623bb59580afda2f5dae73067875a2a8ea5a0168ab56b217fefd842b5515fca7696957efdfad19856c7d2fc4284f7eb691063bb31449
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.2
|
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -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
|
|
data/CONTRIBUTING.md
CHANGED
@@ -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
|
-
#
|
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
|
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
|
16
|
+
Install PAH with the command:
|
11
17
|
|
12
|
-
|
18
|
+
```bash
|
19
|
+
$ gem install pah
|
20
|
+
```
|
13
21
|
|
14
|
-
If using [RVM see
|
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
|
-
$
|
29
|
+
$ pah projectname
|
30
30
|
```
|
31
31
|
|
32
|
-
|
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
|
-
|
34
|
+
:warning: PAH not meant to be used against an existing repo.
|
35
35
|
|
36
|
-
###
|
36
|
+
### RVM
|
37
37
|
|
38
|
-
|
38
|
+
If you're using RVM, create and use a gemset (with the project name) before running PAH:
|
39
39
|
|
40
|
-
|
40
|
+
```bash
|
41
|
+
$ rvm use 2.1.2@projectname --create
|
42
|
+
$ pah projectname
|
43
|
+
```
|
41
44
|
|
42
|
-
|
45
|
+
PAH automatically create the .ruby-version and .ruby-gemset files.
|
43
46
|
|
44
47
|
## Versioning
|
45
48
|
|
46
|
-
|
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
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
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
|
-
##
|
85
|
+
## Made with love by HE:labs
|
72
86
|
|
73
|
-
|
74
|
-
|
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
@@ -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,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,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,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
|
+
"""
|