bookingsync-stylecheck 0.0.5 → 0.0.6

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
  SHA1:
3
- metadata.gz: 41b944d57c1ac7ca003e57d454467d7a8d958b6e
4
- data.tar.gz: cdd52233c0ababa8a085709263570ad55310d135
3
+ metadata.gz: 72ab91d0aa6ac6e44eb27a13194c2e62feaae337
4
+ data.tar.gz: 565d2cfc3a7ab170ee3a39960e062a11f618e80e
5
5
  SHA512:
6
- metadata.gz: d90f22969cbfda7f5ec8d3496f68163473a0e974e2ddf8c81327e809f88b59e7edab709576bc30dfeae5ad9f0ef70c23b15af809e5ef784defbf0037fb51e8b4
7
- data.tar.gz: ae144d72a49bfc19f08afcc2cbfc9b99b593b16e8531754a17a020d4830dcd59ae507a954cfb55c8b8e6922e2dcfdf7b74518a0cedf715d34766d7b78044d891
6
+ metadata.gz: 245729a4739365eef93a19bbb82ddc9a8d5cddc090964d7b8219b5c792c49ff638db798515a4013f2afbb9a77177f97d6f5c61bab3bce42c2a582f874f30c9b4
7
+ data.tar.gz: 89b15da23c374540bb93902578f90ae1d9e1e0132136737b93ba5e7a0b52d523a42b8305fe515ded3e02a3f71a2f770571818fd0754adf68fc3163268241c9d2
data/README.md CHANGED
@@ -8,6 +8,18 @@ Just add to gemfile and new rake task should be available
8
8
 
9
9
  # Tasks
10
10
 
11
+ ## Rails
12
+
13
+ For rails projects the rake tasks should be added automatically through railties.
14
+
15
+ ## Non rails
16
+
17
+ For non rails and gems add the following snippet to `Rakefile`
18
+ ```ruby
19
+ require "bookingsync/stylecheck"
20
+ load "bookingsync/tasks/rubocop.rake"
21
+ ```
22
+
11
23
  ## Default
12
24
 
13
25
  `bundle exec rake style`
@@ -3,7 +3,7 @@ module BookingSync
3
3
  # auto loading rake tasks
4
4
  class Railtie < Rails::Railtie
5
5
  rake_tasks do
6
- rake_path = File.join(File.dirname(__FILE__), '../tasks/*.rake')
6
+ rake_path = File.join(File.dirname(__FILE__), "../tasks/*.rake")
7
7
  Dir[rake_path].each { |f| load f }
8
8
  end
9
9
  end
@@ -1,4 +1,4 @@
1
- require 'fileutils'
1
+ require "fileutils"
2
2
 
3
3
  module BookingSync
4
4
  module Stylecheck
@@ -6,7 +6,7 @@ module BookingSync
6
6
  module RubocopHelpers
7
7
  class << self
8
8
  def config
9
- File.join(BookingSync::Stylecheck.root, 'config', 'rubocop.yml')
9
+ File.join(BookingSync::Stylecheck.root, "config", "rubocop.yml")
10
10
  end
11
11
  end
12
12
  end
@@ -3,11 +3,11 @@ module BookingSync
3
3
  module Stylecheck
4
4
  class << self
5
5
  def root
6
- Gem::Specification.find_by_name('bookingsync-stylecheck').gem_dir
6
+ Gem::Specification.find_by_name("bookingsync-stylecheck").gem_dir
7
7
  end
8
8
  end
9
9
  end
10
10
  end
11
11
 
12
- require 'bookingsync/stylecheck/rubocop_helpers'
13
- require 'bookingsync/stylecheck/railtie'
12
+ require "bookingsync/stylecheck/rubocop_helpers"
13
+ require "bookingsync/stylecheck/railtie" rescue nil # support non rails setups
@@ -0,0 +1,42 @@
1
+ require "fileutils"
2
+
3
+ namespace :style do
4
+ namespace :rubocop do
5
+ desc "Run RuboCop with auto_correct"
6
+ task :with_auto_correct do
7
+ options = ["--rails", "--auto-correct"]
8
+ options += ["--fail-level", "refactor"]
9
+ options += ["-c", BookingSync::Stylecheck::RubocopHelpers.config]
10
+ sh "bundle exec rubocop #{options.join(' ')}" do |ok, _res|
11
+ abort "Fix code style errors" unless ok
12
+ end
13
+ end
14
+
15
+ desc "Run RuboCop without auto_correct"
16
+ task :without_auto_correct do
17
+ options = ["--rails"]
18
+ options += ["--fail-level", "refactor"]
19
+ options += ["-c", BookingSync::Stylecheck::RubocopHelpers.config]
20
+ sh "bundle exec rubocop #{options.join(' ')}" do |ok, _res|
21
+ abort "Fix code style errors" unless ok
22
+ end
23
+ end
24
+
25
+ desc "Run RuboCop using the BookingSync config and concatenate custom commands"
26
+ task :custom, [:command_string, :no_fail] do |t, args|
27
+ args[:no_fail] ||= false
28
+
29
+ options = ["--rails", "--fail-level", "refactor"]
30
+ options += ["-c", BookingSync::Stylecheck::RubocopHelpers.config]
31
+ options += [args[:command_string]]
32
+ sh "bundle exec rubocop #{options.join(' ')}" do |ok, res|
33
+ abort "Fix code style errors" if !args[:no_fail] && !ok
34
+ end
35
+ end
36
+ end
37
+ end
38
+
39
+ desc "Check codestyle and fix common errors"
40
+ task :style do
41
+ Rake::Task["style:rubocop:with_auto_correct"].invoke
42
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookingsync-stylecheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Marciniak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-19 00:00:00.000000000 Z
11
+ date: 2016-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.41.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: railties
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '4'
34
- type: :runtime
33
+ version: '0'
34
+ type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '4'
40
+ version: '0'
41
41
  description: Wraps rubocop for simple and consisten experience
42
42
  email: mandaryyyn@gmail.com
43
43
  executables: []
@@ -50,7 +50,7 @@ files:
50
50
  - lib/bookingsync/stylecheck.rb
51
51
  - lib/bookingsync/stylecheck/railtie.rb
52
52
  - lib/bookingsync/stylecheck/rubocop_helpers.rb
53
- - lib/bookingsync/tasks/rubocop.rake
53
+ - lib/bookingsync/tasks/stylecheck.rake
54
54
  homepage: http://gihub.com/BookingSync/bookingsync-stylecheck
55
55
  licenses:
56
56
  - MIT
@@ -1,42 +0,0 @@
1
- require 'fileutils'
2
-
3
- namespace :style do
4
- namespace :rubocop do
5
- desc 'Run RuboCop with auto_correct'
6
- task :with_auto_correct do
7
- options = ['--rails', '--auto-correct']
8
- options += ['--fail-level', 'refactor']
9
- options += ['-c', BookingSync::Stylecheck::RubocopHelpers.config]
10
- sh "bundle exec rubocop #{options.join(' ')}" do |ok, _res|
11
- abort 'Fix code style errors' unless ok
12
- end
13
- end
14
-
15
- desc 'Run RuboCop without auto_correct'
16
- task :without_auto_correct do
17
- options = ['--rails']
18
- options += ['--fail-level', 'refactor']
19
- options += ['-c', BookingSync::Stylecheck::RubocopHelpers.config]
20
- sh "bundle exec rubocop #{options.join(' ')}" do |ok, _res|
21
- abort 'Fix code style errors' unless ok
22
- end
23
- end
24
-
25
- desc "Run RuboCop using the BookingSync config and concatenate custom commands"
26
- task :custom, [:command_string, :no_fail] do |t, args|
27
- args[:no_fail] ||= false
28
-
29
- options = ['--rails', '--fail-level', 'refactor']
30
- options += ['-c', BookingSync::Stylecheck::RubocopHelpers.config]
31
- options += [args[:command_string]]
32
- sh "bundle exec rubocop #{options.join(' ')}" do |ok, res|
33
- abort 'Fix code style errors' if !args[:no_fail] && !ok
34
- end
35
- end
36
- end
37
- end
38
-
39
- desc 'Check codestyle and fix common errors'
40
- task :style do
41
- Rake::Task['style:rubocop:with_auto_correct'].invoke
42
- end