express_templates 0.11.5 → 0.11.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25344efbf662faf81ee38e848bbee57bcbff4bbe
|
4
|
+
data.tar.gz: 58c5eadf5990d90c894c204578279c88f328a1ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 766f6ec66e155b356b621bd49b39bef4f9b2512912f574a94fbd69f564c8c2585324320f279c038bf034f6b74e98a01ab685cfdcc4d0871c24b7e423a440a8c4
|
7
|
+
data.tar.gz: e47c8531c5ba75cb423b4efebf20139ea39e24b38c3a6c73518c54f210ab91cfa79a750098d32e959059ecdf28a464d1615b6bbb422c03319b232064affd971d
|
@@ -66,7 +66,7 @@ module ExpressTemplates
|
|
66
66
|
when path_parts.size == 4
|
67
67
|
path_parts.first
|
68
68
|
when path_parts.size == 3
|
69
|
-
mod = path_parts.first.
|
69
|
+
mod = path_parts.first.camelize.constantize
|
70
70
|
if mod.const_defined?(:Engine)
|
71
71
|
path_parts.first
|
72
72
|
else
|
@@ -88,7 +88,7 @@ module ExpressTemplates
|
|
88
88
|
when path_parts.size == 4
|
89
89
|
path_parts[1]
|
90
90
|
when path_parts.size == 3
|
91
|
-
mod = path_parts.first.
|
91
|
+
mod = path_parts.first.camelize.constantize
|
92
92
|
if mod.const_defined?(:Engine)
|
93
93
|
nil
|
94
94
|
else
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
module
|
3
|
+
module AdminModules
|
4
4
|
module Engine
|
5
5
|
end
|
6
6
|
class SmartThing < ExpressTemplates::Components::Configurable
|
@@ -30,34 +30,34 @@ module ExpressTemplates
|
|
30
30
|
|
31
31
|
class ResourcefulTest < ActiveSupport::TestCase
|
32
32
|
test 'infers namespace and path prefix within an engine and scope' do
|
33
|
-
smart_thing =
|
34
|
-
assert_equal '
|
33
|
+
smart_thing = AdminModules::SmartThing.new('admin_modules/admin/something/index')
|
34
|
+
assert_equal 'admin_modules', smart_thing.namespace
|
35
35
|
assert_equal 'admin', smart_thing.path_prefix
|
36
36
|
end
|
37
37
|
|
38
38
|
test 'infers a namespace and no prefix within an engine' do
|
39
39
|
# if defined? ExpressFoo::Engine
|
40
|
-
smart_thing =
|
41
|
-
assert_equal '
|
40
|
+
smart_thing = AdminModules::SmartThing.new('admin_modules/something/index')
|
41
|
+
assert_equal 'admin_modules', smart_thing.namespace
|
42
42
|
assert_equal nil, smart_thing.path_prefix
|
43
43
|
end
|
44
44
|
|
45
45
|
test 'no namespace, infers prefix within a scope within an app' do
|
46
46
|
# else of case above
|
47
|
-
smart_thing =
|
47
|
+
smart_thing = AdminModules::SmartThing.new('admin/something/index')
|
48
48
|
assert_equal nil, smart_thing.namespace
|
49
49
|
assert_equal 'admin', smart_thing.path_prefix
|
50
50
|
end
|
51
51
|
|
52
52
|
test 'no namespace, no prefix within an app' do
|
53
|
-
smart_thing =
|
53
|
+
smart_thing = AdminModules::SmartThing.new('somethings/index')
|
54
54
|
assert_equal nil, smart_thing.namespace
|
55
55
|
assert_equal nil, smart_thing.path_prefix
|
56
56
|
end
|
57
57
|
|
58
58
|
test "#resource_class returns resource_class option if specified" do
|
59
|
-
assert_equal FooBar,
|
60
|
-
assert_equal Something,
|
59
|
+
assert_equal FooBar, AdminModules::SmartThing.new('somethings/index', resource_class: 'FooBar').resource_class
|
60
|
+
assert_equal Something, AdminModules::SmartThing.new('somethings/index', id: :something).resource_class
|
61
61
|
end
|
62
62
|
|
63
63
|
test "#resource_class raises a helpful error message when the class does not exist" do
|
@@ -66,7 +66,7 @@ module ExpressTemplates
|
|
66
66
|
"You may need to define the option `:resource_class`.",
|
67
67
|
].join(" ")
|
68
68
|
|
69
|
-
smart_thing =
|
69
|
+
smart_thing = AdminModules::SmartThing.
|
70
70
|
new('somethings/index', resource_class: 'NonExistentBar')
|
71
71
|
|
72
72
|
assert_raises(ArgumentError, expected_error_message) do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: express_templates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Talcott Smith
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-11-
|
12
|
+
date: 2015-11-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|