jquery_sortable_tree 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -0
  3. data/app/helpers/jquery_sortable_tree_helper/render_expandable_tree_helper.rb +0 -6
  4. data/app/helpers/jquery_sortable_tree_helper/render_indented_options_helper.rb +1 -11
  5. data/app/helpers/jquery_sortable_tree_helper/render_nested_options_helper.rb +1 -7
  6. data/app/helpers/jquery_sortable_tree_helper/render_optgroup_helper.rb +11 -0
  7. data/app/helpers/jquery_sortable_tree_helper/render_sortable_tree_helper.rb +8 -4
  8. data/app/helpers/jquery_sortable_tree_helper/render_tree_helper.rb +0 -6
  9. data/app/helpers/jquery_sortable_tree_helper.rb +10 -4
  10. data/lib/jquery_sortable_tree/version.rb +1 -1
  11. data/spec/{dummy_app/spec/build_tree_helper.rb → build_tree_helper.rb} +0 -0
  12. data/spec/dummy_app/Gemfile.lock +1 -1
  13. data/spec/dummy_app/app/controllers/admin/pages_controller.rb +9 -4
  14. data/spec/dummy_app/app/controllers/pages_controller.rb +11 -3
  15. data/spec/dummy_app/app/views/admin/pages/optgroup.html.haml +3 -0
  16. data/spec/dummy_app/app/views/pages/optgroup.html.haml +3 -0
  17. data/spec/dummy_app/app/views/welcome/index.html.haml +3 -0
  18. data/spec/dummy_app/config/application.rb +1 -0
  19. data/spec/dummy_app/config/routes.rb +9 -17
  20. data/spec/dummy_app/db/test.db +0 -0
  21. data/spec/dummy_app/log/development.log +559 -0
  22. data/spec/dummy_app/log/test.log +21016 -0
  23. data/spec/dummy_app/tmp/cache/assets/development/sprockets/14805e3ed08782f4b821fe6cfd03d911 +0 -0
  24. data/spec/dummy_app/tmp/cache/assets/development/sprockets/1e445aefca5bc750ef4f584ec1dc0849 +0 -0
  25. data/spec/dummy_app/tmp/cache/assets/development/sprockets/28eefd9e9c7ea2e1414cd10a6d184ae5 +0 -0
  26. data/spec/dummy_app/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  27. data/spec/dummy_app/tmp/cache/assets/development/sprockets/3dbf5c413607e86fa3ff1f931887217e +0 -0
  28. data/spec/dummy_app/tmp/cache/assets/development/sprockets/505027f29aa1c70c5425d19ea9fb77ce +0 -0
  29. data/spec/dummy_app/tmp/cache/assets/development/sprockets/6016aac84581a1ff8e9503adf790f0eb +0 -0
  30. data/spec/dummy_app/tmp/cache/assets/development/sprockets/7eecec59a10631fead107d7e8c265910 +0 -0
  31. data/spec/dummy_app/tmp/cache/assets/development/sprockets/a0ac3dab292e1eb99d5e8a524e6dfded +0 -0
  32. data/spec/dummy_app/tmp/cache/assets/development/sprockets/a2e4e33192daa77f118bde803b5f469e +0 -0
  33. data/spec/dummy_app/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  34. data/spec/dummy_app/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  35. data/spec/spec_helper.rb +21 -0
  36. data/spec/{dummy_app/spec/views → views}/pages/index.html.haml_spec.rb +14 -10
  37. metadata +57 -7
  38. data/app/inputs/indented_collection_select_input.rb +0 -12
@@ -0,0 +1,21 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ ENV['RAILS_ENV'] ||= 'test'
4
+
5
+ require File.expand_path('../dummy_app/config/environment', __FILE__)
6
+ require 'rspec/rails'
7
+ require 'rspec/autorun'
8
+ require 'capybara/rails'
9
+ require 'faker'
10
+
11
+ # Requires supporting ruby files with custom matchers and macros, etc,
12
+ # in spec/support/ and its subdirectories.
13
+ Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
14
+ ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
15
+
16
+ RSpec.configure do |config|
17
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
18
+ config.use_transactional_fixtures = true
19
+ config.infer_base_class_for_anonymous_controllers = false
20
+ config.order = 'random'
21
+ end
@@ -1,16 +1,21 @@
1
1
  require 'spec_helper'
2
2
  require 'build_tree_helper'
3
3
 
4
- describe "pages/index" do
4
+ describe 'pages/index' do
5
5
  include Capybara::DSL
6
6
 
7
7
  before(:all) do
8
8
  Benchmark.bm do |b|
9
- b.report{
10
- Page.all.each{|p| begin; p.destroy; rescue; end; }
11
- }
9
+ b.report do
10
+ Page.all.each do |p|
11
+ begin
12
+ p.destroy
13
+ rescue
14
+ end
15
+ end
16
+ end
12
17
  end
13
- puts "DB Cleaning"
18
+ puts 'DB Cleaning'
14
19
 
15
20
  # sleep 3
16
21
 
@@ -25,22 +30,21 @@ describe "pages/index" do
25
30
  build_test_tree Page, 10
26
31
  }
27
32
  end
28
- puts "Tree Building"
29
-
33
+ puts 'Tree Building'
30
34
  end
31
35
 
32
- it "render all pages without capybara" do
36
+ it 'render all pages without capybara' do
33
37
  assign :pages, Page.all
34
38
  render
35
39
  end
36
40
 
37
- it "pages/index" do
41
+ it 'pages/index' do
38
42
  visit '/pages'
39
43
  nodes = all('li', visible: true)
40
44
  nodes.count.should be 15
41
45
  end
42
46
 
43
- it "pages/manage all pages" do
47
+ it 'pages/manage all pages' do
44
48
  visit '/pages/manage'
45
49
  nodes = all('li', visible: true)
46
50
  nodes.count.should be 1110
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery_sortable_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya N. Zykin
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-07-27 00:00:00.000000000 Z
14
+ date: 2014-08-09 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -75,6 +75,48 @@ dependencies:
75
75
  - - "~>"
76
76
  - !ruby/object:Gem::Version
77
77
  version: '3.0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: capybara
80
+ requirement: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ type: :development
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ - !ruby/object:Gem::Dependency
93
+ name: faker
94
+ requirement: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ - !ruby/object:Gem::Dependency
107
+ name: awesome_nested_set
108
+ requirement: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - "~>"
111
+ - !ruby/object:Gem::Version
112
+ version: 3.0.0.rc5
113
+ type: :development
114
+ prerelease: false
115
+ version_requirements: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - "~>"
118
+ - !ruby/object:Gem::Version
119
+ version: 3.0.0.rc5
78
120
  description: Drag&Drop GUI, inline node editing and new node creating. Ready for Rails
79
121
  4
80
122
  email:
@@ -115,14 +157,15 @@ files:
115
157
  - app/helpers/jquery_sortable_tree_helper/render_expandable_tree_helper.rb
116
158
  - app/helpers/jquery_sortable_tree_helper/render_indented_options_helper.rb
117
159
  - app/helpers/jquery_sortable_tree_helper/render_nested_options_helper.rb
160
+ - app/helpers/jquery_sortable_tree_helper/render_optgroup_helper.rb
118
161
  - app/helpers/jquery_sortable_tree_helper/render_sortable_tree_helper.rb
119
162
  - app/helpers/jquery_sortable_tree_helper/render_tree_helper.rb
120
- - app/inputs/indented_collection_select_input.rb
121
163
  - lib/fake.example
122
164
  - lib/generators/jquery_sortable_tree/views_generator.rb
123
165
  - lib/jquery_sortable_tree.rb
124
166
  - lib/jquery_sortable_tree/engine.rb
125
167
  - lib/jquery_sortable_tree/version.rb
168
+ - spec/build_tree_helper.rb
126
169
  - spec/dummy_app/Gemfile
127
170
  - spec/dummy_app/Gemfile.lock
128
171
  - spec/dummy_app/README.md
@@ -160,6 +203,7 @@ files:
160
203
  - spec/dummy_app/app/views/admin/pages/namespaced_link.html.haml
161
204
  - spec/dummy_app/app/views/admin/pages/nested_options.html.haml
162
205
  - spec/dummy_app/app/views/admin/pages/node_manage.html.haml
206
+ - spec/dummy_app/app/views/admin/pages/optgroup.html.haml
163
207
  - spec/dummy_app/app/views/article_categories/index.html.haml
164
208
  - spec/dummy_app/app/views/article_categories/manage.html.haml
165
209
  - spec/dummy_app/app/views/inventory/categories/index.html.haml
@@ -171,6 +215,7 @@ files:
171
215
  - spec/dummy_app/app/views/pages/index.html.haml
172
216
  - spec/dummy_app/app/views/pages/manage.html.haml
173
217
  - spec/dummy_app/app/views/pages/nested_options.html.haml
218
+ - spec/dummy_app/app/views/pages/optgroup.html.haml
174
219
  - spec/dummy_app/app/views/welcome/index.html.haml
175
220
  - spec/dummy_app/config.ru
176
221
  - spec/dummy_app/config/application.rb
@@ -200,15 +245,14 @@ files:
200
245
  - spec/dummy_app/doc/README_FOR_APP
201
246
  - spec/dummy_app/lib/tasks/db_bootstrap.rake
202
247
  - spec/dummy_app/log/development.log
248
+ - spec/dummy_app/log/test.log
203
249
  - spec/dummy_app/public/404.html
204
250
  - spec/dummy_app/public/422.html
205
251
  - spec/dummy_app/public/500.html
206
252
  - spec/dummy_app/public/favicon.ico
207
253
  - spec/dummy_app/public/robots.txt
208
254
  - spec/dummy_app/script/rails
209
- - spec/dummy_app/spec/build_tree_helper.rb
210
255
  - spec/dummy_app/spec/spec_helper.rb
211
- - spec/dummy_app/spec/views/pages/index.html.haml_spec.rb
212
256
  - spec/dummy_app/tmp/cache/assets/development/sass/8ecb1409c36a90649b49ac975da6493b50db6d95/expandable_tree.css.scssc
213
257
  - spec/dummy_app/tmp/cache/assets/development/sass/8ecb1409c36a90649b49ac975da6493b50db6d95/nested_options.css.scssc
214
258
  - spec/dummy_app/tmp/cache/assets/development/sass/8ecb1409c36a90649b49ac975da6493b50db6d95/sortable_tree.css.scssc
@@ -411,6 +455,8 @@ files:
411
455
  - spec/dummy_app/tmp/cache/assets/development/sprockets/fdf1d8b5d1d7b6c5fe5e2f5b467812a3
412
456
  - spec/dummy_app/tmp/cache/assets/development/sprockets/fef1622202b16661f9ae083c25eaa0cd
413
457
  - spec/dummy_app/tmp/cache/assets/development/sprockets/ff5a0e8ee643dae44f31640f626ce94a
458
+ - spec/spec_helper.rb
459
+ - spec/views/pages/index.html.haml_spec.rb
414
460
  homepage: https://github.com/maximalink/jquery_sortable_tree
415
461
  licenses:
416
462
  - MIT
@@ -436,10 +482,9 @@ signing_key:
436
482
  specification_version: 4
437
483
  summary: Rails Drag&Drop GUI gem for managing awesom_nested_set.
438
484
  test_files:
485
+ - spec/views/pages/index.html.haml_spec.rb
439
486
  - spec/dummy_app/script/rails
440
- - spec/dummy_app/spec/views/pages/index.html.haml_spec.rb
441
487
  - spec/dummy_app/spec/spec_helper.rb
442
- - spec/dummy_app/spec/build_tree_helper.rb
443
488
  - spec/dummy_app/_test/performance/browsing_test.rb
444
489
  - spec/dummy_app/_test/functional/inventory/category_controller_test.rb
445
490
  - spec/dummy_app/_test/fixtures/comments.yml
@@ -677,6 +722,7 @@ test_files:
677
722
  - spec/dummy_app/app/views/pages/expand.html.haml
678
723
  - spec/dummy_app/app/views/pages/manage.html.haml
679
724
  - spec/dummy_app/app/views/pages/expand_node.html.haml
725
+ - spec/dummy_app/app/views/pages/optgroup.html.haml
680
726
  - spec/dummy_app/app/views/pages/nested_options.html.haml
681
727
  - spec/dummy_app/app/views/pages/indented_options.html.haml
682
728
  - spec/dummy_app/app/views/layouts/application.html.erb
@@ -689,6 +735,7 @@ test_files:
689
735
  - spec/dummy_app/app/views/admin/pages/manage.html.haml
690
736
  - spec/dummy_app/app/views/admin/pages/node_manage.html.haml
691
737
  - spec/dummy_app/app/views/admin/pages/namespaced_link.html.haml
738
+ - spec/dummy_app/app/views/admin/pages/optgroup.html.haml
692
739
  - spec/dummy_app/app/views/admin/pages/nested_options.html.haml
693
740
  - spec/dummy_app/app/views/admin/pages/indented_options.html.haml
694
741
  - spec/dummy_app/app/models/article_category.rb
@@ -718,9 +765,12 @@ test_files:
718
765
  - spec/dummy_app/db/migrate/20120503173258_create_article_categories.rb
719
766
  - spec/dummy_app/README.md
720
767
  - spec/dummy_app/doc/README_FOR_APP
768
+ - spec/dummy_app/log/test.log
721
769
  - spec/dummy_app/log/development.log
722
770
  - spec/dummy_app/public/robots.txt
723
771
  - spec/dummy_app/public/404.html
724
772
  - spec/dummy_app/public/422.html
725
773
  - spec/dummy_app/public/favicon.ico
726
774
  - spec/dummy_app/public/500.html
775
+ - spec/spec_helper.rb
776
+ - spec/build_tree_helper.rb
@@ -1,12 +0,0 @@
1
- class IndentedCollectionSelectInput < SimpleForm::Inputs::CollectionSelectInput
2
- def input
3
- label_method, value_method = detect_collection_methods
4
- collection.map! do |o|
5
- depth_method = options[:depth_method] || :depth
6
- spacing = (options[:spacing] || 3).to_i
7
- label = "\u202f" * spacing * o.send(depth_method) + o.send(label_method)
8
- [label, o.send(value_method)]
9
- end
10
- super
11
- end
12
- end