auxiliary_rails 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 383fb46a307c3e5c32aeb2006f515d87568825f7bbd66de0b81b140bcf32847f
4
- data.tar.gz: a89f2f5b64fe148e5c4291cd68c48e6796976c5cf22fb577c99e5ea7f8afbb21
3
+ metadata.gz: df4f45e6ad249ea84491c5915413011b28fb8e60c2dd1a61a6ed50d35853a98f
4
+ data.tar.gz: 8758a82b9c716aa248a698e6f22f45723294a198fc0b3236455bc5ae8a6a9dd4
5
5
  SHA512:
6
- metadata.gz: 5f9de7541625824350acaed768eb59a22f2daeba9b4b6a5521a91614e48c6878bf2e12f4315fa5d0e68048d9b5082b77b765d7d2e6d1e744f242a9dead18af02
7
- data.tar.gz: 7c5b807b6655f07dfaa3c82eb3051ed2f94dcf44db9f87add4f484d19f60f028472b99c31bea5b5f802f1b60e1b9256a14034456663bb27dd854754e937344f7
6
+ metadata.gz: f2cc8b287f827407f7ae6bd1ae2c7ab6876e5109cdb5863cbcf91fe013bf3ddfd9bbc3a48fa7b3e3c3010e97a486d0a51bb611dbd9630ec009ee02edafa76ada
7
+ data.tar.gz: b25ad1755eab8ef117bf7d419ef7858eb296cf11449ab78a24c03296fe52fd8325aeac9d3edd7ee5141f8dc14621a45dcae6b4b2e9ef45a8de08abb797842bb8
data/.rubocop.yml CHANGED
@@ -1,10 +1,12 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
1
3
  require:
2
4
  - rubocop-performance
3
5
  - rubocop-rspec
4
6
 
5
7
  AllCops:
6
8
  Exclude:
7
- - auxiliary_rails.gemspec
9
+ # - auxiliary_rails.gemspec
8
10
  - vendor/bundle/**/* # fix for running on Travis CI
9
11
 
10
12
  #################### Layout ##############################
@@ -16,6 +18,7 @@ Layout/AlignArguments:
16
18
 
17
19
  Metrics/BlockLength:
18
20
  Exclude:
21
+ - auxiliary_rails.gemspec
19
22
  - 'spec/**/*_spec.rb'
20
23
 
21
24
  #################### Style ###############################
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,27 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2019-05-12 09:23:17 +0300 using RuboCop version 0.68.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
12
+ Layout/ExtraSpacing:
13
+ Exclude:
14
+ - 'auxiliary_rails.gemspec'
15
+
16
+ # Offense count: 1
17
+ # Cop supports --auto-correct.
18
+ # Configuration parameters: AllowForAlignment.
19
+ Layout/SpaceAroundOperators:
20
+ Exclude:
21
+ - 'auxiliary_rails.gemspec'
22
+
23
+ # Offense count: 1
24
+ # Configuration parameters: MinBodyLength.
25
+ Style/GuardClause:
26
+ Exclude:
27
+ - 'auxiliary_rails.gemspec'
data/README.md CHANGED
@@ -34,13 +34,13 @@ Or install it yourself as:
34
34
  Install gem into the system (e.g. using `gem install auxiliary_rails`) then:
35
35
 
36
36
  ```sh
37
- auxiliary_rails APP_PATH
37
+ auxiliary_rails new APP_PATH
38
38
  ```
39
39
 
40
40
  Or use `rails new` command specifying `--template` argument:
41
41
 
42
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
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/elementary.rb
44
44
  ```
45
45
 
46
46
  ### Generators
@@ -1,45 +1,45 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "auxiliary_rails/version"
3
+ require 'auxiliary_rails/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
7
- spec.name = "auxiliary_rails"
6
+ spec.name = 'auxiliary_rails'
8
7
  spec.version = AuxiliaryRails::VERSION
9
- spec.authors = ["Dmitry Babenko"]
10
- spec.email = ["dmitry@ergoserv.com"]
8
+ spec.authors = ['Dmitry Babenko', 'ErgoServ']
9
+ spec.email = ['dmitry@ergoserv.com', 'hello@ergoserv.com']
11
10
 
12
- spec.summary = %q{AuxiliaryRails provides extra layers and utils for helping to build solid and clean Ruby on Rails applications}
13
- spec.description = %q{AuxiliaryRails is a collection of classes, configs, scripts, generators for Ruby on Rails helping you get things done, better.}
14
- spec.homepage = "https://github.com/ergoserv/auxiliary_rails"
15
- spec.license = "MIT"
11
+ spec.summary = 'AuxiliaryRails provides extra layers and utils ' \
12
+ 'for helping to build solid and clean Ruby on Rails applications'
13
+ spec.description = <<~DESC
14
+ AuxiliaryRails is a collection of classes, configs, scripts,
15
+ generators for Ruby on Rails helping you get things done, better.
16
+ DESC
17
+ spec.homepage = 'https://github.com/ergoserv/auxiliary_rails'
18
+ spec.license = 'MIT'
16
19
 
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
20
  if spec.respond_to?(:metadata)
20
- spec.metadata["homepage_uri"] = "https://github.com/ergoserv/auxiliary_rails"
21
- spec.metadata["source_code_uri"] = "https://github.com/ergoserv/auxiliary_rails"
22
- spec.metadata["changelog_uri"] = "https://github.com/ergoserv/auxiliary_rails/blob/master/CHANGELOG.md"
21
+ spec.metadata['homepage_uri'] = 'https://github.com/ergoserv/auxiliary_rails'
22
+ spec.metadata['source_code_uri'] = 'https://github.com/ergoserv/auxiliary_rails'
23
+ spec.metadata['changelog_uri'] = 'https://github.com/ergoserv/auxiliary_rails/blob/master/CHANGELOG.md'
23
24
  else
24
- raise "RubyGems 2.0 or newer is required to protect against " \
25
- "public gem pushes."
25
+ raise 'RubyGems 2.0 or newer is required'
26
26
  end
27
27
 
28
- # Specify which files should be added to the gem when it is released.
29
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
31
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
29
+ `git ls-files -z`.split("\x0").reject do |f|
30
+ f.match(%r{^(test|spec|features)/})
31
+ end
32
32
  end
33
- spec.executables = ["auxiliary_rails"]
34
- spec.require_paths = ["lib"]
33
+ spec.executables = ['auxiliary_rails']
34
+ spec.require_paths = ['lib']
35
35
 
36
- spec.add_development_dependency "bundler", "~> 2.0"
37
- spec.add_development_dependency "pry"
38
- spec.add_development_dependency "rake", "~> 10.0"
39
- spec.add_development_dependency "rspec", "~> 3.0"
40
- spec.add_development_dependency "rubocop"
41
- spec.add_development_dependency "rubocop-performance"
42
- spec.add_development_dependency "rubocop-rspec"
36
+ spec.add_development_dependency 'bundler', '~> 2.0'
37
+ spec.add_development_dependency 'pry'
38
+ spec.add_development_dependency 'rake', '~> 10.0'
39
+ spec.add_development_dependency 'rspec', '~> 3.0'
40
+ spec.add_development_dependency 'rubocop'
41
+ spec.add_development_dependency 'rubocop-performance'
42
+ spec.add_development_dependency 'rubocop-rspec'
43
43
 
44
- spec.add_runtime_dependency "thor"
44
+ spec.add_runtime_dependency 'thor'
45
45
  end
@@ -4,20 +4,33 @@ module AuxiliaryRails
4
4
  class CLI < Thor
5
5
  include Thor::Actions
6
6
 
7
- RAILS_APP_TEMPLATE =
8
- File.expand_path("#{__dir__}/../../templates/rails/template.rb")
7
+ TEMPLATES_DIR =
8
+ File.expand_path("#{__dir__}/../../templates/")
9
9
 
10
- desc 'create_rails_app APP_PATH', 'Create Rails application from template'
10
+ desc 'new APP_PATH', 'Create Rails application from template'
11
11
  long_desc <<-LONGDESC
12
- Creates Rails application from template:
13
- #{RAILS_APP_TEMPLATE}
12
+ Create Rails application from the specified template.
13
+ Works like a wrapper for `rails new` command.
14
14
 
15
- Example: auxiliary_rails create_rails_app ~/Code/weblog
15
+ Example: auxiliary_rails new ~/Code/weblog
16
16
  LONGDESC
17
- def create_rails_app(app_path)
17
+ option :database,
18
+ default: 'postgresql',
19
+ type: :string
20
+ option :template_name,
21
+ default: 'elementary',
22
+ type: :string
23
+ def new(app_path)
18
24
  run "rails new #{app_path} " \
19
- '--skip-action-cable --skip-coffee --skip-test --database=postgresql ' \
20
- "--template=#{RAILS_APP_TEMPLATE}"
25
+ '--skip-action-cable --skip-coffee --skip-test ' \
26
+ "--database=#{options[:database]} " \
27
+ "--template=#{rails_template_path(options[:template_name])}"
28
+ end
29
+
30
+ private
31
+
32
+ def rails_template_path(template_name)
33
+ "#{TEMPLATES_DIR}/rails/#{template_name}.rb"
21
34
  end
22
35
  end
23
36
  end
@@ -1,3 +1,3 @@
1
1
  module AuxiliaryRails
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
@@ -11,15 +11,15 @@ gem 'auxiliary_rails',
11
11
  gem_group :development, :test do
12
12
  gem 'factory_bot_rails'
13
13
  gem 'faker'
14
+ gem 'rspec-rails'
14
15
  gem 'rubocop'
15
16
  gem 'rubocop-performance'
16
17
  gem 'rubocop-rspec'
17
- gem 'rspec-rails'
18
18
  end
19
19
 
20
20
  gem_group :test do
21
- gem 'shoulda-matchers'
22
21
  gem 'rails-controller-testing'
22
+ gem 'shoulda-matchers'
23
23
  end
24
24
 
25
25
  after_bundle do
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auxiliary_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Babenko
8
+ - ErgoServ
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2019-05-10 00:00:00.000000000 Z
12
+ date: 2019-05-12 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
@@ -122,10 +123,12 @@ dependencies:
122
123
  - - ">="
123
124
  - !ruby/object:Gem::Version
124
125
  version: '0'
125
- description: AuxiliaryRails is a collection of classes, configs, scripts, generators
126
- for Ruby on Rails helping you get things done, better.
126
+ description: |
127
+ AuxiliaryRails is a collection of classes, configs, scripts,
128
+ generators for Ruby on Rails helping you get things done, better.
127
129
  email:
128
130
  - dmitry@ergoserv.com
131
+ - hello@ergoserv.com
129
132
  executables:
130
133
  - auxiliary_rails
131
134
  extensions: []
@@ -134,6 +137,7 @@ files:
134
137
  - ".gitignore"
135
138
  - ".rspec"
136
139
  - ".rubocop.yml"
140
+ - ".rubocop_todo.yml"
137
141
  - ".travis.yml"
138
142
  - CHANGELOG.md
139
143
  - CONTRIBUTING.md
@@ -158,7 +162,7 @@ files:
158
162
  - lib/generators/auxiliary_rails/templates/application_error_template.rb
159
163
  - lib/generators/auxiliary_rails/templates/rubocop/rubocop_auxiliary_rails_template.yml
160
164
  - lib/generators/auxiliary_rails/templates/rubocop/rubocop_template.yml
161
- - templates/rails/template.rb
165
+ - templates/rails/elementary.rb
162
166
  homepage: https://github.com/ergoserv/auxiliary_rails
163
167
  licenses:
164
168
  - MIT