modularity-rails 0.15.0 → 0.16.0

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 (89) hide show
  1. data/{LICENSE → MIT-LICENSE} +0 -0
  2. data/README.md +16 -15
  3. data/Rakefile +3 -14
  4. data/{vendor → app}/assets/javascripts/modularity/data/ajax_loader.coffee +0 -0
  5. data/{vendor → app}/assets/javascripts/modularity/data/cache.coffee +5 -0
  6. data/{vendor → app}/assets/javascripts/modularity/data/indexed_cache.coffee +8 -2
  7. data/{vendor → app}/assets/javascripts/modularity/data/persistence_manager.coffee +11 -0
  8. data/{vendor → app}/assets/javascripts/modularity/mixins/clickable.coffee +2 -2
  9. data/{vendor → app}/assets/javascripts/modularity/mixins/closable.coffee +0 -0
  10. data/{vendor/assets/javascripts/modularity.js.coffee → app/assets/javascripts/modularity/modularity.coffee} +3 -0
  11. data/{vendor → app}/assets/javascripts/modularity/modules/autogrow_textarea.coffee +2 -1
  12. data/{vendor → app}/assets/javascripts/modularity/modules/button.coffee +0 -0
  13. data/{vendor → app}/assets/javascripts/modularity/tools/array_tools.coffee +1 -0
  14. data/{vendor → app}/assets/javascripts/modularity/tools/object_tools.coffee +0 -0
  15. data/config/initializers/konacha.rb +6 -0
  16. data/lib/modularity-rails.rb +0 -1
  17. data/lib/modularity-rails/engine.rb +1 -0
  18. data/lib/modularity-rails/version.rb +1 -1
  19. metadata +80 -100
  20. data/.evergreen +0 -6
  21. data/.gitignore +0 -20
  22. data/.travis.yml +0 -8
  23. data/Gemfile +0 -4
  24. data/Guardfile +0 -8
  25. data/demo/.gitignore +0 -15
  26. data/demo/Gemfile +0 -23
  27. data/demo/README.rdoc +0 -261
  28. data/demo/Rakefile +0 -7
  29. data/demo/app/assets/images/rails.png +0 -0
  30. data/demo/app/assets/javascripts/application.coffee +0 -2
  31. data/demo/app/assets/stylesheets/application.css +0 -13
  32. data/demo/app/controllers/application_controller.rb +0 -3
  33. data/demo/app/helpers/application_helper.rb +0 -2
  34. data/demo/app/mailers/.gitkeep +0 -0
  35. data/demo/app/models/.gitkeep +0 -0
  36. data/demo/app/views/layouts/application.html.erb +0 -14
  37. data/demo/config.ru +0 -4
  38. data/demo/config/application.rb +0 -59
  39. data/demo/config/boot.rb +0 -6
  40. data/demo/config/database.yml +0 -25
  41. data/demo/config/environment.rb +0 -5
  42. data/demo/config/environments/development.rb +0 -37
  43. data/demo/config/environments/production.rb +0 -67
  44. data/demo/config/environments/test.rb +0 -37
  45. data/demo/config/initializers/backtrace_silencers.rb +0 -7
  46. data/demo/config/initializers/inflections.rb +0 -15
  47. data/demo/config/initializers/konacha.rb +0 -5
  48. data/demo/config/initializers/mime_types.rb +0 -5
  49. data/demo/config/initializers/secret_token.rb +0 -7
  50. data/demo/config/initializers/session_store.rb +0 -8
  51. data/demo/config/initializers/wrap_parameters.rb +0 -14
  52. data/demo/config/locales/en.yml +0 -5
  53. data/demo/config/routes.rb +0 -58
  54. data/demo/db/seeds.rb +0 -7
  55. data/demo/lib/assets/.gitkeep +0 -0
  56. data/demo/lib/tasks/.gitkeep +0 -0
  57. data/demo/log/.gitkeep +0 -0
  58. data/demo/public/404.html +0 -26
  59. data/demo/public/422.html +0 -26
  60. data/demo/public/500.html +0 -25
  61. data/demo/public/favicon.ico +0 -0
  62. data/demo/public/index.html +0 -241
  63. data/demo/public/robots.txt +0 -5
  64. data/demo/script/rails +0 -6
  65. data/demo/spec/javascripts/data/ajax_loader_spec.coffee +0 -132
  66. data/demo/spec/javascripts/data/cache_spec.coffee +0 -103
  67. data/demo/spec/javascripts/data/indexed_cache_spec.coffee +0 -51
  68. data/demo/spec/javascripts/data/persistence_manager_spec.coffee +0 -283
  69. data/demo/spec/javascripts/konacha_config.coffee +0 -2
  70. data/demo/spec/javascripts/mixins/closable_spec.coffee +0 -98
  71. data/demo/spec/javascripts/modularity_spec.coffee +0 -329
  72. data/demo/spec/javascripts/modules/autogrow_textarea_spec.coffee +0 -43
  73. data/demo/spec/javascripts/modules/button_spec.coffee +0 -39
  74. data/demo/spec/javascripts/modules/counter_button_spec.coffee +0 -57
  75. data/demo/spec/javascripts/sinon-chai.js +0 -116
  76. data/demo/spec/javascripts/sinon.js +0 -3555
  77. data/demo/spec/javascripts/spec_helper.coffee +0 -10
  78. data/demo/spec/javascripts/templates/autogrow_textarea.jst.ejs +0 -2
  79. data/demo/spec/javascripts/templates/button.jst.ejs +0 -3
  80. data/demo/spec/javascripts/templates/closable.jst.ejs +0 -14
  81. data/demo/spec/javascripts/templates/modularity.jst.ejs +0 -6
  82. data/demo/spec/javascripts/tools/array_tools_spec.coffee +0 -12
  83. data/demo/spec/javascripts/tools/object_tools_spec.coffee +0 -46
  84. data/demo/vendor/assets/javascripts/.gitkeep +0 -0
  85. data/demo/vendor/assets/stylesheets/.gitkeep +0 -0
  86. data/demo/vendor/plugins/.gitkeep +0 -0
  87. data/modularity-rails.gemspec +0 -22
  88. data/run_tests +0 -6
  89. data/vendor/assets/javascripts/modularity/modules/counter_button.coffee +0 -17
@@ -1,10 +0,0 @@
1
- #= require application
2
- #= require sinon
3
- #= require sinon-chai
4
- #= require_tree ./templates
5
-
6
-
7
- # Renders the template with the given path in the #konacha div.
8
- window.template = (path) ->
9
- $('#konacha').html JST["templates/#{path}"]()
10
-
@@ -1,2 +0,0 @@
1
- <textarea id="autogrow_area" rows="3" cols="4"></textarea>
2
-
@@ -1,3 +0,0 @@
1
- <div id="button1">A normal button.</div>
2
- <div id="button2">A button with <span class="embedded"></span> elements.</div>
3
-
@@ -1,14 +0,0 @@
1
- <div id="closable1">
2
- A closable section.
3
- <div class="CloseButton"></div>
4
- </div>
5
-
6
- <div id="closable2">
7
- A closable section with a custom close button.
8
- <div class="CustomCloseButton"></div>
9
- </div>
10
-
11
- <div id="closable3">
12
- A section without a close button.
13
- </div>
14
-
@@ -1,6 +0,0 @@
1
- <div id="module_container">
2
- <div class="inside_module"></div>
3
- </div>
4
- <div class="outside_module"></div>
5
- <div class="double"></div>
6
- <div class="double"></div>
@@ -1,12 +0,0 @@
1
- #= require spec_helper
2
- #= require modularity/tools/array_tools
3
-
4
- describe 'array_tools', ->
5
-
6
- describe 'array_unique', ->
7
-
8
- it 'removes duplicate entries from the given array', ->
9
- modularity.array_unique([1,1,2,2,3]).should.eql [1,2,3]
10
-
11
- it 'works with unsorted arrays', ->
12
- modularity.array_unique([2,3,1,2,1]).sort().should.eql [1,2,3]
@@ -1,46 +0,0 @@
1
- #= require spec_helper
2
- #= require modularity/tools/object_tools
3
-
4
-
5
- describe 'clone', ->
6
-
7
- clone = null
8
- entry_1 = {id: 1, value: 'one'}
9
- beforeEach ->
10
- clone = modularity.clone_hash entry_1
11
-
12
- it 'returns an object that has the same properties as the given object', ->
13
- clone.id.should.equal 1
14
- clone.value.should.equal 'one'
15
-
16
- it 'returns an object that can be changed independently from the given object', ->
17
- clone.id = 2
18
- clone.value = 'two'
19
- entry_1.id.should == 1
20
- entry_1.value.should == 'one'
21
-
22
-
23
- describe 'object_tools', ->
24
-
25
- describe 'object_diff', ->
26
- obj_1 = {title: 'title 1', value: 'value 1'}
27
- obj_2 = {title: 'title 2', value: 'value 1'}
28
- obj_1b = {title: 'title 1', value: 'value 1'}
29
-
30
- it 'returns a new object that contains only the changed attributes', ->
31
- modularity.object_diff(obj_1, obj_2).should.eql {title: 'title 2'}
32
-
33
- it 'returns an empty object if the two objects are equal', ->
34
- modularity.object_diff(obj_1, obj_1b).should.eql {}
35
-
36
-
37
- describe 'object_length', ->
38
-
39
- it 'returns the number of attributes of the given object', ->
40
- obj_1 = {1: 'one'}
41
- obj_2 = {1: 'one', 2: 'two'}
42
- obj_3 = {1: 'one', 2: 'two', 3: 'three'}
43
- modularity.object_length({}).should.equal 0
44
- modularity.object_length(obj_1).should.equal 1
45
- modularity.object_length(obj_2).should.equal 2
46
- modularity.object_length(obj_3).should.equal 3
File without changes
File without changes
File without changes
@@ -1,22 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/modularity-rails/version', __FILE__)
3
-
4
- Gem::Specification.new do |s|
5
- s.name = "modularity-rails"
6
- s.version = ModularityRails::VERSION
7
- s.authors = ["Kevin Goslar"]
8
- s.email = ["kevin.goslar@gmail.com"]
9
- s.homepage = "http://github.com/kevgo/modularity-rails"
10
- s.summary = "Summary of ModularityRails."
11
- s.description = "Description of ModularityRails."
12
-
13
- s.add_dependency "rails", ">= 3.1.0"
14
- s.add_development_dependency "capybara-webkit"
15
- s.add_development_dependency "evergreen"
16
- s.add_development_dependency "rb-fsevent" if RUBY_PLATFORM =~ /darwin/i
17
- s.add_development_dependency "guard-livereload"
18
-
19
- s.files = `git ls-files`.split("\n")
20
- s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/}
21
- s.require_path = 'lib'
22
- end
data/run_tests DELETED
@@ -1,6 +0,0 @@
1
- cd demo/
2
- bundle
3
- echo
4
- bundle exec rake konacha:run
5
- echo
6
-
@@ -1,17 +0,0 @@
1
- #= require modularity/modules/button
2
-
3
- # A button that counts how often it is clicked.
4
- # This is implemented as a subclass of Button,
5
- # to take advantage of the already existing functionality there.
6
- class window.modularity.CounterButton extends modularity.Button
7
-
8
- constructor: ->
9
- super
10
-
11
- # Counts how often this button has been clicked so far.
12
- @click_count = 0
13
-
14
-
15
- # We override the event handler for the 'clicked' event here.
16
- container_clicked: =>
17
- @fire_event 'clicked', ++@click_count