Skip to content

Instantly share code, notes, and snippets.

@chriseppstein
Forked from Snugug/split_string.rb
Last active December 11, 2015 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriseppstein/4526067 to your computer and use it in GitHub Desktop.
Save chriseppstein/4526067 to your computer and use it in GitHub Desktop.
def split_string(string, key)
items = string.value.split(" " + key.value + " ")
if items.count == 1
Sass::Script::Bool.new(false)
else
Sass::Script::List.new(items.map{|i| Sass::Script::String.new(i), :comma)
end
end
@Snugug
Copy link

Snugug commented Jan 13, 2013

SyntaxError on line 28 of /Users/Richard/Development/susy/test/config.rb: compile error
/Users/Richard/Development/susy/test/config.rb:25: syntax error, unexpected ',', expecting '}'
...| Sass::Script::String.new(i), :comma)
                              ^
Run with --trace to see the full backtrace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment