pah 0.0.17 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +1 -1
  4. data/CHANGELOG.md +31 -1
  5. data/CONTRIBUTING.md +3 -3
  6. data/README.md +12 -3
  7. data/bin/pah +2 -3
  8. data/features/bourbon.feature +2 -1
  9. data/features/capybara.feature +0 -1
  10. data/features/commands.feature +25 -0
  11. data/features/env.feature +1 -1
  12. data/features/gemfile.feature +1 -1
  13. data/features/inflections.feature +8 -3
  14. data/features/jumpup.feature +2 -1
  15. data/features/layout.feature +0 -4
  16. data/features/{sendgrid.feature → mandrill.feature} +1 -1
  17. data/features/public.feature +0 -9
  18. data/features/rails_works.feature +1 -0
  19. data/features/readme.feature +1 -1
  20. data/features/runner.feature +9 -1
  21. data/features/step_definitions/file_content.rb +5 -0
  22. data/lib/pah/cli.rb +14 -0
  23. data/lib/pah/commands.rb +22 -0
  24. data/lib/pah/commands/app.rb +14 -0
  25. data/lib/pah/commands/help.rb +15 -0
  26. data/lib/pah/commands/version.rb +18 -0
  27. data/lib/pah/files/Gemfile +20 -18
  28. data/lib/pah/files/app/views/layouts/application.html.slim +0 -1
  29. data/lib/pah/files/lib/tasks/jumpup.rake +1 -0
  30. data/lib/pah/rails_template.rb +1 -1
  31. data/lib/pah/templates/bourbon.rb +2 -1
  32. data/lib/pah/templates/capybara.rb +0 -1
  33. data/lib/pah/templates/heroku.rb +8 -1
  34. data/lib/pah/templates/inflection.rb +1 -1
  35. data/lib/pah/templates/mandrill.rb +26 -0
  36. data/lib/pah/templates/public.rb +0 -3
  37. data/lib/pah/version.rb +3 -3
  38. metadata +15 -10
  39. data/lib/pah/files/public/humans.txt +0 -5
  40. data/lib/pah/files/spec/support/shared_connection.rb +0 -14
  41. data/lib/pah/templates/sendgrid.rb +0 -27
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a958ba71aa885ad5767ce98fb2adc99480c41fa
4
- data.tar.gz: 5303420e63892228e3ae4833df6645217ce41b55
3
+ metadata.gz: 5d4df6a429d510293022ab28e25ef317a353b7a3
4
+ data.tar.gz: 783e97620a7957ddc43a7d06c42e0f2b61576f64
5
5
  SHA512:
6
- metadata.gz: 2409d0defd9c811c7da59c002b31657f9da5fc2846a15ce8397f73656fd02e78724b8534feae7773bcbfc945cdf812ae2caf097fbe452cf39b0e9dd8b037aba4
7
- data.tar.gz: 4407c57ea447641f9edd9142d461b8a7d5ada1a2bea866495e9556571738e127b2cd76f7e44c90130667732af0af0b74797629bdaae0189373129b44d120bf11
6
+ metadata.gz: 3b97989269f15499695eee26ee830c2fddb0500ee255371713a47401ca7d9dc0f54b19cf83ba5963254189c495a0e75d39e07186b5c88fb204c66c43c7d9d4b6
7
+ data.tar.gz: a1c5e1f8d2bd3ce33e780e3758c3aefc80d03c28203c90fb3279186ae8742f9d239bcf77611597f61e94dadb9aa194ae541d231dd70af657dec994ca2454df86
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.1.3
1
+ 2.1.5
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.3
3
+ - 2.1.5
4
4
  before_script:
5
5
  - git config --global user.email "johndoe@example.com"
6
6
  - git config --global user.name "John Doe"
data/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.20 (unreleased)
4
+
5
+ ### features
6
+
7
+ ### improvements
8
+
9
+ ### bug fixes
10
+
11
+ ## 0.0.19 (December 12, 2014)
12
+
13
+ ### features
14
+
15
+ ### improvements
16
+
17
+ - Remove shared_connection.rb
18
+ - Add [normalize-rails](https://github.com/markmcconachie/normalize-rails) gem
19
+ - Add [Librato](https://addons.heroku.com/librato) addon
20
+ - Update gems including jumpup to `0.0.8` which includes task to abort integration if a new commit is inserted between test and push
21
+ - Set Ruby 2.1.5 as default
22
+ - Handle version and help commands, instead of delegate directly to rails new
23
+ - Change from sendgrid to mandrill
24
+ - Removed humans.txt
25
+
26
+ ### bug fixes
27
+
28
+ - Fix pah generating duplicated inflections configuration
29
+ - Fix the import of grid-settings on bitters
30
+
31
+ ## 0.0.18 (yanked)
32
+
3
33
  ## 0.0.17 (October 16, 2014)
4
34
 
5
35
  ### bug fixed
@@ -42,7 +72,7 @@
42
72
  - Move production/staging only gems to the correct group on Gemfile
43
73
 
44
74
 
45
- ### bug fixed
75
+ ### bug fixes
46
76
 
47
77
  - Fix the I18n problem (ref.: https://github.com/rails/rails/issues/13164#issuecomment-39744133)
48
78
  - Error out when `heroku` commands fail to run during app's creation
data/CONTRIBUTING.md CHANGED
@@ -23,15 +23,15 @@ a test!
23
23
 
24
24
  1. Create new Pull Request
25
25
 
26
- At this point you're waiting on us. We like to at least give you feedback, if not just
26
+ At this point you're waiting on us. We like to at least give you feedback, if not just
27
27
  accept it, within a few days, depending on our internal priorities.
28
28
 
29
29
  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/).
30
30
 
31
31
  ## General rules
32
32
 
33
- - Small features and versions upgrades should be done only via PR (without opening an issue before)
34
- - Larger features should be discussed on issues before opening a PR
33
+ - Version upgrade of gems should be done only via PR (without opening an issue before)
34
+ - Features should be discussed on issues before opening a PR. If passed 15 days without interaction on the issue(a comment, a pull request) the issue will be closed.
35
35
  - Every PR of new features/gems should come with the specs/feature of the change
36
36
 
37
37
  ## Removing gems
data/README.md CHANGED
@@ -14,12 +14,21 @@ A Rails application template which was born from [Startup DEV][startupdev] and n
14
14
 
15
15
  ## Instalation
16
16
 
17
- Install PAH with the command:
17
+ Install PAH from rubygems with the command:
18
18
 
19
19
  ```bash
20
20
  $ gem install pah
21
21
  ```
22
22
 
23
+ or install from source with:
24
+
25
+ ```bash
26
+ $ git clone https://github.com/Helabs/pah
27
+ cd ./pah
28
+ bundle install
29
+ bundle exec ./bin/pah ~/path/to/project
30
+ ```
31
+
23
32
  If you're using [RVM see those tips](https://github.com/Helabs/pah/wiki/Using-Pah-with-RVM).
24
33
 
25
34
  ## Usage
@@ -30,7 +39,7 @@ Run:
30
39
  $ pah projectname
31
40
  ```
32
41
 
33
- This will create a Rails 4.1.4 app with Ruby 2.1.3. This script creates a new git repository in the folder `projectname`.
42
+ This will create a Rails 4.1.8 app with Ruby 2.1.5. This script creates a new git repository in the folder `projectname`.
34
43
 
35
44
  :warning: PAH is not meant to be used against an existing repo.
36
45
 
@@ -39,7 +48,7 @@ This will create a Rails 4.1.4 app with Ruby 2.1.3. This script creates a new gi
39
48
  If you're using RVM, create and use a gemset (with the project name) before running PAH:
40
49
 
41
50
  ```bash
42
- $ rvm use 2.1.3@projectname --create
51
+ $ rvm use 2.1.5@projectname --create
43
52
  $ pah projectname
44
53
  ```
45
54
 
data/bin/pah CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- require File.expand_path(File.join('..', 'lib', 'pah', 'version.rb'), File.dirname(__FILE__))
2
+ require File.expand_path(File.join('..', 'lib', 'pah', 'cli.rb'), File.dirname(__FILE__))
3
3
 
4
- template_rb = File.expand_path(File.join('..', 'lib', 'pah', 'rails_template.rb'), File.dirname(__FILE__))
5
- exec "rails _#{::Pah::RAILS_VERSION}_ new #{ARGV[0]} -T -m #{template_rb}"
4
+ Pah::CLI.start(ARGV)
@@ -6,6 +6,7 @@ Feature: Bourbon
6
6
  Scenario: Correct bourbon install
7
7
  Then I have the file app/assets/stylesheets/application.css.scss and contents of this file should include:
8
8
  """
9
+ @import 'normalize-rails';
9
10
  @import 'bourbon';
10
11
  @import 'base/base';
11
12
  @import 'neat';
@@ -16,7 +17,7 @@ Feature: Bourbon
16
17
  """
17
18
  Then I have the file app/assets/stylesheets/base/_base.scss and contents of this file should match:
18
19
  """
19
- @import "grid-settings";
20
+ ^@import "grid-settings";
20
21
  """
21
22
  Then I dont have a app/assets/stylesheets/application.css
22
23
 
@@ -7,5 +7,4 @@ Feature: Capybara
7
7
  Then I have a spec/support/acceptance_helpers.rb
8
8
  Then I have a spec/support/acceptance_macros.rb
9
9
  Then I have a spec/support/capybara.rb
10
- Then I have a spec/support/shared_connection.rb
11
10
  Then I have a spec/acceptance/dummy_spec.rb
@@ -0,0 +1,25 @@
1
+ @no-clobber
2
+ Feature: Commands
3
+ Scenario: --version prompts the versions
4
+ When I run `pah --version`
5
+ Then the output should contain:
6
+ """
7
+ Pah version: 0.0.19
8
+ Rails version: 4.1.8
9
+ Ruby version: 2.1.5
10
+ """
11
+ Scenario: -v prompts the versions
12
+ When I run `pah -v`
13
+ Then the output should contain:
14
+ """
15
+ Pah version: 0.0.19
16
+ Rails version: 4.1.8
17
+ Ruby version: 2.1.5
18
+ """
19
+ Scenario: without args prompt help
20
+ When I run `pah`
21
+ Then the output should contain:
22
+ """
23
+ Usage: pah <project_name> Creates a new rails application using project_name
24
+ [--version|-v] Prompts the pah, rails and ruby version
25
+ """
data/features/env.feature CHANGED
@@ -6,7 +6,7 @@ Feature: Env files
6
6
  Scenario: Create env files
7
7
  Then I have the file .ruby-version and contents of this file should be:
8
8
  """
9
- 2.1.3
9
+ 2.1.5
10
10
 
11
11
  """
12
12
  Then I have the file .ruby-gemset and contents of this file should be:
@@ -6,6 +6,6 @@ Feature: Gemfile
6
6
  Scenario: Correct gems on gemfile
7
7
  Then I have the file Gemfile and contents of this file should include:
8
8
  """
9
- gem 'rails', '4.1.6'
9
+ gem 'rails', '4.1.8'
10
10
  """
11
11
 
@@ -6,9 +6,14 @@ Feature: Inflections
6
6
  Scenario: Add API as acronym
7
7
  Then I have the file config/initializers/inflections.rb and contents of this file should include:
8
8
  """
9
- ActiveSupport::Inflector.inflections do |inflect|
9
+ # end
10
+
11
+ # These inflection rules are supported but not enabled by default:
10
12
  """
11
- Then I have the file config/initializers/inflections.rb and contents of this file should include:
13
+ Then I have the file config/initializers/inflections.rb and contents of this file should end with:
12
14
  """
13
- inflect.acronym 'API'
15
+ ActiveSupport::Inflector.inflections do |inflect|
16
+ inflect.acronym 'API'
17
+ end
18
+
14
19
  """
@@ -18,7 +18,8 @@ Feature: Jumpup
18
18
  jumpup:bundle_install
19
19
  db:migrate
20
20
  spec
21
+ jumpup:git:check_last_commit_change
21
22
  jumpup:heroku:finish
22
23
  jumpup:finish
23
24
  )
24
- """
25
+ """
@@ -10,7 +10,3 @@ Feature: Layout
10
10
  """
11
11
  = page_title(app_name: 'example')
12
12
  """
13
- Then I have the file app/views/layouts/application.html.slim and contents of this file should include:
14
- """
15
- link rel="author" href="/humans.txt"
16
- """
@@ -1,5 +1,5 @@
1
1
  @no-clobber
2
- Feature: SendGrid
2
+ Feature: Mandrill
3
3
  Background:
4
4
  Given I have created the app "myapp" with pah
5
5
 
@@ -5,21 +5,12 @@ Feature: Public
5
5
 
6
6
  Scenario: Have correct files
7
7
  Then I have a public/robots.txt
8
- Then I have a public/humans.txt
9
8
  Then I have a public/404.html
10
9
  Then I have a public/500.html
11
10
  Then I have the file public/robots.txt and contents of this file should include:
12
11
  """
13
12
  Disallow: /admin/
14
13
  """
15
- Then I have the file public/humans.txt and contents of this file should include:
16
- """
17
- /* TEAM */
18
- Developer: HE:labs team
19
- Contact: tech [at] helabs.com.br
20
- Twitter: @helabs
21
- From: Rio de Janeiro, Brazil
22
- """
23
14
  Then I have the file public/404.html and contents of this file should include:
24
15
  """
25
16
  Hmmm... Não achamos a página que você está procurando.
@@ -1,3 +1,4 @@
1
+ @announce
1
2
  @no-clobber
2
3
  Feature: Rails works
3
4
  Background:
@@ -11,5 +11,5 @@ Feature: README
11
11
  """
12
12
  Then I have the file README.md and contents of this file should include:
13
13
  """
14
- Ruby 2.1.3
14
+ Ruby 2.1.5
15
15
  """
@@ -42,7 +42,7 @@ Feature: Run without errors
42
42
  """
43
43
  Then the stdout should contain:
44
44
  """
45
- running heroku addons:add sendgrid:starter --app myapponheroku
45
+ running heroku addons:add mandrill:starter --app myapponheroku
46
46
  """
47
47
  Then the stdout should contain:
48
48
  """
@@ -52,6 +52,14 @@ Feature: Run without errors
52
52
  """
53
53
  running heroku addons:add newrelic:stark --app myapponheroku
54
54
  """
55
+ Then the stdout should contain:
56
+ """
57
+ running heroku addons:add librato --app myapponheroku
58
+ """
59
+ Then the stdout should contain:
60
+ """
61
+ running heroku config:set LIBRATO_SOURCE=myapponheroku --app myapponheroku
62
+ """
55
63
  Then the output should contain:
56
64
  """
57
65
  CONGRATS! INSTALLATION COMPLETE!
@@ -8,6 +8,11 @@ Then(/^I have the file(.* )and contents of this file should include:$/) do |file
8
8
  expect(file_content).to include(content)
9
9
  end
10
10
 
11
+ Then(/^I have the file(.* )and contents of this file should end with:$/) do |file, content|
12
+ file_content = read_from_app(file.strip)
13
+ expect(file_content).to end_with(content)
14
+ end
15
+
11
16
  Then(/^I have the file(.* )and contents of this file should not include:$/) do |file, content|
12
17
  file_content = read_from_app(file.strip)
13
18
  expect(file_content).to_not include(content)
data/lib/pah/cli.rb ADDED
@@ -0,0 +1,14 @@
1
+ require 'pah/commands'
2
+
3
+ module Pah
4
+ class CLI
5
+ class << self
6
+
7
+ def start(argv)
8
+ command = Commands.find_by_name(argv[0])
9
+ command.new.run(argv)
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,22 @@
1
+ module Pah
2
+ class Commands
3
+ class << self
4
+
5
+ def find_by_name(name)
6
+ COMMAND_BY_NAME[name.to_s.strip] || Pah::Commands::App
7
+ end
8
+
9
+ end
10
+ end
11
+ end
12
+
13
+ require 'pah/commands/version'
14
+ require 'pah/commands/help'
15
+ require 'pah/commands/app'
16
+
17
+ COMMAND_BY_NAME = {
18
+ "" => Pah::Commands::Help,
19
+ "-v" => Pah::Commands::Version,
20
+ "--version" => Pah::Commands::Version
21
+ }.freeze
22
+
@@ -0,0 +1,14 @@
1
+ require File.expand_path(File.join('..', '..', '..', 'lib', 'pah', 'version.rb'), File.dirname(__FILE__))
2
+
3
+ module Pah
4
+ class Commands
5
+ class App
6
+
7
+ def run(argv)
8
+ template_rb = File.expand_path(File.join('..', '..', '..', 'lib', 'pah', 'rails_template.rb'), File.dirname(__FILE__))
9
+ exec "rails _#{::Pah::RAILS_VERSION}_ new #{argv[0]} -T -m #{template_rb}"
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ module Pah
2
+ class Commands
3
+ class Help
4
+ BANNER = <<-HEREDOC
5
+ Usage: pah <project_name> Creates a new rails application using project_name
6
+ [--version|-v] Prompts the pah, rails and ruby version
7
+ HEREDOC
8
+
9
+ def run(*)
10
+ puts BANNER
11
+ end
12
+
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,18 @@
1
+ require File.expand_path(File.join('..', '..', '..', 'lib', 'pah', 'version.rb'), File.dirname(__FILE__))
2
+
3
+ module Pah
4
+ class Commands
5
+ class Version
6
+ BANNER = <<-HEREDOC
7
+ Pah version: #{Pah::VERSION}
8
+ Rails version: #{Pah::RAILS_VERSION}
9
+ Ruby version: #{Pah::RUBY_VERSION}
10
+ HEREDOC
11
+
12
+ def run(*)
13
+ puts BANNER
14
+ end
15
+
16
+ end
17
+ end
18
+ end
@@ -2,40 +2,42 @@ source 'https://rubygems.org'
2
2
  ruby 'RUBY_VERSION'
3
3
 
4
4
  gem 'rails', 'RAILS_VERSION'
5
- gem 'puma', '2.9.1'
6
- gem 'secure_headers', '1.3.3'
5
+ gem 'puma', '2.10.2'
6
+ gem 'secure_headers', '1.3.4'
7
7
  gem 'jquery-rails', '3.1.2'
8
- gem 'turbolinks', '2.3.0'
9
- gem 'jbuilder', '2.1.3'
8
+ gem 'turbolinks', '2.5.2'
9
+ gem 'jbuilder', '2.2.5'
10
10
  gem 'slim-rails', '2.1.5'
11
11
  gem 'pg', '0.17.1'
12
12
  gem 'sass-rails', github: 'rails/sass-rails', ref: '57ec3397ff99655890895df29a7bf3f683410256'
13
- gem 'coffee-rails', '4.0.1'
13
+ gem 'coffee-rails', '4.1.0'
14
14
  gem 'uglifier', '2.5.3'
15
- gem 'simple_form', '3.1.0.rc1'
15
+ gem 'simple_form', '3.1.0'
16
16
  gem 'flutie', '2.0.0'
17
17
  gem 'bourbon', '4.0.2'
18
- gem 'neat', '1.6.0'
18
+ gem 'neat', '1.7.0'
19
19
  gem 'bitters', '0.10.1'
20
20
  gem 'refills', '0.0.2'
21
+ gem 'normalize-rails', '3.0.1'
21
22
 
22
23
  group :production, :staging do
23
- gem 'rails_12factor', '0.0.2'
24
+ gem 'rails_12factor', '0.0.3'
24
25
  gem 'rack-canonical-host', '0.1.0'
25
26
  gem 'rack-timeout', github: 'kch/rack-timeout', ref: '83ca9f5141c1fdcb626820b1601c406e3a3a560a'
26
- gem 'newrelic_rpm', '3.9.4.245'
27
- gem 'rollbar', '1.0.1'
27
+ gem 'newrelic_rpm', '3.9.7.266'
28
+ gem 'rollbar', '1.2.10'
29
+ gem 'librato-rails', '0.11.1'
28
30
  end
29
31
 
30
32
  group :development do
31
- gem 'spring', '1.1.3'
32
- gem 'foreman', '0.75.0'
33
- gem 'jumpup', '0.0.7'
33
+ gem 'spring', '1.2.0'
34
+ gem 'foreman', '0.76.0'
35
+ gem 'jumpup', '0.0.8'
34
36
  gem 'jumpup-heroku', '0.0.5'
35
37
  gem 'better_errors', '2.0.0'
36
38
  gem 'binding_of_caller', '0.7.2'
37
39
  gem 'letter_opener', '1.2.0'
38
- gem 'bullet', '4.13.2'
40
+ gem 'bullet', '4.14.0'
39
41
  gem 'quiet_assets', '1.0.3'
40
42
  end
41
43
 
@@ -43,17 +45,17 @@ group :test do
43
45
  gem 'shoulda-matchers', '2.7.0', require: false
44
46
  gem 'simplecov', '0.9.1', require: false
45
47
  gem 'email_spec', '1.6.0'
46
- gem 'capybara', '2.4.3'
48
+ gem 'capybara', '2.4.4'
47
49
  gem 'poltergeist', '1.5.1'
48
50
  gem 'vcr', '2.9.3'
49
- gem 'webmock', '1.18.0'
51
+ gem 'webmock', '1.20.4'
50
52
  gem 'database_cleaner', '1.3.0'
51
53
  end
52
54
 
53
55
  group :development, :test do
54
56
  gem 'rspec-rails', '3.1.0'
55
- gem 'factory_girl_rails', '4.4.1'
57
+ gem 'factory_girl_rails', '4.5.0'
56
58
  gem 'pry-rails', '0.3.2'
57
- gem 'dotenv-rails', '0.11.1'
59
+ gem 'dotenv-rails', '1.0.2'
58
60
  gem 'awesome_print', '1.2.0'
59
61
  end
@@ -9,7 +9,6 @@ html lang="pt"
9
9
  = page_title(app_name: 'example')
10
10
 
11
11
  link href="/favicon.ico" rel=("shortcut icon")
12
- link rel="author" href="/humans.txt"
13
12
 
14
13
  = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
15
14
  = javascript_include_tag 'application', 'data-turbolinks-track' => true
@@ -4,6 +4,7 @@ INTEGRATION_TASKS = %w(
4
4
  jumpup:bundle_install
5
5
  db:migrate
6
6
  spec
7
+ jumpup:git:check_last_commit_change
7
8
  jumpup:heroku:finish
8
9
  jumpup:finish
9
10
  )
@@ -26,7 +26,7 @@ runner.apply_n :capybara, 'Adding capybara helpers...'
26
26
  runner.apply_n :generators, 'Adding generators...'
27
27
  runner.apply_n :simple_form, 'Configuring simple_form...'
28
28
  runner.apply_n :letter_opener, 'Adding letter_opener...'
29
- runner.apply_n :sendgrid, 'Adding sendgrid...'
29
+ runner.apply_n :mandrill, 'Adding mandrill...'
30
30
  runner.apply_n :bullet, 'Setting up bullet...'
31
31
  runner.apply_n :locale, 'Adding locale...'
32
32
  runner.apply_n :canonical_host, 'Configuring canonical hosts...'
@@ -7,6 +7,7 @@ module Pah
7
7
 
8
8
  prepend_to_file application_css_path do
9
9
  <<IMPORTS
10
+ @import 'normalize-rails';
10
11
  @import 'bourbon';
11
12
  @import 'base/base';
12
13
  @import 'neat';
@@ -19,7 +20,7 @@ IMPORTS
19
20
  system 'bundle exec bitters install'
20
21
  end
21
22
 
22
- gsub_file "#{css_path}base/_base.scss", %r{// @import 'grid-settings';}, "@import 'grid-settings';"
23
+ gsub_file "#{css_path}base/_base.scss", %r{// @import "grid-settings";}, '@import "grid-settings";'
23
24
 
24
25
  system "mv #{application_css_path} #{css_path}application.css.scss"
25
26
 
@@ -5,7 +5,6 @@ module Pah
5
5
  copy_static_file 'spec/support/acceptance_helpers.rb'
6
6
  copy_static_file 'spec/support/acceptance_macros.rb'
7
7
  copy_static_file 'spec/support/capybara.rb'
8
- copy_static_file 'spec/support/shared_connection.rb'
9
8
  copy_static_file 'spec/acceptance/dummy_spec.rb'
10
9
 
11
10
  git add: 'spec/'
@@ -1,6 +1,6 @@
1
1
  class HerokuApp < Rails::Generators::AppGenerator
2
2
  DEFAULT_ADDONS = %w(heroku-postgresql:dev pgbackups:auto-month logentries
3
- sendgrid:starter rollbar newrelic:stark)
3
+ mandrill:starter rollbar newrelic:stark librato)
4
4
 
5
5
  attr_reader :name, :description, :config
6
6
 
@@ -12,6 +12,7 @@ class HerokuApp < Rails::Generators::AppGenerator
12
12
  add_secret_token
13
13
  add_timezone_config
14
14
  add_addons
15
+ add_librato_source
15
16
  add_heroku_git_remote
16
17
  check_canonical_domain
17
18
  check_collaborators
@@ -49,6 +50,11 @@ class HerokuApp < Rails::Generators::AppGenerator
49
50
  run "heroku config:set TZ=America/Sao_Paulo --app #{name}"
50
51
  end
51
52
 
53
+ def add_librato_source
54
+ say 'Configuring LIBRATO_SOURCE environment variable on Heroku'.magenta
55
+ run "heroku config:set LIBRATO_SOURCE=#{name} --app #{name}"
56
+ end
57
+
52
58
  def open
53
59
  say 'Pushing application to heroku...'.magenta
54
60
 
@@ -58,6 +64,7 @@ class HerokuApp < Rails::Generators::AppGenerator
58
64
  end
59
65
 
60
66
  private
67
+
61
68
  def run(command)
62
69
  unless system(command)
63
70
  fail "Error while running #{command}"
@@ -9,7 +9,7 @@ ActiveSupport::Inflector.inflections do |inflect|
9
9
  end
10
10
  API_ACRONYM
11
11
 
12
- inject_into_file 'config/initializers/inflections.rb', api_acronym_config, after: /^# end/, verbose: false
12
+ inject_into_file 'config/initializers/inflections.rb', api_acronym_config, after: /'RESTful'\n#\ end\n/, verbose: false
13
13
 
14
14
  git add: 'config/initializers/inflections.rb'
15
15
  git_commit 'Add API acronym to inflections.rb.'
@@ -0,0 +1,26 @@
1
+ module Pah
2
+ module Templates
3
+ class Mandrill < Pah::Template
4
+ def call
5
+ mandrill_config = <<MANDRILL
6
+
7
+ # Mandrill config
8
+ config.action_mailer.default_url_options = { host: ENV['CANONICAL_HOST'] }
9
+ config.action_mailer.smtp_settings = {
10
+ address: 'smtp.mandrillapp.com',
11
+ port: '587',
12
+ authentication: :plain,
13
+ user_name: ENV['MANDRILL_USERNAME'],
14
+ password: ENV['MANDRILL_APIKEY'],
15
+ domain: 'heroku.com'
16
+ }
17
+ MANDRILL
18
+
19
+ inject_into_file 'config/environments/production.rb', mandrill_config, before: /^end/, verbose: false
20
+
21
+ git add: 'config/environments/production.rb'
22
+ git_commit 'Add Mandrill config.'
23
+ end
24
+ end
25
+ end
26
+ end
@@ -4,18 +4,15 @@ module Pah
4
4
  def call
5
5
  inside 'public' do
6
6
  remove_file 'robots.txt'
7
- remove_file 'humans.txt'
8
7
  remove_file '404.html'
9
8
  remove_file '500.html'
10
9
  end
11
10
 
12
11
  copy_static_file 'public/robots.txt'
13
- copy_static_file 'public/humans.txt'
14
12
  copy_static_file 'public/404.html'
15
13
  copy_static_file 'public/500.html'
16
14
 
17
15
  git add: 'public/robots.txt'
18
- git add: 'public/humans.txt'
19
16
  git add: 'public/404.html'
20
17
  git add: 'public/500.html'
21
18
 
data/lib/pah/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Pah
2
- VERSION = '0.0.17'
3
- RUBY_VERSION = '2.1.3'
4
- RAILS_VERSION = '4.1.6'
2
+ VERSION = '0.0.19'
3
+ RUBY_VERSION = '2.1.5'
4
+ RAILS_VERSION = '4.1.8'
5
5
  end
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.17
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - HE:labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-16 00:00:00.000000000 Z
11
+ date: 2014-12-12 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.1.6
19
+ version: 4.1.8
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.1.6
26
+ version: 4.1.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: colored
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -118,6 +118,7 @@ files:
118
118
  - features/bullet.feature
119
119
  - features/canonical_host.feature
120
120
  - features/capybara.feature
121
+ - features/commands.feature
121
122
  - features/database.feature
122
123
  - features/env.feature
123
124
  - features/gemfile.feature
@@ -129,6 +130,7 @@ files:
129
130
  - features/layout.feature
130
131
  - features/letter_opener.feature
131
132
  - features/locale.feature
133
+ - features/mandrill.feature
132
134
  - features/newrelic.feature
133
135
  - features/public.feature
134
136
  - features/puma.feature
@@ -143,7 +145,6 @@ files:
143
145
  - features/runner.feature
144
146
  - features/secret_token.feature
145
147
  - features/secure_headers.feature
146
- - features/sendgrid.feature
147
148
  - features/simple_form.feature
148
149
  - features/step_definitions/create_simple_app.rb
149
150
  - features/step_definitions/file.rb
@@ -152,6 +153,11 @@ files:
152
153
  - features/support/env.rb
153
154
  - features/support/file_helpers.rb
154
155
  - lib/pah.rb
156
+ - lib/pah/cli.rb
157
+ - lib/pah/commands.rb
158
+ - lib/pah/commands/app.rb
159
+ - lib/pah/commands/help.rb
160
+ - lib/pah/commands/version.rb
155
161
  - lib/pah/configuration.rb
156
162
  - lib/pah/files/.env
157
163
  - lib/pah/files/.gitignore
@@ -175,7 +181,6 @@ files:
175
181
  - lib/pah/files/lib/tasks/jumpup.rake
176
182
  - lib/pah/files/public/404.html
177
183
  - lib/pah/files/public/500.html
178
- - lib/pah/files/public/humans.txt
179
184
  - lib/pah/files/public/robots.txt
180
185
  - lib/pah/files/spec/acceptance/dummy_spec.rb
181
186
  - lib/pah/files/spec/rails_helper.rb
@@ -189,7 +194,6 @@ files:
189
194
  - lib/pah/files/spec/support/http_basic_auth.rb
190
195
  - lib/pah/files/spec/support/matchers.rb
191
196
  - lib/pah/files/spec/support/random_timezone.rb
192
- - lib/pah/files/spec/support/shared_connection.rb
193
197
  - lib/pah/files/spec/support/suppress_log.rb
194
198
  - lib/pah/files/spec/support/uploaded_file.rb
195
199
  - lib/pah/files/spec/support/vcr.rb
@@ -213,6 +217,7 @@ files:
213
217
  - lib/pah/templates/layout.rb
214
218
  - lib/pah/templates/letter_opener.rb
215
219
  - lib/pah/templates/locale.rb
220
+ - lib/pah/templates/mandrill.rb
216
221
  - lib/pah/templates/newrelic.rb
217
222
  - lib/pah/templates/public.rb
218
223
  - lib/pah/templates/puma.rb
@@ -224,7 +229,6 @@ files:
224
229
  - lib/pah/templates/ruby_env.rb
225
230
  - lib/pah/templates/secret_token.rb
226
231
  - lib/pah/templates/secure_headers.rb
227
- - lib/pah/templates/sendgrid.rb
228
232
  - lib/pah/templates/simple_form.rb
229
233
  - lib/pah/version.rb
230
234
  - pah.gemspec
@@ -240,7 +244,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
240
244
  requirements:
241
245
  - - ">="
242
246
  - !ruby/object:Gem::Version
243
- version: 2.1.3
247
+ version: 2.1.5
244
248
  required_rubygems_version: !ruby/object:Gem::Requirement
245
249
  requirements:
246
250
  - - ">="
@@ -258,6 +262,7 @@ test_files:
258
262
  - features/bullet.feature
259
263
  - features/canonical_host.feature
260
264
  - features/capybara.feature
265
+ - features/commands.feature
261
266
  - features/database.feature
262
267
  - features/env.feature
263
268
  - features/gemfile.feature
@@ -269,6 +274,7 @@ test_files:
269
274
  - features/layout.feature
270
275
  - features/letter_opener.feature
271
276
  - features/locale.feature
277
+ - features/mandrill.feature
272
278
  - features/newrelic.feature
273
279
  - features/public.feature
274
280
  - features/puma.feature
@@ -283,7 +289,6 @@ test_files:
283
289
  - features/runner.feature
284
290
  - features/secret_token.feature
285
291
  - features/secure_headers.feature
286
- - features/sendgrid.feature
287
292
  - features/simple_form.feature
288
293
  - features/step_definitions/create_simple_app.rb
289
294
  - features/step_definitions/file.rb
@@ -1,5 +0,0 @@
1
- /* TEAM */
2
- Developer: HE:labs team
3
- Contact: tech [at] helabs.com.br
4
- Twitter: @helabs
5
- From: Rio de Janeiro, Brazil
@@ -1,14 +0,0 @@
1
- module ActiveRecord
2
- class Base
3
- mattr_accessor :shared_connection
4
- @@shared_connection = nil
5
-
6
- def self.connection
7
- @@shared_connection || retrieve_connection
8
- end
9
- end
10
- end
11
-
12
- # Forces all threads to share the same connection. This works on
13
- # Capybara because it starts the web server in a thread.
14
- ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
@@ -1,27 +0,0 @@
1
- module Pah
2
- module Templates
3
- class Sendgrid < Pah::Template
4
- def call
5
- sendgrid_config = <<SENDGRID
6
-
7
- # SendGrid config
8
- config.action_mailer.default_url_options = { host: ENV['CANONICAL_HOST'] }
9
- config.action_mailer.smtp_settings = {
10
- address: 'smtp.sendgrid.net',
11
- port: '587',
12
- authentication: :plain,
13
- user_name: ENV['SENDGRID_USERNAME'],
14
- password: ENV['SENDGRID_PASSWORD'],
15
- domain: 'heroku.com',
16
- enable_starttls_auto: true
17
- }
18
- SENDGRID
19
-
20
- inject_into_file 'config/environments/production.rb', sendgrid_config, before: /^end/, verbose: false
21
-
22
- git add: 'config/environments/production.rb'
23
- git_commit 'Add sendgrid config.'
24
- end
25
- end
26
- end
27
- end