rails3-jquery-autocomplete 0.6.0 → 0.6.1

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.
Files changed (83) hide show
  1. data/.document +5 -0
  2. data/.gitignore +24 -0
  3. data/Gemfile +18 -0
  4. data/Gemfile.lock +96 -0
  5. data/README.markdown +16 -1
  6. data/Rakefile +2 -47
  7. data/integration/.gitignore +2 -0
  8. data/integration/Gemfile +14 -0
  9. data/integration/Gemfile.lock +159 -0
  10. data/integration/README +256 -0
  11. data/integration/Rakefile +7 -0
  12. data/integration/app/controllers/application_controller.rb +3 -0
  13. data/integration/app/controllers/autocomplete_controller.rb +7 -0
  14. data/integration/app/controllers/id_elements_controller.rb +8 -0
  15. data/integration/app/controllers/multiple_selections_controller.rb +7 -0
  16. data/integration/app/controllers/sub_classes_controller.rb +7 -0
  17. data/integration/app/helpers/application_helper.rb +2 -0
  18. data/integration/app/helpers/autocomplete_helper.rb +2 -0
  19. data/integration/app/helpers/error_messages_helper.rb +23 -0
  20. data/integration/app/helpers/id_elements_helper.rb +2 -0
  21. data/integration/app/helpers/layout_helper.rb +22 -0
  22. data/integration/app/helpers/sub_classes_helper.rb +2 -0
  23. data/integration/app/models/brand.rb +2 -0
  24. data/integration/app/models/foreign_brand.rb +3 -0
  25. data/integration/app/models/product.rb +3 -0
  26. data/integration/app/views/autocomplete/new.html.haml +10 -0
  27. data/integration/app/views/id_elements/new.html.haml +12 -0
  28. data/integration/app/views/layouts/application.html.haml +21 -0
  29. data/integration/app/views/multiple_selections/new.html.haml +9 -0
  30. data/integration/app/views/sub_classes/new.html.haml +9 -0
  31. data/integration/config.ru +4 -0
  32. data/integration/config/application.rb +42 -0
  33. data/integration/config/boot.rb +13 -0
  34. data/integration/config/cucumber.yml +8 -0
  35. data/integration/config/database.yml +25 -0
  36. data/integration/config/environment.rb +5 -0
  37. data/integration/config/environments/development.rb +26 -0
  38. data/integration/config/environments/production.rb +49 -0
  39. data/integration/config/environments/test.rb +35 -0
  40. data/integration/config/initializers/backtrace_silencers.rb +7 -0
  41. data/integration/config/initializers/inflections.rb +10 -0
  42. data/integration/config/initializers/mime_types.rb +5 -0
  43. data/integration/config/initializers/secret_token.rb +7 -0
  44. data/integration/config/initializers/session_store.rb +8 -0
  45. data/integration/config/locales/en.yml +5 -0
  46. data/integration/config/routes.rb +18 -0
  47. data/integration/db/migrate/20101209014338_create_brands.rb +13 -0
  48. data/integration/db/migrate/20101209014355_create_products.rb +14 -0
  49. data/integration/db/migrate/20101209053936_add_type_to_brand.rb +9 -0
  50. data/integration/db/schema.rb +29 -0
  51. data/integration/db/seeds.rb +3 -0
  52. data/integration/doc/README_FOR_APP +2 -0
  53. data/integration/features/autocomplete.feature +45 -0
  54. data/integration/features/step_definitions/autocomplete_steps.rb +5 -0
  55. data/integration/features/step_definitions/pickle_steps.rb +100 -0
  56. data/integration/features/step_definitions/web_steps.rb +219 -0
  57. data/integration/features/support/env.rb +62 -0
  58. data/integration/features/support/paths.rb +33 -0
  59. data/integration/features/support/pickle.rb +24 -0
  60. data/integration/lib/tasks/cucumber.rake +53 -0
  61. data/integration/public/404.html +26 -0
  62. data/integration/public/422.html +26 -0
  63. data/integration/public/500.html +26 -0
  64. data/integration/public/favicon.ico +0 -0
  65. data/integration/public/images/rails.png +0 -0
  66. data/integration/public/javascripts/application.js +0 -0
  67. data/integration/public/javascripts/autocomplete-rails.js +91 -0
  68. data/integration/public/javascripts/jquery-ui.js +11437 -0
  69. data/integration/public/javascripts/jquery-ui.min.js +401 -0
  70. data/integration/public/javascripts/jquery.js +7179 -0
  71. data/integration/public/javascripts/jquery.min.js +167 -0
  72. data/integration/public/javascripts/rails.js +163 -0
  73. data/integration/public/robots.txt +5 -0
  74. data/integration/public/stylesheets/application.css +61 -0
  75. data/integration/public/stylesheets/jquery-ui-1.8.2.custom.css +489 -0
  76. data/integration/public/stylesheets/sass/application.sass +66 -0
  77. data/integration/script/cucumber +10 -0
  78. data/integration/script/rails +6 -0
  79. data/lib/generators/templates/autocomplete-rails.js +1 -1
  80. data/lib/rails3-jquery-autocomplete/autocomplete.rb +3 -1
  81. data/lib/rails3-jquery-autocomplete/version.rb +3 -0
  82. data/rails3-jquery-autocomplete.gemspec +28 -0
  83. metadata +165 -12
@@ -0,0 +1,66 @@
1
+ $primary_color: #4b7399
2
+
3
+ body
4
+ background-color: $primary_color
5
+ font:
6
+ family: Verdana, Helvetica, Arial
7
+ size: 14px
8
+
9
+ a
10
+ color: blue
11
+ img
12
+ border: none
13
+
14
+ .clear
15
+ clear: both
16
+ height: 0
17
+ overflow: hidden
18
+
19
+ #container
20
+ width: 75%
21
+ margin: 0 auto
22
+ background: white
23
+ padding: 20px 40px
24
+ border: solid 1px black
25
+ margin-top: 20px
26
+
27
+ #flash_notice,
28
+ #flash_error,
29
+ #flash_alert
30
+ padding: 5px 8px
31
+ margin: 10px 0
32
+
33
+ #flash_notice
34
+ background-color: #ccffcc
35
+ border: solid 1px #66cc66
36
+
37
+ #flash_error,
38
+ #flash_alert
39
+ background-color: #ffcccc
40
+ border: solid 1px #cc6666
41
+
42
+ .fieldWithErrors
43
+ display: inline
44
+
45
+ .error_messages
46
+ width: 400px
47
+ border: 2px solid #cf0000
48
+ padding: 0
49
+ padding-bottom: 12px
50
+ margin-bottom: 20px
51
+ background-color: #f0f0f0
52
+ font:
53
+ size: 12px
54
+ h2
55
+ text-align: left
56
+ padding: 5px 5px 5px 15px
57
+ margin: 0
58
+ font:
59
+ weight: bold
60
+ size: 12px
61
+ background-color: #cc0000
62
+ color: white
63
+ p
64
+ margin: 8px 10px
65
+ ul
66
+ margin: 0
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
4
+ if vendored_cucumber_bin
5
+ load File.expand_path(vendored_cucumber_bin)
6
+ else
7
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
8
+ require 'cucumber'
9
+ load Cucumber::BINARY
10
+ end
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -46,7 +46,7 @@ $(document).ready(function(){
46
46
  return val.split( e.delimiter );
47
47
  }
48
48
  function extractLast( term ) {
49
- return split( term ).pop();
49
+ return split( term ).pop().replace(/^\s+/,"");
50
50
  }
51
51
 
52
52
  $(e).autocomplete({
@@ -28,7 +28,9 @@ module Rails3JQueryAutocomplete
28
28
  term = params[:term]
29
29
 
30
30
  if term && !term.empty?
31
- items = get_items(:model => get_object(object), \
31
+ #allow specifying fully qualified class name for model object
32
+ class_name = options[:class_name] || object
33
+ items = get_items(:model => get_object(class_name), \
32
34
  :options => options, :term => term, :method => method)
33
35
  else
34
36
  items = {}
@@ -0,0 +1,3 @@
1
+ module Rails3JQueryAutocomplete
2
+ VERSION = '0.6.1'
3
+ end
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "rails3-jquery-autocomplete/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = %q{rails3-jquery-autocomplete}
7
+ s.version = Rails3JQueryAutocomplete::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["David Padilla"]
10
+ s.email = %q{david.padilla@crowdint.com}
11
+ s.homepage = %q{http://github.com/crowdint/rails3-jquery-autocomplete}
12
+ s.summary = %q{Use jQuery's autocomplete plugin with Rails 3.}
13
+ s.description = %q{Use jQuery's autocomplete plugin with Rails 3.}
14
+
15
+ s.add_dependency('rails', '~>3.0.0')
16
+
17
+ s.add_development_dependency('sqlite3-ruby')
18
+ s.add_development_dependency('mongoid', '>= 2.0.0.beta.17')
19
+ s.add_development_dependency('redgreen')
20
+ s.add_development_dependency('shoulda', '~>2.11.1')
21
+ s.add_development_dependency('json')
22
+
23
+ s.files = `git ls-files`.split("\n")
24
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
25
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
26
+ s.require_paths = ["lib"]
27
+ end
28
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails3-jquery-autocomplete
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 0
10
- version: 0.6.0
9
+ - 1
10
+ version: 0.6.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Padilla
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-05 00:00:00 -06:00
18
+ date: 2010-12-21 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -24,7 +24,7 @@ dependencies:
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ">="
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  hash: 7
30
30
  segments:
@@ -32,20 +32,172 @@ dependencies:
32
32
  - 0
33
33
  - 0
34
34
  version: 3.0.0
35
- type: :development
35
+ type: :runtime
36
36
  version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: sqlite3-ruby
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
48
+ version: "0"
49
+ type: :development
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: mongoid
53
+ prerelease: false
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ hash: 62196417
60
+ segments:
61
+ - 2
62
+ - 0
63
+ - 0
64
+ - beta
65
+ - 17
66
+ version: 2.0.0.beta.17
67
+ type: :development
68
+ version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ name: redgreen
71
+ prerelease: false
72
+ requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ hash: 3
78
+ segments:
79
+ - 0
80
+ version: "0"
81
+ type: :development
82
+ version_requirements: *id004
83
+ - !ruby/object:Gem::Dependency
84
+ name: shoulda
85
+ prerelease: false
86
+ requirement: &id005 !ruby/object:Gem::Requirement
87
+ none: false
88
+ requirements:
89
+ - - ~>
90
+ - !ruby/object:Gem::Version
91
+ hash: 33
92
+ segments:
93
+ - 2
94
+ - 11
95
+ - 1
96
+ version: 2.11.1
97
+ type: :development
98
+ version_requirements: *id005
99
+ - !ruby/object:Gem::Dependency
100
+ name: json
101
+ prerelease: false
102
+ requirement: &id006 !ruby/object:Gem::Requirement
103
+ none: false
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ hash: 3
108
+ segments:
109
+ - 0
110
+ version: "0"
111
+ type: :development
112
+ version_requirements: *id006
37
113
  description: Use jQuery's autocomplete plugin with Rails 3.
38
114
  email: david.padilla@crowdint.com
39
115
  executables: []
40
116
 
41
117
  extensions: []
42
118
 
43
- extra_rdoc_files:
44
- - LICENSE
45
- - README.markdown
119
+ extra_rdoc_files: []
120
+
46
121
  files:
122
+ - .document
123
+ - .gitignore
124
+ - Gemfile
125
+ - Gemfile.lock
126
+ - LICENSE
47
127
  - README.markdown
48
128
  - Rakefile
129
+ - integration/.gitignore
130
+ - integration/Gemfile
131
+ - integration/Gemfile.lock
132
+ - integration/README
133
+ - integration/Rakefile
134
+ - integration/app/controllers/application_controller.rb
135
+ - integration/app/controllers/autocomplete_controller.rb
136
+ - integration/app/controllers/id_elements_controller.rb
137
+ - integration/app/controllers/multiple_selections_controller.rb
138
+ - integration/app/controllers/sub_classes_controller.rb
139
+ - integration/app/helpers/application_helper.rb
140
+ - integration/app/helpers/autocomplete_helper.rb
141
+ - integration/app/helpers/error_messages_helper.rb
142
+ - integration/app/helpers/id_elements_helper.rb
143
+ - integration/app/helpers/layout_helper.rb
144
+ - integration/app/helpers/sub_classes_helper.rb
145
+ - integration/app/models/brand.rb
146
+ - integration/app/models/foreign_brand.rb
147
+ - integration/app/models/product.rb
148
+ - integration/app/views/autocomplete/new.html.haml
149
+ - integration/app/views/id_elements/new.html.haml
150
+ - integration/app/views/layouts/application.html.haml
151
+ - integration/app/views/multiple_selections/new.html.haml
152
+ - integration/app/views/sub_classes/new.html.haml
153
+ - integration/config.ru
154
+ - integration/config/application.rb
155
+ - integration/config/boot.rb
156
+ - integration/config/cucumber.yml
157
+ - integration/config/database.yml
158
+ - integration/config/environment.rb
159
+ - integration/config/environments/development.rb
160
+ - integration/config/environments/production.rb
161
+ - integration/config/environments/test.rb
162
+ - integration/config/initializers/backtrace_silencers.rb
163
+ - integration/config/initializers/inflections.rb
164
+ - integration/config/initializers/mime_types.rb
165
+ - integration/config/initializers/secret_token.rb
166
+ - integration/config/initializers/session_store.rb
167
+ - integration/config/locales/en.yml
168
+ - integration/config/routes.rb
169
+ - integration/db/migrate/20101209014338_create_brands.rb
170
+ - integration/db/migrate/20101209014355_create_products.rb
171
+ - integration/db/migrate/20101209053936_add_type_to_brand.rb
172
+ - integration/db/schema.rb
173
+ - integration/db/seeds.rb
174
+ - integration/doc/README_FOR_APP
175
+ - integration/features/autocomplete.feature
176
+ - integration/features/step_definitions/autocomplete_steps.rb
177
+ - integration/features/step_definitions/pickle_steps.rb
178
+ - integration/features/step_definitions/web_steps.rb
179
+ - integration/features/support/env.rb
180
+ - integration/features/support/paths.rb
181
+ - integration/features/support/pickle.rb
182
+ - integration/lib/tasks/cucumber.rake
183
+ - integration/public/404.html
184
+ - integration/public/422.html
185
+ - integration/public/500.html
186
+ - integration/public/favicon.ico
187
+ - integration/public/images/rails.png
188
+ - integration/public/javascripts/application.js
189
+ - integration/public/javascripts/autocomplete-rails.js
190
+ - integration/public/javascripts/jquery-ui.js
191
+ - integration/public/javascripts/jquery-ui.min.js
192
+ - integration/public/javascripts/jquery.js
193
+ - integration/public/javascripts/jquery.min.js
194
+ - integration/public/javascripts/rails.js
195
+ - integration/public/robots.txt
196
+ - integration/public/stylesheets/application.css
197
+ - integration/public/stylesheets/jquery-ui-1.8.2.custom.css
198
+ - integration/public/stylesheets/sass/application.sass
199
+ - integration/script/cucumber
200
+ - integration/script/rails
49
201
  - lib/cucumber/autocomplete.rb
50
202
  - lib/generators/autocomplete_generator.rb
51
203
  - lib/generators/templates/autocomplete-rails.js
@@ -54,6 +206,8 @@ files:
54
206
  - lib/rails3-jquery-autocomplete/form_helper.rb
55
207
  - lib/rails3-jquery-autocomplete/formtastic_plugin.rb
56
208
  - lib/rails3-jquery-autocomplete/helpers.rb
209
+ - lib/rails3-jquery-autocomplete/version.rb
210
+ - rails3-jquery-autocomplete.gemspec
57
211
  - test/form_helper_test.rb
58
212
  - test/generators/generator_test.rb
59
213
  - test/helpers.rb
@@ -62,14 +216,13 @@ files:
62
216
  - test/support/mongoid.rb
63
217
  - test/test_controller.rb
64
218
  - test/test_helper.rb
65
- - LICENSE
66
219
  has_rdoc: true
67
220
  homepage: http://github.com/crowdint/rails3-jquery-autocomplete
68
221
  licenses: []
69
222
 
70
223
  post_install_message:
71
- rdoc_options:
72
- - --charset=UTF-8
224
+ rdoc_options: []
225
+
73
226
  require_paths:
74
227
  - lib
75
228
  required_ruby_version: !ruby/object:Gem::Requirement