Permalink
Browse files

Remove touch from default distribution. Add "modules" rake task.

  • Loading branch information...
1 parent 41a00bb commit f98cb5cdf065fc52837a9c060503458d383670c3 @madrobby madrobby committed Apr 17, 2012
Showing with 15 additions and 5 deletions.
  1. +5 −4 README.md
  2. +10 −1 Rakefile
View
@@ -43,15 +43,16 @@ The resulting files are:
2. `dist/zepto.min.js`
To include optional modules and remove default ones, use the `concat` task. In
-this example, "touch" and "fx" are removed, but "data" and "selector" are added:
+this example, "fx" is removed, but "data" and "selector" are added:
~~~
-$ rake concat[-touch:-fx:data:selector] dist
+$ rake concat[-fx:data:selector] dist
~~~
## Zepto modules
-Zepto modules are individual files in the "src/" directory.
+Zepto modules are individual files in the "src/" directory. You can also list
+the available modules by running `rake modules`.
<table>
<thead><tr>
@@ -135,7 +136,7 @@ href="https://github.com/madrobby/zepto/blob/master/src/selector.js#files">selec
</tr>
<tr>
<th><a href="https://github.com/madrobby/zepto/blob/master/src/touch.js#files">touch</a></th>
- <td></td>
+ <td></td>
<td>Fires tap– and swipe–related events on touch devices</td>
</tr>
<tr>
View
@@ -1,6 +1,6 @@
ZEPTO_VERSION = '1.0rc1'
-DEFAULT_MODULES = %w[ polyfill zepto event detect fx ajax form touch ]
+DEFAULT_MODULES = %w[ polyfill zepto event detect fx ajax form ]
KILO = 1024 # how many bytes in a "kilobyte"
@@ -81,6 +81,15 @@ task :dist => ['dist/zepto.js', 'dist/zepto.min.js', 'dist/zepto.min.gz'] do |ta
rm_f 'dist/zepto.min.gz', :verbose => false
end
+desc "List available modules"
+task :modules do
+ Dir['src/**/*.js'].each do |file|
+ name = file.gsub(/^src\//,'').gsub(/.js$/,'')
+ puts name + (DEFAULT_MODULES.include?(name) ? '*' : '')
+ end
+ puts "\n*included in default build"
+end
+
task(:clean) { rm_rf 'dist' }
desc "Run tests with PhantomJS"

0 comments on commit f98cb5c

Please sign in to comment.