Skip to content

Commit b820a4a

Browse files
author
Michael Bleigh
committed
Add uglifying to automatically build minified, as well as Gemfile.
1 parent 452b5cd commit b820a4a

File tree

7 files changed

+108
-3
lines changed

7 files changed

+108
-3
lines changed

Gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
source 'http://rubygems.org'
2+
3+
gem 'guard'
4+
gem 'guard-coffeescript'
5+
gem 'guard-process'
6+
gem 'guard-uglify'
7+
8+
gem 'rb-fsevent'
9+
gem 'growl'

Gemfile.lock

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
GEM
2+
remote: http://rubygems.org/
3+
specs:
4+
coffee-script (2.2.0)
5+
coffee-script-source
6+
execjs
7+
coffee-script-source (1.1.2)
8+
execjs (1.2.4)
9+
multi_json (~> 1.0)
10+
growl (1.0.3)
11+
guard (0.6.2)
12+
thor (~> 0.14.6)
13+
guard-coffeescript (0.3.3)
14+
coffee-script (>= 2.2.0)
15+
guard (>= 0.4)
16+
guard-process (1.0.1)
17+
guard (>= 0.4.2)
18+
guard-uglify (0.1.0)
19+
guard (>= 0.2.2)
20+
uglifier
21+
multi_json (1.0.3)
22+
rb-fsevent (0.4.1)
23+
thor (0.14.6)
24+
uglifier (1.0.1)
25+
execjs (>= 0.3.0)
26+
multi_json (>= 1.0.2)
27+
28+
PLATFORMS
29+
ruby
30+
31+
DEPENDENCIES
32+
growl
33+
guard
34+
guard-coffeescript
35+
guard-process
36+
guard-uglify
37+
rb-fsevent

Guardfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,10 @@ guard 'process', :name => 'Docco', :command => 'docco src/sketch.coffee' do
99
watch %r{src/.+\.coffee}
1010
end
1111

12+
guard 'process', :name => 'Copy to min', :command => 'cp lib/sketch.js lib/sketch.min.js' do
13+
watch %r{lib/sketch.js}
14+
end
15+
16+
guard 'uglify', :destination_file => "lib/sketch.min.js" do
17+
watch (%r{lib/sketch.min.js})
18+
end

docs/sketch.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
<!DOCTYPE html> <html> <head> <title>sketch.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sketch.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p><strong>Sketch.js</strong> is a simple jQuery plugin for creating drawable canvases
1+
<!DOCTYPE html> <html> <head> <title>sketch.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sketch.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <h1>Sketch.js (v0.0.1)</h1>
2+
3+
<p><strong>Sketch.js</strong> is a simple jQuery plugin for creating drawable canvases
24
using HTML5 Canvas. It supports multiple browsers including mobile
3-
devices (albeit slowly).</p> </td> <td class="code"> <div class="highlight"><pre><span class="p">(</span><span class="nf">($)-&gt;</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h3>jQuery('#mycanvas').sketch(options)</h3>
5+
devices (albeit with performance penalties).</p> </td> <td class="code"> <div class="highlight"><pre><span class="p">(</span><span class="nf">($)-&gt;</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h3>jQuery('#mycanvas').sketch(options)</h3>
46

57
<p>Given an ID selector for a <code>&lt;canvas&gt;</code> element, initialize the specified
68
canvas as a drawing canvas. See below for the options that may be passed in.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">$.fn.sketch = </span><span class="nf">(key, args...)-&gt;</span>

lib/sketch.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

npm-debug.log

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
info it worked if it ends with ok
2+
verbose cli [ 'node',
3+
verbose cli '/usr/local/bin/npm',
4+
verbose cli 'install',
5+
verbose cli 'uglify',
6+
verbose cli '-g' ]
7+
8+
9+
verbose /usr/local/bin/node node symlink
10+
verbose config file /Users/mbleigh/.npmrc
11+
verbose config file /usr/local/etc/npmrc
12+
verbose into /usr/local/lib [ 'uglify' ]
13+
verbose cache add uglify
14+
verbose cache add [ 'uglify', null ]
15+
silly cache add: name, spec, args [ undefined, 'uglify', [ 'uglify', null ] ]
16+
verbose parsed url { pathname: 'uglify', href: 'uglify' }
17+
info addNamed [ 'uglify', '' ]
18+
verbose addNamed [ null, '' ]
19+
verbose GET uglify
20+
verbose raw, before any munging uglify
21+
verbose url resolving [ 'https://registry.npmjs.org/', './uglify' ]
22+
verbose url resolved https://registry.npmjs.org/uglify
23+
verbose url parsed { protocol: 'https:',
24+
verbose url parsed slashes: true,
25+
verbose url parsed host: 'registry.npmjs.org',
26+
verbose url parsed hostname: 'registry.npmjs.org',
27+
verbose url parsed href: 'https://registry.npmjs.org/uglify',
28+
verbose url parsed pathname: '/uglify' }
29+
verbose response https://registry.npmjs.org/uglify
30+
silly chunk {"error":"not_found","reason":"document not found"}
31+
silly chunk
32+
silly get cb [ 404,
33+
silly get cb { server: 'CouchDB/1.1.0 (Erlang OTP/R14B03)',
34+
silly get cb date: 'Mon, 22 Aug 2011 14:39:18 GMT',
35+
silly get cb 'content-type': 'application/json',
36+
silly get cb 'content-length': '52',
37+
silly get cb 'cache-control': 'must-revalidate' } ]
38+
ERR! 404 'uglify' is not in the npm registry.
39+
ERR! 404 You should bug the author to publish it.
40+
ERR! 404 Note that you can also install from a tarball or folder.
41+
ERR!
42+
ERR! System Darwin 11.0.0
43+
ERR! command "node" "/usr/local/bin/npm" "install" "uglify" "-g"
44+
ERR! cwd /Users/mbleigh/code/javascript/sketch.js
45+
ERR! node -v v0.4.10
46+
ERR! npm -v 1.0.26
47+
verbose exit [ 1, true ]

src/sketch.coffee

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# # Sketch.js (v0.0.1)
2+
#
13
# **Sketch.js** is a simple jQuery plugin for creating drawable canvases
24
# using HTML5 Canvas. It supports multiple browsers including mobile
3-
# devices (albeit slowly).
5+
# devices (albeit with performance penalties).
46
(($)->
57
# ### jQuery('#mycanvas').sketch(options)
68
#

0 commit comments

Comments
 (0)