Module: Less2Sass::Util
Instance Method Summary collapse
-
#classify(str) ⇒ String
Formats class names properly.
-
#read_stdin_as_multiline_arg ⇒ String
Formats a multiline console input, so it can be passed as an argument to a console application.
-
#scope(file) ⇒ String
Returns a file’s path relative to the Less2Sass root directory.
Instance Method Details
#classify(str) ⇒ String
Formats class names properly.
32 33 34 |
# File 'lib/less2sass/util.rb', line 32 def classify(str) str.split('_').collect!(&:capitalize).join end |
#read_stdin_as_multiline_arg ⇒ String
Formats a multiline console input, so it can be passed as an argument to a console application.
17 18 19 20 21 22 23 24 25 |
# File 'lib/less2sass/util.rb', line 17 def read_stdin_as_multiline_arg str = '' puts 'Write your code below, so it can be converted for you.' while line = gets line["\n"] = "\\\n" str << line end str end |
#scope(file) ⇒ String
Returns a file’s path relative to the Less2Sass root directory.
9 10 11 |
# File 'lib/less2sass/util.rb', line 9 def scope(file) File.join(Less2Sass::ROOT_DIR, file) end |