diff --git a/.gitignore b/.gitignore index 8474082c..5122c0ad 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,7 @@ site/ .bundle/ .pairs .rvmrc +*.gem +.bundle +Gemfile.lock +pkg/* diff --git a/Gemfile b/Gemfile index 12901f62..10fca11f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,3 @@ source :rubygems - -gem "json_pure", "~>1.4.3" -gem "frank" -gem "term-ansicolor" -gem "ragaskar-jsdoc_helper" -gem "rake", "0.8.7" +gem "term-ansicolor", :require => "term/ansicolor" +gemspec diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 8a21f3ad..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,35 +0,0 @@ -GEM - remote: http://rubygems.org/ - specs: - daemons (1.0.10) - frank (1.0.8) - haml (>= 3.0) - mongrel (>= 1.2.0.pre2) - net-scp (>= 1.0) - net-ssh (>= 2.0) - rack (>= 1.0) - tilt (= 0.9) - gem_plugin (0.2.3) - haml (3.1.2) - json_pure (1.4.6) - mongrel (1.2.0.pre2) - daemons (~> 1.0.10) - gem_plugin (~> 0.2.3) - net-scp (1.0.4) - net-ssh (>= 1.99.1) - net-ssh (2.1.4) - rack (1.3.0) - ragaskar-jsdoc_helper (0.0.2.1) - rake (0.8.7) - term-ansicolor (1.0.5) - tilt (0.9) - -PLATFORMS - ruby - -DEPENDENCIES - frank - json_pure (~> 1.4.3) - ragaskar-jsdoc_helper - rake (= 0.8.7) - term-ansicolor diff --git a/Rakefile b/Rakefile index e0e0d16e..19171eba 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,8 @@ -require 'json' -require 'tilt' -require 'term/ansicolor' +require "bundler" +Bundler::GemHelper.install_tasks +require "term/ansicolor" +require "json" +require "tilt" Dir["#{File.dirname(__FILE__)}/tasks/**/*.rb"].each do |file| require file @@ -25,88 +27,3 @@ class String end Term::ANSIColor.coloring = STDOUT.isatty - -#namespace :jasmine do -# -# desc 'Prepares for distribution' -# task :dist => ['jasmine:build', -# 'jasmine:doc', -# 'jasmine:build_pages', -# 'jasmine:build_example_project', -# 'jasmine:fill_index_downloads'] -# -# end -# -# downloads_file = 'pages/download.html' -# task :need_pages_submodule do -# unless File.exist?(downloads_file) -# raise "Jasmine pages submodule isn't present. Run git submodule update --init" -# end -# end -# -# desc "Build the Github pages HTML" -# task :build_pages => :need_pages_submodule do -# Dir.chdir("pages") do -# FileUtils.rm_r('pages_output') if File.exist?('pages_output') -# Dir.chdir('pages_source') do -# system("frank export ../pages_output") -# end -# puts "\nCopying Frank output to the root of the gh-pages branch\n\n" -# system("cp -r pages_output/* .") -# end -# end -# -# desc "Build jasmine documentation" -# task :doc => :need_pages_submodule do -# puts 'Creating Jasmine Documentation' -# require 'rubygems' -# require 'jsdoc_helper' -# -# FileUtils.rm_r "pages/jsdoc", :force => true -# -# JsdocHelper::Rake::Task.new(:lambda_jsdoc) do |t| -# t[:files] = jasmine_sources << jasmine_html_sources -# t[:options] = "-a" -# t[:out] = "pages/jsdoc" -# # JsdocHelper bug: template must be relative to the JsdocHelper gem, ick -# t[:template] = File.join("../".*(100), Dir::getwd, "jsdoc-template") -# end -# Rake::Task[:lambda_jsdoc].invoke -# end -# -# desc "Build example project" -# task :build_example_project => :need_pages_submodule do -# require 'tmpdir' -# -# temp_dir = File.join(Dir.tmpdir, 'jasmine-standalone-project') -# puts "Building Example Project in #{temp_dir}" -# FileUtils.rm_r temp_dir if File.exist?(temp_dir) -# Dir.mkdir(temp_dir) -# -# root = File.expand_path(File.dirname(__FILE__)) -# FileUtils.cp_r File.join(root, 'example/.'), File.join(temp_dir) -# substitute_jasmine_version(File.join(temp_dir, "SpecRunner.html")) -# -# lib_dir = File.join(temp_dir, "lib/jasmine-#{jasmine_version}") -# FileUtils.mkdir_p(lib_dir) -# { -# "lib/jasmine.js" => "jasmine.js", -# "lib/jasmine-html.js" => "jasmine-html.js", -# "src/html/jasmine.css" => "jasmine.css", -# "MIT.LICENSE" => "MIT.LICENSE" -# }.each_pair do |src, dest| -# FileUtils.cp(File.join(root, src), File.join(lib_dir, dest)) -# end -# -# dist_dir = File.join(root, 'pages/downloads') -# zip_file_name = File.join(dist_dir, "jasmine-standalone-#{jasmine_version}.zip") -# puts "Zipping Example Project and moving to #{zip_file_name}" -# FileUtils.mkdir(dist_dir) unless File.exist?(dist_dir) -# if File.exist?(zip_file_name) -# puts "WARNING!!! #{zip_file_name} already exists!" -# FileUtils.rm(zip_file_name) -# end -# exec "cd #{temp_dir} && zip -r #{zip_file_name} . -x .[a-zA-Z0-9]*" -# end -# -#end diff --git a/cruise_config.rb b/cruise_config.rb deleted file mode 100644 index 20d2a5cb..00000000 --- a/cruise_config.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Project-specific configuration for CruiseControl.rb -Project.configure do |project| - - # Send email notifications about broken and fixed builds to email1@your.site, email2@your.site (default: send to nobody) - # project.email_notifier.emails = ['email1@your.site', 'email2@your.site'] - - # Set email 'from' field to john@doe.com: - # project.email_notifier.from = 'john@doe.com' - - # Build the project by invoking rake task 'custom' - project.rake_task = 'jasmine:test:ci:saucelabs' - - # Build the project by invoking shell script "build_my_app.sh". Keep in mind that when the script is invoked, - # current working directory is [cruise data]/projects/your_project/work, so if you do not keep build_my_app.sh - # in version control, it should be '../build_my_app.sh' instead - #project.build_command = 'cp ../saucelabs.yml .' - - # Ping Subversion for new revisions every 5 minutes (default: 30 seconds) - # project.scheduler.polling_interval = 5.minutes - -end diff --git a/jasmine-core.gemspec b/jasmine-core.gemspec new file mode 100644 index 00000000..8e989713 --- /dev/null +++ b/jasmine-core.gemspec @@ -0,0 +1,23 @@ +# -*- encoding: utf-8 -*- +$:.push File.expand_path("../lib", __FILE__) +require "jasmine-core/version" + +Gem::Specification.new do |s| + s.name = "jasmine-core" + s.version = Jasmine::Core::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["Rajan Agaskar", "Davis Frank", "Christian Williams"] + s.summary = %q{JavaScript BDD framework} + s.description = %q{Test your JavaScript without any framework dependencies, in any environment, and with a nice descriptive syntax.} + s.email = %q{jasmine-js@googlegroups.com} + s.homepage = "http://pivotal.github.com/jasmine" + s.rubyforge_project = "jasmine-core" + + s.files = Dir.glob("./lib/**/*") + s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") + s.require_paths = ["lib"] + s.add_development_dependency "term-ansicolor" + s.add_development_dependency "json_pure", ">= 1.4.3" + s.add_development_dependency "frank" + s.add_development_dependency "ragaskar-jsdoc_helper" +end diff --git a/lib/jasmine-core.rb b/lib/jasmine-core.rb new file mode 100644 index 00000000..dc1c9788 --- /dev/null +++ b/lib/jasmine-core.rb @@ -0,0 +1,17 @@ +module Jasmine + module Core + class << self + def path + File.join(File.dirname(__FILE__), "jasmine-core") + end + + def js_files + (["jasmine.js"] + Dir.glob(File.join(path, "*.js"))).map { |f| File.basename(f) }.uniq + end + + def css_files + Dir.glob(File.join(path, "*.css")).map { |f| File.basename(f) } + end + end + end +end diff --git a/example/SpecRunner.html b/lib/jasmine-core/example/SpecRunner.html similarity index 100% rename from example/SpecRunner.html rename to lib/jasmine-core/example/SpecRunner.html diff --git a/example/spec/PlayerSpec.js b/lib/jasmine-core/example/spec/PlayerSpec.js similarity index 100% rename from example/spec/PlayerSpec.js rename to lib/jasmine-core/example/spec/PlayerSpec.js diff --git a/example/spec/SpecHelper.js b/lib/jasmine-core/example/spec/SpecHelper.js similarity index 100% rename from example/spec/SpecHelper.js rename to lib/jasmine-core/example/spec/SpecHelper.js diff --git a/example/src/Player.js b/lib/jasmine-core/example/src/Player.js similarity index 100% rename from example/src/Player.js rename to lib/jasmine-core/example/src/Player.js diff --git a/example/src/Song.js b/lib/jasmine-core/example/src/Song.js similarity index 100% rename from example/src/Song.js rename to lib/jasmine-core/example/src/Song.js diff --git a/lib/jasmine-html.js b/lib/jasmine-core/jasmine-html.js similarity index 100% rename from lib/jasmine-html.js rename to lib/jasmine-core/jasmine-html.js diff --git a/lib/jasmine.css b/lib/jasmine-core/jasmine.css similarity index 100% rename from lib/jasmine.css rename to lib/jasmine-core/jasmine.css diff --git a/lib/jasmine.js b/lib/jasmine-core/jasmine.js similarity index 99% rename from lib/jasmine.js rename to lib/jasmine-core/jasmine.js index 254c31c4..e0dd0314 100644 --- a/lib/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -735,16 +735,17 @@ jasmine.Env.prototype.version = function () { * @returns string containing jasmine version build info, if set. */ jasmine.Env.prototype.versionString = function() { - if (!jasmine.version_) { + if (jasmine.version_) { + var version = this.version(); + var versionString = version.major + "." + version.minor + "." + version.build; + if (version.release_candidate) { + versionString += ".rc" + version.release_candidate + } + versionString += " revision " + version.revision + return versionString; + } else { return "version unknown"; } - - var version = this.version(); - var dotted_version = version.major + "." + version.minor + "." + version.build; - if (version.rc) { - dotted_version += ".rc" + version.rc; - } - return dotted_version + " revision " + version.revision; }; /** @@ -2471,6 +2472,5 @@ jasmine.version_= { "major": 1, "minor": 1, "build": 0, - "revision": 1308288921, - "rc": 1 + "revision": 1308358300 }; diff --git a/lib/json2.js b/lib/jasmine-core/json2.js similarity index 100% rename from lib/json2.js rename to lib/jasmine-core/json2.js diff --git a/lib/jasmine-core/version.rb b/lib/jasmine-core/version.rb new file mode 100644 index 00000000..828a38e8 --- /dev/null +++ b/lib/jasmine-core/version.rb @@ -0,0 +1,8 @@ +module Jasmine + module Core + require 'json' + VERSION_HASH = JSON.parse(File.new(File.join(File.dirname(__FILE__), "..", "..", "src", "version.json")).read); + VERSION = "#{VERSION_HASH['major']}.#{VERSION_HASH['minor']}.#{VERSION_HASH['build']}" + VERSION << ".rc#{VERSION_HASH['release_candidate']}" if VERSION_HASH['release_candidate'] + end +end diff --git a/spec/core/EnvSpec.js b/spec/core/EnvSpec.js index be7a9fd8..3bd67031 100644 --- a/spec/core/EnvSpec.js +++ b/spec/core/EnvSpec.js @@ -64,9 +64,10 @@ describe("jasmine.Env", function() { "major": 1, "minor": 9, "build": 7, + "release_candidate": "1", "revision": 8 }; - expect(env.versionString()).toEqual("1.9.7 revision 8"); + expect(env.versionString()).toEqual("1.9.7.rc1 revision 8"); }); it("should return a nice string when version is unknown", function() { diff --git a/spec/node_suite.js b/spec/node_suite.js index ded472b8..da7a5b09 100644 --- a/spec/node_suite.js +++ b/spec/node_suite.js @@ -6,7 +6,7 @@ var path = require('path'); // undefined = "diz be undefined yo"; -var jasmineGlobals = require('../lib/jasmine.js'); +var jasmineGlobals = require('../lib/jasmine-core/jasmine.js'); for (var k in jasmineGlobals) { global[k] = jasmineGlobals[k]; } @@ -124,4 +124,4 @@ jasmine.executeSpecs(domIndependentSpecs, function(runner, log) { } else { process.exit(1); } -}, isVerbose, showColors); \ No newline at end of file +}, isVerbose, showColors); diff --git a/spec/runner.html b/spec/runner.html index 391d0b5b..3d5dfe34 100644 --- a/spec/runner.html +++ b/spec/runner.html @@ -6,8 +6,8 @@ - - + + - + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + +