guard-erb 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -1
- data/lib/guard/erb.rb +7 -4
- data/lib/guard/{erb-guard → erb/templates}/Guardfile +0 -0
- data/lib/guard/version.rb +1 -1
- data/lib/struct_erb.rb +14 -0
- metadata +12 -6
data/README.md
CHANGED
@@ -18,7 +18,11 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
Nested erb support via the import method
|
22
|
+
```eruby
|
23
|
+
<%= import('erbfile.html.erb', { foo: bar }) %>
|
24
|
+
```
|
25
|
+
For guard usage please read [Guard usage doc](https://github.com/guard/guard#readme).
|
22
26
|
|
23
27
|
## Guardfile
|
24
28
|
|
data/lib/guard/erb.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'guard'
|
2
2
|
require 'guard/guard'
|
3
3
|
require 'erb'
|
4
|
+
require 'struct_erb'
|
4
5
|
|
5
6
|
module Guard
|
6
7
|
class Erb < Guard
|
8
|
+
|
7
9
|
def initialize(watchers=[], options={})
|
8
10
|
@input = options[:input]
|
9
11
|
@output = options[:output]
|
@@ -22,14 +24,14 @@ module Guard
|
|
22
24
|
compile
|
23
25
|
end
|
24
26
|
|
25
|
-
def
|
27
|
+
def run_on_changes(paths)
|
26
28
|
compile
|
27
29
|
end
|
28
30
|
|
29
31
|
private
|
30
|
-
|
31
|
-
|
32
|
-
::
|
32
|
+
|
33
|
+
def import(file, locals={})
|
34
|
+
::StructErb.new(locals).render(File.read(file))
|
33
35
|
end
|
34
36
|
|
35
37
|
def compile
|
@@ -47,4 +49,5 @@ module Guard
|
|
47
49
|
end
|
48
50
|
end
|
49
51
|
end
|
52
|
+
|
50
53
|
end
|
File without changes
|
data/lib/guard/version.rb
CHANGED
data/lib/struct_erb.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-erb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-03-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: guard
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,12 @@ dependencies:
|
|
21
21
|
version: 0.2.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.2.2
|
25
30
|
description: guard-erb automatically compiles a erb file into the specified directory
|
26
31
|
email:
|
27
32
|
- omar@digitaltree.com
|
@@ -35,9 +40,10 @@ files:
|
|
35
40
|
- README.md
|
36
41
|
- Rakefile
|
37
42
|
- guard-erb.gemspec
|
38
|
-
- lib/guard/erb-guard/Guardfile
|
39
43
|
- lib/guard/erb.rb
|
44
|
+
- lib/guard/erb/templates/Guardfile
|
40
45
|
- lib/guard/version.rb
|
46
|
+
- lib/struct_erb.rb
|
41
47
|
homepage: https://github.com/omarramos/guard-erb
|
42
48
|
licenses: []
|
43
49
|
post_install_message:
|
@@ -58,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
64
|
version: '0'
|
59
65
|
requirements: []
|
60
66
|
rubyforge_project:
|
61
|
-
rubygems_version: 1.8.
|
67
|
+
rubygems_version: 1.8.23
|
62
68
|
signing_key:
|
63
69
|
specification_version: 3
|
64
70
|
summary: Guard for compiling erb files
|