Permalink
Browse files

Gem-ize jasmine

[Finishes #13128217]
  • Loading branch information...
1 parent e4e9b51 commit 30431a3958df3a9ecad99aec152e155349d9121c @ragaskar ragaskar committed Jun 18, 2011
View
@@ -5,3 +5,7 @@ site/
.bundle/
.pairs
.rvmrc
+*.gem
+.bundle
+Gemfile.lock
+pkg/*
View
@@ -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
View
@@ -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
View
@@ -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
View
@@ -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 <em>[cruise&nbsp;data]</em>/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
View
@@ -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
View
@@ -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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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
};
File renamed without changes.
@@ -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
@@ -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() {
View
@@ -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);
+}, isVerbose, showColors);
View
@@ -6,42 +6,42 @@
<link rel="shortcut icon" type="image/png" href="../images/jasmine_favicon.png">
- <link href="../lib/jasmine.css" rel="stylesheet"/>
- <script type="text/javascript" src="../lib/jasmine.js"></script>
+ <link href="../lib/jasmine-core/jasmine.css" rel="stylesheet"/>
+ <script type="text/javascript" src="../lib/jasmine-core/jasmine.js"></script>
<script type="text/javascript">
// yes, really keep this here to keep us honest, but only for jasmine's own runner! [xw]
undefined = "diz be undefined yo";
</script>
<!-- include source files here... -->
- <script type="text/javascript" src="../src/html/TrivialReporter.js"></script>
- <script type="text/javascript" src="../src/console/ConsoleReporter.js"></script>
+ <script type="text/javascript" src=".././src/html/TrivialReporter.js"></script>
+ <script type="text/javascript" src=".././src/console/ConsoleReporter.js"></script>
<!-- include spec files here... -->
- <script type="text/javascript" src="../spec/core/BaseSpec.js"></script>
- <script type="text/javascript" src="../spec/core/CustomMatchersSpec.js"></script>
- <script type="text/javascript" src="../spec/core/EnvSpec.js"></script>
- <script type="text/javascript" src="../spec/core/ExceptionsSpec.js"></script>
- <script type="text/javascript" src="../spec/core/JsApiReporterSpec.js"></script>
- <script type="text/javascript" src="../spec/core/MatchersSpec.js"></script>
- <script type="text/javascript" src="../spec/core/MockClockSpec.js"></script>
- <script type="text/javascript" src="../spec/core/MultiReporterSpec.js"></script>
- <script type="text/javascript" src="../spec/core/NestedResultsSpec.js"></script>
- <script type="text/javascript" src="../spec/core/PrettyPrintSpec.js"></script>
- <script type="text/javascript" src="../spec/core/QueueSpec.js"></script>
- <script type="text/javascript" src="../spec/core/ReporterSpec.js"></script>
- <script type="text/javascript" src="../spec/core/RunnerSpec.js"></script>
- <script type="text/javascript" src="../spec/core/SpecRunningSpec.js"></script>
- <script type="text/javascript" src="../spec/core/SpecSpec.js"></script>
- <script type="text/javascript" src="../spec/core/SpySpec.js"></script>
- <script type="text/javascript" src="../spec/core/SuiteSpec.js"></script>
- <script type="text/javascript" src="../spec/core/UtilSpec.js"></script>
- <script type="text/javascript" src="../spec/core/WaitsForBlockSpec.js"></script>
- <script type="text/javascript" src="../spec/html/MatchersHtmlSpec.js"></script>
- <script type="text/javascript" src="../spec/html/PrettyPrintHtmlSpec.js"></script>
- <script type="text/javascript" src="../spec/html/TrivialReporterSpec.js"></script>
- <script type="text/javascript" src="../spec/console/ConsoleReporterSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/BaseSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/CustomMatchersSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/EnvSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/ExceptionsSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/JsApiReporterSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/MatchersSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/MockClockSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/MultiReporterSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/NestedResultsSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/PrettyPrintSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/QueueSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/ReporterSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/RunnerSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/SpecRunningSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/SpecSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/SpySpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/SuiteSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/UtilSpec.js"></script>
+ <script type="text/javascript" src=".././spec/core/WaitsForBlockSpec.js"></script>
+ <script type="text/javascript" src=".././spec/html/MatchersHtmlSpec.js"></script>
+ <script type="text/javascript" src=".././spec/html/PrettyPrintHtmlSpec.js"></script>
+ <script type="text/javascript" src=".././spec/html/TrivialReporterSpec.js"></script>
+ <script type="text/javascript" src=".././spec/console/ConsoleReporterSpec.js"></script>
<script type="text/javascript">
(function() {
View
@@ -51,16 +51,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;
};
/**
View
@@ -2,6 +2,5 @@ jasmine.version_= {
"major": 1,
"minor": 1,
"build": 0,
- "revision": 1308288921,
- "rc": 1
+ "revision": 1308358300
};
Oops, something went wrong.

0 comments on commit 30431a3

Please sign in to comment.