lib/livetext/userapi.rb in livetext-0.9.31 vs lib/livetext/userapi.rb in livetext-0.9.32
- old
+ new
@@ -30,11 +30,10 @@
def dot
@live
end
def setvar(var, val) # FIXME
- # Livetext::Vars[var] = val # Now indifferent and "safe"
@live.vars.set(var, val)
end
def setvars(pairs)
pairs = pairs.to_a if pairs.is_a?(Hash)
@@ -47,11 +46,12 @@
STDERR.puts msg unless File.exist?(file)
end
def data=(value)
@data = value.dup
- @args = format(@data).chomp.split
+# @args = format(@data).chomp.split
+ @data
end
def data
@data
end
@@ -102,32 +102,20 @@
def body(raw=false)
lines = []
end_found = false
loop do
-# TTY.puts "BODY 0: @line = #{@line.inspect}"
@line = @live.nextline
-# TTY.puts "BODY 1: @line = #{@line.inspect}"
break if @line.nil?
-# TTY.puts "BODY 2: @line = #{@line.inspect}"
@line.chomp!
-# TTY.puts "BODY 3: @line = #{@line.inspect}"
break if end?(@line)
-# TTY.puts "BODY 4: @line = #{@line.inspect}"
next if comment?(@line)
-# TTY.puts "BODY 5: @line = #{@line.inspect}"
@line = format(@line) unless raw
-# TTY.puts "BODY 6: @line = #{@line.inspect}"
lines << @line
-# TTY.puts "BODY 7: @line = #{@line.inspect}"
end
-# TTY.puts "BODY 8: lines = #{lines.inspect}"
raise "Expected .end, found end of file" unless end?(@line) # use custom exception
-# TTY.puts "BODY 9: lines = #{lines.inspect}"
optional_blank_line # FIXME Delete this??
-# TTY.puts "BODY A: lines = #{lines.inspect}"
return lines unless block_given?
-# TTY.puts "BODY B: lines = #{lines.inspect}"
lines.each {|line| yield line } # FIXME what about $. ?
end
def body_text(raw=false)
raw_body.join("\n")