Skip to content

Commit

Permalink
Adapt to Paw JS API version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mittsh committed Sep 10, 2015
1 parent 45b71b8 commit f53289f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
8 changes: 7 additions & 1 deletion Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ build_copy = () ->
fs.writeFileSync "#{ build_dir }/LICENSE", fs.readFileSync("./LICENSE")
fs.writeFileSync "#{ build_dir }/go.mustache", fs.readFileSync("./go.mustache")
fs.writeFileSync "#{ build_dir }/mustache.js", fs.readFileSync("./node_modules/mustache/mustache.js")
fs.writeFileSync "#{ build_dir }/URI.js", fs.readFileSync("./node_modules/URIjs/src/URI.min.js")
fs.writeFileSync "#{ build_dir }/URI.js", fs.readFileSync("./node_modules/URIjs/src/URI.js")
fs.writeFileSync "#{ build_dir }/punycode.js", fs.readFileSync("./node_modules/URIjs/src/punycode.js")
fs.writeFileSync "#{ build_dir }/IPv6.js", fs.readFileSync("./node_modules/URIjs/src/IPv6.js")
fs.writeFileSync "#{ build_dir }/SecondLevelDomains.js", fs.readFileSync("./node_modules/URIjs/src/SecondLevelDomains.js")
# legacy
fs.writeFileSync "#{ build_dir }/URI.min.js", fs.readFileSync("./node_modules/URIjs/src/URI.min.js")

# build: build CoffeeScript
# build: build CoffeeScript and copy files to build directory
build = (callback) ->
# mkdir build dir
Expand Down
11 changes: 9 additions & 2 deletions GoHTTPCodeGenerator.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
require "mustache.js"
require "URI.js"
# in API v0.2.0 and below (Paw 2.2.2 and below), require had no return value
((root) ->
if root.bundle?.minApiVersion('0.2.0')
root.URI = require("./URI")
root.Mustache = require("./mustache")
else
require("URI.min.js")
require("mustache.js")
)(this)

addslashes = (str) ->
("#{str}").replace(/[\\"]/g, '\\$&')
Expand Down

0 comments on commit f53289f

Please sign in to comment.