Skip to content

Commit

Permalink
add inline class and module support
Browse files Browse the repository at this point in the history
  • Loading branch information
brantwedel committed Mar 17, 2014
1 parent d6ea87e commit 162ed52
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,3 +6,4 @@ test/dummy/db/*.sqlite3-journal
test/dummy/log/*.log test/dummy/log/*.log
test/dummy/tmp/ test/dummy/tmp/
test/dummy/.sass-cache test/dummy/.sass-cache
/*.gem
4 changes: 2 additions & 2 deletions lib/yaddl.rb
Expand Up @@ -496,14 +496,14 @@ def parse_line(line, models, stack, depth)


@multiline ||= false @multiline ||= false
unless @multiline unless @multiline
if line.strip =~ /^def .*$/ || line.strip =~ / do \|.+\|$/ || line.strip =~ / do$/ || line.strip =~ /^if / || line.strip =~ /^unless / if line.strip =~ /^(def|module|class|if|unless) / || line.strip =~ / do \|.+\|$/ || line.strip =~ / do$/
@multiline = true @multiline = true
@multiline_spaces = spaces @multiline_spaces = spaces
@multiline_end = /^#{" " * @multiline_spaces}end$/ @multiline_end = /^#{" " * @multiline_spaces}end$/
@multiline_buffer = line[@multiline_spaces..line.length] @multiline_buffer = line[@multiline_spaces..line.length]
return return
elsif line.strip =~ /^[a-z_]+ |^acts_as_.*/ elsif line.strip =~ /^[a-z_]+ |^acts_as_.*/
if line.strip =~ /"^include |^extend |^acts_as_[a-z_]+/ if line.strip =~ /"^include |^require |^extend |^acts_as_[a-z_]+/
line = "!top{#{line.strip}}" line = "!top{#{line.strip}}"
else else
line = "!!{#{line.strip}}" line = "!!{#{line.strip}}"
Expand Down
2 changes: 1 addition & 1 deletion lib/yaddl/version.rb
@@ -1,3 +1,3 @@
module Yaddl module Yaddl
VERSION = "0.0.1" VERSION = "0.0.2"
end end

0 comments on commit 162ed52

Please sign in to comment.