Skip to content

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
drnic committed Apr 26, 2008
0 parents commit a67ae9f
Show file tree
Hide file tree
Showing 26 changed files with 6,630 additions and 0 deletions.
4 changes: 4 additions & 0 deletions History.txt
@@ -0,0 +1,4 @@
== 0.0.1 2008-04-26

* 1 major enhancement:
* Initial release
20 changes: 20 additions & 0 deletions License.txt
@@ -0,0 +1,20 @@
Copyright (c) 2008 Dr Nic Williams

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 changes: 13 additions & 0 deletions README.txt
@@ -0,0 +1,13 @@
Github Badges

Description:
This JavaScript project ...

Example:
...

More information:
http://NOTE-ENTER-URL.com

Author:
Dr Nic Williams, drnicwilliams@gmail.com
121 changes: 121 additions & 0 deletions Rakefile
@@ -0,0 +1,121 @@
require 'rubygems'
begin
require 'rake'
rescue LoadError
puts 'This script should only be accessed via the "rake" command.'
puts 'Installation: gem install rake -y'
exit
end
require 'rake'
require 'rake/clean'
require 'rake/packagetask'

$:.unshift File.dirname(__FILE__) + "/lib"

APP_VERSION = '0.0.1'
APP_NAME = 'github_badges'
RUBYFORGE_PROJECT = APP_NAME
APP_FILE_NAME= "#{APP_NAME}.js"

APP_ROOT = File.expand_path(File.dirname(__FILE__))
APP_SRC_DIR = File.join(APP_ROOT, 'src')
APP_DIST_DIR = File.join(APP_ROOT, 'dist')
APP_PKG_DIR = File.join(APP_ROOT, 'pkg')


unless ENV['rakefile_just_config']

task :default => [:dist, :package, :clean_package_source]

desc "Builds the distribution"
task :dist do
$:.unshift File.join(APP_ROOT, 'lib')
require 'protodoc'
require 'fileutils'
FileUtils.mkdir_p APP_DIST_DIR

Dir.chdir(APP_SRC_DIR) do
File.open(File.join(APP_DIST_DIR, APP_FILE_NAME), 'w+') do |dist|
dist << Protodoc::Preprocessor.new(APP_FILE_NAME)
end
end
Dir.chdir(APP_DIST_DIR) do
FileUtils.copy_file APP_FILE_NAME, "#{APP_NAME}-#{APP_VERSION}.js"
end
if File.directory?("website")
FileUtils.mkdir_p "website/dist"
FileUtils.copy_file "dist/#{APP_FILE_NAME}", "website/dist/#{APP_FILE_NAME}"
FileUtils.copy_file "dist/#{APP_FILE_NAME}", "website/dist/#{APP_NAME}-#{APP_VERSION}.js"
end
end

Rake::PackageTask.new(APP_NAME, APP_VERSION) do |package|
package.need_tar_gz = true
package.package_dir = APP_PKG_DIR
package.package_files.include(
'[A-Z]*',
'config/*.sample',
"dist/#{APP_FILE_NAME}",
'lib/**',
'src/**',
'script/**',
'tasks/**',
'test/**',
'website/**'
)
end

desc "Builds the distribution, runs the JavaScript unit + functional tests and collects their results."
task :test => [:dist, :test_units, :test_functionals]

require 'jstest'
desc "Runs all the JavaScript unit tests and collects the results"
JavaScriptTestTask.new(:test_units, 4711) do |t|
testcases = ENV['TESTCASES']
tests_to_run = ENV['TESTS'] && ENV['TESTS'].split(',')
browsers_to_test = ENV['BROWSERS'] && ENV['BROWSERS'].split(',')

t.mount("/dist")
t.mount("/src")
t.mount("/test")

Dir["test/unit/*_test.html"].sort.each do |test_file|
tests = testcases ? { :url => "/#{test_file}", :testcases => testcases } : "/#{test_file}"
test_filename = test_file[/.*\/(.+?)\.html/, 1]
t.run(tests) unless tests_to_run && !tests_to_run.include?(test_filename)
end

%w( safari firefox ie konqueror opera ).each do |browser|
t.browser(browser.to_sym) unless browsers_to_test && !browsers_to_test.include?(browser)
end
end

desc "Runs all the JavaScript functional tests and collects the results"
JavaScriptTestTask.new(:test_functionals, 4712) do |t|
testcases = ENV['TESTCASES']
tests_to_run = ENV['TESTS'] && ENV['TESTS'].split(',')
browsers_to_test = ENV['BROWSERS'] && ENV['BROWSERS'].split(',')

t.mount("/dist")
t.mount("/src")
t.mount("/test")

Dir["test/functional/*_test.html"].sort.each do |test_file|
tests = testcases ? { :url => "/#{test_file}", :testcases => testcases } : "/#{test_file}"
test_filename = test_file[/.*\/(.+?)\.html/, 1]
t.run(tests) unless tests_to_run && !tests_to_run.include?(test_filename)
end

%w( safari firefox ie konqueror opera ).each do |browser|
t.browser(browser.to_sym) unless browsers_to_test && !browsers_to_test.include?(browser)
end
end


task :clean_package_source do
rm_rf File.join(APP_PKG_DIR, "#{APP_NAME}-#{APP_VERSION}")
end

Dir['tasks/**/*.rake'].each { |rake| load rake }

end
15 changes: 15 additions & 0 deletions config/javascript_test_autotest.yml
@@ -0,0 +1,15 @@
# This file has been copied here by the javascript_test_autotest plugin.
# Comment/uncomment the browsers you wish to autotest with.
# Same schema as per selenium-on-rails plugin, which is nice.
browsers:
# Windows
# firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe'
# ie: 'c:\Program Files\Internet Explorer\iexplore.exe'

# Mac OS X
# firefox: '/Applications/Firefox.app/Contents/MacOS/firefox-bin'
safari: '/Applications/Safari.app/Contents/MacOS/Safari'

# Unix
# ?
# ?

0 comments on commit a67ae9f

Please sign in to comment.