mecha 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/bin/mecha +7 -3
- data/lib/mecha/app_builder.rb +2 -1
- data/lib/mecha/support/string.rb +2 -1
- data/lib/mecha/templates/README.md.erb +1 -1
- data/lib/mecha/templates/bitbucket-pipelines.yml.erb +3 -3
- data/lib/mecha/templates/config/databases/postgresql.ci.yml.erb +11 -0
- data/lib/mecha/templates/config/databases/postgresql.yml.erb +1 -4
- data/lib/mecha/version.rb +1 -1
- data/lib/mecha.rb +1 -1
- data/mecha.gemspec +4 -3
- metadata +14 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e461461b41e1ee3f08ca4c3fd3ff2a786c74dae4
|
4
|
+
data.tar.gz: f6910fd26d550b55c053f729b67c9585f2585b10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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', '
|
10
|
-
o.bool '-bp', '--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
|
data/lib/mecha/app_builder.rb
CHANGED
@@ -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
|
|
data/lib/mecha/support/string.rb
CHANGED
@@ -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
|
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
|
19
|
-
- bundle exec
|
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['
|
26
|
+
password: <%%= ENV['POSTGRESQL_PASSWORD'] %>
|
data/lib/mecha/version.rb
CHANGED
data/lib/mecha.rb
CHANGED
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'
|
33
|
-
spec.add_development_dependency 'rake'
|
34
|
-
spec.add_development_dependency 'minitest'
|
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
|
+
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: '
|
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: '
|
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: '
|
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: '
|
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: '
|
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: '
|
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
|