jqueryplugingen 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/README.rdoc +30 -30
- data/Rakefile +5 -4
- data/jQuery-Plugin-Generator.tmproj +18 -124
- data/lib/jqp/cli.rb +16 -4
- data/lib/jquery_plugin_gen.rb +1 -1
- data/lib/jquery_plugin_gen/compiletask.rb +3 -1
- data/lib/jquery_plugin_gen/support/jquery.rake +2 -0
- metadata +2 -12
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
=
|
1
|
+
= jQuery Plugin Generator
|
2
2
|
|
3
3
|
* http://github.com/toddb/jqueryplugingenerator
|
4
4
|
|
@@ -17,11 +17,15 @@ Generate the structure of jquery plugins easily. Manage library dependencies suc
|
|
17
17
|
* be able to switch between local and remote libraries in actual html pages (perhaps this is the release bundle)
|
18
18
|
* be able to generate new modules and update html pages (as rake task or generator)
|
19
19
|
* nice to remove option -p for project "jpq myplugin"
|
20
|
+
* other packer libraries (especially for windows to avoid perl and sed dependencies)
|
20
21
|
|
21
22
|
== SYNOPSIS:
|
22
23
|
|
23
24
|
jqp -p myplugin
|
24
25
|
|
26
|
+
cd myplugin
|
27
|
+
rake first_time (this installs the latest jquery, jquery-ui & themes, builds and shows tests in browser)
|
28
|
+
|
25
29
|
jQuery plugin generator to help you kick start your plugin development with the following structure:
|
26
30
|
|
27
31
|
plugin
|
@@ -47,7 +51,7 @@ jQuery plugin generator to help you kick start your plugin development with the
|
|
47
51
|
|
48
52
|
It will generate a base plugin of the structure:
|
49
53
|
|
50
|
-
|
54
|
+
(function($) {
|
51
55
|
|
52
56
|
$.jquery.test = {
|
53
57
|
VERSION: "0.0.1",
|
@@ -61,12 +65,7 @@ It will generate a base plugin of the structure:
|
|
61
65
|
settings = $.extend({}, $.jquery.test.defaults, settings);
|
62
66
|
return this.each( function(){
|
63
67
|
self = this;
|
64
|
-
|
65
|
-
// NOTE: semicolons are needed more if you are planning on packing your code
|
66
|
-
console.log(this);
|
67
|
-
console.log($(this));
|
68
|
-
console.log($.jquery.test.VERSION);
|
69
|
-
console.log($.jquery.test.defaults.key);
|
68
|
+
|
70
69
|
// your plugin
|
71
70
|
|
72
71
|
})
|
@@ -79,25 +78,25 @@ And a base set of jsspec tests all hooked into an html page ready to go:
|
|
79
78
|
|
80
79
|
describe('Basic plugin initialization', {
|
81
80
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
81
|
+
'before': function() {
|
82
|
+
$('#jqplugin').jqplugin()
|
83
|
+
},
|
84
|
+
|
85
|
+
'after': function(){
|
86
|
+
},
|
87
|
+
|
88
|
+
'should be able see that version of project': function(){
|
89
|
+
value_of($.jqplugin.VERSION).should_be('0.0.1')
|
90
|
+
},
|
91
|
+
|
92
|
+
'should be able see that element is visible': function(){
|
93
|
+
value_of($('#jqplugin').is(':visible')).should_be_true()
|
94
|
+
},
|
95
|
+
|
96
|
+
'should be able to override default settings': function(){
|
97
|
+
// over to you!
|
98
|
+
},
|
99
|
+
|
101
100
|
})
|
102
101
|
|
103
102
|
Once you have written your code. You have three views of the plugin:
|
@@ -113,13 +112,14 @@ Finally, package your plugin ready for uploading the plugins.jquery.com
|
|
113
112
|
|
114
113
|
== REQUIREMENTS:
|
115
114
|
|
116
|
-
* jquery (installed with rake:jquery
|
115
|
+
* jquery (installed with rake:jquery)
|
117
116
|
* WINDOWS: 7zip (7z) on your path
|
118
|
-
* gems: rss-simple
|
117
|
+
* gems: rss-simple
|
118
|
+
* svn, sed, perl
|
119
119
|
|
120
120
|
== INSTALL:
|
121
121
|
|
122
|
-
* sudo gem install
|
122
|
+
* sudo gem install jqueryplugingen
|
123
123
|
|
124
124
|
== LICENSE:
|
125
125
|
|
data/Rakefile
CHANGED
@@ -12,9 +12,10 @@ $hoe = Hoe.new('jqueryplugingen', JqueryPluginGen::VERSION) do |p|
|
|
12
12
|
p.extra_deps = [
|
13
13
|
['simple-rss','>= 1.2'],
|
14
14
|
]
|
15
|
-
|
16
|
-
|
17
|
-
]
|
15
|
+
|
16
|
+
# p.extra_dev_deps = [
|
17
|
+
# ['newgem', ">= #{::Newgem::VERSION}"]
|
18
|
+
# ]
|
18
19
|
|
19
20
|
p.clean_globs |= %w[**/.DS_Store tmp *.log]
|
20
21
|
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
|
@@ -26,4 +27,4 @@ require 'newgem/tasks' # load /tasks/*.rake
|
|
26
27
|
Dir['tasks/**/*.rake'].each { |t| load t }
|
27
28
|
|
28
29
|
# TODO - want other tests/tasks run by default? Add them to the list
|
29
|
-
|
30
|
+
task :default => [:show]
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<plist version="1.0">
|
4
4
|
<dict>
|
5
5
|
<key>currentDocument</key>
|
6
|
-
<string>
|
6
|
+
<string>README.rdoc</string>
|
7
7
|
<key>documents</key>
|
8
8
|
<array>
|
9
9
|
<dict>
|
@@ -26,23 +26,9 @@
|
|
26
26
|
<key>caret</key>
|
27
27
|
<dict>
|
28
28
|
<key>column</key>
|
29
|
-
<integer>
|
29
|
+
<integer>52</integer>
|
30
30
|
<key>line</key>
|
31
|
-
<integer>
|
32
|
-
</dict>
|
33
|
-
<key>firstVisibleColumn</key>
|
34
|
-
<integer>0</integer>
|
35
|
-
<key>firstVisibleLine</key>
|
36
|
-
<integer>0</integer>
|
37
|
-
</dict>
|
38
|
-
<key>Manifest.txt</key>
|
39
|
-
<dict>
|
40
|
-
<key>caret</key>
|
41
|
-
<dict>
|
42
|
-
<key>column</key>
|
43
|
-
<integer>0</integer>
|
44
|
-
<key>line</key>
|
45
|
-
<integer>0</integer>
|
31
|
+
<integer>3</integer>
|
46
32
|
</dict>
|
47
33
|
<key>firstVisibleColumn</key>
|
48
34
|
<integer>0</integer>
|
@@ -54,9 +40,9 @@
|
|
54
40
|
<key>caret</key>
|
55
41
|
<dict>
|
56
42
|
<key>column</key>
|
57
|
-
<integer>
|
43
|
+
<integer>25</integer>
|
58
44
|
<key>line</key>
|
59
|
-
<integer>
|
45
|
+
<integer>0</integer>
|
60
46
|
</dict>
|
61
47
|
<key>firstVisibleColumn</key>
|
62
48
|
<integer>0</integer>
|
@@ -68,7 +54,7 @@
|
|
68
54
|
<key>caret</key>
|
69
55
|
<dict>
|
70
56
|
<key>column</key>
|
71
|
-
<integer>
|
57
|
+
<integer>42</integer>
|
72
58
|
<key>line</key>
|
73
59
|
<integer>25</integer>
|
74
60
|
</dict>
|
@@ -77,48 +63,6 @@
|
|
77
63
|
<key>firstVisibleLine</key>
|
78
64
|
<integer>0</integer>
|
79
65
|
</dict>
|
80
|
-
<key>lib/jquery_plugin_gen/compiletask.rb</key>
|
81
|
-
<dict>
|
82
|
-
<key>caret</key>
|
83
|
-
<dict>
|
84
|
-
<key>column</key>
|
85
|
-
<integer>15</integer>
|
86
|
-
<key>line</key>
|
87
|
-
<integer>101</integer>
|
88
|
-
</dict>
|
89
|
-
<key>firstVisibleColumn</key>
|
90
|
-
<integer>0</integer>
|
91
|
-
<key>firstVisibleLine</key>
|
92
|
-
<integer>89</integer>
|
93
|
-
</dict>
|
94
|
-
<key>lib/jquery_plugin_gen/generator.rb</key>
|
95
|
-
<dict>
|
96
|
-
<key>caret</key>
|
97
|
-
<dict>
|
98
|
-
<key>column</key>
|
99
|
-
<integer>55</integer>
|
100
|
-
<key>line</key>
|
101
|
-
<integer>28</integer>
|
102
|
-
</dict>
|
103
|
-
<key>firstVisibleColumn</key>
|
104
|
-
<integer>0</integer>
|
105
|
-
<key>firstVisibleLine</key>
|
106
|
-
<integer>0</integer>
|
107
|
-
</dict>
|
108
|
-
<key>lib/jquery_plugin_gen/quick_template.rb</key>
|
109
|
-
<dict>
|
110
|
-
<key>caret</key>
|
111
|
-
<dict>
|
112
|
-
<key>column</key>
|
113
|
-
<integer>19</integer>
|
114
|
-
<key>line</key>
|
115
|
-
<integer>16</integer>
|
116
|
-
</dict>
|
117
|
-
<key>firstVisibleColumn</key>
|
118
|
-
<integer>0</integer>
|
119
|
-
<key>firstVisibleLine</key>
|
120
|
-
<integer>0</integer>
|
121
|
-
</dict>
|
122
66
|
<key>lib/jquery_plugin_gen/support/build.rake</key>
|
123
67
|
<dict>
|
124
68
|
<key>caret</key>
|
@@ -133,86 +77,42 @@
|
|
133
77
|
<key>firstVisibleLine</key>
|
134
78
|
<integer>0</integer>
|
135
79
|
</dict>
|
136
|
-
<key>lib/jquery_plugin_gen/support/
|
80
|
+
<key>lib/jquery_plugin_gen/support/bundles.rake</key>
|
137
81
|
<dict>
|
138
82
|
<key>caret</key>
|
139
83
|
<dict>
|
140
84
|
<key>column</key>
|
141
|
-
<integer>
|
85
|
+
<integer>5</integer>
|
142
86
|
<key>line</key>
|
143
|
-
<integer>
|
87
|
+
<integer>13</integer>
|
144
88
|
</dict>
|
145
89
|
<key>firstVisibleColumn</key>
|
146
90
|
<integer>0</integer>
|
147
91
|
<key>firstVisibleLine</key>
|
148
92
|
<integer>0</integer>
|
149
93
|
</dict>
|
150
|
-
<key>lib/jquery_plugin_gen/support/
|
94
|
+
<key>lib/jquery_plugin_gen/support/jquery.rake</key>
|
151
95
|
<dict>
|
152
96
|
<key>caret</key>
|
153
97
|
<dict>
|
154
98
|
<key>column</key>
|
155
|
-
<integer>
|
99
|
+
<integer>38</integer>
|
156
100
|
<key>line</key>
|
157
|
-
<integer>
|
101
|
+
<integer>21</integer>
|
158
102
|
</dict>
|
159
|
-
<key>columnSelection</key>
|
160
|
-
<false/>
|
161
103
|
<key>firstVisibleColumn</key>
|
162
104
|
<integer>0</integer>
|
163
105
|
<key>firstVisibleLine</key>
|
164
106
|
<integer>0</integer>
|
165
|
-
<key>selectFrom</key>
|
166
|
-
<dict>
|
167
|
-
<key>column</key>
|
168
|
-
<integer>0</integer>
|
169
|
-
<key>line</key>
|
170
|
-
<integer>0</integer>
|
171
|
-
</dict>
|
172
|
-
<key>selectTo</key>
|
173
|
-
<dict>
|
174
|
-
<key>column</key>
|
175
|
-
<integer>56</integer>
|
176
|
-
<key>line</key>
|
177
|
-
<integer>0</integer>
|
178
|
-
</dict>
|
179
107
|
</dict>
|
180
|
-
<key>lib/
|
108
|
+
<key>lib/jquery_plugin_gen/support/package.rake</key>
|
181
109
|
<dict>
|
182
110
|
<key>caret</key>
|
183
111
|
<dict>
|
184
112
|
<key>column</key>
|
185
113
|
<integer>0</integer>
|
186
114
|
<key>line</key>
|
187
|
-
<integer>
|
188
|
-
</dict>
|
189
|
-
<key>firstVisibleColumn</key>
|
190
|
-
<integer>0</integer>
|
191
|
-
<key>firstVisibleLine</key>
|
192
|
-
<integer>0</integer>
|
193
|
-
</dict>
|
194
|
-
<key>lib/templates/Rakefile.erb</key>
|
195
|
-
<dict>
|
196
|
-
<key>caret</key>
|
197
|
-
<dict>
|
198
|
-
<key>column</key>
|
199
|
-
<integer>5</integer>
|
200
|
-
<key>line</key>
|
201
|
-
<integer>14</integer>
|
202
|
-
</dict>
|
203
|
-
<key>firstVisibleColumn</key>
|
204
|
-
<integer>0</integer>
|
205
|
-
<key>firstVisibleLine</key>
|
206
|
-
<integer>0</integer>
|
207
|
-
</dict>
|
208
|
-
<key>lib/templates/example.html.erb</key>
|
209
|
-
<dict>
|
210
|
-
<key>caret</key>
|
211
|
-
<dict>
|
212
|
-
<key>column</key>
|
213
|
-
<integer>7</integer>
|
214
|
-
<key>line</key>
|
215
|
-
<integer>11</integer>
|
115
|
+
<integer>13</integer>
|
216
116
|
</dict>
|
217
117
|
<key>firstVisibleColumn</key>
|
218
118
|
<integer>0</integer>
|
@@ -222,19 +122,13 @@
|
|
222
122
|
</dict>
|
223
123
|
<key>openDocuments</key>
|
224
124
|
<array>
|
225
|
-
<string>lib/jquery_plugin_gen/generator.rb</string>
|
226
|
-
<string>lib/jquery_plugin_gen/support/jquery.rake</string>
|
227
|
-
<string>lib/jquery_plugin_gen/support/test.rake</string>
|
228
|
-
<string>lib/templates/Rakefile.erb</string>
|
229
|
-
<string>lib/templates/example.html.erb</string>
|
230
|
-
<string>lib/jquery_plugin_gen/support/build.rake</string>
|
231
|
-
<string>lib/templates/History.txt.erb</string>
|
232
|
-
<string>lib/jquery_plugin_gen/compiletask.rb</string>
|
233
|
-
<string>lib/jquery_plugin_gen/quick_template.rb</string>
|
234
125
|
<string>Rakefile</string>
|
235
|
-
<string>Manifest.txt</string>
|
236
126
|
<string>README.rdoc</string>
|
237
127
|
<string>History.txt</string>
|
128
|
+
<string>lib/jquery_plugin_gen/support/bundles.rake</string>
|
129
|
+
<string>lib/jquery_plugin_gen/support/build.rake</string>
|
130
|
+
<string>lib/jquery_plugin_gen/support/jquery.rake</string>
|
131
|
+
<string>lib/jquery_plugin_gen/support/package.rake</string>
|
238
132
|
</array>
|
239
133
|
<key>showFileHierarchyDrawer</key>
|
240
134
|
<true/>
|
data/lib/jqp/cli.rb
CHANGED
@@ -12,7 +12,8 @@ module Jqp
|
|
12
12
|
|
13
13
|
parser = OptionParser.new do |opts|
|
14
14
|
opts.banner = <<-BANNER.gsub(/^ /,'')
|
15
|
-
jQuery plugin generator to help you kick start your plugin
|
15
|
+
jQuery plugin generator to help you kick start your plugin
|
16
|
+
development with the following structure:
|
16
17
|
|
17
18
|
plugin
|
18
19
|
/src
|
@@ -34,7 +35,13 @@ module Jqp
|
|
34
35
|
Rakefile
|
35
36
|
History.txt
|
36
37
|
README.txt
|
37
|
-
|
38
|
+
|
39
|
+
|
40
|
+
Dependencies: svn, unzip, sed and perl
|
41
|
+
|
42
|
+
Note: Windows users require svn, 7zip, sed and perl to
|
43
|
+
be on PATH to be available for use
|
44
|
+
|
38
45
|
Usage: #{File.basename($0)} [options]
|
39
46
|
|
40
47
|
Options are:
|
@@ -43,7 +50,7 @@ module Jqp
|
|
43
50
|
opts.on("-p", "--project=Name", String,
|
44
51
|
"The project name should be simple eg 'widget'",
|
45
52
|
"And it will be transformed to jquery.widget.js - there is currently no override feature on this naming convention",
|
46
|
-
"Default:
|
53
|
+
"Default: jqplugin") { |arg| options[:project] = arg }
|
47
54
|
opts.on("-v", "--version=x.x.x", String,
|
48
55
|
"Default: 0.0.1") { |arg| options[:version] = arg }
|
49
56
|
opts.on("-h", "--help",
|
@@ -63,7 +70,7 @@ module Jqp
|
|
63
70
|
|
64
71
|
Now include the jQuery libraries with:
|
65
72
|
|
66
|
-
cd
|
73
|
+
cd jqplugin [or your plugin]
|
67
74
|
rake first_time
|
68
75
|
|
69
76
|
First time will:
|
@@ -79,6 +86,11 @@ However, if you don't you will need to update the html
|
|
79
86
|
pages (example.html, test/spec.html). To see other options
|
80
87
|
use rake -T
|
81
88
|
|
89
|
+
Dependencies: svn, unzip, sed and perl
|
90
|
+
|
91
|
+
Note: Windows users require svn, 7zip, sed and perl to
|
92
|
+
be on PATH to be available for use
|
93
|
+
|
82
94
|
**********************************************************
|
83
95
|
|
84
96
|
MSG
|
data/lib/jquery_plugin_gen.rb
CHANGED
@@ -27,7 +27,7 @@ module Rake
|
|
27
27
|
#
|
28
28
|
# Example:
|
29
29
|
#
|
30
|
-
# JqueryPluginGen::CompileTask.new('
|
30
|
+
# JqueryPluginGen::CompileTask.new('queryplugin') do |p|
|
31
31
|
# p.js_files.include("src/**/*.js")
|
32
32
|
# p.css_files.include("src/css/**/*.css")
|
33
33
|
# p.image_files.include("src/images/**/*.*")
|
@@ -38,6 +38,7 @@ module Rake
|
|
38
38
|
# p.package_dir = "build"
|
39
39
|
# end
|
40
40
|
#
|
41
|
+
# Note: Windows users require sed and perl for rake:compile - please install onto PATH
|
41
42
|
|
42
43
|
class CompileTask < TaskLib
|
43
44
|
|
@@ -76,6 +77,7 @@ module Rake
|
|
76
77
|
init(name)
|
77
78
|
yield self if block_given?
|
78
79
|
define unless name.nil?
|
80
|
+
puts "Windows users require sed and perl for rake:compile - please install onto PATH" if /mswin|mingw/ =~ RUBY_PLATFORM
|
79
81
|
end
|
80
82
|
|
81
83
|
# Initialization that bypasses the "yield self" and "define" step.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jqueryplugingen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toddb
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-20 00:00:00 +12:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,16 +22,6 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: "1.2"
|
24
24
|
version:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: newgem
|
27
|
-
type: :development
|
28
|
-
version_requirement:
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.4.1
|
34
|
-
version:
|
35
25
|
- !ruby/object:Gem::Dependency
|
36
26
|
name: hoe
|
37
27
|
type: :development
|