Quick and flexible web project generator for standalone sites or use with QEDServer. gem install qedproject
=QEDProject
==Modern web project generator
QEDProject creates a simple web project skeleton with support for Sass and CoffeeScript
as well as asset packaging, LiveReload support, and JavaScript testing. It’s a tool I wrote to make things easier for me, and
if you like it, I’d love to hear how you’re using it. It makes use of Guard and many other Ruby tools and lets you create projects with:
It also goes great with http://qedserver.napcs.com/
== Installation
QEDProject is distributed as a Ruby gem. That means you’ll need the Ruby programming language installed on your machine along with the RubyGems package manager.
Then, simply
gem install bundler
gem install qedproject
to get the latest version and all its dependencies.
If you’re on Windows, you’ll need to install RubyInstaller and the Devkit. See http://rubyinstaller.org/add-ons/devkit/ for more.
If you’re on OSX, you need to have XCode installed with the Command Line tools
If you’re on Ubuntu and you want to use CoffeeScript, you’ll need to install NodeJS.
== Usage
Generate a simple web project
qedproject myproject
cd myproject
Then open the public/index.html
file in your browser and get to work. Of course, this is only the tip of the iceberg.
=== CoffeeScript and Sass support
To generate a simple web project with CoffeeScript and Sass support, using Guard to monitor files for changes.
qedproject myproject -c -s
Once the project is created, go into the project folder and run the Guard command.
cd myproject
bundle exec guard
As you work on the Sass and CoffeeScript files, the corresponding CSS and JS files will be placed in public/javascripts and public/stylesheets respectively.
=== Asset Packaging with Jammit
Generate a project that minifies CSS and JS files using Jammit.
Creates the asset configuration file and a Guardfile.
qedproject myproject -a
Create a project with CoffeeScript, Sass, and asset packaging support,
using Guard.
qedproject myproject -c -s -a
=== Including JavaScript libraries.
QEDProject has several popular libraries included.
as well as the simple Responsive Design framework Skeleton
Create a new project using jQuery
qedproject myproject -l jquery
Create a new project using jQuery and Backbone
qedproject myproject -l jquery,backbone
Create a new project using jQuery and Backbone,
but also with Sass, CoffeeScript, and asset packaging.
qedproject myproject -l jquery,backbone -c -s -a
Create a new project using the Skeleton design framework,
jQuery, Backbone, also with Sass, CoffeeScript, and asset packaging.
qedproject myproject -l jquery,backbone,skeleton -c -s -a
=== Creating projects with Jasmine BDD tests
If you’d like to create projects where you can do Jasmine testing, use the -t flag.
qedproject myproject -l jquery,backbone -c -s -a -t
This will create a suite.html file in the spec folder, and will create
a sample spec. If you asked for CoffeeScript, the sample spec will be
written in CoffeeSript and the Guardfile will be modified to convert specs to
js files.
And if you used jQuery, the jasmine-jquery library will be added to your test suite.
=== Using the Server and LiveReload
You can use the -r
flag to add LiveReload support to the project.
qedproject myproject -r -c -s -a -t -l jquery
You can make your browser refresh when you change your files. To do that, first open another window and type
cd myproject
qedproject --server
which starts up a web server on port 1337 that serves up your project’s public
folder. Then install one of the LiveReload plugins for your browser and connect your browser by visiting http://localhost:1337 and activating LiveReload.
To get the browser plugins, visit http://help.livereload.com/kb/general-use/browser-extensions
== Overwriting files
By default, the CLI tool will not overwrite files with the same name. If you want to replace files, pass the -o flag.
= Building Plugins
Plugins should be gems that start with the prefix qedproject-.
Assuming we’re making a plugin called “qedproject-prototype”
for the Prototype library.
Make a structure like this:
qedproject-prototype
lib/
plugins/
prototype.rb
qedproject-prototype.rb
version.rb
vendor/
prototype/
prototype.js
Then your code will look like this for the prototype.rb file:
module QEDProject
module Plugins
class Prototype < QEDProject::Libraries::Base
library :prototype, __FILE__
set_js_files ["prototype.js"]
#set_css_files ["array", "of", "css", "files"]
#set_image_files ["array", "of", "image", "files"]
def generate!
super
# customizations of your own
# if you have no customizations, just don't implement generate! at all.
end
end
end
end
When your plugin is installed as a gem, QEDProject will detect it and attempt to load it.
It will actually load the gem itself, so you don’t necessarily have to create a plugin
with this - you could override any behavior you’d like.
= Contributing
Fork, send patches. Keep them small so I can pull them in.
= Changes
2013-10-27 - 0.6.3
2013-07-19 - 0.6.2
2013-06-04 - 0.6.1
2013-04-10 - 0.6.0
2013-03-19 - 0.5.0
2013-03-09 - 0.4.2
2013-02-17 - 0.4.1
2012-10-25 - 0.4.0
2012-4-30 - 0.3.2
2012-4-24 - 0.3.1
2012-4-19 - 0.3.0
--server
option which just starts up a simple web server pointing to the public/ folder of the current dir.2012-1-10 - 0.2.1
2011-11-10 - 0.2.0
2011-10-09 - 0.1.1
2011-10-08 - 0.1.0
2011-09-21 - 0.0.9
2011-09-07 - 0.0.8
2011-09-07 - 0.0.7
2011-09-03 - 0.0.6
2011-09-02 - 0.0.5
2011-09-02 - 0.0.4
2011-09-01 - 0.0.2
= Licence:
MIT license