lib/jasnode/core.rb in jasnode-0.2.0.0 vs lib/jasnode/core.rb in jasnode-0.4.0.0

- old
+ new

@@ -1,7 +1,8 @@ # Copyright (c) 2010 Cory Ondrejka. All rights reserved. # See MIT.LICENSE for licensing details. +require 'fileutils.rb' module Jasnode class Spec def self.find_specs(root_dir) dir = File.join(root_dir, "**", "*_spec.js") @@ -154,27 +155,25 @@ } eos end def self.spec(verbose, logfile) - File.open(File.join("lib", "jasnode.js"), "w") {|f| f.write(Jasnode::Spec.build_jasmine_test_file(Jasnode::Spec.find_jasmine, Jasnode::Spec.find_specs(Dir.pwd), true)) } + File.open(File.expand_path(File.join("lib", "jasnode.js")), "w") {|f| f.write(Jasnode::Spec.build_jasmine_test_file(Jasnode::Spec.find_jasmine, Jasnode::Spec.find_specs(Dir.pwd), true)) } Dir.chdir("spec") output = "" if logfile output = %x[node runner.js > #{logfile}] else - putput = puts %x[node runner.js] + output = %x[node runner.js] end Dir.chdir("..") output end end class Init def self.template(projectname) - require "ftools" - template_base = File.join(File.dirname(__FILE__), '..', '..', 'templates') - File.makedirs("#{projectname}") + template_base = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'templates')) FileUtils.cp_r("#{template_base}/.", "#{projectname}") end end end \ No newline at end of file