activeadmin_sortable_table 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +15 -0
  5. data/.travis.yml +20 -0
  6. data/Gemfile +8 -0
  7. data/Gemfile.lock +245 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +97 -0
  10. data/Rakefile +27 -0
  11. data/activeadmin_sortable_table.gemspec +28 -0
  12. data/app/assets/javascripts/activeadmin_sortable_table.js +35 -0
  13. data/app/assets/stylesheets/activeadmin_sortable_table.css +11 -0
  14. data/lib/active_admin/sortable_table/engine.rb +9 -0
  15. data/lib/active_admin/sortable_table/handle_column.rb +46 -0
  16. data/lib/active_admin/sortable_table/version.rb +6 -0
  17. data/lib/activeadmin_sortable_table.rb +38 -0
  18. data/spec/dummy/README.rdoc +28 -0
  19. data/spec/dummy/Rakefile +6 -0
  20. data/spec/dummy/app/admin/categories.rb +12 -0
  21. data/spec/dummy/app/admin/dashboard.rb +32 -0
  22. data/spec/dummy/app/assets/images/.keep +0 -0
  23. data/spec/dummy/app/assets/javascripts/active_admin.js.coffee +3 -0
  24. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  25. data/spec/dummy/app/assets/javascripts/jquery.simulate.js +314 -0
  26. data/spec/dummy/app/assets/stylesheets/active_admin.scss +17 -0
  27. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  28. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  29. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  30. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  31. data/spec/dummy/app/mailers/.keep +0 -0
  32. data/spec/dummy/app/models/.keep +0 -0
  33. data/spec/dummy/app/models/category.rb +3 -0
  34. data/spec/dummy/app/models/concerns/.keep +0 -0
  35. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  36. data/spec/dummy/bin/bundle +3 -0
  37. data/spec/dummy/bin/rails +4 -0
  38. data/spec/dummy/bin/rake +4 -0
  39. data/spec/dummy/bin/setup +29 -0
  40. data/spec/dummy/config.ru +4 -0
  41. data/spec/dummy/config/application.rb +28 -0
  42. data/spec/dummy/config/boot.rb +5 -0
  43. data/spec/dummy/config/database.yml +25 -0
  44. data/spec/dummy/config/environment.rb +5 -0
  45. data/spec/dummy/config/environments/development.rb +41 -0
  46. data/spec/dummy/config/environments/production.rb +79 -0
  47. data/spec/dummy/config/environments/test.rb +42 -0
  48. data/spec/dummy/config/initializers/active_admin.rb +262 -0
  49. data/spec/dummy/config/initializers/assets.rb +11 -0
  50. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  51. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  52. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  53. data/spec/dummy/config/initializers/inflections.rb +16 -0
  54. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  55. data/spec/dummy/config/initializers/session_store.rb +3 -0
  56. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  57. data/spec/dummy/config/locales/en.yml +23 -0
  58. data/spec/dummy/config/routes.rb +3 -0
  59. data/spec/dummy/config/secrets.yml +22 -0
  60. data/spec/dummy/db/development.sqlite3 +0 -0
  61. data/spec/dummy/db/migrate/20150910072150_create_active_admin_comments.rb +19 -0
  62. data/spec/dummy/db/migrate/20150910072505_create_categories.rb +8 -0
  63. data/spec/dummy/db/schema.rb +36 -0
  64. data/spec/dummy/lib/assets/.keep +0 -0
  65. data/spec/dummy/log/.keep +0 -0
  66. data/spec/dummy/public/404.html +67 -0
  67. data/spec/dummy/public/422.html +67 -0
  68. data/spec/dummy/public/500.html +66 -0
  69. data/spec/dummy/public/favicon.ico +0 -0
  70. data/spec/features/activeadmin_sortable_table_spec.rb +31 -0
  71. data/spec/rails_helper.rb +62 -0
  72. data/spec/spec_helper.rb +92 -0
  73. data/spec/support/wait_for_ajax.rb +20 -0
  74. metadata +288 -0
@@ -0,0 +1,92 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # The `.rspec` file also contains a few flags that are not defaults but that
16
+ # users commonly want.
17
+ #
18
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # These two settings work together to allow you to limit a spec run
44
+ # to individual examples or groups you care about by tagging them with
45
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
46
+ # get run.
47
+ config.filter_run :focus
48
+ config.run_all_when_everything_filtered = true
49
+
50
+ # Allows RSpec to persist some state between runs in order to support
51
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
52
+ # you configure your source control system to ignore this file.
53
+ # config.example_status_persistence_file_path = "spec/examples.txt"
54
+
55
+ # Limits the available syntax to the non-monkey patched syntax that is
56
+ # recommended. For more details, see:
57
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
58
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
59
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
60
+ config.disable_monkey_patching!
61
+
62
+ # This setting enables warnings. It's recommended, but in some cases may
63
+ # be too noisy due to issues in dependencies.
64
+ config.warnings = false
65
+
66
+ # Many RSpec users commonly either run the entire suite or an individual
67
+ # file, and it's useful to allow more verbose output when running an
68
+ # individual spec file.
69
+ if config.files_to_run.one?
70
+ # Use the documentation formatter for detailed output,
71
+ # unless a formatter has already been configured
72
+ # (e.g. via a command-line flag).
73
+ config.default_formatter = 'doc'
74
+ end
75
+
76
+ # Print the 10 slowest examples and example groups at the
77
+ # end of the spec run, to help surface which specs are running
78
+ # particularly slow.
79
+ # config.profile_examples = 10
80
+
81
+ # Run specs in random order to surface order dependencies. If you find an
82
+ # order dependency and want to debug it, you can fix the order by providing
83
+ # the seed, which is printed after each run.
84
+ # --seed 1234
85
+ config.order = :random
86
+
87
+ # Seed global randomization in this process using the `--seed` CLI option.
88
+ # Setting this allows you to use `--seed` to deterministically reproduce
89
+ # test failures related to randomization by passing the same `--seed` value
90
+ # as the one that triggered the failure.
91
+ Kernel.srand config.seed
92
+ end
@@ -0,0 +1,20 @@
1
+ # Enables ajax helpers in capybara tests
2
+ module WaitForAjax
3
+ def wait_for_ajax(count = 1)
4
+ page.execute_script 'window._ajaxCalls = 0, window._ajaxCompleteCounter = function() { window._ajaxCalls += 1; }'
5
+ page.execute_script '$(document).on("ajaxComplete", window._ajaxCompleteCounter)'
6
+
7
+ yield
8
+
9
+ Timeout.timeout(Capybara.default_max_wait_time) do
10
+ loop until finished_all_ajax_requests?(count)
11
+ end
12
+
13
+ page.execute_script '$(document).off("ajaxComplete", window._ajaxCompleteCounter)'
14
+ page.execute_script 'delete window._ajaxCompleteCounter, window._ajaxCalls'
15
+ end
16
+
17
+ def finished_all_ajax_requests?(count)
18
+ page.evaluate_script('window._ajaxCalls') == count
19
+ end
20
+ end
metadata ADDED
@@ -0,0 +1,288 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activeadmin_sortable_table
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Adam McCrea
8
+ - Jonathan Gertig
9
+ - Artyom Bolshakov
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2015-09-29 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activeadmin
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: 1.0.0.pre1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 1.0.0.pre1
29
+ - !ruby/object:Gem::Dependency
30
+ name: rails
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '4.2'
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '4.2'
43
+ - !ruby/object:Gem::Dependency
44
+ name: capybara
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ - !ruby/object:Gem::Dependency
58
+ name: rspec-rails
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '3.3'
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '3.3'
71
+ - !ruby/object:Gem::Dependency
72
+ name: phantomjs
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ - !ruby/object:Gem::Dependency
86
+ name: poltergeist
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ - !ruby/object:Gem::Dependency
100
+ name: database_cleaner
101
+ requirement: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ type: :development
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ - !ruby/object:Gem::Dependency
114
+ name: launchy
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ type: :development
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ description: Drag and drop reordering interface for ActiveAdmin tables
128
+ email:
129
+ - adam@adamlogic.com
130
+ - jcgertig@gmail.com
131
+ - abolshakov@spbtv.com
132
+ executables: []
133
+ extensions: []
134
+ extra_rdoc_files: []
135
+ files:
136
+ - ".gitignore"
137
+ - ".rspec"
138
+ - ".rubocop.yml"
139
+ - ".travis.yml"
140
+ - Gemfile
141
+ - Gemfile.lock
142
+ - LICENSE.txt
143
+ - README.md
144
+ - Rakefile
145
+ - activeadmin_sortable_table.gemspec
146
+ - app/assets/javascripts/activeadmin_sortable_table.js
147
+ - app/assets/stylesheets/activeadmin_sortable_table.css
148
+ - lib/active_admin/sortable_table/engine.rb
149
+ - lib/active_admin/sortable_table/handle_column.rb
150
+ - lib/active_admin/sortable_table/version.rb
151
+ - lib/activeadmin_sortable_table.rb
152
+ - spec/dummy/README.rdoc
153
+ - spec/dummy/Rakefile
154
+ - spec/dummy/app/admin/categories.rb
155
+ - spec/dummy/app/admin/dashboard.rb
156
+ - spec/dummy/app/assets/images/.keep
157
+ - spec/dummy/app/assets/javascripts/active_admin.js.coffee
158
+ - spec/dummy/app/assets/javascripts/application.js
159
+ - spec/dummy/app/assets/javascripts/jquery.simulate.js
160
+ - spec/dummy/app/assets/stylesheets/active_admin.scss
161
+ - spec/dummy/app/assets/stylesheets/application.css
162
+ - spec/dummy/app/controllers/application_controller.rb
163
+ - spec/dummy/app/controllers/concerns/.keep
164
+ - spec/dummy/app/helpers/application_helper.rb
165
+ - spec/dummy/app/mailers/.keep
166
+ - spec/dummy/app/models/.keep
167
+ - spec/dummy/app/models/category.rb
168
+ - spec/dummy/app/models/concerns/.keep
169
+ - spec/dummy/app/views/layouts/application.html.erb
170
+ - spec/dummy/bin/bundle
171
+ - spec/dummy/bin/rails
172
+ - spec/dummy/bin/rake
173
+ - spec/dummy/bin/setup
174
+ - spec/dummy/config.ru
175
+ - spec/dummy/config/application.rb
176
+ - spec/dummy/config/boot.rb
177
+ - spec/dummy/config/database.yml
178
+ - spec/dummy/config/environment.rb
179
+ - spec/dummy/config/environments/development.rb
180
+ - spec/dummy/config/environments/production.rb
181
+ - spec/dummy/config/environments/test.rb
182
+ - spec/dummy/config/initializers/active_admin.rb
183
+ - spec/dummy/config/initializers/assets.rb
184
+ - spec/dummy/config/initializers/backtrace_silencers.rb
185
+ - spec/dummy/config/initializers/cookies_serializer.rb
186
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
187
+ - spec/dummy/config/initializers/inflections.rb
188
+ - spec/dummy/config/initializers/mime_types.rb
189
+ - spec/dummy/config/initializers/session_store.rb
190
+ - spec/dummy/config/initializers/wrap_parameters.rb
191
+ - spec/dummy/config/locales/en.yml
192
+ - spec/dummy/config/routes.rb
193
+ - spec/dummy/config/secrets.yml
194
+ - spec/dummy/db/development.sqlite3
195
+ - spec/dummy/db/migrate/20150910072150_create_active_admin_comments.rb
196
+ - spec/dummy/db/migrate/20150910072505_create_categories.rb
197
+ - spec/dummy/db/schema.rb
198
+ - spec/dummy/lib/assets/.keep
199
+ - spec/dummy/log/.keep
200
+ - spec/dummy/public/404.html
201
+ - spec/dummy/public/422.html
202
+ - spec/dummy/public/500.html
203
+ - spec/dummy/public/favicon.ico
204
+ - spec/features/activeadmin_sortable_table_spec.rb
205
+ - spec/rails_helper.rb
206
+ - spec/spec_helper.rb
207
+ - spec/support/wait_for_ajax.rb
208
+ homepage: https://github.com/bolshakov/activeadmin_sortable_table
209
+ licenses: []
210
+ metadata: {}
211
+ post_install_message:
212
+ rdoc_options: []
213
+ require_paths:
214
+ - lib
215
+ required_ruby_version: !ruby/object:Gem::Requirement
216
+ requirements:
217
+ - - ">="
218
+ - !ruby/object:Gem::Version
219
+ version: '0'
220
+ required_rubygems_version: !ruby/object:Gem::Requirement
221
+ requirements:
222
+ - - ">="
223
+ - !ruby/object:Gem::Version
224
+ version: '0'
225
+ requirements: []
226
+ rubyforge_project:
227
+ rubygems_version: 2.4.5
228
+ signing_key:
229
+ specification_version: 4
230
+ summary: Drag and drop reordering interface for ActiveAdmin tables
231
+ test_files:
232
+ - spec/dummy/README.rdoc
233
+ - spec/dummy/Rakefile
234
+ - spec/dummy/app/admin/categories.rb
235
+ - spec/dummy/app/admin/dashboard.rb
236
+ - spec/dummy/app/assets/images/.keep
237
+ - spec/dummy/app/assets/javascripts/active_admin.js.coffee
238
+ - spec/dummy/app/assets/javascripts/application.js
239
+ - spec/dummy/app/assets/javascripts/jquery.simulate.js
240
+ - spec/dummy/app/assets/stylesheets/active_admin.scss
241
+ - spec/dummy/app/assets/stylesheets/application.css
242
+ - spec/dummy/app/controllers/application_controller.rb
243
+ - spec/dummy/app/controllers/concerns/.keep
244
+ - spec/dummy/app/helpers/application_helper.rb
245
+ - spec/dummy/app/mailers/.keep
246
+ - spec/dummy/app/models/.keep
247
+ - spec/dummy/app/models/category.rb
248
+ - spec/dummy/app/models/concerns/.keep
249
+ - spec/dummy/app/views/layouts/application.html.erb
250
+ - spec/dummy/bin/bundle
251
+ - spec/dummy/bin/rails
252
+ - spec/dummy/bin/rake
253
+ - spec/dummy/bin/setup
254
+ - spec/dummy/config.ru
255
+ - spec/dummy/config/application.rb
256
+ - spec/dummy/config/boot.rb
257
+ - spec/dummy/config/database.yml
258
+ - spec/dummy/config/environment.rb
259
+ - spec/dummy/config/environments/development.rb
260
+ - spec/dummy/config/environments/production.rb
261
+ - spec/dummy/config/environments/test.rb
262
+ - spec/dummy/config/initializers/active_admin.rb
263
+ - spec/dummy/config/initializers/assets.rb
264
+ - spec/dummy/config/initializers/backtrace_silencers.rb
265
+ - spec/dummy/config/initializers/cookies_serializer.rb
266
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
267
+ - spec/dummy/config/initializers/inflections.rb
268
+ - spec/dummy/config/initializers/mime_types.rb
269
+ - spec/dummy/config/initializers/session_store.rb
270
+ - spec/dummy/config/initializers/wrap_parameters.rb
271
+ - spec/dummy/config/locales/en.yml
272
+ - spec/dummy/config/routes.rb
273
+ - spec/dummy/config/secrets.yml
274
+ - spec/dummy/db/development.sqlite3
275
+ - spec/dummy/db/migrate/20150910072150_create_active_admin_comments.rb
276
+ - spec/dummy/db/migrate/20150910072505_create_categories.rb
277
+ - spec/dummy/db/schema.rb
278
+ - spec/dummy/lib/assets/.keep
279
+ - spec/dummy/log/.keep
280
+ - spec/dummy/public/404.html
281
+ - spec/dummy/public/422.html
282
+ - spec/dummy/public/500.html
283
+ - spec/dummy/public/favicon.ico
284
+ - spec/features/activeadmin_sortable_table_spec.rb
285
+ - spec/rails_helper.rb
286
+ - spec/spec_helper.rb
287
+ - spec/support/wait_for_ajax.rb
288
+ has_rdoc: