RUIC 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 701fc8ed1b3b80439288e9aff34936285aa24210
4
- data.tar.gz: f8373806b048154b3869515c911153721c483dac
3
+ metadata.gz: 8266ac3944df4da06963ce797c9f7c4ded165e35
4
+ data.tar.gz: 56f345f5e38f79cbc2ec24d13c3b591d88332bc3
5
5
  SHA512:
6
- metadata.gz: 084df33530afad35f3ab412300b0cd79504154e7dc07d565319b09dc395d42a93793528986ae53d7a3e91d8d79cf9130dcdac061d8fce48df749f0ca9dd8cded
7
- data.tar.gz: 7619b5c097ed8b05275b2a57f6b1d0c90d90fd79789f621476227f3903ff27336786a6f9e169e3030767c94988cfc44687c08c24637a2ba6740468992bd20598
6
+ metadata.gz: 324c07f70d84f98023a3b2de1606c5e91f158ec2fe13758028dabc71b7eae949253e34a579234bec5444f4aa4f35661ff603a3d88c463c9c75f2c1dc6e2383e5
7
+ data.tar.gz: 7f3b3bbc26be7a229f2f7dfb180b05a0409b56dd7ff6418cd4e6f4c184b5e55bad8ddc433815b3c9eb2f59013934c67812eeb0be3d2225f64952d0430fba04ba
data/lib/ruic.rb CHANGED
@@ -26,17 +26,19 @@ class RUIC
26
26
  end
27
27
 
28
28
  if opts[:repl]
29
- ruic ||= self.new.tap{ |r| r.uia(opts[:uia]) if opts[:uia] }
30
-
31
- require 'ripl'
32
- require 'ripl/multi_line'
33
- require 'ripl/multi_line/live_error.rb'
34
- Ripl::MultiLine.engine = Ripl::MultiLine::LiveError
35
- Ripl::Shell.include Ripl::MultiLine.engine
36
- Ripl.config.merge! prompt:' ', result_prompt:'#=> ', multi_line_prompt:' '
37
- ARGV.clear # So that RIPL doesn't try to interpret the options
38
- puts "(starting interactive RUIC session; 'quit' or ctrl-d to end)"
39
- Ripl.start binding:ruic.instance_eval{ binding }
29
+ location = (ruic && ruic.app && ruic.app.respond_to?(:file) && ruic.app.file) || opts[:uia] || opts[:script] || '.'
30
+ Dir.chdir( File.dirname(location) ) do
31
+ ruic ||= self.new.tap{ |r| r.uia(opts[:uia]) if opts[:uia] }
32
+ require 'ripl'
33
+ require 'ripl/multi_line'
34
+ require 'ripl/multi_line/live_error.rb'
35
+ Ripl::MultiLine.engine = Ripl::MultiLine::LiveError
36
+ Ripl::Shell.include Ripl::MultiLine.engine
37
+ Ripl.config.merge! prompt:' ', result_prompt:'#=> ', multi_line_prompt:' '
38
+ ARGV.clear # So that RIPL doesn't try to interpret the options
39
+ puts "(starting interactive RUIC session; 'quit' or ctrl-d to end)"
40
+ Ripl.start binding:ruic.instance_eval{ binding }
41
+ end
40
42
  end
41
43
  end
42
44
 
@@ -41,12 +41,18 @@ class UIC::Presentation
41
41
  @slides_by_el = {} # indexed by slide state element
42
42
  end
43
43
 
44
+ def to_xml
45
+ @doc.to_xml( indent:1, indent_text:"\t" )
46
+ .gsub( %r{(<\w+(?: [\w:]+="[^"]*")*)(/?>)}i, '\1 \2' )
47
+ .sub('"?>','" ?>')
48
+ end
49
+
44
50
  def save!
45
- File.open(file,'w:utf-8'){ |f|
46
- f << @doc.to_xml( indent:1, indent_text:"\t" )
47
- .gsub( %r{(<\w+(?: [\w:]+="[^"]*")*)(/?>)}i, '\1 \2' )
48
- .sub('"?>','" ?>')
49
- }
51
+ File.open(file,'w:utf-8'){ |f| f << to_xml }
52
+ end
53
+
54
+ def save_as(new_file)
55
+ File.open(new_file,'w:utf-8'){ |f| f << to_xml }
50
56
  end
51
57
 
52
58
  def rebuild_caches_from_document
data/lib/ruic/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class RUIC
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RUIC
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Kistner