simple_autocomplete 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +10 -0
- data/Gemfile.lock +62 -0
- data/Rakefile +6 -5
- data/{README.markdown → Readme.md} +7 -5
- data/VERSION +1 -1
- data/lib/simple_autocomplete.rb +5 -4
- data/simple_autocomplete.gemspec +23 -27
- data/spec/spec_helper.rb +0 -3
- metadata +18 -12
- data/CHANGELOG +0 -4
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
abstract (1.0.0)
|
5
|
+
actionpack (3.0.3)
|
6
|
+
activemodel (= 3.0.3)
|
7
|
+
activesupport (= 3.0.3)
|
8
|
+
builder (~> 2.1.2)
|
9
|
+
erubis (~> 2.6.6)
|
10
|
+
i18n (~> 0.4)
|
11
|
+
rack (~> 1.2.1)
|
12
|
+
rack-mount (~> 0.6.13)
|
13
|
+
rack-test (~> 0.5.6)
|
14
|
+
tzinfo (~> 0.3.23)
|
15
|
+
activemodel (3.0.3)
|
16
|
+
activesupport (= 3.0.3)
|
17
|
+
builder (~> 2.1.2)
|
18
|
+
i18n (~> 0.4)
|
19
|
+
activerecord (3.0.3)
|
20
|
+
activemodel (= 3.0.3)
|
21
|
+
activesupport (= 3.0.3)
|
22
|
+
arel (~> 2.0.2)
|
23
|
+
tzinfo (~> 0.3.23)
|
24
|
+
activesupport (3.0.3)
|
25
|
+
arel (2.0.7)
|
26
|
+
builder (2.1.2)
|
27
|
+
diff-lcs (1.1.2)
|
28
|
+
erubis (2.6.6)
|
29
|
+
abstract (>= 1.0.0)
|
30
|
+
git (1.2.5)
|
31
|
+
i18n (0.5.0)
|
32
|
+
jeweler (1.5.2)
|
33
|
+
bundler (~> 1.0.0)
|
34
|
+
git (>= 1.2.5)
|
35
|
+
rake
|
36
|
+
rack (1.2.1)
|
37
|
+
rack-mount (0.6.13)
|
38
|
+
rack (>= 1.0.0)
|
39
|
+
rack-test (0.5.7)
|
40
|
+
rack (>= 1.0)
|
41
|
+
rake (0.8.7)
|
42
|
+
rspec (2.4.0)
|
43
|
+
rspec-core (~> 2.4.0)
|
44
|
+
rspec-expectations (~> 2.4.0)
|
45
|
+
rspec-mocks (~> 2.4.0)
|
46
|
+
rspec-core (2.4.0)
|
47
|
+
rspec-expectations (2.4.0)
|
48
|
+
diff-lcs (~> 1.1.2)
|
49
|
+
rspec-mocks (2.4.0)
|
50
|
+
sqlite3 (1.3.3)
|
51
|
+
tzinfo (0.3.24)
|
52
|
+
|
53
|
+
PLATFORMS
|
54
|
+
ruby
|
55
|
+
|
56
|
+
DEPENDENCIES
|
57
|
+
actionpack
|
58
|
+
activerecord
|
59
|
+
jeweler
|
60
|
+
rake
|
61
|
+
rspec (~> 2)
|
62
|
+
sqlite3
|
data/Rakefile
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
task :default => :spec
|
2
|
-
require
|
3
|
-
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
4
|
+
t.rspec_opts = '--backtrace --color'
|
5
|
+
end
|
4
6
|
|
5
7
|
begin
|
6
8
|
require 'jeweler'
|
7
|
-
project_name = 'simple_autocomplete'
|
8
9
|
Jeweler::Tasks.new do |gem|
|
9
|
-
gem.name =
|
10
|
+
gem.name = 'simple_autocomplete'
|
10
11
|
gem.summary = "Rails: Simple, customizable, unobstrusive - auto complete"
|
11
12
|
gem.email = "grosser.michael@gmail.com"
|
12
|
-
gem.homepage = "http://github.com/grosser/#{
|
13
|
+
gem.homepage = "http://github.com/grosser/#{gem.name}"
|
13
14
|
gem.authors = ["Michael Grosser"]
|
14
15
|
end
|
15
16
|
|
@@ -6,9 +6,9 @@
|
|
6
6
|
Install
|
7
7
|
=======
|
8
8
|
As Rails plugin:
|
9
|
-
|
9
|
+
rails plugin install git://github.com/grosser/simple_auto_complete.git
|
10
10
|
Or As Gem:
|
11
|
-
|
11
|
+
gem install simple_autocomplete
|
12
12
|
|
13
13
|
Then copy javascripts/css from [example folder](http://github.com/grosser/simple_auto_complete/tree/master/example_js/) OR use your own
|
14
14
|
|
@@ -101,13 +101,15 @@ Authors
|
|
101
101
|
=======
|
102
102
|
Inspired by DHH`s 'obstrusive' autocomplete_plugin.
|
103
103
|
|
104
|
-
###Contributors
|
104
|
+
### [Contributors](http://github.com/grosser/simple_auto_complete/contributors)
|
105
105
|
- [Bryan Ash](http://bryan-ash.blogspot.com)
|
106
106
|
- [David Leal](http://github.com/david)
|
107
107
|
- [mlessard](http://github.com/mlessard)
|
108
108
|
- [Oliver Azevedo Barnes](http://github.com/oliverbarnes)
|
109
109
|
- [Splendeo](http://www.splendeo.es)
|
110
|
+
- [Franco Catena](https://github.com/francocatena)
|
111
|
+
|
110
112
|
|
111
|
-
[Michael Grosser](http://
|
112
|
-
|
113
|
+
[Michael Grosser](http://grosser.it)
|
114
|
+
michael@grosser.it
|
113
115
|
Hereby placed under public domain, do what you want, just do not hold me accountable...
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.7
|
data/lib/simple_autocomplete.rb
CHANGED
@@ -5,9 +5,10 @@ end
|
|
5
5
|
# see Readme for details
|
6
6
|
class ActionController::Base
|
7
7
|
def self.autocomplete_for(object, method, options = {}, &block)
|
8
|
-
options
|
8
|
+
# do not modify options with e.g. delete
|
9
|
+
# https://github.com/grosser/simple_auto_complete/pull/6
|
9
10
|
define_method("autocomplete_for_#{object}_#{method}") do
|
10
|
-
methods = options
|
11
|
+
methods = options[:match] || [*method]
|
11
12
|
condition = methods.map{|m| "LOWER(#{m}) LIKE ?"} * " OR "
|
12
13
|
values = methods.map{|m| "%#{params[:q].to_s.downcase}%"}
|
13
14
|
conditions = [condition, *values]
|
@@ -17,7 +18,7 @@ class ActionController::Base
|
|
17
18
|
:conditions => conditions,
|
18
19
|
:order => "#{methods.first} ASC",
|
19
20
|
:limit => 10
|
20
|
-
}.merge!(options)
|
21
|
+
}.merge!(options.except(:match))
|
21
22
|
|
22
23
|
@items = model.scoped(find_options)
|
23
24
|
|
@@ -93,4 +94,4 @@ class ActiveRecord::Base
|
|
93
94
|
end
|
94
95
|
finder
|
95
96
|
end
|
96
|
-
end
|
97
|
+
end
|
data/simple_autocomplete.gemspec
CHANGED
@@ -1,51 +1,47 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{simple_autocomplete}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Grosser"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-02-03}
|
13
13
|
s.email = %q{grosser.michael@gmail.com}
|
14
|
-
s.extra_rdoc_files = [
|
15
|
-
"README.markdown"
|
16
|
-
]
|
17
14
|
s.files = [
|
18
|
-
"
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
15
|
+
"Gemfile",
|
16
|
+
"Gemfile.lock",
|
17
|
+
"Rakefile",
|
18
|
+
"Readme.md",
|
19
|
+
"VERSION",
|
20
|
+
"example_js/javascripts/application.js",
|
21
|
+
"example_js/javascripts/jquery.autocomplete.js",
|
22
|
+
"example_js/javascripts/jquery.js",
|
23
|
+
"example_js/stylesheets/jquery.autocomplete.css",
|
24
|
+
"init.rb",
|
25
|
+
"lib/simple_autocomplete.rb",
|
26
|
+
"simple_autocomplete.gemspec",
|
27
|
+
"spec/setup_test_model.rb",
|
28
|
+
"spec/simple_autocomplete_spec.rb",
|
29
|
+
"spec/spec_helper.rb"
|
32
30
|
]
|
33
31
|
s.homepage = %q{http://github.com/grosser/simple_autocomplete}
|
34
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
35
32
|
s.require_paths = ["lib"]
|
36
|
-
s.rubygems_version = %q{1.
|
33
|
+
s.rubygems_version = %q{1.4.2}
|
37
34
|
s.summary = %q{Rails: Simple, customizable, unobstrusive - auto complete}
|
38
35
|
s.test_files = [
|
39
|
-
"spec/
|
40
|
-
|
41
|
-
|
36
|
+
"spec/setup_test_model.rb",
|
37
|
+
"spec/simple_autocomplete_spec.rb",
|
38
|
+
"spec/spec_helper.rb"
|
42
39
|
]
|
43
40
|
|
44
41
|
if s.respond_to? :specification_version then
|
45
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
46
42
|
s.specification_version = 3
|
47
43
|
|
48
|
-
if Gem::Version.new(Gem::
|
44
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
49
45
|
else
|
50
46
|
end
|
51
47
|
else
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_autocomplete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
9
|
+
- 7
|
10
|
+
version: 0.3.7
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Michael Grosser
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date:
|
18
|
+
date: 2011-02-03 00:00:00 +01:00
|
18
19
|
default_executable:
|
19
20
|
dependencies: []
|
20
21
|
|
@@ -24,12 +25,13 @@ executables: []
|
|
24
25
|
|
25
26
|
extensions: []
|
26
27
|
|
27
|
-
extra_rdoc_files:
|
28
|
-
|
28
|
+
extra_rdoc_files: []
|
29
|
+
|
29
30
|
files:
|
30
|
-
-
|
31
|
-
-
|
31
|
+
- Gemfile
|
32
|
+
- Gemfile.lock
|
32
33
|
- Rakefile
|
34
|
+
- Readme.md
|
33
35
|
- VERSION
|
34
36
|
- example_js/javascripts/application.js
|
35
37
|
- example_js/javascripts/jquery.autocomplete.js
|
@@ -46,32 +48,36 @@ homepage: http://github.com/grosser/simple_autocomplete
|
|
46
48
|
licenses: []
|
47
49
|
|
48
50
|
post_install_message:
|
49
|
-
rdoc_options:
|
50
|
-
|
51
|
+
rdoc_options: []
|
52
|
+
|
51
53
|
require_paths:
|
52
54
|
- lib
|
53
55
|
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
54
57
|
requirements:
|
55
58
|
- - ">="
|
56
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
57
61
|
segments:
|
58
62
|
- 0
|
59
63
|
version: "0"
|
60
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
61
66
|
requirements:
|
62
67
|
- - ">="
|
63
68
|
- !ruby/object:Gem::Version
|
69
|
+
hash: 3
|
64
70
|
segments:
|
65
71
|
- 0
|
66
72
|
version: "0"
|
67
73
|
requirements: []
|
68
74
|
|
69
75
|
rubyforge_project:
|
70
|
-
rubygems_version: 1.
|
76
|
+
rubygems_version: 1.4.2
|
71
77
|
signing_key:
|
72
78
|
specification_version: 3
|
73
79
|
summary: "Rails: Simple, customizable, unobstrusive - auto complete"
|
74
80
|
test_files:
|
75
|
-
- spec/spec_helper.rb
|
76
81
|
- spec/setup_test_model.rb
|
77
82
|
- spec/simple_autocomplete_spec.rb
|
83
|
+
- spec/spec_helper.rb
|
data/CHANGELOG
DELETED