livetext 0.8.14 → 0.8.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ce867574e9265082c5d06e7cbc88ffb36f6a2c0
4
- data.tar.gz: 831df833c2a2e0f0783dab28e1785c8b12008a94
3
+ metadata.gz: 1e44ca44839bea451faf98e8a23e03d66fb2dc46
4
+ data.tar.gz: da201962e5e112258585bbbf88b44c4e07411d56
5
5
  SHA512:
6
- metadata.gz: 18906ee68137888e8e35a18623f99365e91897e717a4499fa697a0b7295634908da86f1699a115618021dc0a3ee1b92f7a22415a374196005fd922721eafd72f
7
- data.tar.gz: 8b898859512486641de6cd1cd515d7c8f0713cbbedbc33c98c84a5eb33be3bd981fffee06fd52f9f7264e9f9285736209feec420c96c9b117c989feaaa4dfef7
6
+ metadata.gz: a79501d765ac7999e359faef6126ed90b2b1e2753c10a84c2e313da012f66bf9fdcec993662a1b7322b845f2e5dc32b2bc9ac9d96529c79e505dfd5affc51573
7
+ data.tar.gz: fe0b06836e1c99984670c60cbbb52094d8cb484f52a141a36642069f8dbd15fce4d8ae41dfd273c623461e01d9619d103e346cf89dab04f49f0bcdbedd718116
data/dsl/liveblog.rb CHANGED
@@ -16,7 +16,7 @@ def _passthru(line)
16
16
  return if line.nil?
17
17
  @dest << "<p>" if line == "\n" and ! @_nopara
18
18
  line = _formatting(line)
19
- @dest << line
19
+ @dest << line + "\n"
20
20
  end
21
21
 
22
22
  def title
data/lib/livetext.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class Livetext
2
- VERSION = "0.8.14"
2
+ VERSION = "0.8.15"
3
3
  end
4
4
 
5
5
  require 'fileutils'
@@ -20,6 +20,8 @@ TTY = ::File.open("/dev/tty", "w")
20
20
  class Livetext
21
21
  Vars = {}
22
22
 
23
+ attr_reader :main
24
+
23
25
  class Processor
24
26
  include Livetext::Standard
25
27
  include Livetext::UserAPI
@@ -45,6 +47,10 @@ class Livetext
45
47
  @sources = []
46
48
  end
47
49
 
50
+ def output=(io)
51
+ @output = io
52
+ end
53
+
48
54
  def _error!(err, abort=true, trace=false)
49
55
  where = @sources.last || @save_location
50
56
  STDERR.puts "Error: #{err} (at #{where[1]} line #{where[2]})"
@@ -94,8 +100,6 @@ class Livetext
94
100
  @main = Processor.new(self, output)
95
101
  end
96
102
 
97
- attr_reader :main
98
-
99
103
  def process_line(line, sigil=".")
100
104
  nomarkup = true
101
105
  # FIXME inefficient
@@ -120,9 +124,20 @@ class Livetext
120
124
  break if line.nil?
121
125
  process_line(line)
122
126
  end
123
- STDERR.puts "About to call finalize: main = #{@main.inspect}"
124
- STDERR.puts "About to call finalize: methods = #{@main.methods.sort.inspect}"
125
- STDERR.puts "About to call finalize: #{@main.respond_to? :finalize}"
127
+ @main.finalize if @main.respond_to? :finalize
128
+ end
129
+
130
+ def process_file!(fname, backtrace=false)
131
+ raise "No such file '#{fname}' to process" unless File.exist?(fname)
132
+ @main.output = StringIO.new
133
+ enum = File.readlines(fname).each
134
+ @backtrace = backtrace
135
+ @main.source(enum, fname, 0)
136
+ loop do
137
+ line = @main.nextline
138
+ break if line.nil?
139
+ process_line(line)
140
+ end
126
141
  @main.finalize if @main.respond_to? :finalize
127
142
  end
128
143
 
data/lib/standard.rb CHANGED
@@ -178,7 +178,6 @@ module Livetext::Standard
178
178
  end
179
179
 
180
180
  def mixin
181
- STDERR.puts "Got into mixin..."
182
181
  name = @_args.first # Expect a module name
183
182
  file = "#{Plugins}/" + name.downcase + ".rb"
184
183
  return if @_mixins.include?(name)
@@ -194,7 +193,6 @@ STDERR.puts "Got into mixin..."
194
193
  self.extend(newmod)
195
194
  init = "init_#{name}"
196
195
  self.send(init) if self.respond_to? init
197
- STDERR.puts "mixin: self = #{self} @meta = #@meta"
198
196
  _optional_blank_line
199
197
  end
200
198
 
data/lib/userapi.rb CHANGED
@@ -112,11 +112,11 @@ module Livetext::UserAPI
112
112
  end
113
113
 
114
114
  def _puts(*args)
115
- @output.puts *args
115
+ @output.puts *args
116
116
  end
117
117
 
118
118
  def _print(*args)
119
- @output.print *args
119
+ @output.print *args
120
120
  end
121
121
 
122
122
  def _debug=(val)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livetext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.14
4
+ version: 0.8.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-06 00:00:00.000000000 Z
11
+ date: 2017-05-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A smart text processor extensible in Ruby
14
14
  email: rubyhacker@gmail.com
@@ -148,8 +148,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  requirements: []
150
150
  rubyforge_project:
151
- rubygems_version: 2.2.2
151
+ rubygems_version: 2.4.2
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: A smart processor for text
155
155
  test_files: []
156
+ has_rdoc: