mecha 0.4.0 → 0.5.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fbcf2b45c57741a3fdd4e2e8a925799b6bff3dc
4
- data.tar.gz: 0c008950d2c7a33540eb9502d6c8a0a3eca1d8ab
3
+ metadata.gz: e461461b41e1ee3f08ca4c3fd3ff2a786c74dae4
4
+ data.tar.gz: f6910fd26d550b55c053f729b67c9585f2585b10
5
5
  SHA512:
6
- metadata.gz: 421ca89e1e32d11925a7ee7858a85d859190ccd4accfd089e38dcb810e30ebf072d93b72bb5bfdcdb734a93a29a3402f764a6504f3835472a9561d4a237b0da5
7
- data.tar.gz: 0c69d84f1ee92116ec408e6e8bad688e0a7b2f0e581b881161e73348505b45abab082d5e7b20ae4f73077e566363c7fa4267e288431a06144086df4a41a76924
6
+ metadata.gz: 6c5264e23e41413986231588de9dd64639d32ed04b80ca9354d4237775b7c3731e96e56d7ce63802c282ab4c6beb1e64664f7c66b751aeb0276fa9b0494a7332
7
+ data.tar.gz: b59e0005c3f3da57bcd6d59fc871fd816232b73143c21989c0519909990996468c7f9db71310d781b68a960ac504586df45bb4a24b37756c563c82b053868231
data/README.md CHANGED
@@ -40,6 +40,7 @@ Bug reports and pull requests are welcome on [GitHub](https://github.com/magrath
40
40
  intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the
41
41
  [Contributor Covenant](http://contributor-covenant.org) code of conduct.
42
42
 
43
+
43
44
  ## License
44
45
 
45
46
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/bin/mecha CHANGED
@@ -6,12 +6,16 @@ require 'slop'
6
6
  require 'mecha'
7
7
 
8
8
  Mecha.opts = Slop.parse do |o|
9
- o.bool '-d', '--devise', 'Install and config Devise'
10
- o.bool '-bp', '--bitbucket-pipelines', 'Config Bitbucket Pipelines'
11
- o.on '--version', 'print the version' do
9
+ o.bool '-d', '--devise', 'install and config Devise'
10
+ o.bool '-bp', '--bitbucket-pipelines', 'config Bitbucket Pipelines'
11
+ o.on '--version', 'print the gem version' do
12
12
  puts Mecha::VERSION
13
13
  exit
14
14
  end
15
+ o.on '--help', 'list options' do
16
+ puts o
17
+ exit
18
+ end
15
19
  end
16
20
 
17
21
  Mecha.config_templates_path
@@ -45,6 +45,7 @@ module Mecha
45
45
  def database_yml
46
46
  template "config/databases/#{options[:database]}.yml.erb", 'config/database.example.yml'
47
47
  template "config/databases/#{options[:database]}.yml.erb", 'config/database.yml'
48
+ template "config/databases/#{options[:database]}.ci.yml.erb", 'config/database.ci.yml'
48
49
  end
49
50
 
50
51
  def gemfile
@@ -68,9 +69,9 @@ module Mecha
68
69
  config_application
69
70
  config_bitbucket_pipelines
70
71
  config_devise
71
- config_simplecov
72
72
  config_guardfile
73
73
  config_rubocop
74
+ config_simplecov
74
75
  config_test
75
76
  end
76
77
 
@@ -6,7 +6,8 @@ class String
6
6
  #
7
7
  # @return [String] the object converted to underscore format.
8
8
  def underscore
9
- tr('-', '_')
9
+ gsub(/([a-z\d])([A-Z])/, '\1_\2')
10
+ .tr('-', '_')
10
11
  .gsub(/\s/, '_')
11
12
  .gsub(/__+/, '_')
12
13
  .downcase
@@ -65,7 +65,7 @@ We're using Heroku as Staging environment. Take a look in the
65
65
 
66
66
  ```sh
67
67
  git push heroku master
68
- heroku run rake db:migrate
68
+ heroku run rails db:migrate
69
69
  ```
70
70
 
71
71
  ## Style
@@ -10,10 +10,10 @@ pipelines:
10
10
  - /etc/init.d/postgresql start
11
11
  - sudo -u postgres sh -c 'createuser <%= app_name.underscore %>_test & createdb <%= app_name.underscore %>_test'
12
12
  - sudo -u postgres psql -c "ALTER USER <%= app_name.underscore %>_test PASSWORD '<%= app_name.underscore %>_test' CREATEDB SUPERUSER;"
13
- - cp config/database.yml.example config/database.yml
13
+ - cp config/database.ci.yml config/database.yml
14
14
  - apt-get update -yqqq
15
15
  - apt-get -qq -y --force-yes install apt-utils bzip2 nodejs-legacy npm
16
16
  - npm install -g phantomjs-prebuilt
17
17
  - bundle install --jobs $(nproc)
18
- - bundle exec rake db:schema:load RAILS_ENV=test
19
- - bundle exec rake test
18
+ - bundle exec rails db:schema:load RAILS_ENV=test
19
+ - bundle exec rails test
@@ -0,0 +1,11 @@
1
+ test:
2
+ adapter: postgresql
3
+ encoding: unicode
4
+ pool: <%%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
5
+ encoding: utf8
6
+ host: localhost
7
+ timeout: 5000
8
+ database: <%= app_name.underscore %>_test
9
+ username: <%= app_name.underscore %>_test
10
+ password: <%= app_name.underscore %>_test
11
+ template: template0
@@ -18,12 +18,9 @@ test:
18
18
  host: localhost
19
19
  timeout: 5000
20
20
  database: <%= app_name.underscore %>_test
21
- username: <%= app_name.underscore %>_test
22
- password: <%= app_name.underscore %>_test
23
- template: template0
24
21
 
25
22
  production:
26
23
  <<: *default
27
24
  database: <%= app_name.underscore %>_production
28
25
  username: <%= app_name.underscore %>
29
- password: <%%= ENV['KAVO_DATABASE_PASSWORD'] %>
26
+ password: <%%= ENV['POSTGRESQL_PASSWORD'] %>
data/lib/mecha/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Mecha
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  RUBY_VERSION = '>= 2.4'.freeze
4
4
  RAILS_VERSION = '~> 5.0.0'.freeze
5
5
  end
data/lib/mecha.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'mecha/version'
2
- require 'mecha/support/string'
3
2
  require 'mecha/generators/app_generator'
4
3
  require 'mecha/app_builder'
4
+ require 'mecha/support/string'
5
5
 
6
6
  module Mecha
7
7
  @opts = nil
data/mecha.gemspec CHANGED
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'mecha/version'
@@ -29,7 +30,7 @@ Gem::Specification.new do |spec|
29
30
  spec.add_dependency 'rails', Mecha::RAILS_VERSION
30
31
  spec.add_dependency 'slop'
31
32
 
32
- spec.add_development_dependency 'bundler', '~> 1.14'
33
- spec.add_development_dependency 'rake', '~> 12.0'
34
- spec.add_development_dependency 'minitest', '~> 5.0'
33
+ spec.add_development_dependency 'bundler'
34
+ spec.add_development_dependency 'rake'
35
+ spec.add_development_dependency 'minitest'
35
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mecha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magrathea Labs
@@ -42,44 +42,44 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.14'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.14'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '12.0'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '12.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '5.0'
75
+ version: '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: '5.0'
82
+ version: '0'
83
83
  description: Mecha is used by MLabs to bootstrap working apps with our defaults.
84
84
  email:
85
85
  - contact@magrathealabs.com
@@ -109,6 +109,7 @@ files:
109
109
  - lib/mecha/templates/Guardfile
110
110
  - lib/mecha/templates/README.md.erb
111
111
  - lib/mecha/templates/bitbucket-pipelines.yml.erb
112
+ - lib/mecha/templates/config/databases/postgresql.ci.yml.erb
112
113
  - lib/mecha/templates/config/databases/postgresql.yml.erb
113
114
  - lib/mecha/templates/rubocop.yml
114
115
  - lib/mecha/templates/simplecov