haml 2.2.24 → 3.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of haml might be problematic. Click here for more details.
- data/.yardopts +0 -1
- data/README.md +91 -151
- data/REMEMBER +11 -1
- data/Rakefile +73 -55
- data/VERSION +1 -1
- data/VERSION_NAME +1 -1
- data/bin/css2sass +7 -1
- data/bin/sass-convert +7 -0
- data/extra/haml-mode.el +2 -1
- data/lib/haml/buffer.rb +22 -4
- data/lib/haml/engine.rb +5 -1
- data/lib/haml/exec.rb +231 -46
- data/lib/haml/filters.rb +19 -8
- data/lib/haml/helpers.rb +47 -20
- data/lib/haml/helpers/action_view_extensions.rb +2 -4
- data/lib/haml/helpers/action_view_mods.rb +11 -8
- data/lib/haml/helpers/xss_mods.rb +13 -2
- data/lib/haml/html.rb +179 -48
- data/lib/haml/html/erb.rb +141 -0
- data/lib/haml/precompiler.rb +40 -15
- data/lib/haml/railtie.rb +1 -5
- data/lib/haml/root.rb +3 -0
- data/lib/haml/template.rb +4 -14
- data/lib/haml/util.rb +120 -30
- data/lib/haml/version.rb +25 -2
- data/lib/sass.rb +5 -1
- data/lib/sass/callbacks.rb +50 -0
- data/lib/sass/css.rb +40 -191
- data/lib/sass/engine.rb +170 -74
- data/lib/sass/environment.rb +8 -2
- data/lib/sass/error.rb +163 -25
- data/lib/sass/files.rb +31 -28
- data/lib/sass/plugin.rb +268 -87
- data/lib/sass/plugin/rails.rb +9 -4
- data/lib/sass/repl.rb +1 -1
- data/lib/sass/script.rb +31 -29
- data/lib/sass/script/bool.rb +1 -0
- data/lib/sass/script/color.rb +290 -23
- data/lib/sass/script/css_lexer.rb +22 -0
- data/lib/sass/script/css_parser.rb +28 -0
- data/lib/sass/script/funcall.rb +22 -3
- data/lib/sass/script/functions.rb +523 -33
- data/lib/sass/script/interpolation.rb +42 -0
- data/lib/sass/script/lexer.rb +169 -52
- data/lib/sass/script/literal.rb +58 -9
- data/lib/sass/script/node.rb +79 -1
- data/lib/sass/script/number.rb +20 -5
- data/lib/sass/script/operation.rb +49 -3
- data/lib/sass/script/parser.rb +162 -28
- data/lib/sass/script/string.rb +50 -2
- data/lib/sass/script/unary_operation.rb +25 -2
- data/lib/sass/script/variable.rb +21 -4
- data/lib/sass/scss.rb +14 -0
- data/lib/sass/scss/css_parser.rb +39 -0
- data/lib/sass/scss/parser.rb +683 -0
- data/lib/sass/scss/rx.rb +112 -0
- data/lib/sass/scss/script_lexer.rb +13 -0
- data/lib/sass/scss/script_parser.rb +25 -0
- data/lib/sass/tree/comment_node.rb +69 -27
- data/lib/sass/tree/debug_node.rb +7 -2
- data/lib/sass/tree/directive_node.rb +41 -35
- data/lib/sass/tree/for_node.rb +6 -0
- data/lib/sass/tree/if_node.rb +13 -1
- data/lib/sass/tree/import_node.rb +52 -27
- data/lib/sass/tree/mixin_def_node.rb +18 -0
- data/lib/sass/tree/mixin_node.rb +41 -6
- data/lib/sass/tree/node.rb +197 -70
- data/lib/sass/tree/prop_node.rb +152 -57
- data/lib/sass/tree/root_node.rb +118 -0
- data/lib/sass/tree/rule_node.rb +193 -96
- data/lib/sass/tree/variable_node.rb +9 -5
- data/lib/sass/tree/while_node.rb +4 -0
- data/test/benchmark.rb +5 -5
- data/test/haml/engine_test.rb +147 -10
- data/test/haml/{rhtml/_av_partial_1.rhtml → erb/_av_partial_1.erb} +1 -1
- data/test/haml/{rhtml/_av_partial_2.rhtml → erb/_av_partial_2.erb} +1 -1
- data/test/haml/{rhtml/action_view.rhtml → erb/action_view.erb} +1 -1
- data/test/haml/{rhtml/standard.rhtml → erb/standard.erb} +0 -0
- data/test/haml/helper_test.rb +91 -24
- data/test/haml/html2haml/erb_tests.rb +410 -0
- data/test/haml/html2haml_test.rb +210 -66
- data/test/haml/results/filters.xhtml +1 -1
- data/test/haml/results/just_stuff.xhtml +2 -0
- data/test/haml/spec_test.rb +44 -0
- data/test/haml/template_test.rb +22 -2
- data/test/haml/templates/helpers.haml +0 -13
- data/test/haml/templates/just_stuff.haml +2 -0
- data/test/haml/util_test.rb +48 -0
- data/test/sass/callbacks_test.rb +61 -0
- data/test/sass/conversion_test.rb +884 -0
- data/test/sass/css2sass_test.rb +99 -18
- data/test/sass/data/hsl-rgb.txt +319 -0
- data/test/sass/engine_test.rb +1049 -131
- data/test/sass/functions_test.rb +398 -47
- data/test/sass/more_results/more_import.css +1 -1
- data/test/sass/more_templates/more_import.sass +3 -3
- data/test/sass/plugin_test.rb +184 -10
- data/test/sass/results/compact.css +1 -1
- data/test/sass/results/complex.css +5 -5
- data/test/sass/results/compressed.css +1 -1
- data/test/sass/results/expanded.css +1 -1
- data/test/sass/results/import.css +3 -1
- data/test/sass/results/mixins.css +12 -12
- data/test/sass/results/nested.css +1 -1
- data/test/sass/results/options.css +1 -0
- data/test/sass/results/parent_ref.css +4 -4
- data/test/sass/results/script.css +3 -3
- data/test/sass/results/scss_import.css +15 -0
- data/test/sass/results/scss_importee.css +2 -0
- data/test/sass/script_conversion_test.rb +153 -0
- data/test/sass/script_test.rb +137 -70
- data/test/sass/scss/css_test.rb +811 -0
- data/test/sass/scss/rx_test.rb +156 -0
- data/test/sass/scss/scss_test.rb +871 -0
- data/test/sass/scss/test_helper.rb +37 -0
- data/test/sass/templates/alt.sass +2 -2
- data/test/sass/templates/bork1.sass +2 -0
- data/test/sass/templates/bork3.sass +2 -0
- data/test/sass/templates/bork4.sass +2 -0
- data/test/sass/templates/import.sass +4 -4
- data/test/sass/templates/importee.sass +3 -3
- data/test/sass/templates/line_numbers.sass +1 -1
- data/test/sass/templates/mixin_bork.sass +5 -0
- data/test/sass/templates/mixins.sass +2 -2
- data/test/sass/templates/nested_bork1.sass +2 -0
- data/test/sass/templates/nested_bork2.sass +2 -0
- data/test/sass/templates/nested_bork3.sass +2 -0
- data/test/sass/templates/nested_bork4.sass +2 -0
- data/test/sass/templates/nested_mixin_bork.sass +6 -0
- data/test/sass/templates/options.sass +2 -0
- data/test/sass/templates/parent_ref.sass +2 -2
- data/test/sass/templates/script.sass +69 -69
- data/test/sass/templates/scss_import.scss +10 -0
- data/test/sass/templates/scss_importee.scss +1 -0
- data/test/sass/templates/units.sass +10 -10
- data/test/test_helper.rb +20 -8
- data/vendor/fssm/LICENSE +20 -0
- data/vendor/fssm/README.markdown +55 -0
- data/vendor/fssm/Rakefile +59 -0
- data/vendor/fssm/VERSION.yml +5 -0
- data/vendor/fssm/example.rb +9 -0
- data/vendor/fssm/fssm.gemspec +77 -0
- data/vendor/fssm/lib/fssm.rb +33 -0
- data/vendor/fssm/lib/fssm/backends/fsevents.rb +36 -0
- data/vendor/fssm/lib/fssm/backends/inotify.rb +26 -0
- data/vendor/fssm/lib/fssm/backends/polling.rb +25 -0
- data/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +131 -0
- data/vendor/fssm/lib/fssm/monitor.rb +26 -0
- data/vendor/fssm/lib/fssm/path.rb +91 -0
- data/vendor/fssm/lib/fssm/pathname.rb +502 -0
- data/vendor/fssm/lib/fssm/state/directory.rb +57 -0
- data/vendor/fssm/lib/fssm/state/file.rb +24 -0
- data/vendor/fssm/lib/fssm/support.rb +63 -0
- data/vendor/fssm/lib/fssm/tree.rb +176 -0
- data/vendor/fssm/profile/prof-cache.rb +40 -0
- data/vendor/fssm/profile/prof-fssm-pathname.html +1231 -0
- data/vendor/fssm/profile/prof-pathname.rb +68 -0
- data/vendor/fssm/profile/prof-plain-pathname.html +988 -0
- data/vendor/fssm/profile/prof.html +2379 -0
- data/vendor/fssm/spec/path_spec.rb +75 -0
- data/vendor/fssm/spec/root/duck/quack.txt +0 -0
- data/vendor/fssm/spec/root/file.css +0 -0
- data/vendor/fssm/spec/root/file.rb +0 -0
- data/vendor/fssm/spec/root/file.yml +0 -0
- data/vendor/fssm/spec/root/moo/cow.txt +0 -0
- data/vendor/fssm/spec/spec_helper.rb +14 -0
- metadata +94 -14
- data/test/sass/templates/bork.sass +0 -2
@@ -0,0 +1,37 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../test_helper'
|
2
|
+
require 'sass/engine'
|
3
|
+
|
4
|
+
module ScssTestHelper
|
5
|
+
def assert_parses(scss)
|
6
|
+
assert_equal scss.rstrip, render(scss).rstrip
|
7
|
+
end
|
8
|
+
|
9
|
+
def assert_not_parses(expected, scss)
|
10
|
+
raise "Template must include <err> where an error is expected" unless scss.include?("<err>")
|
11
|
+
|
12
|
+
after, was = scss.split("<err>")
|
13
|
+
line = after.count("\n") + 1
|
14
|
+
|
15
|
+
after.gsub!(/\s*\n\s*$/, '')
|
16
|
+
after.gsub!(/.*\n/, '')
|
17
|
+
after = "..." + after[-15..-1] if after.size > 18
|
18
|
+
|
19
|
+
was.gsub!(/^\s*\n\s*/, '')
|
20
|
+
was.gsub!(/\n.*/, '')
|
21
|
+
was = was[0...15] + "..." if was.size > 18
|
22
|
+
|
23
|
+
to_render = scss.sub("<err>", "")
|
24
|
+
render(to_render)
|
25
|
+
assert(false, "Expected syntax error for:\n#{to_render}\n")
|
26
|
+
rescue Sass::SyntaxError => err
|
27
|
+
assert_equal("Invalid CSS after \"#{after}\": expected #{expected}, was \"#{was}\"",
|
28
|
+
err.message)
|
29
|
+
assert_equal line, err.sass_line
|
30
|
+
end
|
31
|
+
|
32
|
+
def render(scss, options = {})
|
33
|
+
options[:syntax] ||= :scss
|
34
|
+
munge_filename options
|
35
|
+
Sass::Engine.new(scss, options).render
|
36
|
+
end
|
37
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
|
1
|
+
$preconst: hello
|
2
2
|
|
3
3
|
=premixin
|
4
4
|
pre-mixin: here
|
5
5
|
|
6
|
-
@import importee.sass, basic.sass, basic.css, ../results/complex.css, partial.sass
|
6
|
+
@import importee.sass, scss_importee, basic.sass, basic.css, ../results/complex.css, partial.sass
|
7
7
|
|
8
8
|
nonimported
|
9
|
-
:myconst
|
10
|
-
:otherconst
|
9
|
+
:myconst $preconst
|
10
|
+
:otherconst $postconst
|
11
11
|
+postmixin
|
@@ -15,9 +15,9 @@ p, div
|
|
15
15
|
:style solid
|
16
16
|
:width 2em
|
17
17
|
.ie7 &, .ie6 &
|
18
|
-
:content string(Totally not cool.)
|
18
|
+
:content string("Totally not cool.")
|
19
19
|
.firefox &
|
20
|
-
:content string(Quite cool.)
|
20
|
+
:content string("Quite cool.")
|
21
21
|
|
22
22
|
.wow, .snazzy
|
23
23
|
:font-family fantasy
|
@@ -1,101 +1,101 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
$width: 10em + 20
|
2
|
+
$color: #00ff98
|
3
|
+
$main_text: #ffa
|
4
|
+
$num: 10
|
5
|
+
$dec: 10.2
|
6
|
+
$dec_0: 99.0
|
7
|
+
$neg: -10
|
8
|
+
$esc: 10\+12
|
9
|
+
$str: Hello\!
|
10
|
+
$qstr: "Quo\"ted\"!"
|
11
|
+
$hstr: Hyph-en\!
|
12
|
+
$concat: #{5 + 4} hi there
|
13
|
+
$percent: 11%
|
14
|
+
$complex: 1px/1em
|
15
15
|
|
16
16
|
#main
|
17
|
-
:content
|
18
|
-
:qstr
|
19
|
-
:hstr
|
20
|
-
:width
|
17
|
+
:content $str
|
18
|
+
:qstr $qstr
|
19
|
+
:hstr $hstr
|
20
|
+
:width $width
|
21
21
|
:background-color #000
|
22
|
-
:color
|
23
|
-
:short-color
|
24
|
-
:named-color
|
25
|
-
:con
|
26
|
-
:con2
|
22
|
+
:color $main_text
|
23
|
+
:short-color #123
|
24
|
+
:named-color olive
|
25
|
+
:con "foo" bar ($concat "boom")
|
26
|
+
:con2 "noquo" quo
|
27
27
|
#sidebar
|
28
|
-
:background-color
|
28
|
+
:background-color $color
|
29
29
|
:num
|
30
|
-
:normal
|
31
|
-
:dec
|
32
|
-
:dec0
|
33
|
-
:neg
|
34
|
-
:esc
|
35
|
-
:many
|
36
|
-
:order
|
37
|
-
:complex
|
30
|
+
:normal $num
|
31
|
+
:dec $dec
|
32
|
+
:dec0 $dec_0
|
33
|
+
:neg $neg
|
34
|
+
:esc $esc
|
35
|
+
:many 1 + 2 + 3
|
36
|
+
:order 1 + 2 * 3
|
37
|
+
:complex ((1 + 2) + 15)+#3a8b9f + (hi+(1 +1+ 2)* 4)
|
38
38
|
|
39
39
|
#plus
|
40
40
|
:num
|
41
|
-
:num
|
42
|
-
:num-un
|
43
|
-
:num-un2
|
44
|
-
:num-neg
|
45
|
-
:str
|
46
|
-
:col
|
47
|
-
:perc
|
41
|
+
:num 5+2
|
42
|
+
:num-un 10em + 15em
|
43
|
+
:num-un2 10 + 13em
|
44
|
+
:num-neg 10 + -.13
|
45
|
+
:str 100 * 1px
|
46
|
+
:col 13 + #aaa
|
47
|
+
:perc $percent + 20%
|
48
48
|
:str
|
49
|
-
:str
|
50
|
-
:str2
|
51
|
-
:col
|
52
|
-
:num
|
49
|
+
:str "hi" + "\ there"
|
50
|
+
:str2 "hi" + " there"
|
51
|
+
:col "14em solid " + #123
|
52
|
+
:num "times: " + 13
|
53
53
|
:col
|
54
|
-
:num
|
55
|
-
:col
|
54
|
+
:num #f02 + 123.5
|
55
|
+
:col #12A + #405162
|
56
56
|
|
57
57
|
#minus
|
58
58
|
:num
|
59
|
-
:num
|
59
|
+
:num 912 - 12
|
60
60
|
:col
|
61
|
-
:num
|
62
|
-
:col
|
61
|
+
:num #fffffa - 5.2
|
62
|
+
:col #abcdef - #fedcba
|
63
63
|
:unary
|
64
|
-
:num
|
65
|
-
:const
|
66
|
-
:paren
|
67
|
-
:two
|
68
|
-
:many
|
69
|
-
:crazy
|
64
|
+
:num -1
|
65
|
+
:const -$neg
|
66
|
+
:paren -(5 + 6)
|
67
|
+
:two --12
|
68
|
+
:many --------12
|
69
|
+
:crazy -----(5 + ---$neg)
|
70
70
|
|
71
71
|
#times
|
72
72
|
:num
|
73
|
-
:num
|
74
|
-
:col
|
73
|
+
:num 2 * 3.5
|
74
|
+
:col 2 * #3a4b5c
|
75
75
|
:col
|
76
|
-
:num
|
77
|
-
:col
|
76
|
+
:num #12468a * 0.5
|
77
|
+
:col #121212 * #020304
|
78
78
|
|
79
79
|
#div
|
80
80
|
:num
|
81
|
-
:num
|
82
|
-
:num2
|
81
|
+
:num (10 / 3.0)
|
82
|
+
:num2 (10 / 3)
|
83
83
|
:col
|
84
|
-
:num
|
85
|
-
:col
|
86
|
-
:comp
|
84
|
+
:num #12468a / 2
|
85
|
+
:col #abcdef / #0f0f0f
|
86
|
+
:comp $complex * 1em
|
87
87
|
|
88
88
|
#mod
|
89
89
|
:num
|
90
|
-
:num
|
90
|
+
:num 17 % 3
|
91
91
|
:col
|
92
|
-
:col
|
93
|
-
:num
|
92
|
+
:col #5f6e7d % #10200a
|
93
|
+
:num #aaabac % 3
|
94
94
|
|
95
95
|
#const
|
96
96
|
:escaped
|
97
|
-
:quote
|
98
|
-
:default
|
97
|
+
:quote \$foo \!bar
|
98
|
+
:default $str !important
|
99
99
|
|
100
100
|
#regression
|
101
|
-
:a
|
101
|
+
:a (3 + 2) - 1
|
@@ -0,0 +1 @@
|
|
1
|
+
scss {imported: yes}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
b
|
2
|
-
:foo
|
3
|
-
:bar
|
4
|
-
:baz
|
5
|
-
:many-units
|
6
|
-
:mm
|
7
|
-
:pc
|
8
|
-
:pt
|
9
|
-
:inches
|
10
|
-
:more-inches
|
11
|
-
:mixed
|
2
|
+
:foo 0.5 * 10px
|
3
|
+
:bar 10zzz * 12px / 5zzz
|
4
|
+
:baz percentage(12.0px / 18px)
|
5
|
+
:many-units 10.0zzz / 3yyy * 12px / 5zzz * 3yyy / 3px * 4em
|
6
|
+
:mm 5mm + 1cm
|
7
|
+
:pc 1pc + 12pt
|
8
|
+
:pt 72pt - 2in
|
9
|
+
:inches 1in + 2.54cm
|
10
|
+
:more-inches 1in + ((72pt * 2in) + (36pt * 1in)) / 2.54cm
|
11
|
+
:mixed (1 + (1em * 6px / 3in)) * 4in / 2em
|
data/test/test_helper.rb
CHANGED
@@ -9,11 +9,28 @@ require 'sass'
|
|
9
9
|
|
10
10
|
Sass::RAILS_LOADED = true unless defined?(Sass::RAILS_LOADED)
|
11
11
|
|
12
|
+
module Sass::Script::Functions
|
13
|
+
module UserFunctions; end
|
14
|
+
include UserFunctions
|
15
|
+
|
16
|
+
def option(name)
|
17
|
+
Sass::Script::String.new(@options[name.value.to_sym].to_s)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
12
21
|
class Test::Unit::TestCase
|
13
|
-
def munge_filename(opts)
|
22
|
+
def munge_filename(opts = {})
|
14
23
|
return if opts.has_key?(:filename)
|
15
|
-
|
16
|
-
|
24
|
+
opts[:filename] = filename_for_test(opts[:syntax] || :sass)
|
25
|
+
end
|
26
|
+
|
27
|
+
def filename_for_test(syntax = :sass)
|
28
|
+
test_name = caller.
|
29
|
+
map {|c| Haml::Util.caller_info(c)[2]}.
|
30
|
+
compact.
|
31
|
+
map {|c| c.sub(/^(block|rescue) in /, '')}.
|
32
|
+
find {|c| c =~ /^test_/}
|
33
|
+
"#{test_name}_inline.#{syntax}"
|
17
34
|
end
|
18
35
|
|
19
36
|
def clean_up_sassc
|
@@ -42,9 +59,4 @@ class Test::Unit::TestCase
|
|
42
59
|
return '=' if Haml::Util.ap_geq_3?
|
43
60
|
return '-'
|
44
61
|
end
|
45
|
-
|
46
|
-
def form_for_calling_convention(name)
|
47
|
-
return "@#{name}, :as => :#{name}, :html => {:class => nil, :id => nil}" if Haml::Util.ap_geq_3_beta_3?
|
48
|
-
return ":#{name}, @#{name}"
|
49
|
-
end
|
50
62
|
end
|
data/vendor/fssm/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Travis Tilley
|
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.
|
@@ -0,0 +1,55 @@
|
|
1
|
+
Monitor API
|
2
|
+
===========
|
3
|
+
|
4
|
+
There are three ways you can run the monitor.
|
5
|
+
|
6
|
+
1. call monitor with a path parameter, and define callbacks in a block
|
7
|
+
2. call monitor with a block to configure multiple paths and callbacks
|
8
|
+
3. create a monitor object and run each step manually
|
9
|
+
|
10
|
+
Monitor with path
|
11
|
+
-----------------
|
12
|
+
|
13
|
+
This form watches one path, and enters the run loop automatically. The first parameter is the path to watch, and the second parameter is an optional glob pattern or array of glob patterns that a file must match in order to trigger a callback. The default glob, if ommitted, is `'**/*'`.
|
14
|
+
|
15
|
+
FSSM.monitor('/some/directory/', '**/*') do
|
16
|
+
update {|base, relative|}
|
17
|
+
delete {|base, relative|}
|
18
|
+
create {|base, relative|}
|
19
|
+
end
|
20
|
+
|
21
|
+
Monitor with block
|
22
|
+
------------------
|
23
|
+
|
24
|
+
This form watches one or more paths, and enters the run loop automatically. The glob configuration call can be ommitted, and defaults to `'**/*'`.
|
25
|
+
|
26
|
+
FSSM.monitor do
|
27
|
+
path '/some/directory/' do
|
28
|
+
glob '**/*.yml'
|
29
|
+
|
30
|
+
update {|base, relative|}
|
31
|
+
delete {|base, relative|}
|
32
|
+
create {|base, relative|}
|
33
|
+
end
|
34
|
+
|
35
|
+
path '/some/other/directory/' do
|
36
|
+
update {|base, relative|}
|
37
|
+
delete {|base, relative|}
|
38
|
+
create {|base, relative|}
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
Monitor object
|
43
|
+
--------------
|
44
|
+
|
45
|
+
This form doesn't enter the run loop automatically.
|
46
|
+
|
47
|
+
monitor = FSSM::Monitor.new
|
48
|
+
|
49
|
+
monitor.path '/some/directory/' do
|
50
|
+
update {|base, relative|}
|
51
|
+
delete {|base, relative|}
|
52
|
+
create {|base, relative|}
|
53
|
+
end
|
54
|
+
|
55
|
+
monitor.run
|