guard-stitch 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/lib/guard/stitch.rb +45 -0
- data/lib/guard/stitch/templates/Guardfile +3 -0
- data/lib/guard/stitch/version.rb +5 -0
- metadata +71 -0
data/Gemfile
ADDED
data/lib/guard/stitch.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'guard'
|
2
|
+
require 'guard/guard'
|
3
|
+
require 'guard/watcher'
|
4
|
+
require 'stitch-rb'
|
5
|
+
|
6
|
+
module Guard
|
7
|
+
class Stitch < Guard
|
8
|
+
|
9
|
+
def initialize(watchers = [], options = {})
|
10
|
+
super(watchers, options)
|
11
|
+
@output = options.delete(:output)
|
12
|
+
end
|
13
|
+
|
14
|
+
def start
|
15
|
+
stitch
|
16
|
+
end
|
17
|
+
|
18
|
+
def reload
|
19
|
+
stitch
|
20
|
+
end
|
21
|
+
|
22
|
+
def run_all
|
23
|
+
stitch
|
24
|
+
end
|
25
|
+
|
26
|
+
def run_on_change(paths)
|
27
|
+
stitch
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
def stitch
|
32
|
+
begin
|
33
|
+
js = ::Stitch::Package.new(:paths => ["app"]).compile
|
34
|
+
open(@output, 'w') {|f| f << js}
|
35
|
+
UI.info "Stitched #{@input} to #{@output}"
|
36
|
+
Notifier.notify "Stitched #{@input} to #{@output}", :title => 'Stitch'
|
37
|
+
true
|
38
|
+
rescue Exception => e
|
39
|
+
UI.error "Stitching #{@input} failed: #{e}"
|
40
|
+
Notifier.notify "Stitching #{@input} failed: #{e}", :title => 'Stitch', :image => :failed
|
41
|
+
false
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-stitch
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- stereosteve
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-10-08 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: guard
|
16
|
+
requirement: &70230872391340 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0.4'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70230872391340
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: stitch-rb
|
27
|
+
requirement: &70230872390840 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.0.4
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70230872390840
|
36
|
+
description: Run stitch-rb on your javascripts.
|
37
|
+
email:
|
38
|
+
- stereosteve@gmail.com
|
39
|
+
executables: []
|
40
|
+
extensions: []
|
41
|
+
extra_rdoc_files: []
|
42
|
+
files:
|
43
|
+
- lib/guard/stitch/templates/Guardfile
|
44
|
+
- lib/guard/stitch/version.rb
|
45
|
+
- lib/guard/stitch.rb
|
46
|
+
- Gemfile
|
47
|
+
homepage: ''
|
48
|
+
licenses: []
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options: []
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
requirements: []
|
66
|
+
rubyforge_project: guard-stitch
|
67
|
+
rubygems_version: 1.8.11
|
68
|
+
signing_key:
|
69
|
+
specification_version: 3
|
70
|
+
summary: Guard for stitch-rb
|
71
|
+
test_files: []
|