class Jasmine::CommandLineTool

Public Instance Methods

copy_boot_js() click to toggle source
# File lib/jasmine/command_line_tool.rb, line 32
def copy_boot_js
  destination_path = File.join('spec', 'javascripts', 'support', 'boot.js')
  if File.exists?(destination_path)
    puts "#{destination_path} already exists"
  else
    require 'jasmine-core'
    source = File.join(Jasmine::Core.path, 'boot.js')
    FileUtils.mkdir_p(File.dirname(destination_path))
    FileUtils.cp(source, destination_path)

    puts 'Jasmine has copied an example boot.js to spec/javascripts/support'
    puts 'To use it set the boot_dir and boot_files keys in jasmine.yml'
    puts ' to point to your custom boot.js'
  end
end
examples() click to toggle source
# File lib/jasmine/command_line_tool.rb, line 26
def examples
  copy_file_structure('examples')

  puts "Jasmine has installed some examples."
end
init() click to toggle source
# File lib/jasmine/command_line_tool.rb, line 15
def init
  ensure_not_rails!

  copy_file_structure('install')

  update_rakefile

  install_path = File.join(jasmine_gem_path, "lib", "jasmine", "command_line_install.txt")
  puts File.read(install_path)
end
license() click to toggle source
# File lib/jasmine/command_line_tool.rb, line 48
def license
  puts File.read(File.join(jasmine_gem_path, "MIT.LICENSE"))
end
print_help() click to toggle source
process(argv) click to toggle source
# File lib/jasmine/command_line_tool.rb, line 5
def process(argv)
  @argv = argv

  if @argv.size > 0 && respond_to?(@argv[0])
    public_send(@argv[0])
  else
    print_help
  end
end