potassium 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e744bb4e04fa650c7190cfb645c050d0ff83691f
4
- data.tar.gz: 588d03c4d1385f5d74387ab7720b32d45e3d2df3
3
+ metadata.gz: 61aa3d6c79b9fb3eabc4d1a6994ae6d48cdd858f
4
+ data.tar.gz: afc543181045764487eabbbbca082b4173e2ca11
5
5
  SHA512:
6
- metadata.gz: 49627be487d9b2e423cc51cac06d135ca89b6c1e5e74d1facfd9a504d804ea4956fd6261fb91b1d2b27d9d03e428cadff4a8fc1fc2867d93411082ba730391b6
7
- data.tar.gz: a723bb7e25ab5849b0b19cce675afd27a7083a1564937ed413189756166620dc77763c5cad3f1ea6827ae1065e19fc5ba04605f610797a3a8c7dfb6ae2e94cf0
6
+ metadata.gz: b9b969ee9403a6366abbf0ccd7fec9def9db563571d7d4682c484805efb332bc1f3930211f703ebc81548e7fbe2d498f6b488aa2fca47d2d9cd5e0cc80076036
7
+ data.tar.gz: 018bc293d98cfd61589f9e2bb321d4d567e8c01843a51ed6be2856af6e4a86c8556ffcb88878a7ca82ba33792a73ae20c6b6341a011f8585ffd648c57cb2a87d
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2
1
+ 2.3
data/README.md CHANGED
@@ -61,17 +61,12 @@ The following optional integrations are added too:
61
61
  A few more things are added to the project:
62
62
 
63
63
  - A [low database connection pool limit][pool]
64
- - Setup [Rubocop][rubocop] configuration with Platanus [style guides][rubocop-platanus]
65
- - Setup [Hound CI][platanus-hound] configuration, with Platanus flavour
66
64
  - Setup continuous integration in [CircleCI](circle-ci) to run tests.
67
65
  - Create the github repository for the project (it used `hub` under the hood)
68
66
  - A `bin/setup` script to setup things on a newly cloned project
69
67
  - A `bin/cibuild` script to run continuous integration build on CI
70
68
 
71
69
  [pool]: https://devcenter.heroku.com/articles/concurrency-and-database-connections
72
- [rubocop]: https://github.com/bbatsov/rubocop
73
- [rubocop-platanus]: https://raw.githubusercontent.com/platanus/hound/platanus/config/style_guides/platanus/ruby.yml
74
- [platanus-hound]: http://monkeyci.platan.us
75
70
 
76
71
  ### API support
77
72
 
@@ -21,5 +21,3 @@ production: &deploy
21
21
  pool: <%%= [Integer(ENV.fetch("MAX_THREADS", 5)), Integer(ENV.fetch("DB_POOL", 5))].max %>
22
22
  timeout: 5000
23
23
  url: <%%= ENV.fetch("DATABASE_URL", "") %>
24
-
25
- staging: *deploy
@@ -15,11 +15,9 @@ test:
15
15
  database: <%= get(:underscorized_app_name) %>_test
16
16
 
17
17
  production: &deploy
18
- adapter: mysql2
18
+ adapter: postgresql
19
19
  encoding: utf8
20
20
  min_messages: warning
21
21
  pool: <%%= [Integer(ENV.fetch("MAX_THREADS", 5)), Integer(ENV.fetch("DB_POOL", 5))].max %>
22
22
  timeout: 5000
23
23
  url: <%%= ENV.fetch("DATABASE_URL", "") %>
24
-
25
- staging: *deploy
@@ -20,7 +20,7 @@ preload_app!
20
20
 
21
21
  rackup DefaultRackup
22
22
  port ENV.fetch('PORT', 3000)
23
- environment ENV.fetch("RAILS_ENV", "development")
23
+ environment ENV.fetch("RACK_ENV", "development")
24
24
 
25
25
  on_worker_boot do
26
26
  # Worker specific setup for Rails 4.1+
@@ -7,8 +7,5 @@ development:
7
7
  test:
8
8
  <<: *default
9
9
 
10
- staging:
11
- <<: *default
12
-
13
10
  production:
14
11
  <<: *default
@@ -6,4 +6,4 @@ test:
6
6
  - ./vendor/bundle:/usr/local/bundle
7
7
  - $CIRCLE_TEST_REPORTS/rspec:$HOME/.rspec_reports
8
8
  environment:
9
- RAILS_ENV: test
9
+ RACK_ENV: test
@@ -0,0 +1,44 @@
1
+ if Rails.env.development?
2
+ task :set_annotation_options do
3
+ # You can override any of these by setting an environment variable of the
4
+ # same name.
5
+ Annotate.set_defaults(
6
+ 'routes' => 'false',
7
+ 'position_in_routes' => 'after',
8
+ 'position_in_class' => 'after',
9
+ 'position_in_test' => 'after',
10
+ 'position_in_fixture' => 'after',
11
+ 'position_in_factory' => 'after',
12
+ 'position_in_serializer' => 'after',
13
+ 'show_foreign_keys' => 'true',
14
+ 'show_indexes' => 'true',
15
+ 'simple_indexes' => 'false',
16
+ 'model_dir' => 'app/models',
17
+ 'root_dir' => '',
18
+ 'include_version' => 'false',
19
+ 'require' => '',
20
+ 'exclude_tests' => 'true',
21
+ 'exclude_fixtures' => 'true',
22
+ 'exclude_factories' => 'true',
23
+ 'exclude_serializers' => 'true',
24
+ 'exclude_scaffolds' => 'true',
25
+ 'exclude_controllers' => 'true',
26
+ 'exclude_helpers' => 'false',
27
+ 'ignore_model_sub_dir' => 'false',
28
+ 'ignore_columns' => nil,
29
+ 'ignore_unknown_models' => 'false',
30
+ 'hide_limit_column_types' => 'integer,boolean',
31
+ 'skip_on_db_migrate' => 'false',
32
+ 'format_bare' => 'true',
33
+ 'format_rdoc' => 'false',
34
+ 'format_markdown' => 'false',
35
+ 'sort' => 'false',
36
+ 'force' => 'false',
37
+ 'trace' => 'false',
38
+ 'wrapper_open' => nil,
39
+ 'wrapper_close' => nil
40
+ )
41
+ end
42
+
43
+ Annotate.load_tasks
44
+ end
@@ -1,5 +1,5 @@
1
1
  # This file is copied to spec/ when you run 'rails generate rspec:install'
2
- ENV['RAILS_ENV'] ||= 'test'
2
+ ENV['RACK_ENV'] ||= 'test'
3
3
  require File.expand_path('../../config/environment', __FILE__)
4
4
  require 'rspec/rails'
5
5
  require 'spec_helper'
@@ -51,3 +51,10 @@ RSpec.configure do |config|
51
51
 
52
52
  config.include FactoryGirl::Syntax::Methods
53
53
  end
54
+
55
+ Shoulda::Matchers.configure do |config|
56
+ config.integrate do |with|
57
+ with.test_framework :rspec
58
+ with.library :rails
59
+ end
60
+ end
@@ -0,0 +1,10 @@
1
+ class Recipes::Annotate < Rails::AppBuilder
2
+ def create
3
+ gather_gems(:development) do
4
+ gather_gem('annotate')
5
+ end
6
+
7
+ template '../assets/lib/tasks/auto_annotate_models.rake',
8
+ 'lib/tasks/auto_annotate_models.rake'
9
+ end
10
+ end
@@ -2,7 +2,6 @@ class Recipes::Cleanup < Rails::AppBuilder
2
2
  def create
3
3
  erase_comments "config/application.rb"
4
4
  erase_comments "config/environments/production.rb"
5
- erase_comments "config/environments/staging.rb"
6
5
  erase_comments "config/environments/test.rb"
7
6
  erase_comments "config/environments/development.rb"
8
7
  cut_comments "config/initializers/backtrace_silencers.rb", limit: 100
@@ -34,7 +34,7 @@ class Recipes::Heroku < Rails::AppBuilder
34
34
  private
35
35
 
36
36
  def add_heroku
37
- gather_gems(:production, :staging) do
37
+ gather_gems(:production) do
38
38
  gather_gem('rails_stdout_logging')
39
39
  end
40
40
 
@@ -80,7 +80,7 @@ class Recipes::Heroku < Rails::AppBuilder
80
80
  end
81
81
 
82
82
  def create_app_on_heroku(environment)
83
- rack_env = "RACK_ENV=#{environment} RAILS_ENV=#{environment}"
83
+ rack_env = "RACK_ENV=production"
84
84
  staged_app_name = app_name_for(environment)
85
85
 
86
86
  run_toolbelt_command "create #{staged_app_name} --remote #{environment}"
@@ -2,7 +2,7 @@ class Recipes::Puma < Rails::AppBuilder
2
2
  def create
3
3
  gather_gem 'puma'
4
4
 
5
- gather_gems(:production, :staging) do
5
+ gather_gems(:production) do
6
6
  gather_gem 'rack-timeout'
7
7
  end
8
8
 
@@ -1,9 +1,8 @@
1
1
  class Recipes::Style < Rails::AppBuilder
2
2
  def create
3
- copy_file '../assets/.rubocop.yml', '.rubocop.yml'
4
- copy_file '../assets/.ruby_style.yml', '.ruby_style.yml'
5
- copy_file '../assets/.hound.yml', '.hound.yml'
6
- append_to_file '.gitignore', ".rubocop-http*\n"
3
+ append_to_file ".gitignore", ".rubocop.yml\n"
4
+ append_to_file ".gitignore", ".eslintrc.json\n"
5
+ append_to_file ".gitignore", ".sscs-lint.yml\n"
7
6
  add_readme_header :style_guide
8
7
  end
9
8
 
@@ -29,6 +29,7 @@ run_action(:recipe_loading) do
29
29
  create :style
30
30
  create :puma
31
31
  create :database
32
+ create :annotate
32
33
  create :ruby
33
34
  create :env
34
35
  create :bower
@@ -43,7 +44,6 @@ run_action(:recipe_loading) do
43
44
  create :pundit
44
45
  create :testing
45
46
  create :production
46
- create :staging
47
47
  create :secrets
48
48
  create :git
49
49
  create :api
@@ -63,5 +63,5 @@ end
63
63
 
64
64
  run_action(:database_creation) do
65
65
  run "rake db:create db:migrate"
66
- run "RAILS_ENV=test rake db:create db:migrate"
66
+ run "RACK_ENV=test rake db:create db:migrate"
67
67
  end
@@ -1,6 +1,6 @@
1
1
  module Potassium
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0"
3
3
  RUBY_VERSION = "2.3.1"
4
4
  RAILS_VERSION = "~> 4.2.0"
5
- RUBOCOP_VERSION = "~> 0.38.0"
5
+ RUBOCOP_VERSION = "~> 0.42.0"
6
6
  end
@@ -34,12 +34,10 @@ RSpec.describe "Heroku" do
34
34
 
35
35
  expect(FakeHeroku).to have_configured_vars("staging", "SECRET_KEY_BASE")
36
36
  expect(FakeHeroku).to have_configured_vars("staging", "RACK_ENV")
37
- expect(FakeHeroku).to have_configured_vars("staging", "RAILS_ENV")
38
37
  expect(FakeHeroku).to have_configured_vars("staging", "DEPLOY_TASKS")
39
38
 
40
39
  expect(FakeHeroku).to have_configured_vars("production", "SECRET_KEY_BASE")
41
40
  expect(FakeHeroku).to have_configured_vars("production", "RACK_ENV")
42
- expect(FakeHeroku).to have_configured_vars("production", "RAILS_ENV")
43
41
  expect(FakeHeroku).to have_configured_vars("production", "DEPLOY_TASKS")
44
42
 
45
43
  expect(FakeHeroku).to have_created_pipeline_for("staging")
@@ -18,24 +18,6 @@ RSpec.describe "A new project" do
18
18
  end
19
19
  end
20
20
 
21
- it "configures rubocop" do
22
- rubocop_config_file = IO.read("#{project_path}/.rubocop.yml")
23
-
24
- expect(rubocop_config_file).to include("inherit_from")
25
- expect(rubocop_config_file).to include("style_guides/platanus/ruby.yml")
26
- expect(rubocop_config_file).to include(".ruby_style.yml")
27
- end
28
-
29
- it "set custom ruby style file placeholder" do
30
- expect(File).to exist("#{project_path}/.ruby_style.yml")
31
- end
32
-
33
- it "configures hound" do
34
- hound_config_file = IO.read("#{project_path}/.hound.yml")
35
-
36
- expect(hound_config_file).to include("config_file: .ruby_style.yml")
37
- end
38
-
39
21
  it "configures postgresql" do
40
22
  database_config_file = IO.read("#{project_path}/config/database.yml")
41
23
  gemfile = IO.read("#{project_path}/Gemfile")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: potassium
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - juliogarciag
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-06 00:00:00.000000000 Z
11
+ date: 2016-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.38.0
75
+ version: 0.42.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.38.0
82
+ version: 0.42.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rails
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -174,11 +174,8 @@ extra_rdoc_files: []
174
174
  files:
175
175
  - ".editorconfig"
176
176
  - ".gitignore"
177
- - ".hound.yml"
178
177
  - ".rspec"
179
- - ".rubocop.yml"
180
178
  - ".ruby-version"
181
- - ".ruby_style.yml"
182
179
  - CHANGELOG.md
183
180
  - Gemfile
184
181
  - LICENSE.txt
@@ -194,10 +191,7 @@ files:
194
191
  - lib/potassium/assets/.dockerignore
195
192
  - lib/potassium/assets/.editorconfig
196
193
  - lib/potassium/assets/.env.development.erb
197
- - lib/potassium/assets/.hound.yml
198
194
  - lib/potassium/assets/.pryrc
199
- - lib/potassium/assets/.rubocop.yml
200
- - lib/potassium/assets/.ruby_style.yml
201
195
  - lib/potassium/assets/Dockerfile.ci
202
196
  - lib/potassium/assets/Procfile
203
197
  - lib/potassium/assets/README.md.erb
@@ -217,11 +211,11 @@ files:
217
211
  - lib/potassium/assets/circle.yml
218
212
  - lib/potassium/assets/config/database_mysql.yml.erb
219
213
  - lib/potassium/assets/config/database_postgresql.yml.erb
220
- - lib/potassium/assets/config/environments/staging.rb
221
214
  - lib/potassium/assets/config/puma.rb
222
215
  - lib/potassium/assets/config/secrets.yml.erb
223
216
  - lib/potassium/assets/docker-compose.ci.yml
224
217
  - lib/potassium/assets/es.yml
218
+ - lib/potassium/assets/lib/tasks/auto_annotate_models.rake
225
219
  - lib/potassium/assets/testing/.rspec
226
220
  - lib/potassium/assets/testing/rails_helper.rb
227
221
  - lib/potassium/cli.rb
@@ -243,6 +237,7 @@ files:
243
237
  - lib/potassium/recipe.rb
244
238
  - lib/potassium/recipes/admin.rb
245
239
  - lib/potassium/recipes/angular_admin.rb
240
+ - lib/potassium/recipes/annotate.rb
246
241
  - lib/potassium/recipes/api.rb
247
242
  - lib/potassium/recipes/aws_sdk.rb
248
243
  - lib/potassium/recipes/bower.rb
@@ -267,7 +262,6 @@ files:
267
262
  - lib/potassium/recipes/ruby.rb
268
263
  - lib/potassium/recipes/script.rb
269
264
  - lib/potassium/recipes/secrets.rb
270
- - lib/potassium/recipes/staging.rb
271
265
  - lib/potassium/recipes/style.rb
272
266
  - lib/potassium/recipes/testing.rb
273
267
  - lib/potassium/template_finder.rb
@@ -306,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
306
300
  version: '0'
307
301
  requirements: []
308
302
  rubyforge_project:
309
- rubygems_version: 2.5.2
303
+ rubygems_version: 2.5.1
310
304
  signing_key:
311
305
  specification_version: 4
312
306
  summary: An application generator from Platanus
@@ -321,4 +315,3 @@ test_files:
321
315
  - spec/support/fake_github.rb
322
316
  - spec/support/fake_heroku.rb
323
317
  - spec/support/potassium_test_helpers.rb
324
- has_rdoc:
data/.hound.yml DELETED
@@ -1,2 +0,0 @@
1
- ruby:
2
- config_file: .ruby_style.yml
data/.rubocop.yml DELETED
@@ -1,3 +0,0 @@
1
- inherit_from:
2
- - https://raw.githubusercontent.com/platanus/hound/platanus/config/style_guides/platanus/ruby.yml
3
- - .ruby_style.yml
data/.ruby_style.yml DELETED
@@ -1,6 +0,0 @@
1
- Rails:
2
- Enabled: false
3
- Metrics/MethodLength:
4
- Enabled: false
5
- Metrics/AbcSize:
6
- Enabled: false
@@ -1,2 +0,0 @@
1
- ruby:
2
- config_file: .ruby_style.yml
@@ -1,3 +0,0 @@
1
- inherit_from:
2
- - https://raw.githubusercontent.com/platanus/hound/platanus/config/style_guides/platanus/ruby.yml
3
- - .ruby_style.yml
File without changes
@@ -1,5 +0,0 @@
1
- require_relative "production"
2
-
3
- Rails.application.configure do
4
- # ...
5
- end
@@ -1,5 +0,0 @@
1
- class Recipes::Staging < Rails::AppBuilder
2
- def create
3
- copy_file '../assets/config/environments/staging.rb', "config/environments/staging.rb"
4
- end
5
- end