sudojs-rails 0.3.0 → 0.3.1
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.
@@ -14,11 +14,13 @@ module Sudojs
|
|
14
14
|
# be considered 'custom' classes
|
15
15
|
@class_names = {
|
16
16
|
'Base' => '_.Base',
|
17
|
+
'Model' => '_.Model',
|
17
18
|
'Container' => '_.Container',
|
18
19
|
'DataView' => '_.DataView',
|
19
20
|
'View' => '_.View',
|
20
21
|
'ViewController' => '_.ViewController'
|
21
22
|
}
|
23
|
+
debugger
|
22
24
|
ary = route.split('#')
|
23
25
|
@c_name = ary[0]
|
24
26
|
@c_camel = camelize(@c_name)
|
@@ -26,14 +28,14 @@ module Sudojs
|
|
26
28
|
@is_application = @c_name == 'application'
|
27
29
|
# 'action' name not always applicable but thats ok
|
28
30
|
@a_name = ary[1]
|
29
|
-
@a_camel = camelize
|
30
|
-
# class invocations with `new` should always use a
|
31
|
-
@a_pascal = @
|
31
|
+
@a_camel = camelize @a_name
|
32
|
+
# class invocations with `new` should always use a PascalCased name
|
33
|
+
@a_pascal = pascalize @a_name
|
32
34
|
# either inherits from a sudo.js class or a custom one
|
33
35
|
@parent = @class_names[name] || name
|
34
36
|
# the arguments vary in the templates for class types
|
35
37
|
if @parent
|
36
|
-
if @parent == '_.Base' || @parent == '_.Container'
|
38
|
+
if @parent == '_.Base' || @parent == '_.Model' || @parent == '_.Container'
|
37
39
|
@args = 'data'
|
38
40
|
else
|
39
41
|
@args = 'el, data'
|
@@ -44,8 +44,16 @@ module Sudojs
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def pascalize(what)
|
47
|
-
|
48
|
-
|
47
|
+
# wow, capitalize will downcase a camel-cased word - fail
|
48
|
+
if what.include? '_'
|
49
|
+
ary = what.split '_'
|
50
|
+
ary.each {|val|
|
51
|
+
val.capitalize!
|
52
|
+
}
|
53
|
+
ary.join('')
|
54
|
+
else
|
55
|
+
what
|
56
|
+
end
|
49
57
|
end
|
50
58
|
|
51
59
|
end
|
data/lib/sudojs/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sudojs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -78,7 +78,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
segments:
|
80
80
|
- 0
|
81
|
-
hash:
|
81
|
+
hash: 1452095784062017175
|
82
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
segments:
|
89
89
|
- 0
|
90
|
-
hash:
|
90
|
+
hash: 1452095784062017175
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
93
|
rubygems_version: 1.8.24
|