sqlite3_ar_regexp 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -6
- data/README.md +3 -1
- data/changelog.md +4 -0
- data/lib/sqlite3_ar_regexp/extension.rb +6 -3
- data/lib/sqlite3_ar_regexp/version.rb +1 -1
- data/spec/regexp_spec.rb +2 -2
- data/sqlite3_ar_regexp.gemspec +21 -18
- metadata +80 -84
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -2,11 +2,13 @@
|
|
2
2
|
|
3
3
|
This adds REGEXP support to SQLite3 in ActiveRecord.
|
4
4
|
|
5
|
+
This project uses [Semantic Versioning](http://semver.org).
|
6
|
+
|
5
7
|
## Installation
|
6
8
|
|
7
9
|
Add this line to your application's Gemfile:
|
8
10
|
|
9
|
-
gem 'sqlite3_ar_regexp'
|
11
|
+
gem 'sqlite3_ar_regexp', '~> 2.0'
|
10
12
|
|
11
13
|
And then execute:
|
12
14
|
|
data/changelog.md
CHANGED
@@ -5,10 +5,13 @@ module SQLite3ARRegexp
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
included do
|
8
|
-
|
9
|
-
|
8
|
+
alias_method :old_initialize, :initialize
|
9
|
+
private :old_initialize
|
10
10
|
|
11
|
-
|
11
|
+
def initialize(connection, logger, config)
|
12
|
+
old_initialize(connection, logger, config)
|
13
|
+
|
14
|
+
connection.create_function('regexp', 2) do |func, pattern, expression|
|
12
15
|
func.result = expression.to_s.match(Regexp.new(pattern.to_s, Regexp::IGNORECASE)) ? 1 : 0
|
13
16
|
end
|
14
17
|
end
|
data/spec/regexp_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe 'SQLite3ARRegexp::Extension' do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
it '
|
15
|
-
NobelPrizeWinner.where('first_name REGEXP "al|ma"').
|
14
|
+
it 'adds "REGEXP" support for ActiveRecord::ConnectionAdapters::SQLite3Adapter' do
|
15
|
+
expect(NobelPrizeWinner.where('first_name REGEXP "al|ma"')).to have(3).records
|
16
16
|
end
|
17
17
|
end
|
data/sqlite3_ar_regexp.gemspec
CHANGED
@@ -1,24 +1,27 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'sqlite3_ar_regexp/version'
|
3
5
|
|
4
|
-
Gem::Specification.new do |
|
5
|
-
|
6
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'sqlite3_ar_regexp'
|
8
|
+
spec.version = SQLite3ARRegexp::VERSION
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
-
gem.summary = %q{Adds REGEXP support for SQLite3 in ActiveRecord.}
|
11
|
-
gem.description = %q{Adds REGEXP support for SQLite3 in ActiveRecord.}
|
12
|
-
gem.homepage = 'https://github.com/AaronLasseigne/sqlite3_ar_regexp'
|
10
|
+
spec.authors = ['Aaron Lasseigne']
|
11
|
+
spec.email = ['aaron.lasseigne@gmail.com']
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
spec.summary = %q{Adds REGEXP support for SQLite3 in ActiveRecord.}
|
14
|
+
spec.description = spec.summary
|
15
|
+
spec.homepage = 'https://github.com/AaronLasseigne/sqlite3_ar_regexp'
|
16
|
+
spec.license = 'MIT'
|
18
17
|
|
19
|
-
|
20
|
-
|
18
|
+
spec.files = `git ls-files`.split($/)
|
19
|
+
spec.test_files = spec.files.grep(%r{^spec/})
|
20
|
+
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
spec.add_dependency 'sqlite3'
|
23
|
+
spec.add_dependency 'activerecord', '>= 3.2'
|
24
|
+
|
25
|
+
spec.add_development_dependency 'rake'
|
26
|
+
spec.add_development_dependency 'rspec'
|
24
27
|
end
|
metadata
CHANGED
@@ -1,89 +1,87 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqlite3_ar_regexp
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
hash: 19
|
3
|
+
version: !ruby/object:Gem::Version
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
- 0
|
10
|
-
version: 1.1.0
|
5
|
+
version: 2.0.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Aaron Lasseigne
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
22
|
-
none: false
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
hash: 3
|
27
|
-
segments:
|
28
|
-
- 0
|
29
|
-
version: "0"
|
30
|
-
version_requirements: *id001
|
12
|
+
date: 2013-07-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
31
15
|
name: sqlite3
|
32
16
|
type: :runtime
|
33
|
-
|
34
|
-
|
35
|
-
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
36
22
|
none: false
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
version_requirements: *id002
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ! '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
none: false
|
29
|
+
prerelease: false
|
30
|
+
- !ruby/object:Gem::Dependency
|
46
31
|
name: activerecord
|
47
32
|
type: :runtime
|
48
|
-
|
49
|
-
|
50
|
-
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '3.2'
|
38
|
+
none: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.2'
|
51
44
|
none: false
|
52
|
-
|
53
|
-
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
hash: 3
|
56
|
-
segments:
|
57
|
-
- 0
|
58
|
-
version: "0"
|
59
|
-
version_requirements: *id003
|
45
|
+
prerelease: false
|
46
|
+
- !ruby/object:Gem::Dependency
|
60
47
|
name: rake
|
61
48
|
type: :development
|
62
|
-
|
63
|
-
|
64
|
-
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
none: false
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
65
60
|
none: false
|
66
|
-
|
67
|
-
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
hash: 3
|
70
|
-
segments:
|
71
|
-
- 0
|
72
|
-
version: "0"
|
73
|
-
version_requirements: *id004
|
61
|
+
prerelease: false
|
62
|
+
- !ruby/object:Gem::Dependency
|
74
63
|
name: rspec
|
75
64
|
type: :development
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
none: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
none: false
|
76
77
|
prerelease: false
|
77
78
|
description: Adds REGEXP support for SQLite3 in ActiveRecord.
|
78
|
-
email:
|
79
|
+
email:
|
79
80
|
- aaron.lasseigne@gmail.com
|
80
81
|
executables: []
|
81
|
-
|
82
82
|
extensions: []
|
83
|
-
|
84
83
|
extra_rdoc_files: []
|
85
|
-
|
86
|
-
files:
|
84
|
+
files:
|
87
85
|
- .gitignore
|
88
86
|
- .travis.yml
|
89
87
|
- Gemfile
|
@@ -98,38 +96,36 @@ files:
|
|
98
96
|
- spec/test.sqlite3
|
99
97
|
- sqlite3_ar_regexp.gemspec
|
100
98
|
homepage: https://github.com/AaronLasseigne/sqlite3_ar_regexp
|
101
|
-
licenses:
|
102
|
-
|
99
|
+
licenses:
|
100
|
+
- MIT
|
103
101
|
post_install_message:
|
104
102
|
rdoc_options: []
|
105
|
-
|
106
|
-
require_paths:
|
103
|
+
require_paths:
|
107
104
|
- lib
|
108
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
hash: 3
|
114
|
-
segments:
|
105
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
segments:
|
115
110
|
- 0
|
116
|
-
|
117
|
-
|
111
|
+
hash: 4442112878736695253
|
112
|
+
version: '0'
|
118
113
|
none: false
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
segments:
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
segments:
|
124
119
|
- 0
|
125
|
-
|
120
|
+
hash: 4442112878736695253
|
121
|
+
version: '0'
|
122
|
+
none: false
|
126
123
|
requirements: []
|
127
|
-
|
128
124
|
rubyforge_project:
|
129
|
-
rubygems_version: 1.8.
|
125
|
+
rubygems_version: 1.8.23
|
130
126
|
signing_key:
|
131
127
|
specification_version: 3
|
132
128
|
summary: Adds REGEXP support for SQLite3 in ActiveRecord.
|
133
|
-
test_files:
|
129
|
+
test_files:
|
134
130
|
- spec/regexp_spec.rb
|
135
131
|
- spec/test.sqlite3
|