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 +4 -4
- data/lib/ruic.rb +13 -11
- data/lib/ruic/presentation.rb +11 -5
- data/lib/ruic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8266ac3944df4da06963ce797c9f7c4ded165e35
|
4
|
+
data.tar.gz: 56f345f5e38f79cbc2ec24d13c3b591d88332bc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
|
data/lib/ruic/presentation.rb
CHANGED
@@ -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
|
-
|
47
|
-
|
48
|
-
|
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