Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Works using regular configurations. All is hardcoded using standard j…

…ammit/rails settings.

Please submit patches for changing output directories etc.
  • Loading branch information...
commit 3a11aea76f9cdb9fca8994b37699783493dad300 1 parent b5360b9
@pelle pelle authored
View
17 README.rdoc
@@ -1,17 +0,0 @@
-= guard-jammit
-
-Description goes here.
-
-== Note on Patches/Pull Requests
-
-* Fork the project.
-* Make your feature addition or bug fix.
-* Add tests for it. This is important so I don't break it in a
- future version unintentionally.
-* Commit, do not mess with rakefile, version, or history.
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-* Send me a pull request. Bonus points for topic branches.
-
-== Copyright
-
-Copyright (c) 2010 Pelle Braendgaard. See LICENSE for details.
View
19 README.textile
@@ -0,0 +1,19 @@
+h1. Guard Jammit Plug-in
+
+Let you configure a Guard that will run jammit whenever a javascript or stylesheet is updated.
+
+h2. Quick Start
+
+Edit the Gemfile for it to looks like:
+
+bc. source "http://rubygems.org"
+gem 'guard-jammit'
+
+You can now download missing gems and initialize the guard
+
+bc. $ bundle install
+$ guard init
+$ guard init jammit
+$ guard
+
+
View
21 Rakefile
@@ -6,11 +6,12 @@ begin
Jeweler::Tasks.new do |gem|
gem.name = "guard-jammit"
gem.summary = %Q{Guard plugin for running jammit}
- gem.description = %Q{TODO: longer description of your gem}
+ gem.description = %Q{This is a guard plugin to watch javascript and stylesheets to afterwards run jammit.}
gem.email = "pelleb@gmail.com"
gem.homepage = "http://github.com/pelle/guard-jammit"
gem.authors = ["Pelle Braendgaard"]
- gem.add_development_dependency "rspec", ">= 1.2.9"
+ gem.add_dependency "guard"
+ gem.add_dependency "jammit"
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
@@ -18,21 +19,7 @@ rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
-require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_files = FileList['spec/**/*_spec.rb']
-end
-
-Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
-end
-
-task :spec => :check_dependencies
-
-task :default => :spec
+task :default => :jeweler
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
View
52 guard-jammit.gemspec
@@ -0,0 +1,52 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{guard-jammit}
+ s.version = "0.1.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Pelle Braendgaard"]
+ s.date = %q{2010-11-08}
+ s.description = %q{This is a guard plugin to watch javascript and stylesheets to afterwards run jammit.}
+ s.email = %q{pelleb@gmail.com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.textile"
+ ]
+ s.files = [
+ ".document",
+ ".gitignore",
+ "LICENSE",
+ "README.textile",
+ "Rakefile",
+ "VERSION",
+ "guard-jammit.gemspec",
+ "lib/guard/jammit.rb",
+ "lib/guard/jammit/templates/Guardfile"
+ ]
+ s.homepage = %q{http://github.com/pelle/guard-jammit}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.7}
+ s.summary = %q{Guard plugin for running jammit}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<guard>, [">= 0"])
+ s.add_runtime_dependency(%q<jammit>, [">= 0"])
+ else
+ s.add_dependency(%q<guard>, [">= 0"])
+ s.add_dependency(%q<jammit>, [">= 0"])
+ end
+ else
+ s.add_dependency(%q<guard>, [">= 0"])
+ s.add_dependency(%q<jammit>, [">= 0"])
+ end
+end
+
View
0  lib/guard-jammit.rb
No changes.
View
10 lib/guard/guard-jammit.rb → lib/guard/jammit.rb
@@ -1,11 +1,12 @@
require 'guard'
require 'guard/guard'
-
+require 'jammit'
module Guard
- class GuardJammit < Guard
+ class Jammit < Guard
def initialize(watchers = [], options = {})
super
+
# init stuff here, thx!
end
@@ -45,7 +46,10 @@ def run_on_change(paths)
end
def jammit
- Jammit.packager.precache_all
+ ::Jammit.load_configuration ::Jammit::DEFAULT_CONFIG_PATH
+ puts "Jamming"
+ ::Jammit.packager.force = true
+ ::Jammit.packager.precache_all
true
end
View
0  lib/guard/guard-jammit/templates/Guardfile → lib/guard/jammit/templates/Guardfile
File renamed without changes
View
7 spec/guard-jammit_spec.rb
@@ -1,7 +0,0 @@
-require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
-
-describe "GuardJammit" do
- it "fails" do
- fail "hey buddy, you should probably rename this file and start specing for real"
- end
-end
View
1  spec/spec.opts
@@ -1 +0,0 @@
---color
View
9 spec/spec_helper.rb
@@ -1,9 +0,0 @@
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-require 'guard-jammit'
-require 'spec'
-require 'spec/autorun'
-
-Spec::Runner.configure do |config|
-
-end
Please sign in to comment.
Something went wrong with that request. Please try again.