bone_tree 0.5.6 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/.gitignore +26 -3
  2. data/Gemfile +5 -12
  3. data/Rakefile +7 -9
  4. data/bone_tree.gemspec +30 -14
  5. data/config.rb +8 -0
  6. data/lib/assets/javascripts/bone_tree.js +277 -981
  7. data/lib/assets/stylesheets/bone_tree.css +108 -0
  8. data/lib/bone_tree/rails.rb +5 -0
  9. data/lib/bone_tree/sprockets.rb +3 -0
  10. data/lib/{version.rb → bone_tree/version.rb} +1 -1
  11. data/lib/bone_tree.rb +11 -6
  12. data/source/index.html.haml +10 -382
  13. data/source/javascripts/{_backbone.js → backbone.js} +282 -142
  14. data/source/javascripts/bone_tree/models/directory.js.coffee +109 -0
  15. data/source/javascripts/bone_tree/models/file.js.coffee +12 -0
  16. data/source/javascripts/bone_tree/models/node.js.coffee +24 -0
  17. data/source/javascripts/bone_tree/models/settings.js.coffee +5 -0
  18. data/source/javascripts/bone_tree/{_namespace.js.coffee → namespace.js.coffee} +1 -1
  19. data/source/javascripts/bone_tree/views/directory.js.coffee +56 -0
  20. data/source/javascripts/bone_tree/views/file.js.coffee +25 -0
  21. data/source/javascripts/bone_tree/views/tree.js.coffee +87 -0
  22. data/source/javascripts/bone_tree.js.coffee +2 -1
  23. data/source/stylesheets/bone_tree.css.sass +0 -38
  24. data/spec/javascripts/directory_spec.coffee +26 -0
  25. data/spec/javascripts/helpers/spec_helper.coffee +3 -4
  26. data/spec/javascripts/sorting_spec.coffee +12 -0
  27. data/spec/javascripts/support/jasmine.yml +6 -4
  28. metadata +143 -36
  29. data/Gemfile.lock +0 -190
  30. data/docs/index.html +0 -222
  31. data/docs/resources/base.css +0 -70
  32. data/docs/resources/index.css +0 -20
  33. data/docs/resources/module.css +0 -24
  34. data/docs/source/javascripts/bone_tree/_namespace.js.html +0 -45
  35. data/docs/source/javascripts/bone_tree/models/_directory.js.html +0 -126
  36. data/docs/source/javascripts/bone_tree/models/_file.js.html +0 -112
  37. data/docs/source/javascripts/bone_tree/models/_nodes.js.html +0 -174
  38. data/docs/source/javascripts/bone_tree/models/_settings.js.html +0 -75
  39. data/docs/source/javascripts/bone_tree/views/_directory.js.html +0 -94
  40. data/docs/source/javascripts/bone_tree/views/_file.js.html +0 -82
  41. data/docs/source/javascripts/bone_tree/views/_menu.js.html +0 -110
  42. data/docs/source/javascripts/bone_tree/views/_tree.js.html +0 -432
  43. data/source/javascripts/_jquery.min.js +0 -5
  44. data/source/javascripts/_underscore.js +0 -999
  45. data/source/javascripts/bone_tree/models/_directory.js.coffee +0 -63
  46. data/source/javascripts/bone_tree/models/_file.js.coffee +0 -55
  47. data/source/javascripts/bone_tree/models/_nodes.js.coffee +0 -117
  48. data/source/javascripts/bone_tree/models/_settings.js.coffee +0 -25
  49. data/source/javascripts/bone_tree/views/_directory.js.coffee +0 -73
  50. data/source/javascripts/bone_tree/views/_file.js.coffee +0 -51
  51. data/source/javascripts/bone_tree/views/_menu.js.coffee +0 -97
  52. data/source/javascripts/bone_tree/views/_tree.js.coffee +0 -498
  53. data/spec/javascripts/directory_view_spec.coffee +0 -91
  54. data/spec/javascripts/file_view_spec.coffee +0 -70
  55. data/spec/javascripts/menu_view_spec.coffee +0 -42
  56. data/spec/javascripts/nodes_spec.coffee +0 -37
  57. data/spec/javascripts/tree_view_spec.coffee +0 -39
@@ -1,37 +0,0 @@
1
- #= require bone_tree/_namespace
2
- #= require bone_tree/models/_nodes
3
-
4
- describe 'BoneTree.Models.Node', ->
5
- beforeEach ->
6
- {Models} = BoneTree
7
-
8
- @file = new Models.Node
9
- nodeType: 'file'
10
- name: 'config'
11
- extension: 'json'
12
-
13
- @directory = new Models.Node
14
- nodeType: 'directory'
15
- name: 'src'
16
-
17
- it 'should return the correct constantized type', ->
18
- expect(@file.constantize()).toEqual('File')
19
- expect(@directory.constantize()).toEqual('Directory')
20
-
21
- it 'should return the full name with extension when appropriate', ->
22
- expect(@file.nameWithExtension()).toEqual('config.json')
23
- expect(@directory.nameWithExtension()).toEqual('src')
24
-
25
- it 'should return just the fileName when no extension is present', ->
26
- @file = new BoneTree.Models.Node
27
- nodeType: 'file'
28
- name: 'something'
29
-
30
- expect(@file.nameWithExtension()).toEqual('something')
31
-
32
- @anotherFile = new BoneTree.Models.Node
33
- nodeType: 'file'
34
- name: 'main'
35
- extension: ''
36
-
37
- expect(@anotherFile.nameWithExtension()).toEqual('main')
@@ -1,39 +0,0 @@
1
- #= require bone_tree/_namespace
2
- #= require bone_tree/views/_tree
3
-
4
- describe "BoneTree.Views.Tree", ->
5
- beforeEach ->
6
- setFixtures("<div id='test'></div>")
7
-
8
- @tree = new BoneTree.Views.Tree
9
-
10
- $('#test').append @tree.render().el
11
-
12
- afterEach ->
13
- @tree.remove()
14
- $('#test').empty()
15
-
16
- describe "rendering", ->
17
- it "should render the correct DOM elements", ->
18
- expect($('#test .tree')).toExist()
19
- expect($('#test .tree').length).toEqual(1)
20
-
21
- describe "configuration", ->
22
- it "should pass options through to the settings object", ->
23
- @tree = new BoneTree.Views.Tree
24
- confirmDeletes: true
25
-
26
- expect(@tree.settings.get('confirmDeletes')).toBeTruthy()
27
-
28
- @tree = new BoneTree.Views.Tree
29
- showExtensions: true
30
-
31
- expect(@tree.settings.get('showExtensions')).toBeTruthy()
32
-
33
- describe 'API', ->
34
- it 'should be able to find files by their path', ->
35
- @tree = new BoneTree.Views.Tree
36
-
37
- srcMain = @tree.file('src/main.coffee', {added: true})
38
-
39
- expect(@tree.file('src/main.coffee')).toEqual(srcMain)