Sha256: d43e343ca73a7416e827cf1c48d10397d85da64acb56e9303f0356413f5ba513
Contents?: true
Size: 1.57 KB
Versions: 1
Compression:
Stored size: 1.57 KB
Contents
#!/usr/bin/env ruby require 'rubygems' require 'rake' def cwd File.expand_path(File.join(File.dirname(__FILE__), '..')) end def expand(*paths) File.expand_path(File.join(*paths)) end def template_path(filepath) expand(cwd, File.join("generators/jasmine/templates", filepath)) end def dest_path(filepath) expand(Dir.pwd, filepath) end def copy_unless_exists(relative_path, dest_path = nil) unless File.exist?(dest_path(relative_path)) File.copy(template_path(relative_path), dest_path(dest_path || relative_path)) end end if ARGV[0] == 'init' require 'ftools' File.makedirs('spec/javascripts') File.makedirs('spec/javascripts/support') copy_unless_exists('spec/javascripts/SpecHelper.js') copy_unless_exists('spec/javascripts/ExampleSpec.js') copy_unless_exists('spec/javascripts/support/jasmine_config.rb') copy_unless_exists('spec/javascripts/support/jasmine_spec.rb') rails_tasks_dir = dest_path('lib/tasks') if File.exist?(rails_tasks_dir) copy_unless_exists('lib/tasks/jasmine.rake') copy_unless_exists('spec/javascripts/support/sources-rails.yaml', 'spec/javascripts/support/sources.yaml') else copy_unless_exists('spec/javascripts/support/sources.yaml') if File.exist?(dest_path('Rakefile')) load dest_path('Rakefile') end write_mode = Rake::Task.task_defined?('jasmine') ? 'a' : 'w' File.open(dest_path('Rakefile'), write_mode) do |f| f.write(File.read(template_path('lib/tasks/jasmine.rake'))) end end File.open(template_path('INSTALL'), 'r').each_line do |line| puts line end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jasmine-0.4.0 | bin/jasmine |