sass 3.1.15 → 3.1.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/README.md +4 -5
  2. data/Rakefile +2 -2
  3. data/VERSION +1 -1
  4. data/lib/sass/css.rb +144 -48
  5. data/lib/sass/engine.rb +3 -1
  6. data/lib/sass/plugin/compiler.rb +25 -32
  7. data/lib/sass/plugin/listener.rb +59 -0
  8. data/lib/sass/script/lexer.rb +1 -1
  9. data/lib/sass/script/list.rb +1 -0
  10. data/lib/sass/scss/parser.rb +90 -4
  11. data/lib/sass/scss/rx.rb +5 -0
  12. data/lib/sass/scss/static_parser.rb +1 -1
  13. data/lib/sass/selector/abstract_sequence.rb +11 -2
  14. data/lib/sass/selector/simple.rb +6 -0
  15. data/lib/sass/tree/comment_node.rb +1 -1
  16. data/lib/sass/tree/node.rb +2 -2
  17. data/lib/sass/tree/visitors/check_nesting.rb +2 -2
  18. data/lib/sass/tree/visitors/cssize.rb +1 -1
  19. data/lib/sass/util.rb +3 -2
  20. data/test/sass/conversion_test.rb +10 -0
  21. data/test/sass/css2sass_test.rb +24 -0
  22. data/test/sass/engine_test.rb +1 -0
  23. data/test/sass/scss/css_test.rb +53 -0
  24. data/vendor/listen/CHANGELOG.md +72 -0
  25. data/vendor/listen/Gemfile +35 -0
  26. data/vendor/listen/Guardfile +8 -0
  27. data/vendor/{fssm → listen}/LICENSE +1 -1
  28. data/vendor/listen/README.md +297 -0
  29. data/vendor/listen/Rakefile +47 -0
  30. data/vendor/listen/Vagrantfile +96 -0
  31. data/vendor/listen/lib/listen.rb +38 -0
  32. data/vendor/listen/lib/listen/adapter.rb +159 -0
  33. data/vendor/listen/lib/listen/adapters/darwin.rb +84 -0
  34. data/vendor/listen/lib/listen/adapters/linux.rb +99 -0
  35. data/vendor/listen/lib/listen/adapters/polling.rb +66 -0
  36. data/vendor/listen/lib/listen/adapters/windows.rb +82 -0
  37. data/vendor/listen/lib/listen/directory_record.rb +257 -0
  38. data/vendor/listen/lib/listen/listener.rb +186 -0
  39. data/vendor/listen/lib/listen/multi_listener.rb +121 -0
  40. data/vendor/listen/lib/listen/turnstile.rb +28 -0
  41. data/vendor/listen/lib/listen/version.rb +3 -0
  42. data/vendor/listen/listen.gemspec +26 -0
  43. data/vendor/listen/spec/listen/adapter_spec.rb +142 -0
  44. data/vendor/listen/spec/listen/adapters/darwin_spec.rb +31 -0
  45. data/vendor/listen/spec/listen/adapters/linux_spec.rb +30 -0
  46. data/vendor/listen/spec/listen/adapters/polling_spec.rb +68 -0
  47. data/vendor/listen/spec/listen/adapters/windows_spec.rb +24 -0
  48. data/vendor/listen/spec/listen/directory_record_spec.rb +807 -0
  49. data/vendor/listen/spec/listen/listener_spec.rb +151 -0
  50. data/vendor/listen/spec/listen/multi_listener_spec.rb +151 -0
  51. data/vendor/listen/spec/listen/turnstile_spec.rb +56 -0
  52. data/vendor/listen/spec/listen_spec.rb +73 -0
  53. data/vendor/listen/spec/spec_helper.rb +16 -0
  54. data/vendor/listen/spec/support/adapter_helper.rb +538 -0
  55. data/vendor/listen/spec/support/directory_record_helper.rb +35 -0
  56. data/vendor/listen/spec/support/fixtures_helper.rb +29 -0
  57. data/vendor/listen/spec/support/listeners_helper.rb +133 -0
  58. data/vendor/listen/spec/support/platform_helper.rb +11 -0
  59. metadata +40 -40
  60. data/vendor/fssm/Gemfile +0 -3
  61. data/vendor/fssm/README.markdown +0 -83
  62. data/vendor/fssm/Rakefile +0 -11
  63. data/vendor/fssm/example.rb +0 -12
  64. data/vendor/fssm/ext/rakefile.rb +0 -14
  65. data/vendor/fssm/fssm.gemspec +0 -27
  66. data/vendor/fssm/lib/fssm.rb +0 -74
  67. data/vendor/fssm/lib/fssm/backends/fsevents.rb +0 -36
  68. data/vendor/fssm/lib/fssm/backends/inotify.rb +0 -26
  69. data/vendor/fssm/lib/fssm/backends/polling.rb +0 -25
  70. data/vendor/fssm/lib/fssm/backends/rbfsevent.rb +0 -42
  71. data/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +0 -131
  72. data/vendor/fssm/lib/fssm/monitor.rb +0 -36
  73. data/vendor/fssm/lib/fssm/path.rb +0 -94
  74. data/vendor/fssm/lib/fssm/pathname.rb +0 -36
  75. data/vendor/fssm/lib/fssm/state/directory.rb +0 -75
  76. data/vendor/fssm/lib/fssm/state/file.rb +0 -24
  77. data/vendor/fssm/lib/fssm/support.rb +0 -87
  78. data/vendor/fssm/lib/fssm/tree.rb +0 -176
  79. data/vendor/fssm/lib/fssm/version.rb +0 -3
  80. data/vendor/fssm/profile/prof-cache.rb +0 -40
  81. data/vendor/fssm/profile/prof-fssm-pathname.html +0 -1231
  82. data/vendor/fssm/profile/prof-pathname-rubinius.rb +0 -35
  83. data/vendor/fssm/profile/prof-pathname.rb +0 -68
  84. data/vendor/fssm/profile/prof-plain-pathname.html +0 -988
  85. data/vendor/fssm/profile/prof.html +0 -2379
  86. data/vendor/fssm/spec/count_down_latch.rb +0 -151
  87. data/vendor/fssm/spec/monitor_spec.rb +0 -202
  88. data/vendor/fssm/spec/path_spec.rb +0 -96
  89. data/vendor/fssm/spec/root/duck/quack.txt +0 -0
  90. data/vendor/fssm/spec/root/file.css +0 -0
  91. data/vendor/fssm/spec/root/file.rb +0 -0
  92. data/vendor/fssm/spec/root/file.yml +0 -0
  93. data/vendor/fssm/spec/root/moo/cow.txt +0 -0
  94. data/vendor/fssm/spec/spec_helper.rb +0 -14
@@ -1,27 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "fssm/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "fssm"
7
- s.version = FSSM::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ["Travis Tilley", "Nathan Weizenbaum", "Chris Eppstein",
10
- "Jonathan Castello", "Tuomas Kareinen"]
11
- s.email = ["ttilley@gmail.com"]
12
- s.homepage = "https://github.com/ttilley/fssm"
13
- s.summary = %q{File System State Monitor}
14
- s.description = %q{The File System State Monitor keeps track of the state of any number of paths and will fire events when said state changes (create/update/delete). FSSM supports using FSEvents on MacOS, Inotify on GNU/Linux, and polling anywhere else.}
15
-
16
- s.rubyforge_project = "fssm"
17
-
18
- s.files = `git ls-files`.split("\n")
19
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
- s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
21
- s.require_paths = ["lib"]
22
-
23
- # s.extensions = 'ext/rakefile.rb'
24
-
25
- s.add_development_dependency "rake"
26
- s.add_development_dependency "rspec", ">= 2.4.0"
27
- end
@@ -1,74 +0,0 @@
1
- dir = File.expand_path(File.dirname(__FILE__))
2
- $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
3
-
4
- require 'thread'
5
-
6
- module FSSM
7
-
8
- FSSMError = Class.new(StandardError)
9
- FileNotFoundError = Class.new(FSSMError)
10
- FileNotRealError = Class.new(FSSMError)
11
- CallbackError = Class.new(FSSMError)
12
-
13
- autoload :VERSION, 'fssm/version'
14
- autoload :Pathname, 'fssm/pathname'
15
- autoload :Support, 'fssm/support'
16
- autoload :Tree, 'fssm/tree'
17
- autoload :Path, 'fssm/path'
18
- autoload :Monitor, 'fssm/monitor'
19
-
20
- module State
21
- autoload :Directory, 'fssm/state/directory'
22
- autoload :File, 'fssm/state/file'
23
- end
24
-
25
- module Backends
26
- autoload :Polling, 'fssm/backends/polling'
27
- autoload :FSEvents, 'fssm/backends/fsevents'
28
- autoload :RBFSEvent, 'fssm/backends/rbfsevent'
29
- autoload :Inotify, 'fssm/backends/inotify'
30
-
31
- class << self
32
- def set_backend(const_symbol=nil, value=nil)
33
- const_symbol ||= :Default
34
- value ||= ::FSSM::Support.backend
35
-
36
- if (value.is_a?(Symbol) || value.is_a?(String))
37
- unless const_defined?(value)
38
- raise NameError,
39
- "uninitialized constant FSSM::Backends::#{value}"
40
- end
41
- value = const_get(value)
42
- end
43
-
44
- unless value.is_a?(Class)
45
- raise ArgumentError,
46
- "value must be a class or the symbol of an existing backend"
47
- end
48
-
49
- remove_const(const_symbol) if const_defined?(const_symbol)
50
- const_set(const_symbol, value)
51
- end
52
-
53
- def const_missing(symbol)
54
- symbol == :Default ? set_backend(symbol, FSSM::Support.backend) : super
55
- end
56
-
57
- end
58
- end
59
-
60
- class << self
61
- def dbg(msg=nil)
62
- STDERR.puts("FSSM -> #{msg}")
63
- end
64
-
65
- def monitor(*args, &block)
66
- options = args[-1].is_a?(Hash) ? args.pop : {}
67
- monitor = FSSM::Monitor.new(options)
68
- FSSM::Support.use_block(args.empty? ? monitor : monitor.path(*args), block)
69
-
70
- monitor.run
71
- end
72
- end
73
-
74
- end
@@ -1,36 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'rubycocoa/fsevents')
2
-
3
- module FSSM::Backends
4
- class FSEvents
5
- def initialize
6
- @handlers = {}
7
- @fsevents = []
8
- end
9
-
10
- def add_handler(handler, preload=true)
11
- @handlers[handler.path.to_s] = handler
12
-
13
- fsevent = Rucola::FSEvents.new(handler.path.to_s, {:latency => 0.5}) do |events|
14
- events.each do |event|
15
- handler.refresh(event.path)
16
- end
17
- end
18
-
19
- fsevent.create_stream
20
- handler.refresh(nil, true) if preload
21
- fsevent.start
22
- @fsevents << fsevent
23
- end
24
-
25
- def run
26
- begin
27
- OSX.CFRunLoopRun
28
- rescue Interrupt
29
- @fsevents.each do |fsev|
30
- fsev.stop
31
- end
32
- end
33
- end
34
-
35
- end
36
- end
@@ -1,26 +0,0 @@
1
- module FSSM::Backends
2
- class Inotify
3
- def initialize
4
- @notifier = INotify::Notifier.new
5
- end
6
-
7
- def add_handler(handler, preload=true)
8
- @notifier.watch(handler.path.to_s, :recursive, :attrib, :close_write, :create,
9
- :delete, :delete_self, :moved_from, :moved_to, :move_self) do |event|
10
- path = FSSM::Pathname.for(event.absolute_name)
11
- path = path.dirname unless event.name == "" # Event on root directory
12
- handler.refresh(path)
13
- end
14
-
15
- handler.refresh(nil, true) if preload
16
- end
17
-
18
- def run
19
- begin
20
- @notifier.run
21
- rescue Interrupt
22
- end
23
- end
24
-
25
- end
26
- end
@@ -1,25 +0,0 @@
1
- module FSSM::Backends
2
- class Polling
3
- def initialize(options={})
4
- @handlers = []
5
- @latency = options[:latency] || 1.5
6
- end
7
-
8
- def add_handler(handler, preload=true)
9
- handler.refresh(nil, true) if preload
10
- @handlers << handler
11
- end
12
-
13
- def run
14
- begin
15
- loop do
16
- start = Time.now.to_f
17
- @handlers.each { |handler| handler.refresh }
18
- nap_time = @latency - (Time.now.to_f - start)
19
- sleep nap_time if nap_time > 0
20
- end
21
- rescue Interrupt
22
- end
23
- end
24
- end
25
- end
@@ -1,42 +0,0 @@
1
- module FSSM::Backends
2
- class RBFSEvent
3
- def initialize
4
- @handlers = []
5
- end
6
-
7
- def add_handler(handler, preload=true)
8
- @handlers << handler
9
- handler.refresh(nil, true) if preload
10
- end
11
-
12
- def run
13
- begin
14
- @fsevent = FSEvent.new
15
- @fsevent.watch(temporary_multipath_hack) do |paths|
16
- paths.each do |path|
17
- temporary_multipath_handler(path)
18
- end
19
- end
20
- @fsevent.run
21
- rescue Interrupt
22
- @fsevent.stop
23
- end
24
- end
25
-
26
- def temporary_multipath_handler(path)
27
- @handlers.each do |handler|
28
- handler_path = File.join(handler.path.to_s, "")
29
- if path.start_with?(handler_path)
30
- handler.refresh(path)
31
- break
32
- end
33
- end
34
- end
35
-
36
- def temporary_multipath_hack
37
- @handlers = @handlers.sort {|x,y| y.path.to_pathname.segments.length <=> x.path.to_pathname.segments.length}
38
- return @handlers.map {|handler| handler.path.to_s}
39
- end
40
-
41
- end
42
- end
@@ -1,131 +0,0 @@
1
- OSX.require_framework '/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework'
2
-
3
- module Rucola
4
- class FSEvents
5
- class FSEvent
6
- attr_reader :fsevents_object
7
- attr_reader :id
8
- attr_reader :path
9
-
10
- def initialize(fsevents_object, id, path)
11
- @fsevents_object, @id, @path = fsevents_object, id, path
12
- end
13
-
14
- # Returns an array of the files/dirs in the path that the event occurred in.
15
- # The files are sorted by the modification time, the first entry is the last modified file.
16
- def files
17
- Dir.glob("#{File.expand_path(path)}/*").sort_by { |f| File.mtime(f) }.reverse
18
- end
19
-
20
- # Returns the last modified file in the path that the event occurred in.
21
- def last_modified_file
22
- files.first
23
- end
24
- end
25
-
26
- class StreamError < StandardError;
27
- end
28
-
29
- attr_reader :paths
30
- attr_reader :stream
31
-
32
- attr_accessor :allocator
33
- attr_accessor :context
34
- attr_accessor :since
35
- attr_accessor :latency
36
- attr_accessor :flags
37
-
38
- # Initializes a new FSEvents `watchdog` object and starts watching the directories you specify for events. The
39
- # block is used as a handler for events, which are passed as the block's argument. This method is the easiest
40
- # way to start watching some directories if you don't care about the details of setting up the event stream.
41
- #
42
- # Rucola::FSEvents.start_watching('/tmp') do |events|
43
- # events.each { |event| log.debug("#{event.files.inspect} were changed.") }
44
- # end
45
- #
46
- # Rucola::FSEvents.start_watching('/var/log/system.log', '/var/log/secure.log', :since => last_id, :latency => 5) do
47
- # Growl.notify("Something was added to your log files!")
48
- # end
49
- #
50
- # Note that the method also returns the FSEvents object. This enables you to control the event stream if you want to.
51
- #
52
- # fsevents = Rucola::FSEvents.start_watching('/Volumes') do |events|
53
- # events.each { |event| Growl.notify("Volume changes: #{event.files.to_sentence}") }
54
- # end
55
- # fsevents.stop
56
- def self.start_watching(*params, &block)
57
- fsevents = new(*params, &block)
58
- fsevents.create_stream
59
- fsevents.start
60
- fsevents
61
- end
62
-
63
- # Creates a new FSEvents `watchdog` object. You can specify a list of paths to watch and options to control the
64
- # behaviour of the watchdog. The block you pass serves as a callback when an event is generated on one of the
65
- # specified paths.
66
- #
67
- # fsevents = FSEvents.new('/etc/passwd') { Mailer.send_mail("Someone touched the password file!") }
68
- # fsevents.create_stream
69
- # fsevents.start
70
- #
71
- # fsevents = FSEvents.new('/home/upload', :since => UploadWatcher.last_event_id) do |events|
72
- # events.each do |event|
73
- # UploadWatcher.last_event_id = event.id
74
- # event.files.each do |file|
75
- # UploadWatcher.logfile.append("#{file} was changed")
76
- # end
77
- # end
78
- # end
79
- #
80
- # *:since: The service will report events that have happened after the supplied event ID. Never use 0 because that
81
- # will cause every fsevent since the "beginning of time" to be reported. Use OSX::KFSEventStreamEventIdSinceNow
82
- # if you want to receive events that have happened after this call. (Default: OSX::KFSEventStreamEventIdSinceNow).
83
- # You can find the ID's passed with :since in the events passed to your block.
84
- # *:latency: Number of seconds to wait until an FSEvent is reported, this allows the service to bundle events. (Default: 0.0)
85
- #
86
- # Please refer to the Cocoa documentation for the rest of the options.
87
- def initialize(*params, &block)
88
- raise ArgumentError, 'No callback block was specified.' unless block_given?
89
-
90
- options = params.last.kind_of?(Hash) ? params.pop : {}
91
- @paths = params.flatten
92
-
93
- paths.each { |path| raise ArgumentError, "The specified path (#{path}) does not exist." unless File.exist?(path) }
94
-
95
- @allocator = options[:allocator] || OSX::KCFAllocatorDefault
96
- @context = options[:context] || nil
97
- @since = options[:since] || OSX::KFSEventStreamEventIdSinceNow
98
- @latency = options[:latency] || 0.0
99
- @flags = options[:flags] || 0
100
- @stream = options[:stream] || nil
101
-
102
- @user_callback = block
103
- @callback = Proc.new do |stream, client_callback_info, number_of_events, paths_pointer, event_flags, event_ids|
104
- paths_pointer.regard_as('*')
105
- events = []
106
- number_of_events.times { |i| events << Rucola::FSEvents::FSEvent.new(self, event_ids[i], paths_pointer[i]) }
107
- @user_callback.call(events)
108
- end
109
- end
110
-
111
- # Create the stream.
112
- # Raises a Rucola::FSEvents::StreamError if the stream could not be created.
113
- def create_stream
114
- @stream = OSX.FSEventStreamCreate(@allocator, @callback, @context, @paths, @since, @latency, @flags)
115
- raise(StreamError, 'Unable to create FSEvents stream.') unless @stream
116
- OSX.FSEventStreamScheduleWithRunLoop(@stream, OSX.CFRunLoopGetCurrent, OSX::KCFRunLoopDefaultMode)
117
- end
118
-
119
- # Start the stream.
120
- # Raises a Rucola::FSEvents::StreamError if the stream could not be started.
121
- def start
122
- raise(StreamError, 'Unable to start FSEvents stream.') unless OSX.FSEventStreamStart(@stream)
123
- end
124
-
125
- # Stop the stream.
126
- # You can resume it by calling `start` again.
127
- def stop
128
- OSX.FSEventStreamStop(@stream)
129
- end
130
- end
131
- end
@@ -1,36 +0,0 @@
1
- class FSSM::Monitor
2
- def initialize(options={})
3
- @options = options
4
- @backend = FSSM::Backends::Default.new
5
- end
6
-
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))
10
- path
11
- rescue FSSM::FileNotRealError => e
12
- FSSM.dbg("#{e}")
13
- nil
14
- end
15
-
16
- def file(path=nil, glob=nil, &block)
17
- path = create_path(path, glob, &block)
18
- @backend.add_handler(FSSM::State::File.new(path))
19
- path
20
- rescue FSSM::FileNotRealError => e
21
- FSSM.dbg("#{e}")
22
- nil
23
- end
24
-
25
- def run
26
- @backend.run
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
36
- end
@@ -1,94 +0,0 @@
1
- class FSSM::Path
2
- def initialize(path=nil, glob=nil, options={}, &block)
3
- @options = options
4
- set_path(path || '.')
5
- set_glob(glob || '**/*')
6
- init_callbacks
7
-
8
- if block_given?
9
- if block.arity == 1
10
- block.call(self)
11
- else
12
- self.instance_eval(&block)
13
- end
14
- end
15
- end
16
-
17
- def to_s
18
- @path.to_s
19
- end
20
-
21
- def to_pathname
22
- @path
23
- end
24
-
25
- def glob(value=nil)
26
- return @glob if value.nil?
27
- set_glob(value)
28
- end
29
-
30
- def create(*args, &block)
31
- callback_action(:create, (block_given? ? block : args))
32
- end
33
-
34
- def update(*args, &block)
35
- callback_action(:update, (block_given? ? block : args))
36
- end
37
-
38
- def delete(*args, &block)
39
- callback_action(:delete, (block_given? ? block : args))
40
- end
41
-
42
- private
43
-
44
- def init_callbacks
45
- do_nothing = lambda { |base, relative|}
46
- @callbacks = Hash.new(do_nothing)
47
- end
48
-
49
- def callback_action(type, args=[])
50
- if args.is_a?(Proc)
51
- set_callback(type, args)
52
- elsif args.empty?
53
- get_callback(type)
54
- else
55
- run_callback(type, args)
56
- end
57
- end
58
-
59
- def set_callback(type, arg)
60
- raise ArgumentError, "Proc expected" unless arg.is_a?(Proc)
61
- @callbacks[type] = arg
62
- end
63
-
64
- def get_callback(type)
65
- @callbacks[type]
66
- end
67
-
68
- def run_callback(type, args)
69
- callback_args = split_path(args[0])
70
- callback_args << args[1] if @options[:directories]
71
-
72
- begin
73
- @callbacks[type].call(*callback_args)
74
- rescue Exception => e
75
- raise FSSM::CallbackError, "#{type} - #{args[0]}: #{e.message}", e.backtrace
76
- end
77
- end
78
-
79
- def split_path(path)
80
- path = FSSM::Pathname.for(path)
81
- [@path.to_s, (path.relative? ? path : path.relative_path_from(@path)).to_s]
82
- end
83
-
84
- def set_path(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
89
- end
90
-
91
- def set_glob(glob)
92
- @glob = glob.is_a?(Array) ? glob : [glob]
93
- end
94
- end