sass 3.1.4 → 3.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. data/REVISION +1 -0
  2. data/VERSION +1 -1
  3. data/test/sass/logger_test.rb +0 -0
  4. data/vendor/fssm/Gemfile +3 -0
  5. data/vendor/fssm/LICENSE +1 -1
  6. data/vendor/fssm/README.markdown +55 -27
  7. data/vendor/fssm/Rakefile +6 -54
  8. data/vendor/fssm/example.rb +6 -3
  9. data/vendor/fssm/fssm.gemspec +17 -70
  10. data/vendor/fssm/lib/fssm.rb +7 -3
  11. data/vendor/fssm/lib/fssm/backends/fsevents.rb +1 -1
  12. data/vendor/fssm/lib/fssm/backends/inotify.rb +2 -2
  13. data/vendor/fssm/lib/fssm/backends/polling.rb +2 -2
  14. data/vendor/fssm/lib/fssm/backends/rbfsevent.rb +42 -0
  15. data/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +10 -10
  16. data/vendor/fssm/lib/fssm/monitor.rb +19 -9
  17. data/vendor/fssm/lib/fssm/path.rb +24 -21
  18. data/vendor/fssm/lib/fssm/pathname.rb +13 -479
  19. data/vendor/fssm/lib/fssm/state/directory.rb +29 -11
  20. data/vendor/fssm/lib/fssm/state/file.rb +1 -1
  21. data/vendor/fssm/lib/fssm/support.rb +41 -12
  22. data/vendor/fssm/lib/fssm/tree.rb +6 -6
  23. data/vendor/fssm/lib/fssm/version.rb +3 -0
  24. data/vendor/fssm/profile/prof-cache.rb +3 -3
  25. data/vendor/fssm/profile/prof-pathname-rubinius.rb +35 -0
  26. data/vendor/fssm/profile/prof-pathname.rb +7 -7
  27. data/vendor/fssm/spec/count_down_latch.rb +151 -0
  28. data/vendor/fssm/spec/monitor_spec.rb +202 -0
  29. data/vendor/fssm/spec/path_spec.rb +36 -15
  30. data/vendor/fssm/spec/spec_helper.rb +6 -6
  31. metadata +218 -299
  32. data/lib/sass.rbc +0 -865
  33. data/lib/sass/cache_stores.rbc +0 -210
  34. data/lib/sass/cache_stores/base.rbc +0 -1110
  35. data/lib/sass/cache_stores/chain.rbc +0 -759
  36. data/lib/sass/cache_stores/filesystem.rbc +0 -1170
  37. data/lib/sass/cache_stores/memory.rbc +0 -892
  38. data/lib/sass/callbacks.rbc +0 -623
  39. data/lib/sass/css.rbc +0 -3483
  40. data/lib/sass/engine.rbc +0 -19260
  41. data/lib/sass/environment.rbc +0 -1829
  42. data/lib/sass/error.rbc +0 -2858
  43. data/lib/sass/importers.rbc +0 -162
  44. data/lib/sass/importers/base.rbc +0 -677
  45. data/lib/sass/importers/filesystem.rbc +0 -2910
  46. data/lib/sass/less.rbc +0 -11309
  47. data/lib/sass/plugin.rbc +0 -1360
  48. data/lib/sass/plugin/compiler.rbc +0 -4205
  49. data/lib/sass/plugin/configuration.rbc +0 -1514
  50. data/lib/sass/plugin/generic.rbc +0 -206
  51. data/lib/sass/plugin/staleness_checker.rbc +0 -2545
  52. data/lib/sass/railtie.rbc +0 -259
  53. data/lib/sass/root.rbc +0 -160
  54. data/lib/sass/script.rbc +0 -728
  55. data/lib/sass/script/bool.rbc +0 -366
  56. data/lib/sass/script/color.rbc +0 -7884
  57. data/lib/sass/script/css_lexer.rbc +0 -793
  58. data/lib/sass/script/css_parser.rbc +0 -620
  59. data/lib/sass/script/funcall.rbc +0 -4325
  60. data/lib/sass/script/functions.rbc +0 -15331
  61. data/lib/sass/script/interpolation.rbc +0 -1181
  62. data/lib/sass/script/lexer.rbc +0 -7136
  63. data/lib/sass/script/list.rbc +0 -1795
  64. data/lib/sass/script/literal.rbc +0 -3411
  65. data/lib/sass/script/node.rbc +0 -1176
  66. data/lib/sass/script/number.rbc +0 -5978
  67. data/lib/sass/script/operation.rbc +0 -1684
  68. data/lib/sass/script/parser.rbc +0 -9739
  69. data/lib/sass/script/string.rbc +0 -965
  70. data/lib/sass/script/string_interpolation.rbc +0 -1619
  71. data/lib/sass/script/unary_operation.rbc +0 -1120
  72. data/lib/sass/script/variable.rbc +0 -899
  73. data/lib/sass/scss.rbc +0 -242
  74. data/lib/sass/scss/css_parser.rbc +0 -1098
  75. data/lib/sass/scss/parser.rbc +0 -20522
  76. data/lib/sass/scss/rx.rbc +0 -2878
  77. data/lib/sass/scss/sass_parser.rbc +0 -287
  78. data/lib/sass/scss/script_lexer.rbc +0 -404
  79. data/lib/sass/scss/script_parser.rbc +0 -482
  80. data/lib/sass/scss/static_parser.rbc +0 -963
  81. data/lib/sass/selector.rbc +0 -4125
  82. data/lib/sass/selector/abstract_sequence.rbc +0 -798
  83. data/lib/sass/selector/comma_sequence.rbc +0 -1806
  84. data/lib/sass/selector/sequence.rbc +0 -4727
  85. data/lib/sass/selector/simple.rbc +0 -1490
  86. data/lib/sass/selector/simple_sequence.rbc +0 -2298
  87. data/lib/sass/shared.rbc +0 -1093
  88. data/lib/sass/tree/charset_node.rbc +0 -381
  89. data/lib/sass/tree/comment_node.rbc +0 -1175
  90. data/lib/sass/tree/debug_node.rbc +0 -365
  91. data/lib/sass/tree/directive_node.rbc +0 -298
  92. data/lib/sass/tree/each_node.rbc +0 -347
  93. data/lib/sass/tree/extend_node.rbc +0 -335
  94. data/lib/sass/tree/for_node.rbc +0 -407
  95. data/lib/sass/tree/function_node.rbc +0 -395
  96. data/lib/sass/tree/if_node.rbc +0 -995
  97. data/lib/sass/tree/import_node.rbc +0 -1327
  98. data/lib/sass/tree/media_node.rbc +0 -423
  99. data/lib/sass/tree/mixin_def_node.rbc +0 -395
  100. data/lib/sass/tree/mixin_node.rbc +0 -377
  101. data/lib/sass/tree/node.rbc +0 -2394
  102. data/lib/sass/tree/prop_node.rbc +0 -2695
  103. data/lib/sass/tree/return_node.rbc +0 -365
  104. data/lib/sass/tree/root_node.rbc +0 -558
  105. data/lib/sass/tree/rule_node.rbc +0 -1597
  106. data/lib/sass/tree/variable_node.rbc +0 -425
  107. data/lib/sass/tree/visitors/base.rbc +0 -981
  108. data/lib/sass/tree/visitors/check_nesting.rbc +0 -3247
  109. data/lib/sass/tree/visitors/convert.rbc +0 -6529
  110. data/lib/sass/tree/visitors/cssize.rbc +0 -4133
  111. data/lib/sass/tree/visitors/perform.rbc +0 -8169
  112. data/lib/sass/tree/visitors/to_css.rbc +0 -6971
  113. data/lib/sass/tree/warn_node.rbc +0 -365
  114. data/lib/sass/tree/while_node.rbc +0 -317
  115. data/lib/sass/util.rbc +0 -9956
  116. data/lib/sass/util/subset_map.rbc +0 -1304
  117. data/lib/sass/version.rbc +0 -1763
  118. data/test/sass/cache_test.rbc +0 -2159
  119. data/test/sass/callbacks_test.rbc +0 -1518
  120. data/test/sass/conversion_test.rbc +0 -7840
  121. data/test/sass/css2sass_test.rbc +0 -3805
  122. data/test/sass/engine_test.rbc +0 -30858
  123. data/test/sass/extend_test.rbc +0 -8794
  124. data/test/sass/functions_test.rbc +0 -21318
  125. data/test/sass/importer_test.rbc +0 -4520
  126. data/test/sass/less_conversion_test.rbc +0 -5328
  127. data/test/sass/mock_importer.rbc +0 -1203
  128. data/test/sass/plugin_test.rbc +0 -11014
  129. data/test/sass/script_conversion_test.rbc +0 -4953
  130. data/test/sass/script_test.rbc +0 -13038
  131. data/test/sass/scss/css_test.rbc +0 -9621
  132. data/test/sass/scss/rx_test.rbc +0 -3183
  133. data/test/sass/scss/scss_test.rbc +0 -10997
  134. data/test/sass/scss/test_helper.rbc +0 -1103
  135. data/test/sass/test_helper.rbc +0 -306
  136. data/test/sass/util/subset_map_test.rbc +0 -2755
  137. data/test/sass/util_test.rbc +0 -6899
  138. data/test/test_helper.rbc +0 -2020
  139. data/vendor/fssm/VERSION.yml +0 -5
  140. data/vendor/fssm/pkg/fssm-0.0.8.gem +0 -0
@@ -4,23 +4,33 @@ class FSSM::Monitor
4
4
  @backend = FSSM::Backends::Default.new
5
5
  end
6
6
 
7
- def path(*args, &block)
8
- path = FSSM::Path.new(*args)
9
- FSSM::Support.use_block(path, block)
10
-
11
- @backend.add_handler(FSSM::State::Directory.new(path))
7
+ def path(path=nil, glob=nil, &block)
8
+ path = create_path(path, glob, &block)
9
+ @backend.add_handler(FSSM::State::Directory.new(path, @options))
12
10
  path
11
+ rescue FSSM::FileNotRealError => e
12
+ FSSM.dbg("#{e}")
13
+ nil
13
14
  end
14
15
 
15
- def file(*args, &block)
16
- path = FSSM::Path.new(*args)
17
- FSSM::Support.use_block(path, block)
18
-
16
+ def file(path=nil, glob=nil, &block)
17
+ path = create_path(path, glob, &block)
19
18
  @backend.add_handler(FSSM::State::File.new(path))
20
19
  path
20
+ rescue FSSM::FileNotRealError => e
21
+ FSSM.dbg("#{e}")
22
+ nil
21
23
  end
22
24
 
23
25
  def run
24
26
  @backend.run
25
27
  end
28
+
29
+ private
30
+
31
+ def create_path(path, glob, &block)
32
+ path = FSSM::Path.new(path, glob, @options)
33
+ FSSM::Support.use_block(path, block)
34
+ path
35
+ end
26
36
  end
@@ -1,5 +1,6 @@
1
1
  class FSSM::Path
2
- def initialize(path=nil, glob=nil, &block)
2
+ def initialize(path=nil, glob=nil, options={}, &block)
3
+ @options = options
3
4
  set_path(path || '.')
4
5
  set_glob(glob || '**/*')
5
6
  init_callbacks
@@ -26,32 +27,32 @@ class FSSM::Path
26
27
  set_glob(value)
27
28
  end
28
29
 
29
- def create(callback_or_path=nil, &block)
30
- callback_action(:create, (block_given? ? block : callback_or_path))
30
+ def create(*args, &block)
31
+ callback_action(:create, (block_given? ? block : args))
31
32
  end
32
33
 
33
- def update(callback_or_path=nil, &block)
34
- callback_action(:update, (block_given? ? block : callback_or_path))
34
+ def update(*args, &block)
35
+ callback_action(:update, (block_given? ? block : args))
35
36
  end
36
37
 
37
- def delete(callback_or_path=nil, &block)
38
- callback_action(:delete, (block_given? ? block : callback_or_path))
38
+ def delete(*args, &block)
39
+ callback_action(:delete, (block_given? ? block : args))
39
40
  end
40
41
 
41
42
  private
42
43
 
43
44
  def init_callbacks
44
- do_nothing = lambda {|base, relative|}
45
+ do_nothing = lambda { |base, relative|}
45
46
  @callbacks = Hash.new(do_nothing)
46
47
  end
47
48
 
48
- def callback_action(type, arg=nil)
49
- if arg.is_a?(Proc)
50
- set_callback(type, arg)
51
- elsif arg.nil?
49
+ def callback_action(type, args=[])
50
+ if args.is_a?(Proc)
51
+ set_callback(type, args)
52
+ elsif args.empty?
52
53
  get_callback(type)
53
54
  else
54
- run_callback(type, arg)
55
+ run_callback(type, args)
55
56
  end
56
57
  end
57
58
 
@@ -64,25 +65,27 @@ class FSSM::Path
64
65
  @callbacks[type]
65
66
  end
66
67
 
67
- def run_callback(type, arg)
68
- base, relative = split_path(arg)
68
+ def run_callback(type, args)
69
+ callback_args = split_path(args[0])
70
+ callback_args << args[1] if @options[:directories]
69
71
 
70
72
  begin
71
- @callbacks[type].call(base, relative)
73
+ @callbacks[type].call(*callback_args)
72
74
  rescue Exception => e
73
- raise FSSM::CallbackError, "#{type} - #{base.join(relative)}: #{e.message}", e.backtrace
75
+ raise FSSM::CallbackError, "#{type} - #{args[0]}: #{e.message}", e.backtrace
74
76
  end
75
77
  end
76
78
 
77
79
  def split_path(path)
78
80
  path = FSSM::Pathname.for(path)
79
- [@path, (path.relative? ? path : path.relative_path_from(@path))]
81
+ [@path.to_s, (path.relative? ? path : path.relative_path_from(@path)).to_s]
80
82
  end
81
83
 
82
84
  def set_path(path)
83
- path = FSSM::Pathname.for(path)
84
- raise FSSM::FileNotFoundError, "No such file or directory - #{path}" unless path.exist?
85
- @path = path.expand_path
85
+ @path = FSSM::Pathname.for(path).expand_path
86
+ raise FSSM::FileNotFoundError, "No such file or directory - #{@path}" unless @path.exist?
87
+ raise FSSM::FileNotRealError, "Path is virtual - #{@path}" if @path.is_virtual?
88
+ @path = @path.realpath
86
89
  end
87
90
 
88
91
  def set_glob(glob)
@@ -1,502 +1,36 @@
1
1
  require 'fileutils'
2
2
  require 'find'
3
+ require 'pathname'
3
4
 
4
5
  module FSSM
5
- class Pathname < String
6
- SYMLOOP_MAX = 8
7
-
8
- ROOT = '/'.freeze
9
- DOT = '.'.freeze
10
- DOT_DOT = '..'.freeze
6
+ class Pathname < ::Pathname
7
+ VIRTUAL_REGEX = /^file:([^!]*)!/
11
8
 
12
9
  class << self
13
10
  def for(path)
14
- path.is_a?(::FSSM::Pathname) ? path : new("#{path}")
15
- end
16
- end
17
-
18
- def initialize(path)
19
- raise ArgumentError, "path cannot contain ASCII NULLs" if path =~ %r{\0}
20
- super(path)
21
- end
22
-
23
- def <=>(other)
24
- self.tr('/', "\0").to_s <=> other.to_str.tr('/', "\0")
25
- rescue NoMethodError
26
- nil
27
- end
28
-
29
- def ==(other)
30
- left = self.cleanpath.tr('/', "\0").to_s
31
- right = self.class.for(other).cleanpath.tr('/', "\0").to_s
32
-
33
- left == right
34
- rescue NoMethodError
35
- false
36
- end
37
-
38
- def +(path)
39
- dup << path
40
- end
41
-
42
- def <<(path)
43
- replace( join(path).cleanpath! )
44
- end
45
-
46
- def absolute?
47
- self[0, 1].to_s == ROOT
48
- end
49
-
50
- def ascend
51
- parts = to_a
52
- parts.length.downto(1) do |i|
53
- yield self.class.join(parts[0, i])
54
- end
55
- end
56
-
57
- def children
58
- entries[2..-1]
59
- end
60
-
61
- def cleanpath!
62
- parts = to_a
63
- final = []
64
-
65
- parts.each do |part|
66
- case part
67
- when DOT then
68
- next
69
- when DOT_DOT then
70
- case final.last
71
- when ROOT then
72
- next
73
- when DOT_DOT then
74
- final.push(DOT_DOT)
75
- when nil then
76
- final.push(DOT_DOT)
77
- else
78
- final.pop
79
- end
80
- else
81
- final.push(part)
82
- end
83
- end
84
-
85
- replace(final.empty? ? DOT : self.class.join(*final))
86
- end
87
-
88
- def cleanpath
89
- dup.cleanpath!
90
- end
91
-
92
- def descend
93
- parts = to_a
94
- 1.upto(parts.length) { |i| yield self.class.join(parts[0, i]) }
95
- end
96
-
97
- def dot?
98
- self == DOT
99
- end
100
-
101
- def dot_dot?
102
- self == DOT_DOT
103
- end
104
-
105
- def each_filename(&blk)
106
- to_a.each(&blk)
107
- end
108
-
109
- def mountpoint?
110
- stat1 = self.lstat
111
- stat2 = self.parent.lstat
112
-
113
- stat1.dev != stat2.dev || stat1.ino == stat2.ino
114
- rescue Errno::ENOENT
115
- false
116
- end
117
-
118
- def parent
119
- self + '..'
120
- end
121
-
122
- def realpath
123
- path = self
124
-
125
- SYMLOOP_MAX.times do
126
- link = path.readlink
127
- link = path.dirname + link if link.relative?
128
- path = link
129
- end
130
-
131
- raise Errno::ELOOP, self
132
- rescue Errno::EINVAL
133
- path.expand_path
134
- end
135
-
136
- def relative?
137
- !absolute?
138
- end
139
-
140
- def relative_path_from(base)
141
- base = self.class.for(base)
142
-
143
- raise ArgumentError, 'no relative path between a relative and absolute' if self.absolute? != base.absolute?
144
-
145
- return self if base.dot?
146
- return self.class.new(DOT) if self == base
147
-
148
- base = base.cleanpath.to_a
149
- dest = self.cleanpath.to_a
150
-
151
- while !dest.empty? && !base.empty? && dest[0] == base[0]
152
- base.shift
153
- dest.shift
11
+ path.is_a?(::FSSM::Pathname) ? path : new(path)
154
12
  end
155
13
 
156
- base.shift if base[0] == DOT
157
- dest.shift if dest[0] == DOT
158
-
159
- raise ArgumentError, "base directory may not contain '#{DOT_DOT}'" if base.include?(DOT_DOT)
160
-
161
- path = base.fill(DOT_DOT) + dest
162
- path = self.class.join(*path)
163
- path = self.class.new(DOT) if path.empty?
164
-
165
- path
14
+ alias :[] :glob
166
15
  end
167
16
 
168
- def root?
169
- !!(self =~ %r{^#{ROOT}+$})
17
+ def is_virtual?
18
+ !!(VIRTUAL_REGEX =~ to_s)
170
19
  end
171
20
 
172
- def to_a
173
- array = to_s.split(File::SEPARATOR)
21
+ def segments
22
+ path = to_s
23
+ array = path.split(File::SEPARATOR)
174
24
  array.delete('')
175
- array.insert(0, ROOT) if absolute?
25
+ array.insert(0, File::SEPARATOR) if path[0, 1] == File::SEPARATOR
26
+ array[0] += File::SEPARATOR if path[0, 3] =~ SEPARATOR_PAT
176
27
  array
177
28
  end
178
29
 
179
- alias segments to_a
180
-
181
- def to_path
182
- self
183
- end
184
-
185
- def to_s
186
- "#{self}"
187
- end
188
-
189
- alias to_str to_s
190
-
191
- def unlink
192
- Dir.unlink(self)
193
- true
194
- rescue Errno::ENOTDIR
195
- File.unlink(self)
196
- true
197
- end
198
- end
199
-
200
- class Pathname
201
- def self.[](pattern)
202
- Dir[pattern].map! {|d| FSSM::Pathname.new(d) }
203
- end
204
-
205
- def self.pwd
206
- FSSM::Pathname.new(Dir.pwd)
207
- end
208
-
209
- def entries
210
- Dir.entries(self).map! {|e| FSSM::Pathname.new(e) }
211
- end
212
-
213
- def mkdir(mode = 0777)
214
- Dir.mkdir(self, mode)
215
- end
216
-
217
- def opendir(&blk)
218
- Dir.open(self, &blk)
219
- end
220
-
221
- def rmdir
222
- Dir.rmdir(self)
223
- end
224
-
225
- def self.glob(pattern, flags = 0)
226
- dirs = Dir.glob(pattern, flags)
227
- dirs.map! {|path| FSSM::Pathname.new(path) }
228
-
229
- if block_given?
230
- dirs.each {|dir| yield dir }
231
- nil
232
- else
233
- dirs
234
- end
235
- end
236
-
237
30
  def glob(pattern, flags = 0, &block)
238
31
  patterns = [pattern].flatten
239
- patterns.map! {|p| self.class.glob(self.to_s + p, flags, &block) }
32
+ patterns.map! { |p| self.class.glob(to_s + p, flags, &block) }
240
33
  patterns.flatten
241
34
  end
242
-
243
- def chdir
244
- blk = lambda { yield self } if block_given?
245
- Dir.chdir(self, &blk)
246
- end
247
- end
248
-
249
- class Pathname
250
- def blockdev?
251
- FileTest.blockdev?(self)
252
- end
253
-
254
- def chardev?
255
- FileTest.chardev?(self)
256
- end
257
-
258
- def directory?
259
- FileTest.directory?(self)
260
- end
261
-
262
- def executable?
263
- FileTest.executable?(self)
264
- end
265
-
266
- def executable_real?
267
- FileTest.executable_real?(self)
268
- end
269
-
270
- def exists?
271
- FileTest.exists?(self)
272
- end
273
-
274
- def file?
275
- FileTest.file?(self)
276
- end
277
-
278
- def grpowned?
279
- FileTest.grpowned?(self)
280
- end
281
-
282
- def owned?
283
- FileTest.owned?(self)
284
- end
285
-
286
- def pipe?
287
- FileTest.pipe?(self)
288
- end
289
-
290
- def readable?
291
- FileTest.readable?(self)
292
- end
293
-
294
- def readable_real?
295
- FileTest.readable_real?(self)
296
- end
297
-
298
- def setgid?
299
- FileTest.setgit?(self)
300
- end
301
-
302
- def setuid?
303
- FileTest.setuid?(self)
304
- end
305
-
306
- def socket?
307
- FileTest.socket?(self)
308
- end
309
-
310
- def sticky?
311
- FileTest.sticky?(self)
312
- end
313
-
314
- def symlink?
315
- FileTest.symlink?(self)
316
- end
317
-
318
- def world_readable?
319
- FileTest.world_readable?(self)
320
- end
321
-
322
- def world_writable?
323
- FileTest.world_writable?(self)
324
- end
325
-
326
- def writable?
327
- FileTest.writable?(self)
328
- end
329
-
330
- def writable_real?
331
- FileTest.writable_real?(self)
332
- end
333
-
334
- def zero?
335
- FileTest.zero?(self)
336
- end
337
- end
338
-
339
- class Pathname
340
- def atime
341
- File.atime(self)
342
- end
343
-
344
- def ctime
345
- File.ctime(self)
346
- end
347
-
348
- def ftype
349
- File.ftype(self)
350
- end
351
-
352
- def lstat
353
- File.lstat(self)
354
- end
355
-
356
- def mtime
357
- File.mtime(self)
358
- end
359
-
360
- def stat
361
- File.stat(self)
362
- end
363
-
364
- def utime(atime, mtime)
365
- File.utime(self, atime, mtime)
366
- end
367
- end
368
-
369
- class Pathname
370
- def self.join(*parts)
371
- last_part = FSSM::Pathname.new(parts.last)
372
- return last_part if last_part.absolute?
373
- FSSM::Pathname.new(File.join(*parts.reject {|p| p.empty? }))
374
- end
375
-
376
- def basename
377
- self.class.new(File.basename(self))
378
- end
379
-
380
- def chmod(mode)
381
- File.chmod(mode, self)
382
- end
383
-
384
- def chown(owner, group)
385
- File.chown(owner, group, self)
386
- end
387
-
388
- def dirname
389
- self.class.new(File.dirname(self))
390
- end
391
-
392
- def expand_path(from = nil)
393
- self.class.new(File.expand_path(self, from))
394
- end
395
-
396
- def extname
397
- File.extname(self)
398
- end
399
-
400
- def fnmatch?(pat, flags = 0)
401
- File.fnmatch(pat, self, flags)
402
- end
403
-
404
- def join(*parts)
405
- self.class.join(self, *parts)
406
- end
407
-
408
- def lchmod(mode)
409
- File.lchmod(mode, self)
410
- end
411
-
412
- def lchown(owner, group)
413
- File.lchown(owner, group, self)
414
- end
415
-
416
- def link(to)
417
- File.link(self, to)
418
- end
419
-
420
- def open(mode = 'r', perm = nil, &blk)
421
- File.open(self, mode, perm, &blk)
422
- end
423
-
424
- def readlink
425
- self.class.new(File.readlink(self))
426
- end
427
-
428
- def rename(to)
429
- File.rename(self, to)
430
- replace(to)
431
- end
432
-
433
- def size
434
- File.size(self)
435
- end
436
-
437
- def size?
438
- File.size?(self)
439
- end
440
-
441
- def split
442
- File.split(self).map {|part| FSSM::Pathname.new(part) }
443
- end
444
-
445
- def symlink(to)
446
- File.symlink(self, to)
447
- end
448
-
449
- def truncate
450
- File.truncate(self)
451
- end
452
- end
453
-
454
- class Pathname
455
- def mkpath
456
- self.class.new(FileUtils.mkpath(self))
457
- end
458
-
459
- def rmtree
460
- self.class.new(FileUtils.rmtree(self).first)
461
- end
462
-
463
- def touch
464
- self.class.new(FileUtils.touch(self).first)
465
- end
466
- end
467
-
468
- class Pathname
469
- def each_line(sep = $/, &blk)
470
- IO.foreach(self, sep, &blk)
471
- end
472
-
473
- def read(len = nil, off = 0)
474
- IO.read(self, len, off)
475
- end
476
-
477
- def readlines(sep = $/)
478
- IO.readlines(self, sep)
479
- end
480
-
481
- def sysopen(mode = 'r', perm = nil)
482
- IO.sysopen(self, mode, perm)
483
- end
484
- end
485
-
486
- class Pathname
487
- def find
488
- Find.find(self) {|path| yield FSSM::Pathname.new(path) }
489
- end
490
- end
491
-
492
- class Pathname
493
- class << self
494
- alias getwd pwd
495
- end
496
-
497
- alias absolute expand_path
498
- alias delete unlink
499
- alias exist? exists?
500
- alias fnmatch fnmatch?
501
35
  end
502
36
  end