Permalink
Browse files

Separate unittest lib assets and user assets into two.

  • Loading branch information...
tobie committed Dec 13, 2008
1 parent a286887 commit fefb554e20a70b15517490dfe620486c420b6df2
@@ -10,12 +10,15 @@ def initialize(options = {})
def copy_assets
if @options.assets_dir.exists?
assets = Dir[@options.assets_dir.join('*')]
+ @options.output_assets_dir.mk_and_stamp!
FileUtils.cp_r(assets, @options.output_assets_dir)
end
end
def copy_unittest_assets
- unittest_assets_dir.copy_to(@options.output_assets_dir)
+ @options.output_unittest_assets_dir.mk_and_stamp!
+ assets = Dir[unittest_assets_dir.join('*')]
+ FileUtils.cp_r(assets, @options.output_unittest_assets_dir)
end
def unittest_assets_dir
@@ -1,11 +1,12 @@
module UnittestJS
module Builder
class BuilderOptions
- OUTPUT = 'tmp'
- ASSETS = 'assets'
- FIXTURES = 'fixtures'
- TEMPLATES = 'templates'
- TESTS = 'tests'
+ OUTPUT = 'tmp'
+ ASSETS = 'assets'
+ LIB_ASSETS = 'lib_assets'
+ FIXTURES = 'fixtures'
+ TEMPLATES = 'templates'
+ TESTS = 'tests'
def initialize(options = {})
@options = options
@@ -35,6 +36,10 @@ def output_assets_dir
@output_assets_dir ||= DirPathname.new(output_dir, @options[:output_assets_dir_name] || ASSETS)
end
+ def output_unittest_assets_dir
+ @output_unittest_assets_dir ||= DirPathname.new(output_dir, LIB_ASSETS)
+ end
+
def output_fixtures_dir
@output_fixtures_dir ||= DirPathname.new(output_dir, @options[:output_fixtures_dir_name] || FIXTURES)
end
@@ -35,7 +35,7 @@ def timestamp
end
def lib_files
- assets = @options.output_assets_dir.name
+ assets = @options.output_unittest_assets_dir.name
[
to_script_tag("#{assets}/prototype.js"),
to_script_tag("#{assets}/unittest.js"),

0 comments on commit fefb554

Please sign in to comment.