jbundle 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/jbundle/command_line.rb +2 -0
- data/lib/jbundle/templates/lib.tt +4 -4
- data/lib/jbundle/templates/tests.tt +1 -1
- data/lib/jbundle/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -185,7 +185,7 @@ Learn more about the JBundle command-line with
|
|
185
185
|
|
186
186
|
The command line has a quick generator that creates stub files for your library code, an example file and tests using Qunit.
|
187
187
|
|
188
|
-
|
188
|
+
jbundle init my_library.js
|
189
189
|
|
190
190
|
create JFile
|
191
191
|
create src
|
data/lib/jbundle/command_line.rb
CHANGED
@@ -69,6 +69,8 @@ Then package your work
|
|
69
69
|
method_option :tests, :default => 'qunit', :aliases => '-t'
|
70
70
|
def init(name)
|
71
71
|
@name = name
|
72
|
+
@klass_name = name.sub('.js', '').split(/[^a-z0-9]/i).map{|w| w.capitalize}.join
|
73
|
+
|
72
74
|
template('templates/jfile.tt', "JFile")
|
73
75
|
empty_directory 'src'
|
74
76
|
template('templates/license.tt', "src/license.txt")
|
@@ -1,14 +1,14 @@
|
|
1
|
-
var <%= @
|
1
|
+
var <%= @klass_name %> = (function () {
|
2
2
|
|
3
|
-
function
|
3
|
+
function <%= @klass_name %> (name) {
|
4
4
|
this.name = name;
|
5
5
|
}
|
6
6
|
|
7
|
-
|
7
|
+
<%= @klass_name %>.prototype = {
|
8
8
|
title: function () {
|
9
9
|
return 'Mr. ' + this.name;
|
10
10
|
}
|
11
11
|
}
|
12
12
|
|
13
|
-
return
|
13
|
+
return <%= @klass_name %>;
|
14
14
|
})();
|
data/lib/jbundle/version.rb
CHANGED