 
   addFile: (filePath) ->
     if filePath not in @getFilePaths()
-      id = @pathToId filePath
-      @code.push
+      @code.push asCodeOb.call
         type: "file"
         filePath: filePath
-        uid: id
-
-      @devMapping[id] = filePath
+
 
   addRaw: (raw) ->
-    @code.push
+    @code.push asCodeOb.call
       type: "raw"
       raw: raw
-      uid: @getUID()
 
   getFilePaths: ->
     (ob.filePath for ob in @code when ob.type is "file")
 
   addUrl: (url) ->
-    if @urls.indexOf(url) is -1
+    if url not in @urls
       @urls.push url
-
-
-
-
-  readDev: (uid, cb) ->
-    filePath = @devMapping[uid]
-    return cb new Error "No such dev file #{ uid }" unless filePath
-
-    fs.readFile filePath, (err, data) =>
-      return cb err if err
-      @getCompiler(filePath) data.toString(), (err, code) ->
-        cb err, code
-
-  getCompiler: (filePath) ->
-    compiler = @compilers[extension filePath]
-    if not compiler
-      throw new Error "Could not find compiler for #{ filePath }"
-    compiler.render
 
 
 



  addOb: (ob) ->
    @code.push
      type: "object"
      object: ob
      uid: @getUID()


  addExec: (fn) ->
    @code.push
      type: "exec"
      object: fn
      uid: @getUID()


  wrapInTag: (uri, extra="") ->

      tags += "\n"
    else
      for ob in @code
        tags += @wrapInTag "/pile/#{ @name }.dev-#{ ob.type }-#{ ob.getId() }.#{ @ext }", "id=\"pile-#{ ob.getId() }\""
        tags += "\n"

    tags


  findCodeObById: (id) ->
    (codeOb for codeOb in @code when codeOb.getId() is id)[0]

  findCodeObByFilePath: (path) ->
    (codeOb for codeOb in @code when codeOb.filePath is id)[0]


  getProductionUrl: ->
    "#{ @urlRoot }#{ @name }.min.#{ @ext }"
