modularity-rails 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -37,6 +37,10 @@ describe 'modularity', ->
|
|
37
37
|
new TestModule()
|
38
38
|
expect(alert).toHaveBeenCalled()
|
39
39
|
|
40
|
+
it 'tries to load the DOM if the given container is a string', ->
|
41
|
+
new TestModule('#module_container')
|
42
|
+
expect(alert).not.toHaveBeenCalled()
|
43
|
+
|
40
44
|
it 'shows an error if the container is not a jQuery object', ->
|
41
45
|
new TestModule({})
|
42
46
|
expect(alert).toHaveBeenCalled()
|
@@ -7,7 +7,10 @@
|
|
7
7
|
class window.Module
|
8
8
|
|
9
9
|
# The container variable is required. Provide 'testing' in tests.
|
10
|
-
constructor: (
|
10
|
+
constructor: (container) ->
|
11
|
+
container = $(container) if (typeof container == 'string') and container != 'testing'
|
12
|
+
@container = container
|
13
|
+
|
11
14
|
return alert 'Error in Module constructor: No container given.' unless @container?
|
12
15
|
if container != 'testing'
|
13
16
|
return alert 'Error in Module constructor: The given container must be a jQuery object.' unless typeof container.jquery == 'string'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modularity-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-04-17 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70138326211200 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70138326211200
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: capybara-webkit
|
27
|
-
requirement: &
|
27
|
+
requirement: &70138326210780 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70138326210780
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: evergreen
|
38
|
-
requirement: &
|
38
|
+
requirement: &70138314263400 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70138314263400
|
47
47
|
description: Description of ModularityRails.
|
48
48
|
email:
|
49
49
|
- kevin.goslar@gmail.com
|