sass 3.2.19 → 3.3.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. data/CONTRIBUTING +1 -1
  2. data/MIT-LICENSE +2 -2
  3. data/README.md +13 -14
  4. data/REVISION +1 -1
  5. data/Rakefile +4 -6
  6. data/VERSION +1 -1
  7. data/VERSION_DATE +1 -1
  8. data/VERSION_NAME +1 -1
  9. data/bin/sass +1 -6
  10. data/bin/sass-convert +1 -6
  11. data/bin/scss +1 -6
  12. data/lib/sass/cache_stores/base.rb +0 -2
  13. data/lib/sass/cache_stores/chain.rb +1 -1
  14. data/lib/sass/cache_stores/filesystem.rb +3 -6
  15. data/lib/sass/callbacks.rb +1 -1
  16. data/lib/sass/css.rb +1 -1
  17. data/lib/sass/engine.rb +4 -11
  18. data/lib/sass/error.rb +2 -2
  19. data/lib/sass/exec.rb +10 -40
  20. data/lib/sass/importers/filesystem.rb +15 -52
  21. data/lib/sass/logger/log_level.rb +3 -3
  22. data/lib/sass/media.rb +4 -1
  23. data/lib/sass/plugin.rb +1 -2
  24. data/lib/sass/plugin/compiler.rb +18 -40
  25. data/lib/sass/plugin/staleness_checker.rb +5 -21
  26. data/lib/sass/railtie.rb +0 -1
  27. data/lib/sass/script/funcall.rb +8 -62
  28. data/lib/sass/script/functions.rb +457 -557
  29. data/lib/sass/script/lexer.rb +30 -25
  30. data/lib/sass/script/list.rb +1 -2
  31. data/lib/sass/script/literal.rb +18 -0
  32. data/lib/sass/script/null.rb +1 -4
  33. data/lib/sass/script/operation.rb +1 -0
  34. data/lib/sass/script/parser.rb +35 -42
  35. data/lib/sass/script/string.rb +1 -1
  36. data/lib/sass/script/unary_operation.rb +3 -8
  37. data/lib/sass/scss/parser.rb +14 -33
  38. data/lib/sass/scss/rx.rb +10 -3
  39. data/lib/sass/selector.rb +16 -19
  40. data/lib/sass/selector/sequence.rb +7 -16
  41. data/lib/sass/selector/simple.rb +1 -1
  42. data/lib/sass/selector/simple_sequence.rb +15 -25
  43. data/lib/sass/tree/comment_node.rb +2 -2
  44. data/lib/sass/tree/import_node.rb +2 -9
  45. data/lib/sass/tree/visitors/check_nesting.rb +2 -3
  46. data/lib/sass/tree/visitors/convert.rb +4 -9
  47. data/lib/sass/tree/visitors/cssize.rb +15 -36
  48. data/lib/sass/tree/visitors/perform.rb +20 -23
  49. data/lib/sass/tree/visitors/set_options.rb +0 -8
  50. data/lib/sass/tree/visitors/to_css.rb +1 -0
  51. data/lib/sass/util.rb +2 -120
  52. data/lib/sass/util/multibyte_string_scanner.rb +8 -29
  53. data/test/sass/conversion_test.rb +8 -33
  54. data/test/sass/css2sass_test.rb +0 -19
  55. data/test/sass/engine_test.rb +17 -129
  56. data/test/sass/extend_test.rb +24 -169
  57. data/test/sass/functions_test.rb +73 -93
  58. data/test/sass/plugin_test.rb +11 -72
  59. data/test/sass/script_conversion_test.rb +0 -14
  60. data/test/sass/script_test.rb +1 -40
  61. data/test/sass/scss/css_test.rb +3 -44
  62. data/test/sass/scss/scss_test.rb +3 -134
  63. data/test/sass/util_test.rb +0 -93
  64. data/vendor/listen/CHANGELOG.md +2 -83
  65. data/vendor/listen/Gemfile +1 -8
  66. data/vendor/listen/Guardfile +1 -1
  67. data/vendor/listen/LICENSE +1 -1
  68. data/vendor/listen/README.md +5 -8
  69. data/vendor/listen/lib/listen.rb +5 -7
  70. data/vendor/listen/lib/listen/adapter.rb +29 -76
  71. data/vendor/listen/lib/listen/adapters/darwin.rb +10 -11
  72. data/vendor/listen/lib/listen/adapters/linux.rb +30 -33
  73. data/vendor/listen/lib/listen/adapters/polling.rb +1 -2
  74. data/vendor/listen/lib/listen/adapters/windows.rb +21 -27
  75. data/vendor/listen/lib/listen/directory_record.rb +10 -63
  76. data/vendor/listen/lib/listen/listener.rb +0 -22
  77. data/vendor/listen/lib/listen/multi_listener.rb +0 -22
  78. data/vendor/listen/lib/listen/version.rb +1 -1
  79. data/vendor/listen/listen.gemspec +4 -0
  80. data/vendor/listen/spec/listen/adapter_spec.rb +4 -45
  81. data/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -6
  82. data/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -6
  83. data/vendor/listen/spec/listen/adapters/windows_spec.rb +1 -7
  84. data/vendor/listen/spec/listen/directory_record_spec.rb +4 -91
  85. data/vendor/listen/spec/listen/listener_spec.rb +0 -14
  86. data/vendor/listen/spec/listen/multi_listener_spec.rb +1 -19
  87. data/vendor/listen/spec/spec_helper.rb +3 -6
  88. data/vendor/listen/spec/support/adapter_helper.rb +212 -125
  89. data/vendor/listen/spec/support/listeners_helper.rb +1 -13
  90. data/vendor/listen/spec/support/platform_helper.rb +0 -4
  91. metadata +113 -105
  92. checksums.yaml +0 -7
  93. data/lib/sass/util/test.rb +0 -10
  94. data/test/sass/exec_test.rb +0 -86
  95. data/test/sass/results/cached_import_option.css +0 -3
  96. data/test/sass/templates/_cached_import_option_partial.scss +0 -1
  97. data/test/sass/templates/_same_name_different_partiality.scss +0 -1
  98. data/test/sass/templates/bork5.sass +0 -3
  99. data/test/sass/templates/cached_import_option.scss +0 -3
  100. data/test/sass/templates/same_name_different_ext.sass +0 -2
  101. data/test/sass/templates/same_name_different_ext.scss +0 -1
  102. data/test/sass/templates/same_name_different_partiality.scss +0 -1
  103. data/test/sass/templates/subdir/import_up1.scss +0 -1
  104. data/test/sass/templates/subdir/import_up2.scss +0 -1
  105. data/vendor/listen/CONTRIBUTING.md +0 -38
  106. data/vendor/listen/lib/listen/adapters/bsd.rb +0 -112
  107. data/vendor/listen/lib/listen/dependency_manager.rb +0 -126
  108. data/vendor/listen/spec/listen/adapters/bsd_spec.rb +0 -36
  109. data/vendor/listen/spec/listen/dependency_manager_spec.rb +0 -107
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: ee87925e31efa7b2b9f04b31651d51cda825569e
4
- data.tar.gz: dd0e7f384e2a5625754529631f5b510757d1e0d5
5
- SHA512:
6
- metadata.gz: a865f9ebe4cc0a8f54d7f73679ff92c19401425f1f390d5b62e574decc98768a5e5fd96d54fa10e1daf701758c8532e555664e50fcb8664d9f489de7d413ab96
7
- data.tar.gz: 09311860e8236dd537d391efa8e31dd2aaa8744932e4d2ca6a6e3d56174282b173bf614faeee4c4940b2c3ff465131ce783c408f3653ce53f7fc22d118ae90d7
@@ -1,10 +0,0 @@
1
- module Sass
2
- module Util
3
- module Test
4
- def skip(msg = nil, bt = caller)
5
- super if defined?(super)
6
- return
7
- end
8
- end
9
- end
10
- end
@@ -1,86 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../test_helper'
3
- require 'sass/util/test'
4
- require 'tmpdir'
5
-
6
- class ExecTest < Test::Unit::TestCase
7
- include Sass::Util::Test
8
-
9
- def setup
10
- @dir = Dir.mktmpdir
11
- end
12
-
13
- def teardown
14
- FileUtils.rm_rf(@dir)
15
- clean_up_sassc
16
- end
17
-
18
- def test_scss_t_expanded
19
- src = get_path("src.scss")
20
- dest = get_path("dest.css")
21
- write(src, ".ruleset { margin: 0 }")
22
- assert(exec(*%w[scss -t expanded --unix-newlines].push(src, dest)))
23
- assert_equal(".ruleset {\n margin: 0;\n}\n", read(dest))
24
- end
25
-
26
- def test_sass_convert_T_sass
27
- src = get_path("src.scss")
28
- dest = get_path("dest.css")
29
- write(src, ".ruleset { margin: 0 }")
30
- assert(exec(*%w[sass-convert -T sass --unix-newlines].push(src, dest)))
31
- assert_equal(".ruleset\n margin: 0\n", read(dest))
32
- end
33
-
34
- def test_sass_convert_T_sass_in_place
35
- src = get_path("src.scss")
36
- write(src, ".ruleset { margin: 0 }")
37
- assert(exec(*%w[sass-convert -T sass --in-place --unix-newlines].push(src)))
38
- assert_equal(".ruleset\n margin: 0\n", read(src))
39
- end
40
-
41
- def test_scss_t_expanded_no_unix_newlines
42
- return skip "Can be run on Windows only" unless Sass::Util.windows?
43
- src = get_path("src.scss")
44
- dest = get_path("dest.css")
45
- write(src, ".ruleset { margin: 0 }")
46
- assert(exec(*%w[scss -t expanded].push(src, dest)))
47
- assert_equal(".ruleset {\r\n margin: 0;\r\n}\r\n", read(dest))
48
- end
49
-
50
- def test_sass_convert_T_sass_no_unix_newlines
51
- return skip "Can be run on Windows only" unless Sass::Util.windows?
52
- src = get_path("src.scss")
53
- dest = get_path("dest.sass")
54
- write(src, ".ruleset { margin: 0 }")
55
- assert(exec(*%w[sass-convert -T sass].push(src, dest)))
56
- assert_equal(".ruleset\r\n margin: 0\r\n", read(dest))
57
- end
58
-
59
- def test_sass_convert_T_sass_in_place_no_unix_newlines
60
- return skip "Can be run on Windows only" unless Sass::Util.windows?
61
- src = get_path("src.scss")
62
- write(src, ".ruleset { margin: 0 }")
63
- assert(exec(*%w[sass-convert -T sass --in-place].push(src)))
64
- assert_equal(".ruleset\r\n margin: 0\r\n", read(src))
65
- end
66
-
67
- private
68
-
69
- def get_path(name)
70
- File.join(@dir, name)
71
- end
72
-
73
- def read(file)
74
- open(file, 'rb') {|f| f.read}
75
- end
76
-
77
- def write(file, content)
78
- open(file, 'wb') {|f| f.write(content)}
79
- end
80
-
81
- def exec(script, *args)
82
- script = File.dirname(__FILE__) + '/../../bin/' + script
83
- ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT'])
84
- system(ruby, script, *args)
85
- end
86
- end
@@ -1,3 +0,0 @@
1
- partial { value: correct; }
2
-
3
- main { value: correct; }
@@ -1 +0,0 @@
1
- partial {value: whatever()}
@@ -1 +0,0 @@
1
- .foo {partial: yes}
@@ -1,3 +0,0 @@
1
- bork
2
- /* foo */
3
- :bork $bork
@@ -1,3 +0,0 @@
1
- @import "cached_import_option_partial";
2
-
3
- main {value: whatever()}
@@ -1,2 +0,0 @@
1
- .foo
2
- ext: sass
@@ -1 +0,0 @@
1
- .foo {ext: scss}
@@ -1 +0,0 @@
1
- .foo {partial: no}
@@ -1 +0,0 @@
1
- @import "../subdir/import_up2.scss";
@@ -1 +0,0 @@
1
- @import "../subdir/import_up3.scss";
@@ -1,38 +0,0 @@
1
- Contribute to Listen
2
- ===================
3
-
4
- File an issue
5
- -------------
6
-
7
- You can report bugs and feature requests to [GitHub Issues](https://github.com/guard/listen/issues).
8
-
9
- **Please don't ask question in the issue tracker**, instead ask them in our
10
- [Google group](http://groups.google.com/group/guard-dev) or on `#guard` (irc.freenode.net).
11
-
12
- Try to figure out where the issue belongs to: Is it an issue with Listen itself or with Guard?
13
-
14
- When you file a bug, please try to follow these simple rules if applicable:
15
-
16
- * Make sure you run Listen with `bundle exec` first.
17
- * Add your `Guardfile` (if used) and `Gemfile` to the issue.
18
- * Make sure that the issue is reproducible with your description.
19
-
20
- **It's most likely that your bug gets resolved faster if you provide as much information as possible!**
21
-
22
- Development
23
- -----------
24
-
25
- * Documentation hosted at [RubyDoc](http://rubydoc.info/github/guard/listen/master/frames).
26
- * Source hosted at [GitHub](https://github.com/guard/listen).
27
-
28
- Pull requests are very welcome! Please try to follow these simple rules if applicable:
29
-
30
- * Please create a topic branch for every separate change you make.
31
- * Make sure your patches are well tested. All specs run with `rake spec` must pass.
32
- * Update the [Yard](http://yardoc.org/) documentation.
33
- * Update the [README](https://github.com/guard/listen/blob/master/README.md).
34
- * Update the [CHANGELOG](https://github.com/guard/listen/blob/master/CHANGELOG.md) for noteworthy changes.
35
- * Please **do not change** the version number.
36
-
37
- For questions please join us in our [Google group](http://groups.google.com/group/guard-dev) or on
38
- `#guard` (irc.freenode.net).
@@ -1,112 +0,0 @@
1
- module Listen
2
- module Adapters
3
-
4
- # Listener implementation for BSD's `kqueue`.
5
- #
6
- class BSD < Adapter
7
- extend DependencyManager
8
-
9
- # Declare the adapter's dependencies
10
- dependency 'rb-kqueue', '~> 0.2'
11
-
12
- # Watched kqueue events
13
- #
14
- # @see http://www.freebsd.org/cgi/man.cgi?query=kqueue
15
- # @see https://github.com/nex3/rb-kqueue/blob/master/lib/rb-kqueue/queue.rb
16
- #
17
- EVENTS = [ :delete, :write, :extend, :attrib, :link, :rename, :revoke ]
18
-
19
- # Initializes the Adapter. See {Listen::Adapter#initialize} for
20
- # more info.
21
- #
22
- def initialize(directories, options = {}, &callback)
23
- super
24
- @kqueue = init_kqueue
25
- end
26
-
27
- # Starts the adapter.
28
- #
29
- # @param [Boolean] blocking whether or not to block the current thread after starting
30
- #
31
- def start(blocking = true)
32
- @mutex.synchronize do
33
- return if @stop == false
34
- super
35
- end
36
-
37
- @kqueue_thread = Thread.new do
38
- until @stop
39
- @kqueue.poll
40
- sleep(@latency)
41
- end
42
- end
43
- @poll_thread = Thread.new { poll_changed_dirs } if @report_changes
44
-
45
- @kqueue_thread.join if blocking
46
- end
47
-
48
- # Stops the adapter.
49
- #
50
- def stop
51
- @mutex.synchronize do
52
- return if @stop == true
53
- super
54
- end
55
-
56
- @kqueue.stop
57
- Thread.kill(@kqueue_thread) if @kqueue_thread
58
- @poll_thread.join if @poll_thread
59
- end
60
-
61
- # Checks if the adapter is usable on the current OS.
62
- #
63
- # @return [Boolean] whether usable or not
64
- #
65
- def self.usable?
66
- return false unless RbConfig::CONFIG['target_os'] =~ /freebsd/i
67
- super
68
- end
69
-
70
- private
71
-
72
- # Initializes a kqueue Queue and adds a watcher for each files in
73
- # the directories passed to the adapter.
74
- #
75
- # @return [INotify::Notifier] initialized kqueue
76
- #
77
- def init_kqueue
78
- require 'find'
79
-
80
- callback = lambda do |event|
81
- path = event.watcher.path
82
- @mutex.synchronize do
83
- # kqueue watches everything, but Listen only needs the
84
- # directory where stuffs happens.
85
- @changed_dirs << (File.directory?(path) ? path : File.dirname(path))
86
-
87
- # If it is a directory, and it has a write flag, it means a
88
- # file has been added so find out which and deal with it.
89
- # No need to check for removed file, kqueue will forget them
90
- # when the vfs does..
91
- if File.directory?(path) && !(event.flags & [:write]).empty?
92
- queue = event.watcher.queue
93
- Find.find(path) do |file|
94
- unless queue.watchers.detect {|k,v| v.path == file.to_s}
95
- queue.watch_file(file, *EVENTS, &callback)
96
- end
97
- end
98
- end
99
- end
100
- end
101
-
102
- KQueue::Queue.new.tap do |queue|
103
- @directories.each do |directory|
104
- Find.find(directory) do |path|
105
- queue.watch_file(path, *EVENTS, &callback)
106
- end
107
- end
108
- end
109
- end
110
- end
111
- end
112
- end
@@ -1,126 +0,0 @@
1
- require 'set'
2
-
3
- module Listen
4
-
5
- # The dependency-manager offers a simple DSL which allows
6
- # classes to declare their gem dependencies and load them when
7
- # needed.
8
- # It raises a user-friendly exception when the dependencies
9
- # can't be loaded which has the install command in the message.
10
- #
11
- module DependencyManager
12
-
13
- GEM_LOAD_MESSAGE = <<-EOS.gsub(/^ {6}/, '')
14
- Missing dependency '%s' (version '%s')!
15
- EOS
16
-
17
- GEM_INSTALL_COMMAND = <<-EOS.gsub(/^ {6}/, '')
18
- Please run the following to satisfy the dependency:
19
- gem install --version '%s' %s
20
- EOS
21
-
22
- BUNDLER_DECLARE_GEM = <<-EOS.gsub(/^ {6}/, '')
23
- Please add the following to your Gemfile to satisfy the dependency:
24
- gem '%s', '%s'
25
- EOS
26
-
27
- Dependency = Struct.new(:name, :version)
28
-
29
- # The error raised when a dependency can't be loaded.
30
- class Error < StandardError; end
31
-
32
- # A list of all loaded dependencies in the dependency manager.
33
- @_loaded_dependencies = Set.new
34
-
35
- # class methods
36
- class << self
37
-
38
- # Initializes the extended class.
39
- #
40
- # @param [Class] the class for which some dependencies must be managed
41
- #
42
- def extended(base)
43
- base.class_eval do
44
- @_dependencies = Set.new
45
- end
46
- end
47
-
48
- # Adds a loaded dependency to a list so that it doesn't have
49
- # to be loaded again by another classes.
50
- #
51
- # @param [Dependency] dependency
52
- #
53
- def add_loaded(dependency)
54
- @_loaded_dependencies << dependency
55
- end
56
-
57
- # Returns whether the dependency is alread loaded or not.
58
- #
59
- # @param [Dependency] dependency
60
- # @return [Boolean]
61
- #
62
- def already_loaded?(dependency)
63
- @_loaded_dependencies.include?(dependency)
64
- end
65
-
66
- # Clears the list of loaded dependencies.
67
- #
68
- def clear_loaded
69
- @_loaded_dependencies.clear
70
- end
71
- end
72
-
73
- # Registers a new dependency.
74
- #
75
- # @param [String] name the name of the gem
76
- # @param [String] version the version of the gem
77
- #
78
- def dependency(name, version)
79
- @_dependencies << Dependency.new(name, version)
80
- end
81
-
82
- # Loads the registered dependencies.
83
- #
84
- # @raise DependencyManager::Error if the dependency can't be loaded.
85
- #
86
- def load_depenencies
87
- @_dependencies.each do |dependency|
88
- begin
89
- next if DependencyManager.already_loaded?(dependency)
90
- gem(dependency.name, dependency.version)
91
- require(dependency.name)
92
- DependencyManager.add_loaded(dependency)
93
- @_dependencies.delete(dependency)
94
- rescue Gem::LoadError
95
- args = [dependency.name, dependency.version]
96
- command = if running_under_bundler?
97
- BUNDLER_DECLARE_GEM % args
98
- else
99
- GEM_INSTALL_COMMAND % args.reverse
100
- end
101
- message = GEM_LOAD_MESSAGE % args
102
-
103
- raise Error.new(message + command)
104
- end
105
- end
106
- end
107
-
108
- # Returns whether all the dependencies has been loaded or not.
109
- #
110
- # @return [Boolean]
111
- #
112
- def dependencies_loaded?
113
- @_dependencies.empty?
114
- end
115
-
116
- private
117
-
118
- # Returns whether we are running under bundler or not
119
- #
120
- # @return [Boolean]
121
- #
122
- def running_under_bundler?
123
- !!(File.exists?('Gemfile') && ENV['BUNDLE_GEMFILE'])
124
- end
125
- end
126
- end
@@ -1,36 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Listen::Adapters::BSD do
4
- if bsd?
5
- if Listen::Adapters::BSD.usable?
6
- it "is usable on BSD" do
7
- described_class.should be_usable
8
- end
9
-
10
- it_should_behave_like 'a filesystem adapter'
11
- it_should_behave_like 'an adapter that call properly listener#on_change'
12
- else
13
- it "isn't usable on BSD with #{RbConfig::CONFIG['RUBY_INSTALL_NAME']}" do
14
- described_class.should_not be_usable
15
- end
16
- end
17
- end
18
-
19
- if linux?
20
- it "isn't usable on Linux" do
21
- described_class.should_not be_usable
22
- end
23
- end
24
-
25
- if mac?
26
- it "isn't usable on Mac OS X" do
27
- described_class.should_not be_usable
28
- end
29
- end
30
-
31
- if windows?
32
- it "isn't usable on Windows" do
33
- described_class.should_not be_usable
34
- end
35
- end
36
- end