readme and gemspec and bin

This commit is contained in:
John Bintz 2011-04-11 07:00:05 -04:00
parent b4c4a74e81
commit 7317a0ab78
3 changed files with 28 additions and 8 deletions

View File

@ -1,5 +1,25 @@
## Introduction
This gem works with projects that have use the [Jasmine gem](https://github.com/pivotal/jasmine-gem) to
create a `jasmine.yml` file that defines what to test in their Jasmine project. The runner loads that
`jasmine.yml` file and executes the
tests in a Qt WebKit widget, displaying the results to the console and setting the exit code to 0 for
success or 1 for failure.
`console.log` works, too, so you can run your specs side-by-side in a browser if you're so inclined.
## Usage
`jasmine-headless-webkit` [path to jasmine.yml, defaults to spec/javascripts/support/jasmine.yml]
*This gem is currently as rough as it gets.*
Installation requires Qt 4.7. See [senchalabs/examples](https://github.com/senchalabs/examples) and [my fork
of examples](https://github.com/johnbintz/examples) for more information on the QtWebKit runner.
Copyright (c) 2010 Sencha Inc.
Copyright (c) 2011 John Bintz
Jasmine JavaScript library Copyright (c) 2008-2011 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -3,13 +3,13 @@
require 'yaml'
require 'fileutils'
data = YAML.load_file('spec/javascripts/support/jasmine.yml')
data = YAML.load_file(ARGV[0] || 'spec/javascripts/support/jasmine.yml')
gem_dir = File.expand_path('../..', __FILE__)
files = [
File.join(gem_dir, 'lib/jasmine/lib/jasmine.js'),
File.join(gem_dir, 'lib/jasmine/lib/jasmine-html.js'),
File.join(gem_dir, 'lib/jasmine/lib/jasmine.css')
'file://' + File.join(gem_dir, 'jasmine/lib/jasmine.js'),
'file://' + File.join(gem_dir, 'jasmine/lib/jasmine-html.js'),
'file://' + File.join(gem_dir, 'jasmine/lib/jasmine.css')
]
files += [ [ 'src_files', 'src_dir' ], [ 'stylesheets', 'src_dir' ], [ 'helpers', 'spec_dir' ], [ 'spec_files', 'spec_dir' ] ].collect do |searches, root|
@ -52,7 +52,7 @@ window.console = { log: function(data) { debug.log(JSON.stringify(data)); } };
HTML
File.open(target = "specrunner.#{$$}.html", 'w') { |fh| fh.print output }
system %{#{File.join(gem_dir, 'ext/jasmine-webkit-specrunner/jasmine-webkit-specrunner'} #{target}}
system %{#{File.join(gem_dir, 'ext/jasmine-webkit-specrunner/jasmine-webkit-specrunner')} #{target}}
status = ($? == 0) ? 0 : 1
FileUtils.rm_f target

View File

@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.name = "jasmine-headless-webkit"
s.version = Jasmine::Headless::Webkit::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["John Bintz", "Sencha Inc."]
s.authors = ["John Bintz", "Sencha Inc.", "Pivotal Labs"]
s.email = ["john@coswellproductions.com"]
s.homepage = ""
s.summary = %q{Run Jasmine specs headlessly in a WebKit browser}
@ -15,10 +15,10 @@ Gem::Specification.new do |s|
s.rubyforge_project = "jasmine-headless-webkit"
s.extensions = `git ls-files -- ext/**/extconf.rb`.split("\n")
s.files = `git ls-files`.split("\n")
s.files = `git ls-files`.split("\n") + Dir['jasmine/lib/*']
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
s.add_dependency 'jasmine-gem'
s.add_dependency 'jasmine'
end