guard-jammit 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.textile +19 -0
- data/Rakefile +32 -0
- data/VERSION +1 -0
- data/guard-jammit.gemspec +52 -0
- data/lib/guard/jammit/templates/Guardfile +4 -0
- data/lib/guard/jammit.rb +57 -0
- metadata +103 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Pelle Braendgaard
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.textile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
h1. Guard Jammit Plug-in
|
2
|
+
|
3
|
+
Let you configure a Guard that will run jammit whenever a javascript or stylesheet is updated.
|
4
|
+
|
5
|
+
h2. Quick Start
|
6
|
+
|
7
|
+
Edit the Gemfile for it to looks like:
|
8
|
+
|
9
|
+
bc. source "http://rubygems.org"
|
10
|
+
gem 'guard-jammit'
|
11
|
+
|
12
|
+
You can now download missing gems and initialize the guard
|
13
|
+
|
14
|
+
bc. $ bundle install
|
15
|
+
$ guard init
|
16
|
+
$ guard init jammit
|
17
|
+
$ guard
|
18
|
+
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "guard-jammit"
|
8
|
+
gem.summary = %Q{Guard plugin for running jammit}
|
9
|
+
gem.description = %Q{This is a guard plugin to watch javascript and stylesheets to afterwards run jammit.}
|
10
|
+
gem.email = "pelleb@gmail.com"
|
11
|
+
gem.homepage = "http://github.com/pelle/guard-jammit"
|
12
|
+
gem.authors = ["Pelle Braendgaard"]
|
13
|
+
gem.add_dependency "guard"
|
14
|
+
gem.add_dependency "jammit"
|
15
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
|
+
end
|
17
|
+
Jeweler::GemcutterTasks.new
|
18
|
+
rescue LoadError
|
19
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
20
|
+
end
|
21
|
+
|
22
|
+
task :default => :jeweler
|
23
|
+
|
24
|
+
require 'rake/rdoctask'
|
25
|
+
Rake::RDocTask.new do |rdoc|
|
26
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
27
|
+
|
28
|
+
rdoc.rdoc_dir = 'rdoc'
|
29
|
+
rdoc.title = "guard-jammit #{version}"
|
30
|
+
rdoc.rdoc_files.include('README*')
|
31
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
32
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{guard-jammit}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Pelle Braendgaard"]
|
12
|
+
s.date = %q{2010-11-08}
|
13
|
+
s.description = %q{This is a guard plugin to watch javascript and stylesheets to afterwards run jammit.}
|
14
|
+
s.email = %q{pelleb@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.textile"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.textile",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"guard-jammit.gemspec",
|
27
|
+
"lib/guard/jammit.rb",
|
28
|
+
"lib/guard/jammit/templates/Guardfile"
|
29
|
+
]
|
30
|
+
s.homepage = %q{http://github.com/pelle/guard-jammit}
|
31
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
32
|
+
s.require_paths = ["lib"]
|
33
|
+
s.rubygems_version = %q{1.3.7}
|
34
|
+
s.summary = %q{Guard plugin for running jammit}
|
35
|
+
|
36
|
+
if s.respond_to? :specification_version then
|
37
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
38
|
+
s.specification_version = 3
|
39
|
+
|
40
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
41
|
+
s.add_runtime_dependency(%q<guard>, [">= 0"])
|
42
|
+
s.add_runtime_dependency(%q<jammit>, [">= 0"])
|
43
|
+
else
|
44
|
+
s.add_dependency(%q<guard>, [">= 0"])
|
45
|
+
s.add_dependency(%q<jammit>, [">= 0"])
|
46
|
+
end
|
47
|
+
else
|
48
|
+
s.add_dependency(%q<guard>, [">= 0"])
|
49
|
+
s.add_dependency(%q<jammit>, [">= 0"])
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
data/lib/guard/jammit.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'guard'
|
2
|
+
require 'guard/guard'
|
3
|
+
require 'jammit'
|
4
|
+
module Guard
|
5
|
+
class Jammit < Guard
|
6
|
+
|
7
|
+
def initialize(watchers = [], options = {})
|
8
|
+
super
|
9
|
+
|
10
|
+
# init stuff here, thx!
|
11
|
+
end
|
12
|
+
|
13
|
+
# ================
|
14
|
+
# = Guard method =
|
15
|
+
# ================
|
16
|
+
|
17
|
+
# If one of those methods raise an exception, the Guard instance
|
18
|
+
# will be removed from the active guard.
|
19
|
+
|
20
|
+
# Call once when guard starts
|
21
|
+
# Please override initialize method to init stuff
|
22
|
+
def start
|
23
|
+
jammit
|
24
|
+
end
|
25
|
+
|
26
|
+
# Call with Ctrl-C signal (when Guard quit)
|
27
|
+
def stop
|
28
|
+
true
|
29
|
+
end
|
30
|
+
|
31
|
+
# Call with Ctrl-Z signal
|
32
|
+
# This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
|
33
|
+
def reload
|
34
|
+
jammit
|
35
|
+
end
|
36
|
+
|
37
|
+
# Call with Ctrl-/ signal
|
38
|
+
# This method should be principally used for long action like running all specs/tests/...
|
39
|
+
def run_all
|
40
|
+
jammit
|
41
|
+
end
|
42
|
+
|
43
|
+
# Call on file(s) modifications
|
44
|
+
def run_on_change(paths)
|
45
|
+
jammit
|
46
|
+
end
|
47
|
+
|
48
|
+
def jammit
|
49
|
+
::Jammit.load_configuration ::Jammit::DEFAULT_CONFIG_PATH
|
50
|
+
puts "Jamming"
|
51
|
+
::Jammit.packager.force = true
|
52
|
+
::Jammit.packager.precache_all
|
53
|
+
true
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-jammit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Pelle Braendgaard
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-11-08 00:00:00 -05:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: guard
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: jammit
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
49
|
+
description: This is a guard plugin to watch javascript and stylesheets to afterwards run jammit.
|
50
|
+
email: pelleb@gmail.com
|
51
|
+
executables: []
|
52
|
+
|
53
|
+
extensions: []
|
54
|
+
|
55
|
+
extra_rdoc_files:
|
56
|
+
- LICENSE
|
57
|
+
- README.textile
|
58
|
+
files:
|
59
|
+
- .document
|
60
|
+
- .gitignore
|
61
|
+
- LICENSE
|
62
|
+
- README.textile
|
63
|
+
- Rakefile
|
64
|
+
- VERSION
|
65
|
+
- guard-jammit.gemspec
|
66
|
+
- lib/guard/jammit.rb
|
67
|
+
- lib/guard/jammit/templates/Guardfile
|
68
|
+
has_rdoc: true
|
69
|
+
homepage: http://github.com/pelle/guard-jammit
|
70
|
+
licenses: []
|
71
|
+
|
72
|
+
post_install_message:
|
73
|
+
rdoc_options:
|
74
|
+
- --charset=UTF-8
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
hash: 3
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
version: "0"
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
hash: 3
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
version: "0"
|
95
|
+
requirements: []
|
96
|
+
|
97
|
+
rubyforge_project:
|
98
|
+
rubygems_version: 1.3.7
|
99
|
+
signing_key:
|
100
|
+
specification_version: 3
|
101
|
+
summary: Guard plugin for running jammit
|
102
|
+
test_files: []
|
103
|
+
|