generapp 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -4
- data/.rubocop_todo.yml +5 -24
- data/.ruby-version +1 -1
- data/.travis.yml +1 -1
- data/CHANGELOG.md +17 -0
- data/Gemfile +1 -0
- data/Rakefile +1 -0
- data/bin/generapp +1 -0
- data/generapp.gemspec +2 -1
- data/lib/generapp/actions/configuration.rb +6 -2
- data/lib/generapp/actions/database.rb +1 -0
- data/lib/generapp/actions/develop.rb +6 -1
- data/lib/generapp/actions/production.rb +1 -0
- data/lib/generapp/actions/test.rb +1 -0
- data/lib/generapp/actions/views.rb +11 -0
- data/lib/generapp/app_builder.rb +4 -1
- data/lib/generapp/generators/app_generator.rb +1 -0
- data/lib/generapp/version.rb +2 -2
- data/lib/generapp.rb +1 -0
- data/templates/CONTRIBUTING.md +60 -0
- data/templates/Gemfile.erb +2 -2
- data/templates/README.md.erb +8 -1
- data/templates/RELEASING.md +23 -0
- data/templates/bin/setup +30 -0
- data/templates/circle.yml +1 -1
- data/templates/config/application.yml +1 -4
- data/templates/config/puma.rb +1 -0
- data/templates/config/version.rb.erb +8 -0
- data/templates/generapp_gitignore +0 -7
- data/templates/public/{manifest.json → manifest.json.erb} +1 -1
- data/templates/spec/database_cleaner.rb +1 -0
- data/templates/spec/devise.rb +1 -0
- data/templates/spec/rails_helper.rb +1 -0
- data/templates/spec/shoulda_matchers_config.rb +1 -0
- data/templates/tasks/auto_annotate_models.rake +1 -0
- data/templates/tasks/bundler_audit.rake +1 -0
- data/templates/views/_head.html.erb.erb +3 -4
- metadata +9 -8
- data/.hound.yml +0 -2
- data/.rubocop_defaults.yml +0 -1631
- data/templates/Procfile.dev +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4f1fe0fc28a191ec82da9cd272336fc8e5c010a
|
4
|
+
data.tar.gz: 3f1e6427e22485d87d3fe14d4755692539c52af5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32a11439297b5aae323a5b9101408fbc2928e7ecde7b53adb5dff360ea351ee2f040333c7605aace9356ac4f2de6845139b154671369bc7ee6409a48a792ca6e
|
7
|
+
data.tar.gz: 43dfc60ef2bace760290f263bf582a6316eb5f9e1f2a0fcfe29ba105593c7b4d624ac54545d88c5141ad54d4aeec3715cc6d35b20ee990b8ab8e6cec500a003e
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2016-
|
3
|
+
# on 2016-05-02 09:43:28 -0500 using RuboCop version 0.39.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -11,10 +11,11 @@
|
|
11
11
|
Metrics/ClassLength:
|
12
12
|
Max: 109
|
13
13
|
|
14
|
-
# Offense count:
|
15
|
-
# Configuration parameters: AllowURI, URISchemes.
|
14
|
+
# Offense count: 6
|
15
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
16
|
+
# URISchemes: http, https
|
16
17
|
Metrics/LineLength:
|
17
|
-
Max:
|
18
|
+
Max: 92
|
18
19
|
|
19
20
|
# Offense count: 2
|
20
21
|
# Configuration parameters: CountComments.
|
@@ -25,23 +26,3 @@ Metrics/MethodLength:
|
|
25
26
|
Style/AccessorMethodName:
|
26
27
|
Exclude:
|
27
28
|
- 'lib/generapp/generators/app_generator.rb'
|
28
|
-
|
29
|
-
# Offense count: 1
|
30
|
-
# Cop supports --auto-correct.
|
31
|
-
# Configuration parameters: AllowForAlignment.
|
32
|
-
Style/ExtraSpacing:
|
33
|
-
Exclude:
|
34
|
-
- 'templates/config/puma.rb'
|
35
|
-
|
36
|
-
# Offense count: 2
|
37
|
-
# Cop supports --auto-correct.
|
38
|
-
Style/SingleSpaceBeforeFirstArg:
|
39
|
-
Exclude:
|
40
|
-
- 'templates/config/puma.rb'
|
41
|
-
|
42
|
-
# Offense count: 2
|
43
|
-
# Cop supports --auto-correct.
|
44
|
-
# Configuration parameters: MultiSpaceAllowedForOperators.
|
45
|
-
Style/SpaceAroundOperators:
|
46
|
-
Exclude:
|
47
|
-
- 'templates/config/puma.rb'
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.1
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
### master
|
2
2
|
|
3
|
+
### 0.3.1 - 2016-05-02
|
4
|
+
|
5
|
+
* enhances
|
6
|
+
* Add RELEASING and CONTRIBUTING docs to generated app
|
7
|
+
* Improve integration with circleci
|
8
|
+
* Add file to track app version to generated app (`config/initializer/version.rb`)
|
9
|
+
* Add setup script
|
10
|
+
* Update to Ruby 2.3.1
|
11
|
+
|
12
|
+
### 0.3.0 - 2016-01-15
|
13
|
+
|
14
|
+
* enhances
|
15
|
+
* Improve annotate defaults
|
16
|
+
* Improve hound code review
|
17
|
+
* Improve code base
|
18
|
+
* Integrate coverage with circle ci
|
19
|
+
|
3
20
|
### 0.2.0 - 2016-01-13
|
4
21
|
|
5
22
|
* bug fixes
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/bin/generapp
CHANGED
data/generapp.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'generapp/version'
|
@@ -29,6 +30,6 @@ Feel free to use it to jump start your project and don't waste any time configur
|
|
29
30
|
spec.add_dependency 'rails', Generapp::RAILS_VERSION
|
30
31
|
spec.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0'
|
31
32
|
spec.add_development_dependency 'rubocop', '~> 0.35', '>= 0.35'
|
32
|
-
spec.add_development_dependency 'coveralls', '~>0.8.0', '>= 0.8.0'
|
33
|
+
spec.add_development_dependency 'coveralls', '~> 0.8.0', '>= 0.8.0'
|
33
34
|
spec.add_development_dependency 'yard', '~> 0.8.7', '>= 0.8.0'
|
34
35
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Generapp
|
2
3
|
module Actions #:nodoc
|
3
4
|
# App configuration associated actions
|
@@ -12,9 +13,12 @@ module Generapp
|
|
12
13
|
copy_file 'config/puma.rb', 'config/puma.rb'
|
13
14
|
end
|
14
15
|
|
15
|
-
def
|
16
|
+
def set_up_version
|
17
|
+
template 'config/version.rb.erb', 'config/initializers/version.rb'
|
18
|
+
end
|
19
|
+
|
20
|
+
def set_up_procfile
|
16
21
|
copy_file 'Procfile', 'Procfile'
|
17
|
-
copy_file 'Procfile.dev', 'Procfile.dev'
|
18
22
|
end
|
19
23
|
|
20
24
|
def generate_devise
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
module Generapp
|
3
3
|
module Actions #:nodoc
|
4
4
|
# App develop environment
|
@@ -44,6 +44,11 @@ module Generapp
|
|
44
44
|
copy_file 'config/application.yml', 'config/application.yml'
|
45
45
|
end
|
46
46
|
|
47
|
+
def provide_setup_script
|
48
|
+
template 'bin/setup', 'bin/setup', force: true
|
49
|
+
run 'chmod a+x bin/setup'
|
50
|
+
end
|
51
|
+
|
47
52
|
protected
|
48
53
|
|
49
54
|
def generapp_generators
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Generapp
|
2
3
|
module Actions #:nodoc
|
3
4
|
# App views configuration
|
@@ -27,6 +28,16 @@ module Generapp
|
|
27
28
|
'app/views/layouts/application.html.erb',
|
28
29
|
force: true
|
29
30
|
end
|
31
|
+
|
32
|
+
def create_humans_txt
|
33
|
+
copy_file 'public/humans.txt',
|
34
|
+
'public/humans.txt'
|
35
|
+
end
|
36
|
+
|
37
|
+
def create_manifest
|
38
|
+
template 'public/manifest.json.erb',
|
39
|
+
'public/manifest.json'
|
40
|
+
end
|
30
41
|
end
|
31
42
|
end
|
32
43
|
end
|
data/lib/generapp/app_builder.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'rails/generators/rails/app/app_generator'
|
2
3
|
|
3
4
|
module Generapp
|
@@ -12,10 +13,12 @@ module Generapp
|
|
12
13
|
|
13
14
|
def readme
|
14
15
|
template 'README.md.erb', 'README.md'
|
16
|
+
copy_file 'RELEASING.md', 'RELEASING.md'
|
17
|
+
copy_file 'CONTRIBUTING.md', 'CONTRIBUTING.md'
|
15
18
|
end
|
16
19
|
|
17
20
|
def gitignore
|
18
|
-
|
21
|
+
copy_file 'generapp_gitignore', '.gitignore'
|
19
22
|
end
|
20
23
|
|
21
24
|
def gemfile
|
data/lib/generapp/version.rb
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
# with some of Koombea's standards and practices
|
6
6
|
module Generapp
|
7
7
|
# Default Rails Version
|
8
|
-
RAILS_VERSION = '~> 4.2.0'
|
8
|
+
RAILS_VERSION = '~> 4.2.0'
|
9
9
|
# Default Ruby Version
|
10
10
|
RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
|
11
11
|
# Gem Version
|
12
|
-
VERSION = '0.3.
|
12
|
+
VERSION = '0.3.1'
|
13
13
|
end
|
data/lib/generapp.rb
CHANGED
@@ -0,0 +1,60 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
We try to keep master as a reflection of production and all work is done in the develop branch.
|
4
|
+
To facilitate this work you can install `git flow`, a series of commands on top of git
|
5
|
+
that allow feature branching and versioning release
|
6
|
+
|
7
|
+
Make your change. Write tests. Follow the [ruby style guide](https://github.com/bbatsov/ruby-style-guide).
|
8
|
+
|
9
|
+
## Install git-flow
|
10
|
+
|
11
|
+
Check [git flow page](https://github.com/nvie/gitflow/wiki/Installation) for instructions
|
12
|
+
|
13
|
+
## Initialize git-flow
|
14
|
+
|
15
|
+
```sh
|
16
|
+
$ git flow init
|
17
|
+
```
|
18
|
+
|
19
|
+
### Features:
|
20
|
+
|
21
|
+
Every new change should be done in a feature branch,
|
22
|
+
these are the instructions for working with features and git flow
|
23
|
+
|
24
|
+
+ Start a new feature from the 'develop' branch:
|
25
|
+
|
26
|
+
```sh
|
27
|
+
$ git flow feature start <your feature>
|
28
|
+
```
|
29
|
+
|
30
|
+
This action creates a new feature branch based on 'develop' and switches to it.
|
31
|
+
|
32
|
+
+ Publish a feature:
|
33
|
+
|
34
|
+
```sh
|
35
|
+
$ git flow feature publish <your feature>
|
36
|
+
```
|
37
|
+
|
38
|
+
Publish a feature to the remote server so it can be used or reviewed by other users.
|
39
|
+
|
40
|
+
+ Getting a published feature:
|
41
|
+
|
42
|
+
```sh
|
43
|
+
$ git flow feature pull origin <your feature>
|
44
|
+
```
|
45
|
+
|
46
|
+
Get a feature published by another user.
|
47
|
+
|
48
|
+
+ Finish a feature:
|
49
|
+
|
50
|
+
```sh
|
51
|
+
$ git flow feature finish <your feature>
|
52
|
+
```
|
53
|
+
|
54
|
+
- Merged <your feature> into 'develop'.
|
55
|
+
- Removes the feature branch.
|
56
|
+
- Switches back to 'develop' branch.
|
57
|
+
|
58
|
+
## More
|
59
|
+
|
60
|
+
On using git flow: http://nvie.com/posts/a-successful-git-branching-model/
|
data/templates/Gemfile.erb
CHANGED
@@ -18,7 +18,7 @@ group :development do
|
|
18
18
|
gem 'better_errors'
|
19
19
|
gem 'binding_of_caller'
|
20
20
|
gem 'bullet' # N+1 queries reporter
|
21
|
-
gem 'lol_dba'
|
21
|
+
gem 'lol_dba' # Missing index reporter
|
22
22
|
gem 'quiet_assets'
|
23
23
|
gem 'rails-erd' # ER Diagrams
|
24
24
|
gem 'spring'
|
@@ -29,7 +29,6 @@ group :development, :test do
|
|
29
29
|
gem 'bundler-audit', require: false
|
30
30
|
gem 'factory_girl_rails'
|
31
31
|
gem 'figaro' # Secrets
|
32
|
-
gem 'foreman'
|
33
32
|
gem 'pry-rails'
|
34
33
|
gem 'pry-remote'
|
35
34
|
gem 'rspec-rails'
|
@@ -38,6 +37,7 @@ end
|
|
38
37
|
group :test do
|
39
38
|
gem 'database_cleaner'
|
40
39
|
gem 'faker'
|
40
|
+
gem 'rspec_junit_formatter', '~> 0.2.2'
|
41
41
|
gem 'shoulda-matchers'
|
42
42
|
gem 'simplecov', require: false
|
43
43
|
gem 'timecop' # Time manipulation
|
data/templates/README.md.erb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
# Releasing
|
2
|
+
|
3
|
+
Check the version number on `config/initializers/version.rb` then start the release for the next version.
|
4
|
+
Remember to follow [semantic versioning](config/initializers/version.rb).
|
5
|
+
|
6
|
+
```sh
|
7
|
+
$ git flow release start <version>
|
8
|
+
```
|
9
|
+
|
10
|
+
Update `config/initializers/version.rb` with the new version number and commit your changes.
|
11
|
+
|
12
|
+
```sh
|
13
|
+
$ git commit -am "Bump version to <version>"
|
14
|
+
$ git flow release finish <version>
|
15
|
+
```
|
16
|
+
|
17
|
+
Indicate changes when prompted and then push to remotes
|
18
|
+
|
19
|
+
```sh
|
20
|
+
$ git push origin master
|
21
|
+
$ git push origin develop
|
22
|
+
$ git push --tags
|
23
|
+
```
|
data/templates/bin/setup
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
require 'pathname'
|
4
|
+
|
5
|
+
# path to your application root.
|
6
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
7
|
+
|
8
|
+
Dir.chdir APP_ROOT do
|
9
|
+
# This script is a starting point to setup your application.
|
10
|
+
# Add necessary setup steps to this file:
|
11
|
+
|
12
|
+
puts '== Installing dependencies =='
|
13
|
+
system 'gem install bundler --conservative'
|
14
|
+
system 'bundle check || bundle install'
|
15
|
+
|
16
|
+
puts "\n== Copying sample application secrets =="
|
17
|
+
unless File.exist?('config/application.yml')
|
18
|
+
system 'cp config/application.yml.example config/application.yml'
|
19
|
+
end
|
20
|
+
|
21
|
+
puts "\n== Preparing database =="
|
22
|
+
system 'bin/rake db:setup'
|
23
|
+
|
24
|
+
puts "\n== Removing old logs and tempfiles =="
|
25
|
+
system 'rm -f log/*'
|
26
|
+
system 'rm -rf tmp/cache'
|
27
|
+
|
28
|
+
puts "\n== Restarting application server =="
|
29
|
+
system 'touch tmp/restart.txt'
|
30
|
+
end
|
data/templates/circle.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
defaults: &defaults
|
2
|
-
DB_POOL: '
|
2
|
+
DB_POOL: '10' # Max number of active DB connection
|
3
3
|
MAX_THREADS: '3' # Puma max number of threads
|
4
4
|
REAPING_FREQUENCY: '5' # Enable database reaping connections
|
5
5
|
WEB_CONCURRENCY: '2' # Puma processes
|
@@ -10,8 +10,5 @@ development:
|
|
10
10
|
test:
|
11
11
|
<<: *defaults
|
12
12
|
|
13
|
-
staging:
|
14
|
-
<<: *defaults
|
15
|
-
|
16
13
|
production:
|
17
14
|
<<: *defaults
|
data/templates/config/puma.rb
CHANGED
data/templates/spec/devise.rb
CHANGED
@@ -20,11 +20,10 @@
|
|
20
20
|
<meta name="theme-color" content="#fff">
|
21
21
|
|
22
22
|
<meta name="robots" content="index,follow">
|
23
|
-
<meta name="description" content="
|
24
|
-
<meta name="keywords" content="
|
25
|
-
<link rel="author" href="humans.txt" />
|
23
|
+
<meta name="description" content="">
|
24
|
+
<meta name="keywords" content="">
|
25
|
+
<link rel="author" href="/humans.txt" />
|
26
26
|
|
27
27
|
<%%= stylesheet_link_tag 'application' %>
|
28
28
|
<%%= csrf_meta_tags %>
|
29
29
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
30
|
-
<link href='https://fonts.googleapis.com/css?family=Roboto:400,700,300' rel='stylesheet' type='text/css'>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: generapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gustavo Bazan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -130,10 +130,8 @@ extra_rdoc_files: []
|
|
130
130
|
files:
|
131
131
|
- ".coveralls.yml"
|
132
132
|
- ".gitignore"
|
133
|
-
- ".hound.yml"
|
134
133
|
- ".rspec"
|
135
134
|
- ".rubocop.yml"
|
136
|
-
- ".rubocop_defaults.yml"
|
137
135
|
- ".rubocop_todo.yml"
|
138
136
|
- ".ruby-version"
|
139
137
|
- ".travis.yml"
|
@@ -157,19 +155,22 @@ files:
|
|
157
155
|
- lib/generapp/app_builder.rb
|
158
156
|
- lib/generapp/generators/app_generator.rb
|
159
157
|
- lib/generapp/version.rb
|
158
|
+
- templates/CONTRIBUTING.md
|
160
159
|
- templates/Gemfile.erb
|
161
160
|
- templates/Procfile
|
162
|
-
- templates/Procfile.dev
|
163
161
|
- templates/README.md.erb
|
162
|
+
- templates/RELEASING.md
|
164
163
|
- templates/application.scss
|
164
|
+
- templates/bin/setup
|
165
165
|
- templates/circle.yml
|
166
166
|
- templates/config/application.yml
|
167
167
|
- templates/config/newrelic.yml.erb
|
168
168
|
- templates/config/postgresql_database.yml.erb
|
169
169
|
- templates/config/puma.rb
|
170
|
+
- templates/config/version.rb.erb
|
170
171
|
- templates/generapp_gitignore
|
171
172
|
- templates/public/humans.txt
|
172
|
-
- templates/public/manifest.json
|
173
|
+
- templates/public/manifest.json.erb
|
173
174
|
- templates/simplecov
|
174
175
|
- templates/spec/database_cleaner.rb
|
175
176
|
- templates/spec/devise.rb
|
@@ -193,7 +194,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
193
194
|
requirements:
|
194
195
|
- - ">="
|
195
196
|
- !ruby/object:Gem::Version
|
196
|
-
version: 2.3.
|
197
|
+
version: 2.3.1
|
197
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
199
|
requirements:
|
199
200
|
- - ">="
|
@@ -201,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
202
|
version: '0'
|
202
203
|
requirements: []
|
203
204
|
rubyforge_project:
|
204
|
-
rubygems_version: 2.
|
205
|
+
rubygems_version: 2.6.4
|
205
206
|
signing_key:
|
206
207
|
specification_version: 4
|
207
208
|
summary: Koombea Rails app generator
|
data/.hound.yml
DELETED