guard-uglify 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/guard/uglify.rb +28 -0
- data/lib/guard/uglify/templates/Guardfile +3 -0
- data/lib/guard/uglify/version.rb +6 -0
- metadata +79 -0
data/lib/guard/uglify.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'guard'
|
2
|
+
require 'guard/guard'
|
3
|
+
|
4
|
+
require 'uglifier'
|
5
|
+
|
6
|
+
module Guard
|
7
|
+
class Uglify < Guard
|
8
|
+
def initialize(watchers=[], options={})
|
9
|
+
super
|
10
|
+
@destination_file = options[:destination_file]
|
11
|
+
end
|
12
|
+
|
13
|
+
def start
|
14
|
+
UI.info "Uglify is waiting for js file changes..."
|
15
|
+
end
|
16
|
+
|
17
|
+
def run_all
|
18
|
+
true
|
19
|
+
end
|
20
|
+
|
21
|
+
def run_on_change(paths)
|
22
|
+
@destination_file ||= "public/javascripts/application.js"
|
23
|
+
uglified = Uglifier.new.compile(File.read(@destination_file))
|
24
|
+
File.open(@destination_file,'w'){ |f| f.write(uglified) }
|
25
|
+
UI.info "Uglify creating file #{@destination_file}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-uglify
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Aaron Cruz
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-05-13 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: guard
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.2.2
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: uglifier
|
28
|
+
prerelease: false
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0"
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id002
|
37
|
+
description: guard file for the uglifier gem
|
38
|
+
email:
|
39
|
+
- aaron@aaroncruz.com
|
40
|
+
executables: []
|
41
|
+
|
42
|
+
extensions: []
|
43
|
+
|
44
|
+
extra_rdoc_files: []
|
45
|
+
|
46
|
+
files:
|
47
|
+
- lib/guard/uglify/templates/Guardfile
|
48
|
+
- lib/guard/uglify/version.rb
|
49
|
+
- lib/guard/uglify.rb
|
50
|
+
homepage: http://aaroncruz.com
|
51
|
+
licenses: []
|
52
|
+
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
|
56
|
+
require_paths:
|
57
|
+
- lib
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: "0"
|
64
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: "0"
|
70
|
+
requirements: []
|
71
|
+
|
72
|
+
rubyforge_project: guard-uglify
|
73
|
+
rubygems_version: 1.7.2
|
74
|
+
signing_key:
|
75
|
+
specification_version: 3
|
76
|
+
summary: guard file for the uglifier gem
|
77
|
+
test_files: []
|
78
|
+
|
79
|
+
has_rdoc:
|