index_shotgun 0.3.0 → 1.0.0

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: 3d782336b1c4e2a721d5b94c3127849fa49492f9
4
- data.tar.gz: 66240f9286136b54f9b799e03fb9339d31fcc198
3
+ metadata.gz: 65ac3d14caebadb787d825c169398eb63567c2b0
4
+ data.tar.gz: c11b30830d3a14fea4369c9f99048bd0065dd4ba
5
5
  SHA512:
6
- metadata.gz: 5d80243cc017af759eb4322998cd6d423286c1e7649d6625ac0b0392b94e6c563a7ef85fe087594e0a8391f127a36ec32941bedb8b358e6b66f03e6f54429171
7
- data.tar.gz: f3ddb4fef643d6bab7157256b347d05719442735b7d8bf6970c133d927ac937c19ad790754df42f5f85be739337f10f12d7161ff11c13d82c59e046786adcead
6
+ metadata.gz: bda06e43aadddb1813c9e0f097299a417e68b86f1775d8c364cde6da5a95ba8ee552e575f0ef09fd896e29177ac88b7dd75b44403c4276dca47fff0b3b4f27ff
7
+ data.tar.gz: 229854c455c117d6e1fe70a8b7a29bb5d057489a7ccb5582bed9a07f0bafcacabcd11be23636c68dc131ed7f21187d63cc9d9689ab518bac8ab216e69df36b76
@@ -0,0 +1,162 @@
1
+ version: 2.1
2
+
3
+ environment: &environment
4
+ LANG: en_US.UTF-8
5
+ LANGUAGE: en_US.UTF-8
6
+ LC_ALL: C.UTF-8
7
+
8
+ BUNDLE_PATH: vendor/bundle
9
+ CC_TEST_REPORTER_ID: 377596024a4c6f3c4c4b9a0cd16add92fb5e7f716663629b5efd080377c0b838
10
+
11
+ executors:
12
+ ruby:
13
+ docker:
14
+ - image: circleci/ruby
15
+ environment:
16
+ <<: *environment
17
+
18
+ working_directory: /home/circleci/app
19
+
20
+ oracle:
21
+ docker:
22
+ - image: wnameless/oracle-xe-11g:16.04
23
+ environment:
24
+ <<: *environment
25
+ DATABASE: oracle
26
+
27
+ ORACLE_HOME: /u01/app/oracle/product/11.2.0/xe
28
+ ORACLE_SID: XE
29
+ ORACLE_SYSTEM_PASSWORD: oracle
30
+ NLS_LANG: AMERICAN_AMERICA.UTF8
31
+
32
+ working_directory: /home/circleci/app
33
+
34
+ commands:
35
+ setup_bundle:
36
+ description: "Setup bundle with cache"
37
+
38
+ parameters:
39
+ bundle_without:
40
+ type: string
41
+
42
+ steps:
43
+ - restore_cache:
44
+ keys:
45
+ - v3-bundle-{{ .Environment.CIRCLE_JOB }}-{{ epoch }}
46
+ - v3-bundle-{{ .Environment.CIRCLE_JOB }}
47
+
48
+ - run:
49
+ name: Setup bundle
50
+ command: |
51
+ set -xe
52
+ ruby --version
53
+ bundle --version
54
+ gem --version
55
+
56
+ bundle check || bundle install --jobs=4 --without << parameters.bundle_without >> --path=${BUNDLE_PATH:-vendor/bundle}
57
+ bundle clean
58
+
59
+ - save_cache:
60
+ key: v3-bundle-{{ .Environment.CIRCLE_JOB }}-{{ epoch }}
61
+ paths:
62
+ - /home/circleci/app/vendor/bundle
63
+ - /home/circleci/app/gemfiles/vendor/bundle
64
+ - /home/circleci/app/Gemfile.lock
65
+
66
+ with-cc-test-reporter:
67
+ description: "Run test with cc-test-reporter"
68
+ parameters:
69
+ steps:
70
+ type: steps
71
+ default: []
72
+ description: "Run steps between `before-build` and `after-build`"
73
+ steps:
74
+ - run:
75
+ name: Setup Code Climate test-reporter
76
+ command: |
77
+ # download test reporter as a static binary
78
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
79
+ chmod +x ./cc-test-reporter
80
+ - run: ./cc-test-reporter before-build
81
+ - steps: << parameters.steps >>
82
+ - run:
83
+ command: ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
84
+ when: always
85
+
86
+ jobs:
87
+ oracle_activerecord:
88
+ parameters:
89
+ gemfile:
90
+ type: string
91
+ executor:
92
+ name: oracle
93
+ environment:
94
+ BUNDLE_GEMFILE: gemfiles/<< parameters.gemfile >>.gemfile
95
+ steps:
96
+ - run:
97
+ name: Setup ruby
98
+ command: |
99
+ apt-get update
100
+ apt-get install -y software-properties-common
101
+ apt-add-repository -y ppa:brightbox/ruby-ng
102
+ apt-get update
103
+ apt-get install -y ruby2.5 ruby2.5-dev git build-essential tar curl
104
+
105
+ gem update --system --no-document
106
+ gem install bundler --no-document
107
+ shell: /bin/bash -xe
108
+
109
+ - run:
110
+ name: Setup oracle
111
+ command: |
112
+ export PATH=$ORACLE_HOME/bin:$PATH
113
+ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
114
+ /usr/sbin/startup.sh
115
+ /etc/init.d/oracle-xe status
116
+ shell: /bin/bash -xe
117
+
118
+ - checkout
119
+ - setup_bundle:
120
+ bundle_without: mysql postgresql sqlite3
121
+
122
+ - with-cc-test-reporter:
123
+ steps:
124
+ - run: ./ci/build.sh
125
+
126
+ rubocop:
127
+ executor:
128
+ name: ruby
129
+
130
+ steps:
131
+ - checkout
132
+ - setup_bundle:
133
+ bundle_without: mysql postgresql sqlite3 oracle
134
+
135
+ - run: bundle exec rubocop
136
+
137
+ build_jobs: &build_jobs
138
+ - oracle_activerecord:
139
+ name: "oracle_activerecord:5.0"
140
+ gemfile: "activerecord_5_0"
141
+ - oracle_activerecord:
142
+ name: "oracle_activerecord:5.1"
143
+ gemfile: "activerecord_5_1"
144
+ - oracle_activerecord:
145
+ name: "oracle_activerecord:5.2"
146
+ gemfile: "activerecord_5_2"
147
+ - rubocop
148
+
149
+ workflows:
150
+ version: 2
151
+
152
+ build:
153
+ jobs: *build_jobs
154
+
155
+ weekly_build:
156
+ triggers:
157
+ - schedule:
158
+ cron: "00 19 * * 5" # JST 4:00 (Sat)
159
+ filters:
160
+ branches:
161
+ only: master
162
+ jobs: *build_jobs
@@ -1 +1,2 @@
1
- --date-format='%Y/%m/%d'
1
+ date-format=%Y/%m/%d
2
+ unreleased=true
@@ -1,4 +1,28 @@
1
- inherit_from: .rubocop_standard.yml
1
+ inherit_gem:
2
+ onkcop:
3
+ - "config/rubocop.yml"
4
+ - "config/rspec.yml"
2
5
 
3
- Rails/Output:
6
+ AllCops:
7
+ TargetRubyVersion: 2.3
8
+
9
+ Layout/AlignHash:
10
+ EnforcedHashRocketStyle: table
11
+ EnforcedColonStyle: table
12
+
13
+ Metrics/AbcSize:
14
+ Max: 33
15
+
16
+ Metrics/MethodLength:
17
+ Max: 25
18
+
19
+ RSpec/NestedGroups:
4
20
  Enabled: false
21
+
22
+ RSpec/SharedExamples:
23
+ Enabled: false
24
+
25
+ Security/Eval:
26
+ Exclude:
27
+ - "Gemfile"
28
+ - "gemfiles/*.gemfile"
@@ -1,35 +1,39 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1
4
- - 2.2.2
5
- - 2.3.1
6
- - ruby-head
3
+ - 2.3
4
+ - 2.4
5
+ - 2.5
6
+ - 2.6
7
+ - ruby-head
7
8
  gemfile:
8
- - gemfiles/activerecord_4_2.gemfile
9
- - gemfiles/activerecord_5_0.gemfile
9
+ - gemfiles/activerecord_5_0.gemfile
10
+ - gemfiles/activerecord_5_1.gemfile
11
+ - gemfiles/activerecord_5_2.gemfile
10
12
  env:
11
- - DATABASE=mysql
12
- - DATABASE=postgresql
13
- - DATABASE=sqlite3
14
- before_script:
15
- - export CI=true
16
- - export CODECLIMATE_REPO_TOKEN=377596024a4c6f3c4c4b9a0cd16add92fb5e7f716663629b5efd080377c0b838
17
- before_install: gem install bundler -v 1.10.6
13
+ - DATABASE=mysql
14
+ - DATABASE=postgresql
15
+ - DATABASE=sqlite3
18
16
  bundler_args: --without oracle
17
+ before_install:
18
+ - travis_retry gem update --system || travis_retry gem update --system 2.7.8
19
+ - travis_retry gem install bundler --no-document || travis_retry gem install bundler --no-document -v 1.17.3
20
+ before_script:
21
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
22
+ - chmod +x ./cc-test-reporter
23
+ - ./cc-test-reporter before-build
24
+ - export CC_TEST_REPORTER_ID=377596024a4c6f3c4c4b9a0cd16add92fb5e7f716663629b5efd080377c0b838
19
25
  script: "./ci/build.sh"
26
+ after_script:
27
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
20
28
  branches:
21
29
  only:
22
- - master
30
+ - master
23
31
  notifications:
24
32
  email: false
25
33
  slack:
26
34
  secure: YGQKOd0oz96gfQtyfTLj7N2Riq93oj1lR9X5hf4071Zu9q3wQjLD4a5y39iVAtOpK2Lw3ShM93kcGREZfpThx9jQ0jUd26DWLLFokZvM82l5+hD7PMhLU1Pv/EbW7mTGAw1TR0su98m91A71qJghdZsT/UrP+QN/4zV72I8XiYrkAiKaTLaucEN4Pn2GgSAGV4Hs7eqT7jNBkGbxSOio3MttoYMDz7dBfR3Z8GRk7jSL5z820zejHNPbfbpwZQhtx/rY/KGSHoIRDc7je6Aiebd5wElQFKsh13LFYSbGaYvB2gRdU/ZmyG0YLV+0hUvWYS14QvCUFrCbiKmRf58tTk3Y/FVtBga+Aj11JrAgpvR9qf2y+gC3BwBwBwaElZ2gMmfZOzXPI7P+OATKbVCQOE4PCAIUkfBbaYkg6FJlYwaume5n+ObLhZPZwa8EGaOkrzonKRhU7hMBT6A+aQkwz0wfccErEog8vB/5OYSMquxZtfWywLgUpnyg97SYeC8aaON+/U8edWsYUR+0bBIySNYEAq0algQEo52cLh4qNpLJeb/zRdFX2b+CI1EYPa+rDSygD7NpT+mx5/5leAcxyvp4S3iKxjFEVkoKwIEoLnqbqjarwz2LjJ+l32wZDhmBV5UggpKoieV5KtpkIwOCJ4g6t+aq786oSW+/GWWI9s0=
27
35
  matrix:
28
36
  allow_failures:
29
- - rvm: ruby-head
30
- exclude:
31
- # NOTE: activesupport 5.x requires Ruby version >= 2.2.2
32
- - rvm: 2.1
33
- gemfile: gemfiles/activerecord_5_0.gemfile
37
+ - rvm: ruby-head
34
38
  cache: bundler
35
39
  sudo: false
@@ -1,4 +1,24 @@
1
1
  # Change Log
2
+ ## Unreleased
3
+ [Full Changelog](https://github.com/sue445/index_shotgun/compare/v1.0.0...master)
4
+
5
+ ## [v1.0.0](https://github.com/sue445/index_shotgun/tree/v1.0.0) (2019/01/06)
6
+ [Full Changelog](https://github.com/sue445/index_shotgun/compare/v0.3.0...v1.0.0)
7
+
8
+ ### Breaking changes :bomb:
9
+ * Drop support for Ruby 2.2 and Rails 4.2
10
+ * https://github.com/sue445/index_shotgun/pull/60
11
+
12
+ ## [v0.3.0](https://github.com/sue445/index_shotgun/tree/v0.3.0) (2016/07/23)
13
+ [Full Changelog](https://github.com/sue445/index_shotgun/compare/v0.2.1...v0.3.0)
14
+
15
+ **Merged pull requests:**
16
+
17
+ - exit on failure if exists duplicate index [\#26](https://github.com/sue445/index_shotgun/pull/26) ([sue445](https://github.com/sue445))
18
+ - Resupport ruby 2.1 [\#25](https://github.com/sue445/index_shotgun/pull/25) ([sue445](https://github.com/sue445))
19
+ - Support activerecord 5 [\#24](https://github.com/sue445/index_shotgun/pull/24) ([sue445](https://github.com/sue445))
20
+ - Add CI for oracle [\#23](https://github.com/sue445/index_shotgun/pull/23) ([sue445](https://github.com/sue445))
21
+ - Test ruby 2.3.1 [\#22](https://github.com/sue445/index_shotgun/pull/22) ([sue445](https://github.com/sue445))
2
22
 
3
23
  ## [v0.2.1](https://github.com/sue445/index_shotgun/tree/v0.2.1) (2016/02/17)
4
24
  [Full Changelog](https://github.com/sue445/index_shotgun/compare/v0.2.0...v0.2.1)
data/Gemfile CHANGED
@@ -3,4 +3,17 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in index_shotgun.gemspec
4
4
  gemspec
5
5
 
6
- eval(Pathname("gemfiles/databases.gemfile").read)
6
+ group :postgresql do
7
+ gem "pg"
8
+ end
9
+
10
+ group :mysql do
11
+ gem "mysql2"
12
+ end
13
+
14
+ group :oracle do
15
+ gem "activerecord-oracle_enhanced-adapter"
16
+ gem "ruby-oci8"
17
+ end
18
+
19
+ eval(Pathname("gemfiles/common.gemfile").read)
data/README.md CHANGED
@@ -1,11 +1,9 @@
1
1
  # IndexShotgun :fire: :gun: :cop:
2
2
  [![Gem Version](https://badge.fury.io/rb/index_shotgun.svg)](http://badge.fury.io/rb/index_shotgun)
3
3
  [![Build Status](https://travis-ci.org/sue445/index_shotgun.svg?branch=master)](https://travis-ci.org/sue445/index_shotgun)
4
+ [![CircleCI](https://circleci.com/gh/sue445/index_shotgun/tree/master.svg?style=svg)](https://circleci.com/gh/sue445/index_shotgun/tree/master)
4
5
  [![Code Climate](https://codeclimate.com/github/sue445/index_shotgun/badges/gpa.svg)](https://codeclimate.com/github/sue445/index_shotgun)
5
6
  [![Coverage Status](https://coveralls.io/repos/sue445/index_shotgun/badge.svg?branch=master&service=github)](https://coveralls.io/github/sue445/index_shotgun?branch=master)
6
- [![Dependency Status](https://gemnasium.com/sue445/index_shotgun.svg)](https://gemnasium.com/sue445/index_shotgun)
7
-
8
- [![wercker status](https://app.wercker.com/status/1af95c0c5debe57562ec3036c849f80d/m/master "wercker status")](https://app.wercker.com/project/bykey/1af95c0c5debe57562ec3036c849f80d)
9
7
 
10
8
  Duplicate index checker.
11
9
 
@@ -48,7 +46,7 @@ ALTER TABLE `user_stocks` DROP INDEX `index_user_stocks_on_user_id`;
48
46
  ```
49
47
 
50
48
  ## Requirements
51
- * Ruby 2.1+
49
+ * Ruby 2.3+
52
50
  * Database you want to use (ex. MySQL, PostgreSQL or SQLite3)
53
51
 
54
52
  ## Installation
@@ -1,7 +1,7 @@
1
1
  #!/bin/bash -xe
2
2
 
3
3
  cp ci/database.yml.${DATABASE} spec/config/database.yml
4
- bundle exec rspec
4
+ bundle exec rspec --profile
5
5
 
6
6
  bundle exec ./exe/index_shotgun version
7
7
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'index_shotgun/cli'
3
+ require "index_shotgun/cli"
4
4
 
5
5
  IndexShotgun::CLI.start(ARGV)
@@ -1,7 +1,22 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "activerecord", "~> 5.0.0"
3
+ gem "activerecord", "~> 5.0.7"
4
4
 
5
- gemspec path: '../'
5
+ group :postgresql do
6
+ # https://github.com/rails/rails/blob/v5.0.7/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L2
7
+ gem "pg", ">= 0.18", "< 2.0"
8
+ end
6
9
 
7
- eval(Pathname("#{__dir__}/databases.gemfile").read)
10
+ group :mysql do
11
+ # https://github.com/rails/rails/blob/v5.0.7/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L4
12
+ gem "mysql2", ">= 0.4.4", "< 0.6.0"
13
+ end
14
+
15
+ group :oracle do
16
+ gem "activerecord-oracle_enhanced-adapter", "~> 1.7.11"
17
+ gem "ruby-oci8"
18
+ end
19
+
20
+ gemspec path: "../"
21
+
22
+ eval(Pathname("#{__dir__}/common.gemfile").read)
@@ -0,0 +1,22 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "activerecord", "~> 5.1.6"
4
+
5
+ group :postgresql do
6
+ # https://github.com/rails/rails/blob/v5.1.6/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L2
7
+ gem "pg", ">= 0.18", "< 2.0"
8
+ end
9
+
10
+ group :mysql do
11
+ # https://github.com/rails/rails/blob/v5.1.6/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L4-L6
12
+ gem "mysql2", ">= 0.4.4", "< 0.6.0"
13
+ end
14
+
15
+ group :oracle do
16
+ gem "activerecord-oracle_enhanced-adapter", "~> 1.8.2"
17
+ gem "ruby-oci8"
18
+ end
19
+
20
+ gemspec path: "../"
21
+
22
+ eval(Pathname("#{__dir__}/common.gemfile").read)
@@ -0,0 +1,22 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "activerecord", "~> 5.2.0"
4
+
5
+ group :postgresql do
6
+ # https://github.com/rails/rails/blob/v5.2.0/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L4
7
+ gem "pg", ">= 0.18", "< 2.0"
8
+ end
9
+
10
+ group :mysql do
11
+ # https://github.com/rails/rails/blob/v5.2.0/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6
12
+ gem "mysql2", ">= 0.4.4", "< 0.6.0"
13
+ end
14
+
15
+ group :oracle do
16
+ gem "activerecord-oracle_enhanced-adapter", "~> 5.2.3"
17
+ gem "ruby-oci8"
18
+ end
19
+
20
+ gemspec path: "../"
21
+
22
+ eval(Pathname("#{__dir__}/common.gemfile").read)
@@ -0,0 +1,3 @@
1
+ group :sqlite3 do
2
+ gem "sqlite3"
3
+ end
@@ -1,5 +1,4 @@
1
- # coding: utf-8
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
3
  require "index_shotgun/version"
5
4
 
@@ -14,24 +13,26 @@ Gem::Specification.new do |spec|
14
13
  spec.homepage = "https://github.com/sue445/index_shotgun"
15
14
  spec.license = "MIT"
16
15
 
17
- spec.required_ruby_version = ">= 2.1"
16
+ spec.required_ruby_version = ">= 2.3.0"
18
17
 
19
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
20
19
  spec.bindir = "exe"
21
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
22
21
  spec.require_paths = ["lib"]
23
22
 
24
- spec.add_dependency "activerecord"
23
+ spec.add_dependency "activerecord", ">= 5.0.0"
25
24
  spec.add_dependency "thor"
26
25
 
27
26
  spec.add_development_dependency "bundler"
28
- spec.add_development_dependency "codeclimate-test-reporter"
29
27
  spec.add_development_dependency "coveralls"
28
+ spec.add_development_dependency "onkcop", "0.53.0.2"
30
29
  spec.add_development_dependency "pry-byebug"
31
30
  spec.add_development_dependency "rake", "~> 10.0"
32
- spec.add_development_dependency "rake_shared_context"
31
+ spec.add_development_dependency "rake_shared_context", "0.2.2"
33
32
  spec.add_development_dependency "rspec"
34
33
  spec.add_development_dependency "rspec-its"
35
34
  spec.add_development_dependency "rspec-power_assert"
36
- spec.add_development_dependency "rubocop", "0.31.0"
35
+ spec.add_development_dependency "rubocop", "0.62.0"
36
+ spec.add_development_dependency "rubocop_auto_corrector"
37
+ spec.add_development_dependency "simplecov"
37
38
  end