sass 3.1.21 → 3.2.0.alpha.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -4
- data/REVISION +1 -1
- data/Rakefile +6 -15
- data/VERSION +1 -1
- data/VERSION_NAME +1 -1
- data/lib/sass.rb +0 -1
- data/lib/sass/cache_stores/base.rb +1 -3
- data/lib/sass/cache_stores/filesystem.rb +0 -3
- data/lib/sass/css.rb +49 -145
- data/lib/sass/engine.rb +23 -47
- data/lib/sass/environment.rb +5 -30
- data/lib/sass/exec.rb +7 -30
- data/lib/sass/importers/base.rb +1 -2
- data/lib/sass/importers/filesystem.rb +13 -18
- data/lib/sass/less.rb +1 -1
- data/lib/sass/plugin.rb +8 -4
- data/lib/sass/plugin/compiler.rb +67 -93
- data/lib/sass/plugin/configuration.rb +2 -0
- data/lib/sass/plugin/staleness_checker.rb +4 -14
- data/lib/sass/repl.rb +3 -2
- data/lib/sass/script.rb +1 -0
- data/lib/sass/script/color.rb +9 -4
- data/lib/sass/script/funcall.rb +3 -16
- data/lib/sass/script/functions.rb +55 -98
- data/lib/sass/script/interpolation.rb +0 -9
- data/lib/sass/script/lexer.rb +4 -2
- data/lib/sass/script/list.rb +0 -8
- data/lib/sass/script/literal.rb +20 -5
- data/lib/sass/script/node.rb +0 -8
- data/lib/sass/script/number.rb +11 -35
- data/lib/sass/script/operation.rb +0 -16
- data/lib/sass/script/parser.rb +5 -12
- data/lib/sass/script/string_interpolation.rb +0 -9
- data/lib/sass/script/unary_operation.rb +0 -7
- data/lib/sass/script/variable.rb +1 -5
- data/lib/sass/scss/parser.rb +54 -191
- data/lib/sass/scss/rx.rb +3 -15
- data/lib/sass/scss/static_parser.rb +3 -3
- data/lib/sass/selector.rb +3 -15
- data/lib/sass/selector/abstract_sequence.rb +2 -11
- data/lib/sass/selector/comma_sequence.rb +3 -8
- data/lib/sass/selector/sequence.rb +11 -74
- data/lib/sass/selector/simple.rb +1 -7
- data/lib/sass/selector/simple_sequence.rb +8 -28
- data/lib/sass/shared.rb +5 -3
- data/lib/sass/tree/comment_node.rb +12 -25
- data/lib/sass/tree/debug_node.rb +1 -1
- data/lib/sass/tree/directive_node.rb +0 -5
- data/lib/sass/tree/each_node.rb +1 -1
- data/lib/sass/tree/extend_node.rb +1 -1
- data/lib/sass/tree/for_node.rb +2 -2
- data/lib/sass/tree/function_node.rb +1 -1
- data/lib/sass/tree/if_node.rb +14 -1
- data/lib/sass/tree/media_node.rb +4 -4
- data/lib/sass/tree/mixin_def_node.rb +1 -1
- data/lib/sass/tree/mixin_node.rb +2 -2
- data/lib/sass/tree/node.rb +26 -10
- data/lib/sass/tree/return_node.rb +1 -1
- data/lib/sass/tree/root_node.rb +1 -1
- data/lib/sass/tree/rule_node.rb +11 -9
- data/lib/sass/tree/variable_node.rb +1 -1
- data/lib/sass/tree/visitors/base.rb +1 -1
- data/lib/sass/tree/visitors/check_nesting.rb +36 -29
- data/lib/sass/tree/visitors/convert.rb +9 -16
- data/lib/sass/tree/visitors/cssize.rb +9 -40
- data/lib/sass/tree/visitors/perform.rb +23 -79
- data/lib/sass/tree/visitors/to_css.rb +21 -23
- data/lib/sass/tree/warn_node.rb +1 -1
- data/lib/sass/tree/while_node.rb +1 -1
- data/lib/sass/util.rb +9 -147
- data/lib/sass/version.rb +0 -14
- data/test/sass/cache_test.rb +0 -15
- data/test/sass/conversion_test.rb +8 -50
- data/test/sass/css2sass_test.rb +0 -33
- data/test/sass/engine_test.rb +32 -283
- data/test/sass/extend_test.rb +0 -315
- data/test/sass/functions_test.rb +23 -60
- data/test/sass/importer_test.rb +0 -110
- data/test/sass/more_results/more_import.css +2 -2
- data/test/sass/plugin_test.rb +13 -40
- data/test/sass/results/import.css +2 -2
- data/test/sass/results/import_charset.css +0 -1
- data/test/sass/results/import_charset_1_8.css +0 -1
- data/test/sass/results/import_charset_ibm866.css +0 -1
- data/test/sass/results/scss_import.css +2 -2
- data/test/sass/results/units.css +1 -1
- data/test/sass/script_conversion_test.rb +0 -2
- data/test/sass/script_test.rb +4 -28
- data/test/sass/scss/css_test.rb +1 -79
- data/test/sass/scss/scss_test.rb +16 -96
- data/test/sass/templates/import_charset.sass +0 -2
- data/test/sass/templates/import_charset_1_8.sass +0 -2
- data/test/sass/templates/import_charset_ibm866.sass +0 -2
- data/test/sass/test_helper.rb +1 -1
- data/test/sass/util_test.rb +0 -28
- data/test/test_helper.rb +0 -2
- data/vendor/{listen → fssm}/LICENSE +1 -1
- 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 +246 -281
- data/VERSION_DATE +0 -1
- data/lib/sass/logger.rb +0 -15
- data/lib/sass/logger/base.rb +0 -32
- data/lib/sass/logger/log_level.rb +0 -49
- data/lib/sass/tree/visitors/deep_copy.rb +0 -87
- data/lib/sass/tree/visitors/extend.rb +0 -42
- data/lib/sass/tree/visitors/set_options.rb +0 -97
- data/lib/sass/util/multibyte_string_scanner.rb +0 -134
- data/test/Gemfile +0 -4
- data/test/Gemfile.lock +0 -19
- data/test/sass/fixtures/test_staleness_check_across_importers.css +0 -1
- data/test/sass/fixtures/test_staleness_check_across_importers.scss +0 -1
- data/test/sass/logger_test.rb +0 -58
- data/test/sass/templates/_double_import_loop2.sass +0 -1
- data/test/sass/templates/bork5.sass +0 -3
- data/test/sass/templates/double_import_loop1.sass +0 -1
- data/test/sass/templates/nested_bork5.sass +0 -2
- data/test/sass/templates/single_import_loop.sass +0 -1
- data/test/sass/util/multibyte_string_scanner_test.rb +0 -147
- data/vendor/listen/CHANGELOG.md +0 -147
- data/vendor/listen/Gemfile +0 -23
- data/vendor/listen/Guardfile +0 -8
- data/vendor/listen/README.md +0 -312
- data/vendor/listen/Rakefile +0 -47
- data/vendor/listen/Vagrantfile +0 -96
- data/vendor/listen/lib/listen.rb +0 -38
- data/vendor/listen/lib/listen/adapter.rb +0 -167
- data/vendor/listen/lib/listen/adapters/darwin.rb +0 -84
- data/vendor/listen/lib/listen/adapters/linux.rb +0 -110
- data/vendor/listen/lib/listen/adapters/polling.rb +0 -66
- data/vendor/listen/lib/listen/adapters/windows.rb +0 -81
- data/vendor/listen/lib/listen/directory_record.rb +0 -318
- data/vendor/listen/lib/listen/listener.rb +0 -203
- data/vendor/listen/lib/listen/multi_listener.rb +0 -121
- data/vendor/listen/lib/listen/turnstile.rb +0 -28
- data/vendor/listen/lib/listen/version.rb +0 -3
- data/vendor/listen/listen.gemspec +0 -26
- data/vendor/listen/spec/listen/adapter_spec.rb +0 -142
- data/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -31
- data/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -41
- data/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
- data/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -24
- data/vendor/listen/spec/listen/directory_record_spec.rb +0 -1138
- data/vendor/listen/spec/listen/listener_spec.rb +0 -155
- data/vendor/listen/spec/listen/multi_listener_spec.rb +0 -156
- data/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
- data/vendor/listen/spec/listen_spec.rb +0 -73
- data/vendor/listen/spec/spec_helper.rb +0 -18
- data/vendor/listen/spec/support/adapter_helper.rb +0 -716
- data/vendor/listen/spec/support/directory_record_helper.rb +0 -55
- data/vendor/listen/spec/support/fixtures_helper.rb +0 -29
- data/vendor/listen/spec/support/listeners_helper.rb +0 -144
- data/vendor/listen/spec/support/platform_helper.rb +0 -11
data/test/Gemfile
DELETED
data/test/Gemfile.lock
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
less (1.2.21)
|
5
|
-
mutter (>= 0.4.2)
|
6
|
-
treetop (>= 1.4.2)
|
7
|
-
mutter (0.5.3)
|
8
|
-
polyglot (0.3.2)
|
9
|
-
rake (0.9.2)
|
10
|
-
treetop (1.4.10)
|
11
|
-
polyglot
|
12
|
-
polyglot (>= 0.3.1)
|
13
|
-
|
14
|
-
PLATFORMS
|
15
|
-
ruby
|
16
|
-
|
17
|
-
DEPENDENCIES
|
18
|
-
less (< 2.0.0)
|
19
|
-
rake
|
@@ -1 +0,0 @@
|
|
1
|
-
.pear { color: green; }
|
@@ -1 +0,0 @@
|
|
1
|
-
@import "apple";
|
data/test/sass/logger_test.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
3
|
-
require 'pathname'
|
4
|
-
|
5
|
-
class LoggerTest < Test::Unit::TestCase
|
6
|
-
|
7
|
-
class InterceptedLogger < Sass::Logger::Base
|
8
|
-
|
9
|
-
attr_accessor :messages
|
10
|
-
|
11
|
-
def initialize(*args)
|
12
|
-
super
|
13
|
-
self.messages = []
|
14
|
-
end
|
15
|
-
|
16
|
-
def reset!
|
17
|
-
self.messages = []
|
18
|
-
end
|
19
|
-
|
20
|
-
def _log(*args)
|
21
|
-
messages << [args]
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_global_sass_logger_instance_exists
|
27
|
-
assert Sass.logger.respond_to?(:warn)
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_log_level_orders
|
31
|
-
logged_levels = {
|
32
|
-
:trace => [ [], [:trace, :debug, :info, :warn, :error]],
|
33
|
-
:debug => [ [:trace], [:debug, :info, :warn, :error]],
|
34
|
-
:info => [ [:trace, :debug], [:info, :warn, :error]],
|
35
|
-
:warn => [ [:trace, :debug, :info], [:warn, :error]],
|
36
|
-
:error => [ [:trace, :debug, :info, :warn], [:error]]
|
37
|
-
}
|
38
|
-
logged_levels.each do |level, (should_not_be_logged, should_be_logged)|
|
39
|
-
logger = Sass::Logger::Base.new(level)
|
40
|
-
should_not_be_logged.each do |should_level|
|
41
|
-
assert !logger.logging_level?(should_level)
|
42
|
-
end
|
43
|
-
should_be_logged.each do |should_level|
|
44
|
-
assert logger.logging_level?(should_level)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def test_logging_can_be_disabled
|
50
|
-
logger = InterceptedLogger.new
|
51
|
-
logger.error("message #1")
|
52
|
-
assert_equal 1, logger.messages.size
|
53
|
-
logger.reset!
|
54
|
-
logger.disabled = true
|
55
|
-
logger.error("message #2")
|
56
|
-
assert_equal 0, logger.messages.size
|
57
|
-
end
|
58
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
@import "double_import_loop1"
|
@@ -1 +0,0 @@
|
|
1
|
-
@import "double_import_loop2"
|
@@ -1 +0,0 @@
|
|
1
|
-
@import "single_import_loop"
|
@@ -1,147 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
require File.dirname(__FILE__) + '/../../test_helper'
|
4
|
-
|
5
|
-
unless Sass::Util.ruby1_8?
|
6
|
-
class MultibyteStringScannerTest < Test::Unit::TestCase
|
7
|
-
def setup
|
8
|
-
@scanner = Sass::Util::MultibyteStringScanner.new("cölorfül")
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_initial
|
12
|
-
assert_scanner_state 0, 0, nil, nil
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_check
|
16
|
-
assert_equal 'cö', @scanner.check(/../)
|
17
|
-
assert_scanner_state 0, 0, 2, 3
|
18
|
-
assert_equal 0, @scanner.pos
|
19
|
-
assert_equal 0, @scanner.pos
|
20
|
-
assert_equal 2, @scanner.matched_size
|
21
|
-
assert_equal 3, @scanner.byte_matched_size
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_check_until
|
25
|
-
assert_equal 'cölorfü', @scanner.check_until(/f./)
|
26
|
-
assert_scanner_state 0, 0, 2, 3
|
27
|
-
end
|
28
|
-
|
29
|
-
def test_getch
|
30
|
-
assert_equal 'c', @scanner.getch
|
31
|
-
assert_equal 'ö', @scanner.getch
|
32
|
-
assert_scanner_state 2, 3, 1, 2
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_match?
|
36
|
-
assert_equal 2, @scanner.match?(/../)
|
37
|
-
assert_scanner_state 0, 0, 2, 3
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_peek
|
41
|
-
assert_equal 'cö', @scanner.peek(2)
|
42
|
-
assert_scanner_state 0, 0, nil, nil
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_rest_size
|
46
|
-
assert_equal 'cö', @scanner.scan(/../)
|
47
|
-
assert_equal 6, @scanner.rest_size
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_scan
|
51
|
-
assert_equal 'cö', @scanner.scan(/../)
|
52
|
-
assert_scanner_state 2, 3, 2, 3
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_scan_until
|
56
|
-
assert_equal 'cölorfü', @scanner.scan_until(/f./)
|
57
|
-
assert_scanner_state 7, 9, 2, 3
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_skip
|
61
|
-
assert_equal 2, @scanner.skip(/../)
|
62
|
-
assert_scanner_state 2, 3, 2, 3
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_skip_until
|
66
|
-
assert_equal 7, @scanner.skip_until(/f./)
|
67
|
-
assert_scanner_state 7, 9, 2, 3
|
68
|
-
end
|
69
|
-
|
70
|
-
def test_set_pos
|
71
|
-
@scanner.pos = 7
|
72
|
-
assert_scanner_state 7, 9, nil, nil
|
73
|
-
@scanner.pos = 6
|
74
|
-
assert_scanner_state 6, 7, nil, nil
|
75
|
-
@scanner.pos = 1
|
76
|
-
assert_scanner_state 1, 1, nil, nil
|
77
|
-
end
|
78
|
-
|
79
|
-
def test_reset
|
80
|
-
@scanner.scan(/../)
|
81
|
-
@scanner.reset
|
82
|
-
assert_scanner_state 0, 0, nil, nil
|
83
|
-
end
|
84
|
-
|
85
|
-
def test_scan_full
|
86
|
-
assert_equal 'cö', @scanner.scan_full(/../, true, true)
|
87
|
-
assert_scanner_state 2, 3, 2, 3
|
88
|
-
|
89
|
-
@scanner.reset
|
90
|
-
assert_equal 'cö', @scanner.scan_full(/../, false, true)
|
91
|
-
assert_scanner_state 0, 0, 2, 3
|
92
|
-
|
93
|
-
@scanner.reset
|
94
|
-
assert_nil @scanner.scan_full(/../, true, false)
|
95
|
-
assert_scanner_state 2, 3, 2, 3
|
96
|
-
|
97
|
-
@scanner.reset
|
98
|
-
assert_nil @scanner.scan_full(/../, false, false)
|
99
|
-
assert_scanner_state 0, 0, 2, 3
|
100
|
-
end
|
101
|
-
|
102
|
-
def test_search_full
|
103
|
-
assert_equal 'cölorfü', @scanner.search_full(/f./, true, true)
|
104
|
-
assert_scanner_state 7, 9, 2, 3
|
105
|
-
|
106
|
-
@scanner.reset
|
107
|
-
assert_equal 'cölorfü', @scanner.search_full(/f./, false, true)
|
108
|
-
assert_scanner_state 0, 0, 2, 3
|
109
|
-
|
110
|
-
@scanner.reset
|
111
|
-
assert_nil @scanner.search_full(/f./, true, false)
|
112
|
-
assert_scanner_state 7, 9, 2, 3
|
113
|
-
|
114
|
-
@scanner.reset
|
115
|
-
assert_nil @scanner.search_full(/f./, false, false)
|
116
|
-
assert_scanner_state 0, 0, 2, 3
|
117
|
-
end
|
118
|
-
|
119
|
-
def test_set_string
|
120
|
-
@scanner.scan(/../)
|
121
|
-
@scanner.string = 'föóbâr'
|
122
|
-
assert_scanner_state 0, 0, nil, nil
|
123
|
-
end
|
124
|
-
|
125
|
-
def test_terminate
|
126
|
-
@scanner.scan(/../)
|
127
|
-
@scanner.terminate
|
128
|
-
assert_scanner_state 8, 10, nil, nil
|
129
|
-
end
|
130
|
-
|
131
|
-
def test_unscan
|
132
|
-
@scanner.scan(/../)
|
133
|
-
@scanner.scan_until(/f./)
|
134
|
-
@scanner.unscan
|
135
|
-
assert_scanner_state 2, 3, nil, nil
|
136
|
-
end
|
137
|
-
|
138
|
-
private
|
139
|
-
|
140
|
-
def assert_scanner_state(pos, byte_pos, matched_size, byte_matched_size)
|
141
|
-
assert_equal pos, @scanner.pos, 'pos'
|
142
|
-
assert_equal byte_pos, @scanner.byte_pos, 'byte_pos'
|
143
|
-
assert_equal matched_size, @scanner.matched_size, 'matched_size'
|
144
|
-
assert_equal byte_matched_size, @scanner.byte_matched_size, 'byte_matched_size'
|
145
|
-
end
|
146
|
-
end
|
147
|
-
end
|
data/vendor/listen/CHANGELOG.md
DELETED
@@ -1,147 +0,0 @@
|
|
1
|
-
## 0.4.7 - June 27, 2012
|
2
|
-
|
3
|
-
### Bug fixes
|
4
|
-
|
5
|
-
- Increase latency to 0.25, to avoid useless polling fallback. (fixed by [@thibaudgg][])
|
6
|
-
- Change watched inotify events, to avoid duplication callback. (fixed by [@thibaudgg][])
|
7
|
-
- [#41](https://github.com/guard/listen/issues/41) Use lstat instead of stat when calculating mtime. (fixed by [@ebroder][])
|
8
|
-
|
9
|
-
## 0.4.6 - June 20, 2012
|
10
|
-
|
11
|
-
### Bug fix
|
12
|
-
|
13
|
-
- [#39](https://github.com/guard/listen/issues/39) Fix digest race condition. (fixed by [@dkubb][])
|
14
|
-
|
15
|
-
## 0.4.5 - June 13, 2012
|
16
|
-
|
17
|
-
### Bug fix
|
18
|
-
|
19
|
-
- [#39](https://github.com/guard/listen/issues/39) Rescue Errno::ENOENT when path inserted doesn't exist. (reported by [@textgoeshere][], fixed by [@thibaudgg][] and [@rymai][])
|
20
|
-
|
21
|
-
## 0.4.4 - June 8, 2012
|
22
|
-
|
23
|
-
### Bug fixes
|
24
|
-
|
25
|
-
- ~~[#39](https://github.com/guard/listen/issues/39) Non-existing path insertion bug. (reported by [@textgoeshere][], fixed by [@thibaudgg][])~~
|
26
|
-
- Fix relative path for directories containing special characters. (reported by [@napcs][], fixed by [@netzpirat][])
|
27
|
-
|
28
|
-
## 0.4.3 - June 6, 2012
|
29
|
-
|
30
|
-
### Bug fixes
|
31
|
-
|
32
|
-
- [#24](https://github.com/guard/listen/issues/24) Fail gracefully when the inotify limit is not enough for Listen to function. (reported by [@daemonza][], fixed by [@Maher4Ever][])
|
33
|
-
- [#32](https://github.com/guard/listen/issues/32) Fix a crash when trying to calculate the checksum of unreadable files. (reported by [@nex3][], fixed by [@Maher4Ever][])
|
34
|
-
|
35
|
-
### Improvements
|
36
|
-
|
37
|
-
- Add `#relative_paths` method to listeners. ([@Maher4Ever][])
|
38
|
-
- Add `#started?` query-method to adapters. ([@Maher4Ever][])
|
39
|
-
- Dynamically detect the mtime precision used on a system. ([@Maher4Ever][] with help from [@nex3][])
|
40
|
-
|
41
|
-
## 0.4.2 - May 1, 2012
|
42
|
-
|
43
|
-
### Bug fixes
|
44
|
-
|
45
|
-
- [#21](https://github.com/guard/listen/issues/21) Issues when listening to changes in relative paths. (reported by [@akerbos][], fixed by [@Maher4Ever][])
|
46
|
-
- [#27](https://github.com/guard/listen/issues/27) Wrong reports for files modifications. (reported by [@cobychapple][], fixed by [@Maher4Ever][])
|
47
|
-
- Fix segmentation fault when profiling on Windows. ([@Maher4Ever][])
|
48
|
-
- Fix redundant watchers on Windows. ([@Maher4Ever][])
|
49
|
-
|
50
|
-
### Improvements
|
51
|
-
|
52
|
-
- [#17](https://github.com/guard/listen/issues/17) Use regexp-patterns with the `ignore` method instead of supplying paths. (reported by [@fny][], added by [@Maher4Ever][])
|
53
|
-
- Speed improvement when listening to changes in directories with ignored paths. ([@Maher4Ever][])
|
54
|
-
- Added `.rbx` and `.svn` to ignored directories. ([@Maher4Ever][])
|
55
|
-
|
56
|
-
## 0.4.1 - April 15, 2012
|
57
|
-
|
58
|
-
### Bug fix
|
59
|
-
|
60
|
-
- [#18](https://github.com/guard/listen/issues/18) Listener crashes when removing directories with nested paths. (reported by [@daemonza][], fixed by [@Maher4Ever][])
|
61
|
-
|
62
|
-
## 0.4.0 - April 9, 2012
|
63
|
-
|
64
|
-
### New features
|
65
|
-
|
66
|
-
- Add `wait_for_callback` method to all adapters. ([@Maher4Ever][])
|
67
|
-
- Add `Listen::MultiListener` class to listen to multiple directories at once. ([@Maher4Ever][])
|
68
|
-
- Allow passing multiple directories to the `Listen.to` method. ([@Maher4Ever][])
|
69
|
-
- Add `blocking` option to `Listen#start` which can be used to disable blocking the current thread upon starting. ([@Maher4Ever][])
|
70
|
-
- Use absolute-paths in callbacks by default instead of relative-paths. ([@Maher4Ever][])
|
71
|
-
- Add `relative_paths` option to `Listen::Listener` to retain the old functionality. ([@Maher4Ever][])
|
72
|
-
|
73
|
-
### Improvements
|
74
|
-
|
75
|
-
- Encapsulate thread spawning in the linux-adapter. ([@Maher4Ever][])
|
76
|
-
- Encapsulate thread spawning in the darwin-adapter. ([@Maher4Ever][] with [@scottdavis][] help)
|
77
|
-
- Encapsulate thread spawning in the windows-adapter. ([@Maher4Ever][])
|
78
|
-
- Fix linux-adapter bug where Listen would report file-modification events on the parent-directory. ([@Maher4Ever][])
|
79
|
-
|
80
|
-
### Change
|
81
|
-
|
82
|
-
- Remove `wait_until_listening` as adapters doesn't need to run inside threads anymore ([@Maher4Ever][])
|
83
|
-
|
84
|
-
## 0.3.3 - March 6, 2012
|
85
|
-
|
86
|
-
### Improvement
|
87
|
-
|
88
|
-
- Improve pause/unpause. ([@thibaudgg][])
|
89
|
-
|
90
|
-
## 0.3.2 - March 4, 2012
|
91
|
-
|
92
|
-
### New feature
|
93
|
-
|
94
|
-
- Add pause/unpause listener's methods. ([@thibaudgg][])
|
95
|
-
|
96
|
-
## 0.3.1 - February 22, 2012
|
97
|
-
|
98
|
-
### Bug fix
|
99
|
-
|
100
|
-
- [#9](https://github.com/guard/listen/issues/9) Ignore doesn't seem to work. (reported by [@markiz][], fixed by [@thibaudgg][])
|
101
|
-
|
102
|
-
## 0.3.0 - February 21, 2012
|
103
|
-
|
104
|
-
### New features
|
105
|
-
|
106
|
-
- Add automatic fallback to polling if system adapter doesn't work (like a DropBox folder). ([@thibaudgg][])
|
107
|
-
- Add latency and force_polling options. ([@Maher4Ever][])
|
108
|
-
|
109
|
-
## 0.2.0 - February 13, 2012
|
110
|
-
|
111
|
-
### New features
|
112
|
-
|
113
|
-
- Add checksum comparaison support for detecting consecutive file modifications made during the same second. ([@thibaudgg][])
|
114
|
-
- Add rb-fchange support. ([@thibaudgg][])
|
115
|
-
- Add rb-inotify support. ([@thibaudgg][] with [@Maher4Ever][] help)
|
116
|
-
- Add rb-fsevent support. ([@thibaudgg][])
|
117
|
-
- Add non-recursive diff with multiple directories support. ([@thibaudgg][])
|
118
|
-
- Ignore .DS_Store by default. ([@thibaudgg][])
|
119
|
-
|
120
|
-
## 0.1.0 - January 28, 2012
|
121
|
-
|
122
|
-
- First version with only a polling adapter and basic features set (ignore & filter). ([@thibaudgg][])
|
123
|
-
|
124
|
-
<!--- The following link definition list is generated by PimpMyChangelog --->
|
125
|
-
[#9]: https://github.com/guard/listen/issues/9
|
126
|
-
[#17]: https://github.com/guard/listen/issues/17
|
127
|
-
[#18]: https://github.com/guard/listen/issues/18
|
128
|
-
[#21]: https://github.com/guard/listen/issues/21
|
129
|
-
[#24]: https://github.com/guard/listen/issues/24
|
130
|
-
[#27]: https://github.com/guard/listen/issues/27
|
131
|
-
[#32]: https://github.com/guard/listen/issues/32
|
132
|
-
[#39]: https://github.com/guard/listen/issues/39
|
133
|
-
[@Maher4Ever]: https://github.com/Maher4Ever
|
134
|
-
[@dkubb]: https://github.com/dkubb
|
135
|
-
[@ebroder]: https://github.com/ebroder
|
136
|
-
[@akerbos]: https://github.com/akerbos
|
137
|
-
[@cobychapple]: https://github.com/cobychapple
|
138
|
-
[@daemonza]: https://github.com/daemonza
|
139
|
-
[@fny]: https://github.com/fny
|
140
|
-
[@markiz]: https://github.com/markiz
|
141
|
-
[@napcs]: https://github.com/napcs
|
142
|
-
[@netzpirat]: https://github.com/netzpirat
|
143
|
-
[@nex3]: https://github.com/nex3
|
144
|
-
[@rymai]: https://github.com/rymai
|
145
|
-
[@scottdavis]: https://github.com/scottdavis
|
146
|
-
[@textgoeshere]: https://github.com/textgoeshere
|
147
|
-
[@thibaudgg]: https://github.com/thibaudgg
|
data/vendor/listen/Gemfile
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
source :rubygems
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
gem 'rake'
|
6
|
-
|
7
|
-
group :development do
|
8
|
-
platform :ruby do
|
9
|
-
gem 'coolline'
|
10
|
-
end
|
11
|
-
|
12
|
-
gem 'guard'
|
13
|
-
gem 'guard-rspec'
|
14
|
-
gem 'yard'
|
15
|
-
gem 'redcarpet'
|
16
|
-
gem 'pry'
|
17
|
-
|
18
|
-
gem 'vagrant'
|
19
|
-
end
|
20
|
-
|
21
|
-
group :test do
|
22
|
-
gem 'rspec'
|
23
|
-
end
|
data/vendor/listen/Guardfile
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
guard :rspec, :all_on_start => false, :all_after_pass => false, :cli => '--fail-fast --format doc' do
|
2
|
-
watch(%r{^spec/.+_spec\.rb$})
|
3
|
-
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
4
|
-
watch('spec/support/adapter_helper.rb') { "spec/listen/adapters" }
|
5
|
-
watch('spec/support/listener_helper.rb') { "spec/listen/listener_spec.rb" }
|
6
|
-
watch('spec/support/fixtures_helper.rb') { "spec" }
|
7
|
-
watch('spec/spec_helper.rb') { "spec" }
|
8
|
-
end
|
data/vendor/listen/README.md
DELETED
@@ -1,312 +0,0 @@
|
|
1
|
-
# Listen [![Build Status](https://secure.travis-ci.org/guard/listen.png?branch=master)](http://travis-ci.org/guard/listen)
|
2
|
-
|
3
|
-
The Listen gem listens to file modifications and notifies you about the changes.
|
4
|
-
|
5
|
-
## Features
|
6
|
-
|
7
|
-
* Works everywhere!
|
8
|
-
* Supports watching multiple directories from a single listener.
|
9
|
-
* OS-specific adapters for Mac OS X 10.6+, Linux and Windows.
|
10
|
-
* Automatic fallback to polling if OS-specific adapter doesn't work.
|
11
|
-
* Detects files modification, addidation and removal.
|
12
|
-
* Checksum comparaison for modifications made under the same second.
|
13
|
-
* Allows supplying regexp-patterns to ignore and filter paths for better results.
|
14
|
-
* Tested on all Ruby environments via [travis-ci](http://travis-ci.org/guard/listen).
|
15
|
-
|
16
|
-
## Install
|
17
|
-
|
18
|
-
``` bash
|
19
|
-
gem install listen
|
20
|
-
```
|
21
|
-
|
22
|
-
## Usage
|
23
|
-
|
24
|
-
There are **two ways** to use Listen:
|
25
|
-
|
26
|
-
1. Call `Listen.to` with either a single directory or multiple directories, then define the `change` callback in a block.
|
27
|
-
2. Create a `listener` object and use it in an (ARel style) chainable way.
|
28
|
-
|
29
|
-
Feel free to give your feeback via [Listen issues](https://github.com/guard/listen/issues)
|
30
|
-
|
31
|
-
### Block API
|
32
|
-
|
33
|
-
``` ruby
|
34
|
-
# Listen to a single directory.
|
35
|
-
Listen.to('dir/path/to/listen', :filter => /\.rb$/, :ignore => %r{ignored/path/}) do |modified, added, removed|
|
36
|
-
# ...
|
37
|
-
end
|
38
|
-
|
39
|
-
# Listen to multiple directories.
|
40
|
-
Listen.to('dir/to/awesome_app', 'dir/to/other_app', :filter => /\.rb$/, :latency => 0.1) do |modified, added, removed|
|
41
|
-
# ...
|
42
|
-
end
|
43
|
-
```
|
44
|
-
|
45
|
-
### "Object" API
|
46
|
-
|
47
|
-
``` ruby
|
48
|
-
listener = Listen.to('dir/path/to/listen')
|
49
|
-
listener = listener.ignore(%r{^ignored/path/})
|
50
|
-
listener = listener.filter(/\.rb$/)
|
51
|
-
listener = listener.latency(0.5)
|
52
|
-
listener = listener.force_polling(true)
|
53
|
-
listener = listener.polling_fallback_message(false)
|
54
|
-
listener = listener.change(&callback)
|
55
|
-
listener.start # blocks execution!
|
56
|
-
```
|
57
|
-
|
58
|
-
### Chainable
|
59
|
-
|
60
|
-
``` ruby
|
61
|
-
Listen.to('dir/path/to/listen')
|
62
|
-
.ignore(%r{^ignored/path/})
|
63
|
-
.filter(/\.rb$/)
|
64
|
-
.latency(0.5)
|
65
|
-
.force_polling(true)
|
66
|
-
.polling_fallback_message('custom message')
|
67
|
-
.change(&callback)
|
68
|
-
.start # blocks execution!
|
69
|
-
```
|
70
|
-
|
71
|
-
### Pause/Unpause
|
72
|
-
|
73
|
-
Listener can also easily be paused/unpaused:
|
74
|
-
|
75
|
-
``` ruby
|
76
|
-
listener = Listen.to('dir/path/to/listen')
|
77
|
-
listener.start(false) # non-blocking mode
|
78
|
-
listener.pause # stop listening to changes
|
79
|
-
listener.paused? # => true
|
80
|
-
listener.unpause
|
81
|
-
listener.stop
|
82
|
-
```
|
83
|
-
|
84
|
-
## Listening to changes on multiple directories
|
85
|
-
|
86
|
-
The Listen gem provides the `MultiListener` class to watch multiple directories and
|
87
|
-
handle their changes from a single listener:
|
88
|
-
|
89
|
-
```ruby
|
90
|
-
listener = Listen::MultiListener.new('app/css', 'app/js')
|
91
|
-
listener.latency(0.5)
|
92
|
-
|
93
|
-
# Configure the listener to your needs...
|
94
|
-
|
95
|
-
listener.start # blocks execution!
|
96
|
-
````
|
97
|
-
|
98
|
-
For an easier access, the `Listen.to` method can also be used to create a multi-listener:
|
99
|
-
|
100
|
-
``` ruby
|
101
|
-
listener = Listen.to('app/css', 'app/js')
|
102
|
-
.ignore(%r{^vendor/}) # both js/vendor and css/vendor will be ignored
|
103
|
-
.change(&assets_callback)
|
104
|
-
|
105
|
-
listener.start # blocks execution!
|
106
|
-
```
|
107
|
-
|
108
|
-
## Changes callback
|
109
|
-
|
110
|
-
Changes to the listened-to directories gets reported back to the user in a callback.
|
111
|
-
The registered callback gets invoked, when there are changes, with **three** parameters:
|
112
|
-
`modified_paths`, `added_paths` and `removed_paths` in that particular order.
|
113
|
-
|
114
|
-
You can register a callback in two ways. The first way is by passing a block when calling
|
115
|
-
the `Listen.to` method or when initializing a listener object:
|
116
|
-
|
117
|
-
```ruby
|
118
|
-
Listen.to('path/to/app') do |modified, added, removed|
|
119
|
-
# This block will be called when there are changes.
|
120
|
-
end
|
121
|
-
|
122
|
-
# or ...
|
123
|
-
|
124
|
-
listener = Listen::Listener.new('path/to/app') do |modified, added, removed|
|
125
|
-
# This block will be called when there are changes.
|
126
|
-
end
|
127
|
-
|
128
|
-
```
|
129
|
-
|
130
|
-
The second way to register a callback is be calling the `change` method on any
|
131
|
-
listener passing it a block:
|
132
|
-
|
133
|
-
```ruby
|
134
|
-
# Create a callback
|
135
|
-
callback = Proc.new do |modified, added, removed|
|
136
|
-
# This proc will be called when there are changes.
|
137
|
-
end
|
138
|
-
|
139
|
-
listener = Listen.to('dir')
|
140
|
-
listener.change(&callback) # convert the callback to a block and register it
|
141
|
-
|
142
|
-
listener.start # blocks execution
|
143
|
-
```
|
144
|
-
|
145
|
-
### Paths in callbacks
|
146
|
-
|
147
|
-
Listeners invoke callbacks passing them absolute paths by default:
|
148
|
-
|
149
|
-
```ruby
|
150
|
-
# Assume someone changes the 'style.css' file in '/home/user/app/css' after creating
|
151
|
-
# the listener.
|
152
|
-
Listen.to('/home/user/app/css') do |modified, added, removed|
|
153
|
-
modified.inspect # => ['/home/user/app/css/style.css']
|
154
|
-
end
|
155
|
-
```
|
156
|
-
|
157
|
-
#### Relative paths in callbacks
|
158
|
-
|
159
|
-
When creating a listener for a **single** path (more specifically a `Listen::Listener` instance),
|
160
|
-
you can pass `:relative_paths => true` as an option to get relative paths in
|
161
|
-
your callback:
|
162
|
-
|
163
|
-
```ruby
|
164
|
-
# Assume someone changes the 'style.css' file in '/home/user/app/css' after creating
|
165
|
-
# the listener.
|
166
|
-
Listen.to('/home/user/app/css', :relative_paths => true) do |modified, added, removed|
|
167
|
-
modified.inspect # => ['style.css']
|
168
|
-
end
|
169
|
-
```
|
170
|
-
|
171
|
-
Passing the `:relative_paths => true` option won't work when listeneing to multiple
|
172
|
-
directories:
|
173
|
-
|
174
|
-
```ruby
|
175
|
-
# Assume someone changes the 'style.css' file in '/home/user/app/css' after creating
|
176
|
-
# the listener.
|
177
|
-
Listen.to('/home/user/app/css', '/home/user/app/js', :relative_paths => true) do |modified, added, removed|
|
178
|
-
modified.inspect # => ['/home/user/app/css/style.css']
|
179
|
-
end
|
180
|
-
```
|
181
|
-
|
182
|
-
## Options
|
183
|
-
|
184
|
-
These options can be set through `Listen.to` params or via methods (see the "Object" API)
|
185
|
-
|
186
|
-
```ruby
|
187
|
-
:filter => /\.rb$/, /\.coffee$/ # Filter files to listen to via a regexps list.
|
188
|
-
# default: none
|
189
|
-
|
190
|
-
:ignore => %r{app/CMake/}, /\.pid$/ # Ignore a list of paths (root directory or sub-dir)
|
191
|
-
# default: See DEFAULT_IGNORED_DIRECTORIES and DEFAULT_IGNORED_EXTENSIONS in Listen::DirectoryRecord
|
192
|
-
|
193
|
-
:latency => 0.5 # Set the delay (**in seconds**) between checking for changes
|
194
|
-
# default: 0.25 sec (1.0 sec for polling)
|
195
|
-
|
196
|
-
:relative_paths => true # Enable the use of relative paths in the callback.
|
197
|
-
# default: false
|
198
|
-
|
199
|
-
:force_polling => true # Force the use of the polling adapter
|
200
|
-
# default: none
|
201
|
-
|
202
|
-
:polling_fallback_message => 'custom message' # Set a custom polling fallback message (or disable it with `false`)
|
203
|
-
# default: "WARNING: Listen fallen back to polling, learn more at https://github.com/guard/listen#fallback."
|
204
|
-
```
|
205
|
-
|
206
|
-
### The patterns for filtering and ignoring paths
|
207
|
-
|
208
|
-
Just like the unix convention of beginning absolute paths with the
|
209
|
-
directory-separator (forward slash `/` in unix) and with no prefix for relative paths,
|
210
|
-
Listen doesn't prefix relative paths (to the watched directory) with a directory-separator.
|
211
|
-
|
212
|
-
Therefore make sure _NOT_ to prefix your regexp-patterns for filtering or ignoring paths
|
213
|
-
with a directory-separator, otherwise they won't work as expected.
|
214
|
-
|
215
|
-
As an example: to ignore the `build` directory in a C-project, use `%r{build/}`
|
216
|
-
and not `%r{/build/}`.
|
217
|
-
|
218
|
-
### Non-blocking listening to changes
|
219
|
-
|
220
|
-
Starting a listener blocks the current thread by default. That means any code after the
|
221
|
-
`start` call won't be run until the listener is stopped (which needs to be done from another thread).
|
222
|
-
|
223
|
-
For advanced usage there is an option to disable this behavior and have the listener start working
|
224
|
-
in the background without blocking. To enable non-blocking listening the `start` method of
|
225
|
-
the listener (be it `Listener` or `MultiListener`) needs to be called with `false` as a parameter.
|
226
|
-
|
227
|
-
Here is an example of using a listener in the non-blocking mode:
|
228
|
-
|
229
|
-
```ruby
|
230
|
-
listener = Listen.to('dir/path/to/listen')
|
231
|
-
listener.start(false) # doesn't block execution
|
232
|
-
|
233
|
-
# Code here will run immediately after starting the listener
|
234
|
-
|
235
|
-
```
|
236
|
-
|
237
|
-
**note**: Using the `Listen.to` helper-method with a callback-block will always
|
238
|
-
block execution. See the "Block API" section for an example.
|
239
|
-
|
240
|
-
## Listen adapters
|
241
|
-
|
242
|
-
The Listen gem has a set of adapters to notify it when there are changes.
|
243
|
-
There are 3 OS-specific adapters to support Mac, Linux and Windows. These adapters are fast
|
244
|
-
as they use some system-calls to implement the notifying function.
|
245
|
-
|
246
|
-
There is also a polling adapter which is a cross-platform adapter and it will
|
247
|
-
work on any system. This adapter is unfortunately slower than the rest of the adapters.
|
248
|
-
|
249
|
-
The Listen gem will choose the best and working adapter for your machine automatically. If you
|
250
|
-
want to force the use of the polling adapter, either use the `:force_polling` option
|
251
|
-
while initializing the listener or call the `force_polling` method on your listener
|
252
|
-
before starting it.
|
253
|
-
|
254
|
-
<a name="fallback"/>
|
255
|
-
## Polling fallback
|
256
|
-
|
257
|
-
When a OS-specific adapter doesn't work the Listen gem automatically falls back to the polling adapter.
|
258
|
-
Here are some things you could try to avoid the polling fallback:
|
259
|
-
|
260
|
-
* [Update your Dropbox client](http://www.dropbox.com/downloading) (if used).
|
261
|
-
* Increase latency. (Please [open an issue](https://github.com/guard/listen/issues/new) if you think that default is too low.)
|
262
|
-
* Move or rename the listened folder.
|
263
|
-
* Update/reboot your OS.
|
264
|
-
|
265
|
-
If your application keeps using the polling-adapter and you can't figure out why, feel free to [open an issue](https://github.com/guard/listen/issues/new) (and be sure to give all the details).
|
266
|
-
|
267
|
-
## Development [![Dependency Status](https://gemnasium.com/guard/listen.png?branch=master)](https://gemnasium.com/guard/listen)
|
268
|
-
|
269
|
-
* Documentation hosted at [RubyDoc](http://rubydoc.info/github/guard/listen/master/frames).
|
270
|
-
* Source hosted at [GitHub](https://github.com/guard/listen).
|
271
|
-
|
272
|
-
Pull requests are very welcome! Please try to follow these simple rules if applicable:
|
273
|
-
|
274
|
-
* Please create a topic branch for every separate change you make.
|
275
|
-
* Make sure your patches are well tested. All specs run with `rake spec:portability` must pass.
|
276
|
-
* Update the [Yard](http://yardoc.org/) documentation.
|
277
|
-
* Update the README.
|
278
|
-
* Update the CHANGELOG for noteworthy changes.
|
279
|
-
* Please **do not change** the version number.
|
280
|
-
|
281
|
-
For questions please join us in our [Google group](http://groups.google.com/group/guard-dev) or on
|
282
|
-
`#guard` (irc.freenode.net).
|
283
|
-
|
284
|
-
## Acknowledgment
|
285
|
-
|
286
|
-
* [Michael Kessler (netzpirat)][] for having written the [initial specs](https://github.com/guard/listen/commit/1e457b13b1bb8a25d2240428ce5ed488bafbed1f).
|
287
|
-
* [Travis Tilley (ttilley)][] for this awesome work on [fssm][] & [rb-fsevent][].
|
288
|
-
* [Nathan Weizenbaum (nex3)][] for [rb-inotify][], a thorough inotify wrapper.
|
289
|
-
* [stereobooster][] for [rb-fchange][], windows support wouldn't exist without him.
|
290
|
-
* [Yehuda Katz (wycats)][] for [vigilo][], that has been a great source of inspiration.
|
291
|
-
|
292
|
-
## Authors
|
293
|
-
|
294
|
-
* [Thibaud Guillaume-Gentil][] ([@thibaudgg](http://twitter.com/thibaudgg))
|
295
|
-
* [Maher Sallam][] ([@mahersalam](http://twitter.com/mahersalam))
|
296
|
-
|
297
|
-
## Contributors
|
298
|
-
|
299
|
-
[https://github.com/guard/listen/contributors](https://github.com/guard/listen/contributors)
|
300
|
-
|
301
|
-
[Thibaud Guillaume-Gentil]: https://github.com/thibaudgg
|
302
|
-
[Maher Sallam]: https://github.com/Maher4Ever
|
303
|
-
[Michael Kessler (netzpirat)]: https://github.com/netzpirat
|
304
|
-
[Travis Tilley (ttilley)]: https://github.com/ttilley
|
305
|
-
[fssm]: https://github.com/ttilley/fssm
|
306
|
-
[rb-fsevent]: https://github.com/thibaudgg/rb-fsevent
|
307
|
-
[Nathan Weizenbaum (nex3)]: https://github.com/nex3
|
308
|
-
[rb-inotify]: https://github.com/nex3/rb-inotify
|
309
|
-
[stereobooster]: https://github.com/stereobooster
|
310
|
-
[rb-fchange]: https://github.com/stereobooster/rb-fchange
|
311
|
-
[Yehuda Katz (wycats)]: https://github.com/wycats
|
312
|
-
[vigilo]: https://github.com/wycats/vigilo
|