Skip to content

Commit

Permalink
Upgrade to grunt 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nicinabox committed Mar 3, 2013
1 parent d8f0559 commit 2bfa8b7
Show file tree
Hide file tree
Showing 15 changed files with 5,324 additions and 4,442 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/node_modules/
.DS_Store
.jhw-cache/
public
.sass-cache/
public
node_modules/
15 changes: 15 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"unused": true,
"boss": true,
"eqnull": true,
"node": true,
"es5": true
}
12 changes: 4 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
# Contributing

## Important notes
Please don't edit files in the `dist` subdirectory as they are generated via grunt. You'll find source code in the `src` subdirectory!
Please don't edit files in the `dist` subdirectory as they are generated via Grunt. You'll find source code in the `src` subdirectory!

### Code style
Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.**

### PhantomJS
While grunt can run the included unit tests via [PhantomJS](http://phantomjs.org/), this shouldn't be considered a substitute for the real thing. Please be sure to test the `test/*.html` unit test file(s) in _actual_ browsers.

See the [Why does grunt complain that PhantomJS isn't installed?](https://github.com/gruntjs/grunt/blob/master/docs/faq.md#why-does-grunt-complain-that-phantomjs-isnt-installed) guide in the [Grunt FAQ](https://github.com/gruntjs/grunt/blob/master/docs/faq.md) for help with installing or troubleshooting PhantomJS.
While Grunt can run the included unit tests via [PhantomJS](http://phantomjs.org/), this shouldn't be considered a substitute for the real thing. Please be sure to test the `test/*.html` unit test file(s) in _actual_ browsers.

## Modifying the code
First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed.

Test that grunt is installed globally by running `grunt --version` at the command-line. If grunt isn't installed globally, run `npm install -g grunt` to install the latest version. _You may need to run `sudo npm install -g grunt`._

_Note that in Windows, you may have to run `grunt.cmd` instead of `grunt`._
Test that Grunt's CLI is installed by running `grunt --version`. If the command isn't found, run `npm install -g grunt-cli`. For more information about installing Grunt, see the [getting started guide](http://gruntjs.com/getting-started).

1. Fork and clone the repo.
1. Run `npm install` to install all dependencies (including grunt).
1. Run `npm install` to install all dependencies (including Grunt).
1. Run `grunt` to grunt this project.

Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken.
Expand Down
7 changes: 1 addition & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@ source "https://rubygems.org"

group :development do
gem 'compass'
end

group :test do
gem 'jasmine'
gem 'jasmine-headless-webkit'
end
end
87 changes: 87 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
'use strict';

module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('superslides.jquery.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
// Task configuration.
clean: {
files: ['dist']
},
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
dist: {
src: ['src/<%= pkg.name %>.js'],
dest: 'dist/jquery.<%= pkg.name %>.js'
},
},
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
src: '<%= concat.dist.dest %>',
dest: 'dist/jquery.<%= pkg.name %>.min.js'
},
},
qunit: {
files: ['test/**/*.html']
},
jshint: {
gruntfile: {
options: {
jshintrc: '.jshintrc'
},
src: 'Gruntfile.js'
},
src: {
options: {
jshintrc: 'src/.jshintrc'
},
src: ['src/**/*.js']
},
test: {
options: {
jshintrc: 'test/.jshintrc'
},
src: ['test/**/*.js']
},
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
src: {
files: '<%= jshint.src.src %>',
tasks: ['jshint:src', 'qunit']
},
test: {
files: '<%= jshint.test.src %>',
tasks: ['jshint:test', 'qunit']
},
},
});

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');

// Default task.
grunt.registerTask('default', ['jshint', 'qunit', 'clean', 'concat', 'uglify']);

};
2 changes: 1 addition & 1 deletion LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012 Nic Haynes
Copyright (c) 2013 Nic Aitch

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
76 changes: 0 additions & 76 deletions grunt.js

This file was deleted.

8 changes: 3 additions & 5 deletions libs/jquery-loader.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
(function() {
// Default to the local version.
var path = '../libs/jquery/jquery.js';
// Get any jquery=___ param from the query string.
var jqversion = location.search.match(/[?&]jquery=(.*?)(?=&|$)/);
var path;
// If a version was specified, use that version from code.jquery.com.
if (jqversion) {
// A version was specified, load that version from code.jquery.com.
path = 'http://code.jquery.com/jquery-' + jqversion[1] + '.js';
} else {
// No version was specified, load the local version.
path = '../libs/jquery/jquery.js';
}
// This is the only time I'll ever use document.write, I promise!
document.write('<script src="' + path + '"></script>');
Expand Down
Loading

0 comments on commit 2bfa8b7

Please sign in to comment.