activerecord-simple_index_name 0.1.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 849ff84b3033d6444d18452d1d9ddd961a063628
4
+ data.tar.gz: 29de6a7c397a663a8d261370f6775227e81b96b5
5
+ SHA512:
6
+ metadata.gz: 6530739de8506345c4224df48afa26f3c6829547e9e676df8767bc299f4d3117311c8a2cfa2efdc89ae9ec0f8d88d2c89b41c47622f3924357eb9863120186b2
7
+ data.tar.gz: a39c6530502f4a65ba71ee8412d7097b3f8fb8104aad23b8a931c7f66912a879c61254a02e4e65099e543994d94722d9ac9f8a977a4cdd0e29d2ea5d27f6508d
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ repo_token: qe2G5E6W8zo5gkiua587xrqDlrxM4JX0m
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,28 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1
4
+ - 2.2
5
+ - 2.3
6
+ - ruby-head
7
+ gemfile:
8
+ - gemfiles/activerecord_4_1.gemfile
9
+ - gemfiles/activerecord_4_2.gemfile
10
+ cache: bundler
11
+ sudo: false
12
+ before_install: gem install bundler -v 1.10.6
13
+ before_script:
14
+ - export CODECLIMATE_REPO_TOKEN=900e51ca1a374ee25f9166b5eb3f2a1d86fa33ca47d4dee6e9746f4120fc7fef
15
+ - export CI=true
16
+ script:
17
+ - bundle exec rspec
18
+ branches:
19
+ only:
20
+ - master
21
+ notifications:
22
+ email: false
23
+ slack:
24
+ secure: iJVdq7jPe/vHRBDRZhGOBrvUNqXAVWtfP6yBoZ58RaMcboelaNxZm15o4+EhTCwNb3Sz3wM3MXQo9oQngB31UNpleavg0xK315oFBsQQ24M6oMWdCR6PndWH3sJtf5CZvXUZ0hEZDPG2dkDGTfXF2HyhyotHI3FzrvXAjI8R8sJKxGRVAga0uDAfUntsS19SS8Ftwt6ob3VNKl5GKYElZ4U/gZ3n2e+I8dxiTy9YNBaydNLf33lZe3iZHTQbcRDxH5HbLof0FItGPEvoPJSxnqa6OyfbsTajhRUUOU2m2RInJjSHCliHV1F8nzPjotCl6N7OegO2HJ93FepsZ2dOul/Hbxkb0BuxFxYFgGfS0bHDb66V6JiqmLpwBi/QibP1kVEiP4vizLdX5b32fi/p1L7FRDX00qsYsjEdDyBH5WrWF4yTKTpNotwHmb/E4nFfbtme3jawvSJq5Kg1FL07H3pTP6nUgEKKyYq1FQhxHEGgKHMZYmUG+B7kILgQj3ZM0w7M09Hb2NMDuv7PEr7CbOw6x7ulVUu8ZfgpU7+jKUlnSS8xPN7/kso3hnSWA4PRlNt0Ef9ingUstNpb4wJYDiAmYD7NfFLf4K6CikkcgGXJbV/XYwszb8DKV39vIYDgW0VzREerixo4+SQE0v7FFF1ZQQbQ3yZaQ26UnlYm/Ag=
25
+ matrix:
26
+ allow_failures:
27
+ - rvm: ruby-head
28
+ - rvm: 2.3
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in activerecord-simple_index_name.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 sue445
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Activerecord::SimpleIndexName
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/activerecord/simple_index_name`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ [![Build Status](https://travis-ci.org/sue445/activerecord-simple_index_name.svg?branch=master)](https://travis-ci.org/sue445/activerecord-simple_index_name)
6
+ [![Dependency Status](https://gemnasium.com/sue445/activerecord-simple_index_name.svg)](https://gemnasium.com/sue445/activerecord-simple_index_name)
7
+ [![Coverage Status](https://coveralls.io/repos/sue445/activerecord-simple_index_name/badge.svg?branch=master&service=github)](https://coveralls.io/github/sue445/activerecord-simple_index_name?branch=master)
8
+ [![Code Climate](https://codeclimate.com/github/sue445/activerecord-simple_index_name/badges/gpa.svg)](https://codeclimate.com/github/sue445/activerecord-simple_index_name)
9
+ [![Issue Count](https://codeclimate.com/github/sue445/activerecord-simple_index_name/badges/issue_count.svg)](https://codeclimate.com/github/sue445/activerecord-simple_index_name)
10
+
11
+ TODO: Delete this and the text above, and describe your gem
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ ```ruby
18
+ gem 'activerecord-simple_index_name'
19
+ ```
20
+
21
+ And then execute:
22
+
23
+ $ bundle
24
+
25
+ Or install it yourself as:
26
+
27
+ $ gem install activerecord-simple_index_name
28
+
29
+ ## Usage
30
+
31
+ TODO: Write usage instructions here
32
+
33
+ ## Development
34
+
35
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
36
+
37
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
38
+
39
+ ## Contributing
40
+
41
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/activerecord-simple_index_name.
42
+
43
+
44
+ ## License
45
+
46
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
47
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'activerecord/simple_index_name/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "activerecord-simple_index_name"
8
+ spec.version = Activerecord::SimpleIndexName::VERSION
9
+ spec.authors = ["sue445"]
10
+ spec.email = ["sue445@sue445.net"]
11
+
12
+ spec.summary = %q{Shorten index name}
13
+ spec.description = %q{Shorten index name}
14
+ spec.homepage = "https://github.com/sue445/activerecord-simple_index_name"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_dependency "activerecord"
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.10"
25
+ spec.add_development_dependency "coveralls"
26
+ spec.add_development_dependency "codeclimate-test-reporter"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "rspec"
29
+ spec.add_development_dependency "rspec-power_assert"
30
+ spec.add_development_dependency "sqlite3"
31
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "activerecord/simple_index_name"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "activerecord", "~> 4.1.0"
4
+
5
+ gemspec path: '../'
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "activerecord", "~> 4.2.0"
4
+
5
+ gemspec path: '../'
@@ -0,0 +1,15 @@
1
+ module ActiveRecord
2
+ module ConnectionAdapters
3
+ module SchemaStatements
4
+ def index_name_with_simple(table_name, options)
5
+ if Hash === options && options[:column]
6
+ Array.wrap(options[:column]) * "_and_"
7
+ else
8
+ index_name_without_simple(table_name, options)
9
+ end
10
+ end
11
+
12
+ alias_method_chain :index_name, :simple
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ module Activerecord
2
+ module SimpleIndexName
3
+ class Railtie < ::Rails::Railtie
4
+ on_load :active_record do
5
+ load "#{__dir__}/active_record_ext.rb"
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ module Activerecord
2
+ module SimpleIndexName
3
+ VERSION = "0.1.0.beta1"
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ require "activerecord/simple_index_name/version"
2
+ require "active_record"
3
+
4
+ module Activerecord
5
+ module SimpleIndexName
6
+ end
7
+ end
8
+
9
+ if defined?(Rails)
10
+ require "activerecord/simple_index_name/railtie"
11
+ else
12
+ require "activerecord/simple_index_name/active_record_ext"
13
+ end
@@ -0,0 +1 @@
1
+ require "activerecord/simple_index_name"
metadata ADDED
@@ -0,0 +1,174 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activerecord-simple_index_name
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0.beta1
5
+ platform: ruby
6
+ authors:
7
+ - sue445
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-11-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activerecord
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: coveralls
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: codeclimate-test-reporter
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
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: rspec-power_assert
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: sqlite3
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: Shorten index name
126
+ email:
127
+ - sue445@sue445.net
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - ".coveralls.yml"
133
+ - ".gitignore"
134
+ - ".rspec"
135
+ - ".travis.yml"
136
+ - Gemfile
137
+ - LICENSE.txt
138
+ - README.md
139
+ - Rakefile
140
+ - activerecord-simple_index_name.gemspec
141
+ - bin/console
142
+ - bin/setup
143
+ - gemfiles/activerecord_4_1.gemfile
144
+ - gemfiles/activerecord_4_2.gemfile
145
+ - lib/activerecord-simple_index_name.rb
146
+ - lib/activerecord/simple_index_name.rb
147
+ - lib/activerecord/simple_index_name/active_record_ext.rb
148
+ - lib/activerecord/simple_index_name/railtie.rb
149
+ - lib/activerecord/simple_index_name/version.rb
150
+ homepage: https://github.com/sue445/activerecord-simple_index_name
151
+ licenses:
152
+ - MIT
153
+ metadata: {}
154
+ post_install_message:
155
+ rdoc_options: []
156
+ require_paths:
157
+ - lib
158
+ required_ruby_version: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ required_rubygems_version: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">"
166
+ - !ruby/object:Gem::Version
167
+ version: 1.3.1
168
+ requirements: []
169
+ rubyforge_project:
170
+ rubygems_version: 2.4.5.1
171
+ signing_key:
172
+ specification_version: 4
173
+ summary: Shorten index name
174
+ test_files: []