RUIC 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -1
  3. data/lib/ruic.rb +19 -17
  4. data/lib/ruic/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c4e1cec982987968c63ecbbafff9d3e411cde33
4
- data.tar.gz: 12b6241b55467219a87ebdbe18b31a7a9c323cf2
3
+ metadata.gz: a5d86081f88d5330f6058d8dd28f8630b0cc3208
4
+ data.tar.gz: d2ab8c9a69380ba4ac88fd1dead6a81398f54a97
5
5
  SHA512:
6
- metadata.gz: c16621f5aefc0467c4ebb18df1a76addf920001033127b920a5504b2227bfd88d63abfde631580371cefd6b1551a672117ecb9f5e05c4178ff6652533bb83299
7
- data.tar.gz: b50269750f9bbecd3e94f19662c4e1c3897f8e2e00c24aaf01b2a0af29affc6ec6325ac264664fd159f03393d0de8fd42453338c21b10ccdebddf2dcd61491ea
6
+ metadata.gz: ff1658a0ec1704137957310153f62e3a253c5ecd6e0fc11bbee931cff0502054a5696f2b0f4e7ed4a51fef93583964acbee620abf3367fba51656b120fe78651
7
+ data.tar.gz: 5e28125ea41704334453ed1a9e651c243b5e2e0b42c09d7c7c57a78237468f7ce4a6dfdbfe14779fef1c13e8228b43b17f63aaafcaed58ece9820ec66990f1b1
data/README.md CHANGED
@@ -219,12 +219,15 @@ _In decreasing priority…_
219
219
 
220
220
  # History
221
221
 
222
+ ## v0.2.3 - 2014-Nov-7
223
+ * Cleaner mechanism for creating a truly blank binding
224
+
222
225
  ## v0.2.2 - 2014-Nov-7
223
226
  * REPL shows version number when it starts
224
227
 
225
228
  ## v0.2.1 - 2014-Nov-7
226
229
  * REPL mode after script maintains binding of script (all local variables remain available)
227
- * Customized `.irbrc` files will not cause warnings.
230
+ * Customized `.irbrc` files will not cause warnings
228
231
 
229
232
  ## v0.2.0 - 2014-Nov-7
230
233
  * Add Presentation#save_as
@@ -14,25 +14,23 @@ require_relative 'ruic/presentation'
14
14
 
15
15
  class RUIC
16
16
  DEFAULTMETADATA = 'C:/Program Files (x86)/NVIDIA Corporation/UI Composer 8.0/res/DataModelMetadata/en-us/MetaData.xml'
17
- def self.run(_RUICRUNOPTS_={})
18
- # Use instance variables to not pollute the binding
19
- @opts = _RUICRUNOPTS_
20
- @ruic = nil
21
- @env = nil
22
- if @opts[:script]
23
- @script = File.read(@opts[:script],encoding:'utf-8')
24
- Dir.chdir(File.dirname(@opts[:script])) do
25
- @ruic = self.new
26
- @ruic.uia(@opts[:uia]) if @opts[:uia]
27
- @env = @ruic.instance_eval{ binding }
28
- @env.eval(@script,@opts[:script])
17
+
18
+ def self.run(opts={})
19
+ opts = opts
20
+ ruic = nil
21
+ if opts[:script]
22
+ script = File.read(opts[:script],encoding:'utf-8')
23
+ Dir.chdir(File.dirname(opts[:script])) do
24
+ ruic = self.new
25
+ ruic.uia(opts[:uia]) if opts[:uia]
26
+ ruic.env.eval(script,opts[:script])
29
27
  end
30
28
  end
31
29
 
32
- if @opts[:repl]
33
- @location = (@ruic && @ruic.app && @ruic.app.respond_to?(:file) && @ruic.app.file) || @opts[:uia] || @opts[:script] || '.'
34
- Dir.chdir( File.dirname(@location) ) do
35
- @ruic ||= self.new.tap{ |r| r.uia(@opts[:uia]) if @opts[:uia] }
30
+ if opts[:repl]
31
+ location = (ruic && ruic.app && ruic.app.respond_to?(:file) && ruic.app.file) || opts[:uia] || opts[:script] || '.'
32
+ Dir.chdir( File.dirname(location) ) do
33
+ ruic ||= self.new.tap{ |r| r.uia(opts[:uia]) if opts[:uia] }
36
34
  require 'ripl/irb'
37
35
  require 'ripl/multi_line'
38
36
  require 'ripl/multi_line/live_error.rb'
@@ -41,7 +39,7 @@ class RUIC
41
39
  Ripl.config.merge! prompt:"\n", result_prompt:'#=> ', multi_line_prompt:' ', irb_verbose:false
42
40
  ARGV.clear # So that RIPL doesn't try to interpret the options
43
41
  puts "(RUIC v#{RUIC::VERSION} interactive session; 'quit' or ctrl-d to end)"
44
- Ripl.start binding:(@env || @ruic.instance_eval{ binding })
42
+ Ripl.start binding:ruic.env
45
43
  end
46
44
  end
47
45
  end
@@ -61,6 +59,10 @@ class RUIC
61
59
  @apps[name] = UIC.App(meta,path)
62
60
  end
63
61
 
62
+ def env
63
+ @env ||= binding
64
+ end
65
+
64
66
  module SelfInspecting
65
67
  def inspect
66
68
  to_s
@@ -1,3 +1,3 @@
1
1
  class RUIC
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
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.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Kistner