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.
- data/{LICENSE → MIT-LICENSE} +0 -0
- data/README.md +16 -15
- data/Rakefile +3 -14
- data/{vendor → app}/assets/javascripts/modularity/data/ajax_loader.coffee +0 -0
- data/{vendor → app}/assets/javascripts/modularity/data/cache.coffee +5 -0
- data/{vendor → app}/assets/javascripts/modularity/data/indexed_cache.coffee +8 -2
- data/{vendor → app}/assets/javascripts/modularity/data/persistence_manager.coffee +11 -0
- data/{vendor → app}/assets/javascripts/modularity/mixins/clickable.coffee +2 -2
- data/{vendor → app}/assets/javascripts/modularity/mixins/closable.coffee +0 -0
- data/{vendor/assets/javascripts/modularity.js.coffee → app/assets/javascripts/modularity/modularity.coffee} +3 -0
- data/{vendor → app}/assets/javascripts/modularity/modules/autogrow_textarea.coffee +2 -1
- data/{vendor → app}/assets/javascripts/modularity/modules/button.coffee +0 -0
- data/{vendor → app}/assets/javascripts/modularity/tools/array_tools.coffee +1 -0
- data/{vendor → app}/assets/javascripts/modularity/tools/object_tools.coffee +0 -0
- data/config/initializers/konacha.rb +6 -0
- data/lib/modularity-rails.rb +0 -1
- data/lib/modularity-rails/engine.rb +1 -0
- data/lib/modularity-rails/version.rb +1 -1
- metadata +80 -100
- data/.evergreen +0 -6
- data/.gitignore +0 -20
- data/.travis.yml +0 -8
- data/Gemfile +0 -4
- data/Guardfile +0 -8
- data/demo/.gitignore +0 -15
- data/demo/Gemfile +0 -23
- data/demo/README.rdoc +0 -261
- data/demo/Rakefile +0 -7
- data/demo/app/assets/images/rails.png +0 -0
- data/demo/app/assets/javascripts/application.coffee +0 -2
- data/demo/app/assets/stylesheets/application.css +0 -13
- data/demo/app/controllers/application_controller.rb +0 -3
- data/demo/app/helpers/application_helper.rb +0 -2
- data/demo/app/mailers/.gitkeep +0 -0
- data/demo/app/models/.gitkeep +0 -0
- data/demo/app/views/layouts/application.html.erb +0 -14
- data/demo/config.ru +0 -4
- data/demo/config/application.rb +0 -59
- data/demo/config/boot.rb +0 -6
- data/demo/config/database.yml +0 -25
- data/demo/config/environment.rb +0 -5
- data/demo/config/environments/development.rb +0 -37
- data/demo/config/environments/production.rb +0 -67
- data/demo/config/environments/test.rb +0 -37
- data/demo/config/initializers/backtrace_silencers.rb +0 -7
- data/demo/config/initializers/inflections.rb +0 -15
- data/demo/config/initializers/konacha.rb +0 -5
- data/demo/config/initializers/mime_types.rb +0 -5
- data/demo/config/initializers/secret_token.rb +0 -7
- data/demo/config/initializers/session_store.rb +0 -8
- data/demo/config/initializers/wrap_parameters.rb +0 -14
- data/demo/config/locales/en.yml +0 -5
- data/demo/config/routes.rb +0 -58
- data/demo/db/seeds.rb +0 -7
- data/demo/lib/assets/.gitkeep +0 -0
- data/demo/lib/tasks/.gitkeep +0 -0
- data/demo/log/.gitkeep +0 -0
- data/demo/public/404.html +0 -26
- data/demo/public/422.html +0 -26
- data/demo/public/500.html +0 -25
- data/demo/public/favicon.ico +0 -0
- data/demo/public/index.html +0 -241
- data/demo/public/robots.txt +0 -5
- data/demo/script/rails +0 -6
- data/demo/spec/javascripts/data/ajax_loader_spec.coffee +0 -132
- data/demo/spec/javascripts/data/cache_spec.coffee +0 -103
- data/demo/spec/javascripts/data/indexed_cache_spec.coffee +0 -51
- data/demo/spec/javascripts/data/persistence_manager_spec.coffee +0 -283
- data/demo/spec/javascripts/konacha_config.coffee +0 -2
- data/demo/spec/javascripts/mixins/closable_spec.coffee +0 -98
- data/demo/spec/javascripts/modularity_spec.coffee +0 -329
- data/demo/spec/javascripts/modules/autogrow_textarea_spec.coffee +0 -43
- data/demo/spec/javascripts/modules/button_spec.coffee +0 -39
- data/demo/spec/javascripts/modules/counter_button_spec.coffee +0 -57
- data/demo/spec/javascripts/sinon-chai.js +0 -116
- data/demo/spec/javascripts/sinon.js +0 -3555
- data/demo/spec/javascripts/spec_helper.coffee +0 -10
- data/demo/spec/javascripts/templates/autogrow_textarea.jst.ejs +0 -2
- data/demo/spec/javascripts/templates/button.jst.ejs +0 -3
- data/demo/spec/javascripts/templates/closable.jst.ejs +0 -14
- data/demo/spec/javascripts/templates/modularity.jst.ejs +0 -6
- data/demo/spec/javascripts/tools/array_tools_spec.coffee +0 -12
- data/demo/spec/javascripts/tools/object_tools_spec.coffee +0 -46
- data/demo/vendor/assets/javascripts/.gitkeep +0 -0
- data/demo/vendor/assets/stylesheets/.gitkeep +0 -0
- data/demo/vendor/plugins/.gitkeep +0 -0
- data/modularity-rails.gemspec +0 -22
- data/run_tests +0 -6
- data/vendor/assets/javascripts/modularity/modules/counter_button.coffee +0 -17
@@ -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,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
|
data/modularity-rails.gemspec
DELETED
@@ -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,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
|