Permalink
Browse files

Ready for 0.5.0 release

  • Loading branch information...
1 parent 801dda1 commit 308192e7c99a081cab0f8e8c048e39210ce649ff @napcs committed Mar 19, 2013
Showing with 79 additions and 7 deletions.
  1. +42 −5 README.rdoc
  2. +1 −0 bin/qedproject
  3. +15 −2 lib/qedproject/project.rb
  4. +3 −0 qedproject.gemspec
  5. +1 −0 templates/Gemfile
  6. +1 −0 templates/assets.yml
  7. +1 −0 test/jammit_test.rb
  8. +13 −0 test/project_test.rb
  9. +2 −0 test/project_test_helper.rb
View
@@ -3,7 +3,16 @@
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.
+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:
+
+* Sass
+* CoffeeScript
+* Backbone.JS
+* jQuery
+* jQuery Mobile
+* Ember.JS
+* Skeleton (http://getskeleton.com)
+* Knockout.JS
It also goes great with http://qedserver.napcs.com/
@@ -13,13 +22,14 @@ QEDProject is distributed as a Ruby gem. That means you'll need the Ruby program
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.
+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.
@@ -30,18 +40,18 @@ 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.
+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.
+Once the project is created, go into the project folder and run the Guard command.
cd myproject
- guard
+ 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.
@@ -59,6 +69,15 @@ using Guard.
=== Including JavaScript libraries.
+QEDProject has several popular libraries included.
+
+* jquery
+* jquerymobile
+* backbone
+* ember
+
+as well as the simple Responsive Design framework Skeleton
+
Create a new project using jQuery
qedproject myproject -l jquery
@@ -73,6 +92,12 @@ 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 <tt>-t</tt> flag.
@@ -157,6 +182,18 @@ Fork, send patches. Keep them small so I can pull them in.
= Changes
+2013-03-19 - 0.5.0
+* Ruby 1.9 only. No more support for 1.8.7
+* Updated jQuery to 1.9.1
+* Updated Ember to 1.0.0-rc1
+* Updated Knockout to 2.2
+* Updated Jasmine to 1.3.1
+* Updated Backbone.js to 0.9.10
+* Updated mustache to 0.7.2
+* Updated Guard depenndency to 1.6 so tmux is supported
+* QEDProject creation automatically runs 'bundle install'
+* Compression for Jammit uses uglifier now.
+
2013-03-09 - 0.4.2
* Fixed dependency issue with guard-livereload.
* Seriously, last version that supports 1.8.7.
View
@@ -73,6 +73,7 @@ else
puts "Specify a project. Use qedproject -h for options."
else
begin
+ options[:bundle] = true
QEDProject::Project.create(project, options)
rescue QEDProject::BadLibraryError => e
puts e.message
@@ -9,7 +9,8 @@ class Project
attr_accessor :path, :libs, :coffeescript, :sass, :jammit, :public_dir, :no_overwrite,
:js_path, :css_path, :images_path, :verbose, :testing, :skip_index, :livereload,
:sorted_libs,
- :css_assets, :js_assets
+ :css_assets, :js_assets,
+ :run_bundle
# convenience method to create a new project.
# Simply call create with the project path and the options.
def self.create(project_path, options= {})
@@ -38,7 +39,15 @@ def initialize(project_path, options = {})
self.path = project_path
self.process_options(options)
self.set_paths
- end
+ end
+
+ def bundle
+ Dir.chdir(self.path) do
+ puts "Bundling assets"
+ `bundle install`
+ end
+
+ end
def collect_libraries
@@ -87,6 +96,8 @@ def process_options(options)
self.skip_index = options[:skip_index]
self.livereload = options[:livereload]
self.no_overwrite = options[:no_overwrite] ? true : false
+ self.run_bundle = options[:bundle]
+
end
# Set up the basic paths we'll use throughout
@@ -121,6 +132,8 @@ def generate
self.create_guardfile if self.needs_guardfile?
self.create_rakefile
self.create_gemfile
+ self.bundle if self.run_bundle
+
end
# includes the Jasmine BDD framework for javascript testing
View
@@ -85,6 +85,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "coffee-script", ">=2.2.0"
s.add_runtime_dependency "sass", ">=3.2.0"
s.add_runtime_dependency "jammit", ">=0.6.5"
+ s.add_runtime_dependency "uglifier", ">=1.3.0"
s.add_runtime_dependency "rake", ">=0.8.7"
s.add_runtime_dependency "guard", ">=1.6.0"
s.add_runtime_dependency "guard-jammit", ">=1.0.1"
@@ -93,4 +94,6 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "guard-livereload", ">=1.1.0"
s.add_development_dependency "guard-test"
s.add_development_dependency "rdoc"
+ s.add_development_dependency "mocha", ">=0.13.0"
+
end
View
@@ -9,6 +9,7 @@ gem 'guard-coffeescript'
<% end -%>
<% if self.jammit -%>
gem 'guard-jammit'
+gem 'uglifier'
<% end -%>
<% if self.livereload -%>
gem 'guard-livereload'
@@ -1,3 +1,4 @@
+javascript_compressor: uglifier
stylesheets:
app:
<% self.css_assets.each do |lib| -%>
View
@@ -155,6 +155,7 @@ def test_should_create_gemfile_with_jammit
p = QEDProject::Project.new(@folder, :jammit => true)
p.generate
assert Pathname.new(File.join(@folder, "Gemfile")).read.include?("gem 'guard-jammit'")
+ assert Pathname.new(File.join(@folder, "Gemfile")).read.include?("uglifier")
end
View
@@ -133,4 +133,17 @@ def test_js_assets_has_jquery_first_and_only_includes_it_once_when_explicitly_re
# p.js_assets[2] is filled cos ember uses handlebars
assert_nil p.js_assets[3]
end
+
+ def test_does_not_run_bundler_by_default
+ p = QEDProject::Project.new(@folder)
+ p.expects(:bundle).never
+ p.generate
+ end
+
+ def test_runs_bundler_when_option_passed
+ p = QEDProject::Project.new(@folder, :bundle => true)
+ p.expects(:bundle)
+ p.generate
+ end
+
end
@@ -2,6 +2,8 @@
require 'test/unit'
require 'qedproject'
require 'pathname'
+require "mocha/setup"
+
class Test::Unit::TestCase
class << self

0 comments on commit 308192e

Please sign in to comment.