Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marshaling methods for ImportNode, fixes #1028 #1029

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/sass/tree/import_node.rb
Expand Up @@ -39,6 +39,17 @@ def css_import?
end
end

def _dump(f)
Marshal.dump([@imported_filename, children])
end

def self._load(data)
filename, children = Marshal.load(data)
node = ImportNode.new(filename)
node.children = children
node
end

private

def import
Expand Down
9 changes: 2 additions & 7 deletions lib/sass/util.rb
Expand Up @@ -537,15 +537,10 @@ def jruby?
@jruby = RUBY_PLATFORM =~ /java/
end

# @see #jruby_version-class_method
def jruby_version
Sass::Util.jruby_version
end

# Returns an array of ints representing the JRuby version number.
#
# @return [Array<Fixnum>]
def self.jruby_version
def jruby_version
@jruby_version ||= ::JRUBY_VERSION.split(".").map {|s| s.to_i}
end

Expand Down Expand Up @@ -1129,7 +1124,7 @@ def lcs_backtrace(c, x, y, i, j, &block)
lcs_backtrace(c, x, y, i - 1, j, &block)
end

(Sass::Util.methods - Module.methods).each {|method| module_function method}
singleton_methods.each {|method| module_function method}
end
end

Expand Down