auxiliary_rails 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: dce34a0947ba20a256225ca03f3622701fb2a4e93ce59b9a4742398ff09e7158
4
- data.tar.gz: 720609166305db76bbb4b501011fb240f9448894f1d0abcbd2f7cf59f6949b89
3
+ metadata.gz: 383fb46a307c3e5c32aeb2006f515d87568825f7bbd66de0b81b140bcf32847f
4
+ data.tar.gz: a89f2f5b64fe148e5c4291cd68c48e6796976c5cf22fb577c99e5ea7f8afbb21
5
5
  SHA512:
6
- metadata.gz: b91070a6b45fd48d6ba572fa6994b551621bc2de2394bbb8330e6c92deee7de9a25ebbc3e07c760f4560ace4491bab91ef5ce1262d208a5419c0bb4c2e8511f5
7
- data.tar.gz: 9e82e6f53db8770b2d0cd1771889f7a481f5e80907d0b009cbbc67878526cc4423fe242f55b986938cc73f30e2c90a5e7a4d24ed74c9ec2055aed48e651df719
6
+ metadata.gz: 5f9de7541625824350acaed768eb59a22f2daeba9b4b6a5521a91614e48c6878bf2e12f4315fa5d0e68048d9b5082b77b765d7d2e6d1e744f242a9dead18af02
7
+ data.tar.gz: 7c5b807b6655f07dfaa3c82eb3051ed2f94dcf44db9f87add4f484d19f60f028472b99c31bea5b5f802f1b60e1b9256a14034456663bb27dd854754e937344f7
data/.rubocop.yml CHANGED
@@ -1,8 +1,23 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+
1
5
  AllCops:
2
6
  Exclude:
3
7
  - auxiliary_rails.gemspec
4
8
  - vendor/bundle/**/* # fix for running on Travis CI
5
9
 
10
+ #################### Layout ##############################
11
+
12
+ Layout/AlignArguments:
13
+ EnforcedStyle: with_fixed_indentation
14
+
15
+ #################### Metrics ##############################
16
+
17
+ Metrics/BlockLength:
18
+ Exclude:
19
+ - 'spec/**/*_spec.rb'
20
+
6
21
  #################### Style ###############################
7
22
 
8
23
  Style/Documentation:
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # AuxiliaryRails Changelog
2
2
 
3
- ## v0.1.1
3
+ ## v0.1.3
4
+
5
+ * Upgrate `rubocop` gem and its configs
6
+ * `rubocop-rspec` and `rubocop-performance` gem itegration
7
+ * Added basic Rails application template
8
+ * CLI with `create_rails_app` command
9
+
10
+ ## v0.1.2
4
11
 
5
12
  * Fix Gemfile.lock
6
13
 
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,7 @@
1
+ # Contributing to AuxiliaryRails
2
+
3
+ ## Rubocop Templates
4
+
5
+ ### Versioning
6
+
7
+ File `rubocop_auxiliary_rails_template.yml` contains a basic template of Rubocop config. After making any changes to this file the line `Version: N` should be updated and `N` (version number) should be incremented by one.
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- auxiliary_rails (0.1.2)
4
+ auxiliary_rails (0.1.3)
5
+ thor
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
@@ -11,8 +12,8 @@ GEM
11
12
  diff-lcs (1.3)
12
13
  jaro_winkler (1.5.2)
13
14
  method_source (0.9.2)
14
- parallel (1.16.2)
15
- parser (2.6.2.0)
15
+ parallel (1.17.0)
16
+ parser (2.6.3.0)
16
17
  ast (~> 2.4.0)
17
18
  pry (0.12.2)
18
19
  coderay (~> 1.1.0)
@@ -26,14 +27,14 @@ GEM
26
27
  rspec-mocks (~> 3.8.0)
27
28
  rspec-core (3.8.0)
28
29
  rspec-support (~> 3.8.0)
29
- rspec-expectations (3.8.2)
30
+ rspec-expectations (3.8.3)
30
31
  diff-lcs (>= 1.2.0, < 2.0)
31
32
  rspec-support (~> 3.8.0)
32
33
  rspec-mocks (3.8.0)
33
34
  diff-lcs (>= 1.2.0, < 2.0)
34
35
  rspec-support (~> 3.8.0)
35
36
  rspec-support (3.8.0)
36
- rubocop (0.66.0)
37
+ rubocop (0.68.1)
37
38
  jaro_winkler (~> 1.5.1)
38
39
  parallel (~> 1.10)
39
40
  parser (>= 2.5, != 2.5.1.1)
@@ -41,7 +42,12 @@ GEM
41
42
  rainbow (>= 2.2.2, < 4.0)
42
43
  ruby-progressbar (~> 1.7)
43
44
  unicode-display_width (>= 1.4.0, < 1.6)
45
+ rubocop-performance (1.2.0)
46
+ rubocop (>= 0.68.0)
47
+ rubocop-rspec (1.32.0)
48
+ rubocop (>= 0.60.0)
44
49
  ruby-progressbar (1.10.0)
50
+ thor (0.20.3)
45
51
  unicode-display_width (1.5.0)
46
52
 
47
53
  PLATFORMS
@@ -54,6 +60,8 @@ DEPENDENCIES
54
60
  rake (~> 10.0)
55
61
  rspec (~> 3.0)
56
62
  rubocop
63
+ rubocop-performance
64
+ rubocop-rspec
57
65
 
58
66
  BUNDLED WITH
59
67
  2.0.1
data/README.md CHANGED
@@ -8,10 +8,15 @@ Collection of classes, configs, scripts, generators for Ruby on Rails helping yo
8
8
 
9
9
  ## Installation
10
10
 
11
- Add this line to your application's Gemfile:
11
+ Add one of these lines to your application's Gemfile:
12
12
 
13
13
  ```ruby
14
+ # version released to RubyGems
15
+ gem 'auxiliary_rails'
16
+ # or latest version from the repository
14
17
  gem 'auxiliary_rails', git: 'https://github.com/ergoserv/auxiliary_rails'
18
+ # or from a specific branch of the repository
19
+ gem 'auxiliary_rails', github: 'ergoserv/auxiliary_rails', branch: 'develop'
15
20
  ```
16
21
 
17
22
  And then execute:
@@ -24,11 +29,26 @@ Or install it yourself as:
24
29
 
25
30
  ## Usage
26
31
 
32
+ ### Rails Application Templates
33
+
34
+ Install gem into the system (e.g. using `gem install auxiliary_rails`) then:
35
+
36
+ ```sh
37
+ auxiliary_rails APP_PATH
38
+ ```
39
+
40
+ Or use `rails new` command specifying `--template` argument:
41
+
42
+ ```sh
43
+ rails new APP_PATH --skip-action-cable --skip-coffee --skip-test --database=postgresql --template=https://raw.githubusercontent.com/ergoserv/auxiliary_rails/develop/templates/rails/template.rb
44
+ ```
45
+
27
46
  ### Generators
28
47
 
29
48
  ```sh
30
49
  rails generate auxiliary_rails:install_errors
31
50
  rails generate auxiliary_rails:install_rubocop
51
+ rails generate auxiliary_rails:install_rubocop --no-specify-gems
32
52
  ```
33
53
 
34
54
  ### View Helpers
@@ -30,8 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
31
31
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
32
  end
33
- spec.bindir = "exe"
34
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
+ spec.executables = ["auxiliary_rails"]
35
34
  spec.require_paths = ["lib"]
36
35
 
37
36
  spec.add_development_dependency "bundler", "~> 2.0"
@@ -39,4 +38,8 @@ Gem::Specification.new do |spec|
39
38
  spec.add_development_dependency "rake", "~> 10.0"
40
39
  spec.add_development_dependency "rspec", "~> 3.0"
41
40
  spec.add_development_dependency "rubocop"
41
+ spec.add_development_dependency "rubocop-performance"
42
+ spec.add_development_dependency "rubocop-rspec"
43
+
44
+ spec.add_runtime_dependency "thor"
42
45
  end
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "#{__dir__}/../lib/auxiliary_rails/cli"
4
+
5
+ AuxiliaryRails::CLI.start
@@ -0,0 +1,23 @@
1
+ require 'thor'
2
+
3
+ module AuxiliaryRails
4
+ class CLI < Thor
5
+ include Thor::Actions
6
+
7
+ RAILS_APP_TEMPLATE =
8
+ File.expand_path("#{__dir__}/../../templates/rails/template.rb")
9
+
10
+ desc 'create_rails_app APP_PATH', 'Create Rails application from template'
11
+ long_desc <<-LONGDESC
12
+ Creates Rails application from template:
13
+ #{RAILS_APP_TEMPLATE}
14
+
15
+ Example: auxiliary_rails create_rails_app ~/Code/weblog
16
+ LONGDESC
17
+ def create_rails_app(app_path)
18
+ run "rails new #{app_path} " \
19
+ '--skip-action-cable --skip-coffee --skip-test --database=postgresql ' \
20
+ "--template=#{RAILS_APP_TEMPLATE}"
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module AuxiliaryRails
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
@@ -6,7 +6,7 @@ module AuxiliaryRails
6
6
 
7
7
  def copy_application_error_file
8
8
  copy_file 'application_error_template.rb',
9
- 'app/errors/application_error.rb'
9
+ 'app/errors/application_error.rb'
10
10
  end
11
11
  end
12
12
  end
@@ -2,18 +2,26 @@ require 'rails'
2
2
 
3
3
  module AuxiliaryRails
4
4
  class InstallRubocopGenerator < ::Rails::Generators::Base
5
- source_root File.expand_path('templates', __dir__)
5
+ class_option :specify_gems,
6
+ type: :boolean,
7
+ default: true,
8
+ desc: 'Indicates if `rubocop` gem needs to be added to Gemfile'
9
+ source_root File.expand_path('templates/rubocop', __dir__)
6
10
 
7
11
  def copy_config_files
8
12
  copy_file 'rubocop_template.yml',
9
- '.rubocop.yml'
13
+ '.rubocop.yml'
10
14
  copy_file 'rubocop_auxiliary_rails_template.yml',
11
- '.rubocop_auxiliary_rails.yml'
15
+ '.rubocop_auxiliary_rails.yml'
12
16
  end
13
17
 
14
- def specify_gem_dependency
18
+ def specify_gems_dependency
19
+ return unless options[:specify_gems]
20
+
15
21
  gem_group :development, :test do
16
22
  gem 'rubocop'
23
+ gem 'rubocop-performance'
24
+ gem 'rubocop-rspec'
17
25
  end
18
26
  end
19
27
  end
@@ -1,6 +1,6 @@
1
- # AuxiliaryRails Rubocop Config
1
+ # AuxiliaryRails RuboCop Config
2
2
  # Homepage: https://github.com/ergoserv/auxiliary_rails
3
- # Version: 1
3
+ # Version: 5
4
4
 
5
5
  AllCops:
6
6
  Exclude:
@@ -9,6 +9,11 @@ AllCops:
9
9
  - 'db/migrate/*'
10
10
  - 'vendor/**/*'
11
11
 
12
+ #################### Layout ###############################
13
+
14
+ Layout/AlignArguments:
15
+ EnforcedStyle: with_fixed_indentation
16
+
12
17
  #################### Metrics ###############################
13
18
 
14
19
  Metrics/MethodLength:
@@ -19,10 +24,21 @@ Metrics/MethodLength:
19
24
  Rails:
20
25
  Enabled: true
21
26
 
22
- #################### Style ###############################
27
+ #################### RSpec #################################
28
+
29
+ RSpec/NamedSubject:
30
+ Enabled: false
31
+
32
+ #################### Style #################################
23
33
 
24
34
  Style/Documentation:
25
35
  Enabled: false
26
36
 
27
37
  Style/FrozenStringLiteralComment:
28
38
  Enabled: false
39
+
40
+ Style/IfUnlessModifier:
41
+ Enabled: false
42
+
43
+ Style/NegatedIf:
44
+ EnforcedStyle: postfix
@@ -0,0 +1,6 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+
5
+ inherit_from:
6
+ - .rubocop_auxiliary_rails.yml
@@ -0,0 +1,30 @@
1
+ # Gemfile cleanup
2
+ gsub_file 'Gemfile', /^\s*#.*$\n/, ''
3
+ gsub_file 'Gemfile', /^.*coffee.*$\n/, ''
4
+ gsub_file 'Gemfile', /^.*jbuilder.*$\n/, ''
5
+ gsub_file 'Gemfile', /^.*tzinfo-data.*$\n/, ''
6
+
7
+ gem 'auxiliary_rails',
8
+ git: 'https://github.com/ergoserv/auxiliary_rails',
9
+ branch: 'develop'
10
+
11
+ gem_group :development, :test do
12
+ gem 'factory_bot_rails'
13
+ gem 'faker'
14
+ gem 'rubocop'
15
+ gem 'rubocop-performance'
16
+ gem 'rubocop-rspec'
17
+ gem 'rspec-rails'
18
+ end
19
+
20
+ gem_group :test do
21
+ gem 'shoulda-matchers'
22
+ gem 'rails-controller-testing'
23
+ end
24
+
25
+ after_bundle do
26
+ # ensure using the latest versions of gems
27
+ run 'bundle update'
28
+ rails_command 'generate auxiliary_rails:install_rubocop --no-specify-gems'
29
+ rails_command 'generate rspec:install'
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auxiliary_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Babenko
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-30 00:00:00.000000000 Z
11
+ date: 2019-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,11 +80,54 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop-performance
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: thor
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
83
125
  description: AuxiliaryRails is a collection of classes, configs, scripts, generators
84
126
  for Ruby on Rails helping you get things done, better.
85
127
  email:
86
128
  - dmitry@ergoserv.com
87
- executables: []
129
+ executables:
130
+ - auxiliary_rails
88
131
  extensions: []
89
132
  extra_rdoc_files: []
90
133
  files:
@@ -93,6 +136,7 @@ files:
93
136
  - ".rubocop.yml"
94
137
  - ".travis.yml"
95
138
  - CHANGELOG.md
139
+ - CONTRIBUTING.md
96
140
  - Gemfile
97
141
  - Gemfile.lock
98
142
  - LICENSE.txt
@@ -100,18 +144,21 @@ files:
100
144
  - Rakefile
101
145
  - assets/ErgoServ_horizontalColor@sign+text+bg.png
102
146
  - auxiliary_rails.gemspec
147
+ - bin/auxiliary_rails
103
148
  - bin/console
104
149
  - bin/setup
105
150
  - lib/auxiliary_rails.rb
106
151
  - lib/auxiliary_rails/abstract_error.rb
152
+ - lib/auxiliary_rails/cli.rb
107
153
  - lib/auxiliary_rails/railtie.rb
108
154
  - lib/auxiliary_rails/version.rb
109
155
  - lib/auxiliary_rails/view_helpers.rb
110
156
  - lib/generators/auxiliary_rails/install_errors_generator.rb
111
157
  - lib/generators/auxiliary_rails/install_rubocop_generator.rb
112
158
  - lib/generators/auxiliary_rails/templates/application_error_template.rb
113
- - lib/generators/auxiliary_rails/templates/rubocop_auxiliary_rails_template.yml
114
- - lib/generators/auxiliary_rails/templates/rubocop_template.yml
159
+ - lib/generators/auxiliary_rails/templates/rubocop/rubocop_auxiliary_rails_template.yml
160
+ - lib/generators/auxiliary_rails/templates/rubocop/rubocop_template.yml
161
+ - templates/rails/template.rb
115
162
  homepage: https://github.com/ergoserv/auxiliary_rails
116
163
  licenses:
117
164
  - MIT
@@ -1,2 +0,0 @@
1
- inherit_from:
2
- - .rubocop_auxiliary_rails.yml