rubocop-migrations 0.1.1 → 0.1.2

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: fbc9c3a1af242d1c0390ca167c0196393c689c71
4
- data.tar.gz: 649a2ff415dcacba5fe937df7bd797be103f3549
3
+ metadata.gz: 6cfad4f333654b8a78574c04ff6cb9e154557813
4
+ data.tar.gz: 88d16496aeeb6ffbe37296f4fa16966dcc7aa84b
5
5
  SHA512:
6
- metadata.gz: 31dc94ba1e6343d51c65c76e9d4a02324d3aa0119d656322c5b44efd5fabf34bc51e54305fada16344b6fd85e95fd8632efa30163667d588de8f3e3777aefcbd
7
- data.tar.gz: efbc63baafb1e6a057c1f6b199b0d97c75e56b75b014f84c511b2926fdd9dd86168b48688237aa240ed5575aea97d15130fecb64311d313d32e98ffd5876dfe2
6
+ metadata.gz: 67b0e195615c1109824f8402576892f1e5ad233a253ac94ffe1242ba8fc00af2c310ec7c1ed68c1431db3cf659097110cb0865781f5dfbafa136d4bdfdabca66
7
+ data.tar.gz: 2180325201612f1bc454ca4dc1f32b4cfdacc2375ed7d8d81ee84e31537ba81a7ec590c4df7ac04970892d4bc7a1803fa78aa13d2f46972b3ee08526bf20e83a
data/.gitignore CHANGED
@@ -8,3 +8,5 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  *~
11
+ gemfiles/vendor
12
+ gemfiles/*.lock
@@ -2,3 +2,8 @@ language: ruby
2
2
  rvm:
3
3
  - 2.3.0
4
4
  before_install: gem install bundler -v 1.11.2
5
+ gemfile:
6
+ - gemfiles/rubocop_0.41.gemfile
7
+ - gemfiles/rubocop_0.42.gemfile
8
+ - gemfiles/rubocop_0.43.gemfile
9
+ - gemfiles/latest_rubocop.gemfile
@@ -0,0 +1,15 @@
1
+ appraise 'rubocop-0.41' do
2
+ gem 'rubocop', '~> 0.41.0'
3
+ end
4
+
5
+ appraise 'rubocop-0.42' do
6
+ gem 'rubocop', '~> 0.42.0'
7
+ end
8
+
9
+ appraise 'rubocop-0.43' do
10
+ gem 'rubocop', '~> 0.43.0'
11
+ end
12
+
13
+ appraise 'latest-rubocop' do
14
+ gem 'rubocop'
15
+ end
data/README.md CHANGED
@@ -1,12 +1,15 @@
1
1
  # RuboCop Migrations
2
2
 
3
- Rails migrations analysis as a extension of [RuboCop](https://github.com/bbatsov/rubocop). Heavily inspired by [`rubocop-cask`](https://github.com/caskroom/rubocop-cask) which in turn is inspired by [`rubocop-rspec`](https://github.com/nevir/rubocop-rspec).
3
+ Rails migrations analysis as a extension
4
+ of [RuboCop](https://github.com/bbatsov/rubocop). Heavily inspired
5
+ by [`rubocop-cask`](https://github.com/caskroom/rubocop-cask) which in turn is
6
+ inspired by [`rubocop-rspec`](https://github.com/nevir/rubocop-rspec).
4
7
 
5
8
  ## Installation
6
9
 
7
10
  Just install the `rubocop-migrations` gem
8
11
 
9
- ```bash
12
+ ```shell
10
13
  gem install rubocop-migrations
11
14
  ```
12
15
 
@@ -19,7 +22,8 @@ gem 'rubocop-migrations'
19
22
 
20
23
  ## Usage
21
24
 
22
- You need to tell RuboCop to load the Migrations extension. There are three ways to do this:
25
+ You need to tell RuboCop to load the Migrations extension. There are three ways
26
+ to do this:
23
27
 
24
28
  ### RuboCop configuration file
25
29
 
@@ -29,19 +33,23 @@ Put this into your `.rubocop.yml`:
29
33
  require: rubocop/migrations
30
34
  ```
31
35
 
32
- Now you can run `rubocop` and it will automatically load the RuboCop Migrations cops together with the standard cops.
36
+ Now you can run `rubocop` and it will automatically load the RuboCop Migrations
37
+ cops together with the standard cops.
33
38
 
34
39
  ### Command line
35
40
 
36
- ```bash
41
+ ```shell
37
42
  rubocop --require rubocop/migrations
38
43
  ```
39
44
 
40
45
  ## The Cop
41
46
 
42
- All cops are located under [`lib/rubocop/cop/migrations`](lib/rubocop/cop/migrations), and contain examples/documentation.
47
+ All cops are located
48
+ under [`lib/rubocop/cop/migrations`](lib/rubocop/cop/migrations), and contain
49
+ examples/documentation.
43
50
 
44
- In your `.rubocop.yml`, you may treat the Cask cops just like any other cop. For example:
51
+ In your `.rubocop.yml`, you may treat the Cask cops just like any other cop. For
52
+ example:
45
53
 
46
54
  ```yaml
47
55
  Migrations/RemoveIndex:
@@ -56,13 +64,25 @@ Migrations/RemoveIndex:
56
64
  4. Push to the branch (`git push origin my-new-feature`)
57
65
  5. Create new Pull Request
58
66
 
59
- For running the spec files, this project depends on RuboCop's spec helpers. This means that in order to run the specs locally, you need a (shallow) clone of the RuboCop repository:
67
+ ### Running the tests
60
68
 
61
- ```bash
62
- git submodule update --init --depth 1 vendor/rubocop
69
+ We use Appraisals in order to run the tests with different rubocop versions to
70
+ ensure compatibility.
71
+
72
+ To run the specs with all supported rubocop versions first install the required
73
+ dependencies with:
74
+
75
+ ```shell
76
+ bundle exec appraisals install
63
77
  ```
64
78
 
79
+ Then run the specs by just running `rake` it will run specs with all the
80
+ versions.
81
+
82
+ For more info just check the appraisals documentation
83
+ https://github.com/thoughtbot/appraisal
84
+
65
85
  ## License
66
86
 
67
- `rubocop-migrations` is MIT licensed. [See the accompanying file](MIT-LICENSE.md) for
68
- the full text.
87
+ `rubocop-migrations` is MIT
88
+ licensed. [See the accompanying file](MIT-LICENSE.md) for the full text.
data/Rakefile CHANGED
@@ -1,6 +1,13 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+ require 'appraisal'
3
6
 
4
- RSpec::Core::RakeTask.new(:spec)
7
+ RSpec::Core::RakeTask.new(:test)
5
8
 
6
- task :default => :spec
9
+ if !ENV['APPRAISAL_INITIALIZED'] && !ENV['TRAVIS']
10
+ task default: :appraisal
11
+ else
12
+ task default: :test
13
+ end
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_DISABLE_SHARED_GEMS: "true"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "~> 0.41.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "~> 0.42.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rubocop", "~> 0.43.0"
6
+
7
+ gemspec :path => "../"
@@ -1,5 +1,5 @@
1
1
  module Rubocop
2
2
  module Migrations
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -20,9 +20,10 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_runtime_dependency 'rubocop', '~> 0.41.0'
23
+ spec.add_runtime_dependency 'rubocop', '~> 0.41'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 1.11'
26
26
  spec.add_development_dependency 'rake', '~> 10.0'
27
- spec.add_development_dependency 'rspec', '3.5.0'
27
+ spec.add_development_dependency 'rspec', '~> 3.5'
28
+ spec.add_development_dependency 'appraisal'
28
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - enricostano
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-09-26 00:00:00.000000000 Z
12
+ date: 2016-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubocop
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 0.41.0
20
+ version: '0.41'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 0.41.0
27
+ version: '0.41'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -57,16 +57,30 @@ dependencies:
57
57
  name: rspec
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '='
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '3.5'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '3.5'
70
+ - !ruby/object:Gem::Dependency
71
+ name: appraisal
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
61
75
  - !ruby/object:Gem::Version
62
- version: 3.5.0
76
+ version: '0'
63
77
  type: :development
64
78
  prerelease: false
65
79
  version_requirements: !ruby/object:Gem::Requirement
66
80
  requirements:
67
- - - '='
81
+ - - ">="
68
82
  - !ruby/object:Gem::Version
69
- version: 3.5.0
83
+ version: '0'
70
84
  description: Performs some checks for migration sanity
71
85
  email:
72
86
  - ocirne.onats@gmail.com
@@ -78,12 +92,18 @@ files:
78
92
  - ".gitignore"
79
93
  - ".rspec"
80
94
  - ".travis.yml"
95
+ - Appraisals
81
96
  - Gemfile
82
97
  - LICENSE.txt
83
98
  - README.md
84
99
  - Rakefile
85
100
  - bin/console
86
101
  - bin/setup
102
+ - gemfiles/.bundle/config
103
+ - gemfiles/latest_rubocop.gemfile
104
+ - gemfiles/rubocop_0.41.gemfile
105
+ - gemfiles/rubocop_0.42.gemfile
106
+ - gemfiles/rubocop_0.43.gemfile
87
107
  - lib/rubocop/cop/migrations/remove_index.rb
88
108
  - lib/rubocop/migrations.rb
89
109
  - lib/rubocop/migrations/version.rb