MrMurano 1.12.6 → 1.12.8

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: c8d648032c78a076df907fc5df4e7c34fc132bdf
4
- data.tar.gz: 8427da53825f267b4e359e4cd487231b2c76e73f
3
+ metadata.gz: e591da051dc929f8d3102ad5d5e4e509cfc8f615
4
+ data.tar.gz: bcc33ba440e43735cccf0ecfd533cfaed7de6c5f
5
5
  SHA512:
6
- metadata.gz: eaf548e3a9ca3f760e777258657475f6184dac842db66dc36e069c19904f0d4b70380e48c87d6eede8cfa2c0a2ab9a34266e73b88d3ea6844ab1d1a11f0b4d5f
7
- data.tar.gz: 44fc4db071c247b69551dcf466c60fa0eca3dd4d8c3b0a6678d93a9e131c1f2688f64969e10d94c32c80afea8081686913bc276cf4c986f843213687de23f3f2
6
+ metadata.gz: bc03f582fa7ef39dc93448f4ad3a01285bfb2758e89e959f2bc8aec4d7ad8088b7a1b4bf04822165afd7960329ea4612a07c371e3377bdc4d5c2bf9224692cae
7
+ data.tar.gz: 1dedb31aca67f814643b11bb29715708f3d857b7e4e0ae7ed242a084aac9418e2520c085d69acadce0c2b3cd84d72367ce6bc7701cc969c75ef472178a3ca963
@@ -120,8 +120,8 @@ module MrMurano
120
120
  dirNames=[CFG_DIR_NAME]
121
121
  home = Pathname.new(Dir.home).realpath
122
122
  pwd = Pathname.new(Dir.pwd).realpath
123
- return nil if home == pwd
124
- pwd.dirname.ascend do |i|
123
+ return home if home == pwd
124
+ pwd.ascend do |i|
125
125
  break unless result.nil?
126
126
  break if i == home
127
127
  fileNames.each do |f|
@@ -136,17 +136,6 @@ module MrMurano
136
136
  end
137
137
  end
138
138
 
139
- # If nothing found, do a last ditch try by looking for .git/
140
- if result.nil? then
141
- pwd.dirname.ascend do |i|
142
- break unless result.nil?
143
- break if i == home
144
- if (i + '.git').directory? then
145
- result = i
146
- end
147
- end
148
- end
149
-
150
139
  # Now if nothing found, assume it will live in pwd.
151
140
  result = Pathname.new(Dir.pwd) if result.nil?
152
141
  return result
@@ -33,10 +33,12 @@ module MrMurano
33
33
  raise "Missing name!" if name.nil?
34
34
  raise "Empty name!" if name.empty?
35
35
  ret = get('/'+CGI.escape(name))
36
+ error "Unexpected result type, assuming empty instead: #{ret}" unless ret.kind_of? Hash
37
+ ret = {} unless ret.kind_of? Hash
36
38
  if block_given? then
37
- yield ret[:script]
39
+ yield (ret[:script] or '')
38
40
  else
39
- ret[:script]
41
+ ret[:script] or ''
40
42
  end
41
43
  end
42
44
 
@@ -19,6 +19,7 @@ require 'MrMurano/commands/productDeviceIdCmds'
19
19
  require 'MrMurano/commands/productList'
20
20
  require 'MrMurano/commands/productSpec'
21
21
  require 'MrMurano/commands/productWrite'
22
+ require 'MrMurano/commands/show'
22
23
  require 'MrMurano/commands/solution'
23
24
  require 'MrMurano/commands/solutionCreate'
24
25
  require 'MrMurano/commands/solutionDelete'
@@ -1,4 +1,4 @@
1
1
  module MrMurano
2
- VERSION = '1.12.6'.freeze
2
+ VERSION = '1.12.8'.freeze
3
3
  end
4
4
 
data/spec/Config_spec.rb CHANGED
@@ -280,134 +280,6 @@ RSpec.describe MrMurano::Config do
280
280
  end
281
281
  end
282
282
 
283
- context "Can find the project directory by .git/" do
284
- before(:example) do
285
- @tmpdir = Dir.tmpdir
286
- path = '/home/work/project/some/where'
287
- @projectDir = @tmpdir + '/home/work/project'
288
- FileUtils.mkpath(@tmpdir + path)
289
- FileUtils.mkpath(@projectDir + '/.git')
290
-
291
- # Set ENV to override output of Dir.home
292
- ENV['HOME'] = @tmpdir + '/home'
293
- end
294
-
295
- after(:example) do
296
- FileUtils.remove_dir(@tmpdir + '/home', true) if FileTest.exist? @tmpdir
297
- end
298
-
299
- it "when in project directory" do
300
- Dir.chdir(@projectDir) do
301
- cfg = MrMurano::Config.new
302
- cfg.load
303
- # Follow symlinks to get the paths comparable.
304
- locbase = cfg.get('location.base', :defaults).realdirpath
305
- wkd = Pathname.new(@projectDir).realdirpath
306
- expect(locbase).to eq(wkd)
307
- end
308
- end
309
-
310
- it "when in sub directory" do
311
- Dir.chdir(@projectDir + '/some/where') do
312
- cfg = MrMurano::Config.new
313
- cfg.load
314
- # Follow symlinks to get the paths comparable.
315
- locbase = cfg.get('location.base', :defaults).realdirpath
316
- wkd = Pathname.new(@projectDir).realdirpath
317
- expect(locbase).to eq(wkd)
318
- end
319
- end
320
- end
321
-
322
- context "Can find the project directory by .mrmuranorc but not sub .git/" do
323
- #
324
- # /home/work/project/
325
- # /home/work/project/.mrmuranorc
326
- # /home/work/project/some/.git
327
- before(:example) do
328
- @tmpdir = Dir.tmpdir
329
- path = '/home/work/project/some/where'
330
- @projectDir = @tmpdir + '/home/work/project'
331
- FileUtils.mkpath(@tmpdir + path)
332
- FileUtils.touch(@projectDir + '/.mrmuranorc')
333
- FileUtils.mkpath(@projectDir + '/some/.git')
334
-
335
- # Set ENV to override output of Dir.home
336
- ENV['HOME'] = @tmpdir + '/home'
337
- end
338
-
339
- after(:example) do
340
- FileUtils.remove_dir(@tmpdir + '/home', true) if FileTest.exist? @tmpdir
341
- end
342
-
343
- it "when in project directory" do
344
- Dir.chdir(@projectDir) do
345
- cfg = MrMurano::Config.new
346
- cfg.load
347
- # Follow symlinks to get the paths comparable.
348
- locbase = cfg.get('location.base', :defaults).realdirpath
349
- wkd = Pathname.new(@projectDir).realdirpath
350
- expect(locbase).to eq(wkd)
351
- end
352
- end
353
-
354
- it "when in sub directory" do
355
- Dir.chdir(@projectDir + '/some/where') do
356
- cfg = MrMurano::Config.new
357
- cfg.load
358
- # Follow symlinks to get the paths comparable.
359
- locbase = cfg.get('location.base', :defaults).realdirpath
360
- wkd = Pathname.new(@projectDir).realdirpath
361
- expect(locbase).to eq(wkd)
362
- end
363
- end
364
- end
365
-
366
- context "Can find the project directory by .mrmuranorc but not parent .git/" do
367
- # /home/work/project/
368
- # /home/work/project/.git
369
- # /home/work/project/some/.mrmuranorc
370
- before(:example) do
371
- @tmpdir = Dir.tmpdir
372
- path = '/home/work/project/some/where'
373
- @projectDir = @tmpdir + '/home/work/project'
374
- FileUtils.mkpath(@tmpdir + path)
375
- FileUtils.touch(@projectDir + '/some/.mrmuranorc')
376
- FileUtils.mkpath(@projectDir + '/.git')
377
-
378
- # Set ENV to override output of Dir.home
379
- ENV['HOME'] = @tmpdir + '/home'
380
- end
381
-
382
- after(:example) do
383
- FileUtils.remove_dir(@tmpdir + '/home', true) if FileTest.exist? @tmpdir
384
- end
385
-
386
- it "when in project directory" do
387
- Dir.chdir(@projectDir) do
388
- cfg = MrMurano::Config.new
389
- cfg.load
390
- # Follow symlinks to get the paths comparable.
391
- locbase = cfg.get('location.base', :defaults).realdirpath
392
- wkd = Pathname.new(@projectDir).realdirpath
393
- # This will correctly assume that this project dir with .git is the
394
- # location.base
395
- expect(locbase).to eq(wkd)
396
- end
397
- end
398
-
399
- it "when in sub directory" do
400
- Dir.chdir(@projectDir + '/some/where') do
401
- cfg = MrMurano::Config.new
402
- cfg.load
403
- # Follow symlinks to get the paths comparable.
404
- locbase = cfg.get('location.base', :defaults).realdirpath
405
- wkd = Pathname.new(@projectDir+'/some').realdirpath
406
- expect(locbase).to eq(wkd)
407
- end
408
- end
409
- end
410
-
411
283
  context "When pwd is $HOME:" do
412
284
  before(:example) do
413
285
  @tmpdir = Dir.tmpdir
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MrMurano
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.6
4
+ version: 1.12.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Conrad Tadpol Tilstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-06 00:00:00.000000000 Z
11
+ date: 2017-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander