MuranoCLI 3.0.0 → 3.0.1

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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +50 -27
  3. data/.trustme.vim +12 -8
  4. data/bin/murano +23 -8
  5. data/docs/basic_example.rst +1 -1
  6. data/docs/completions/murano_completion-bash +88 -0
  7. data/lib/MrMurano/Account.rb +3 -3
  8. data/lib/MrMurano/Business.rb +6 -6
  9. data/lib/MrMurano/Config-Migrate.rb +1 -3
  10. data/lib/MrMurano/Config.rb +16 -8
  11. data/lib/MrMurano/Content.rb +56 -45
  12. data/lib/MrMurano/Gateway.rb +62 -21
  13. data/lib/MrMurano/Mock.rb +27 -19
  14. data/lib/MrMurano/Passwords.rb +7 -7
  15. data/lib/MrMurano/ReCommander.rb +171 -28
  16. data/lib/MrMurano/Setting.rb +38 -40
  17. data/lib/MrMurano/Solution-ServiceConfig.rb +2 -1
  18. data/lib/MrMurano/Solution-Services.rb +196 -61
  19. data/lib/MrMurano/Solution-Users.rb +7 -7
  20. data/lib/MrMurano/Solution.rb +22 -8
  21. data/lib/MrMurano/SolutionId.rb +10 -4
  22. data/lib/MrMurano/SubCmdGroupContext.rb +14 -5
  23. data/lib/MrMurano/SyncAllowed.rb +42 -0
  24. data/lib/MrMurano/SyncUpDown.rb +122 -65
  25. data/lib/MrMurano/Webservice-Cors.rb +9 -3
  26. data/lib/MrMurano/Webservice-Endpoint.rb +39 -33
  27. data/lib/MrMurano/Webservice-File.rb +35 -24
  28. data/lib/MrMurano/commands/business.rb +18 -18
  29. data/lib/MrMurano/commands/content.rb +3 -2
  30. data/lib/MrMurano/commands/devices.rb +137 -22
  31. data/lib/MrMurano/commands/globals.rb +8 -2
  32. data/lib/MrMurano/commands/keystore.rb +3 -2
  33. data/lib/MrMurano/commands/link.rb +13 -13
  34. data/lib/MrMurano/commands/login.rb +3 -2
  35. data/lib/MrMurano/commands/mock.rb +4 -3
  36. data/lib/MrMurano/commands/password.rb +4 -2
  37. data/lib/MrMurano/commands/postgresql.rb +5 -3
  38. data/lib/MrMurano/commands/settings.rb +78 -62
  39. data/lib/MrMurano/commands/show.rb +79 -74
  40. data/lib/MrMurano/commands/solution.rb +6 -4
  41. data/lib/MrMurano/commands/solution_picker.rb +5 -4
  42. data/lib/MrMurano/commands/status.rb +15 -4
  43. data/lib/MrMurano/commands/timeseries.rb +3 -2
  44. data/lib/MrMurano/commands/tsdb.rb +3 -2
  45. data/lib/MrMurano/hash.rb +6 -6
  46. data/lib/MrMurano/http.rb +66 -67
  47. data/lib/MrMurano/makePretty.rb +18 -12
  48. data/lib/MrMurano/progress.rb +9 -2
  49. data/lib/MrMurano/verbosing.rb +14 -2
  50. data/lib/MrMurano/version.rb +2 -2
  51. data/spec/GatewayDevice_spec.rb +190 -149
  52. data/spec/Mock_spec.rb +3 -3
  53. data/spec/Solution-ServiceEventHandler_spec.rb +170 -137
  54. data/spec/SyncUpDown_spec.rb +205 -191
  55. metadata +3 -2
@@ -64,46 +64,51 @@ RSpec.describe MrMurano::SyncUpDown do
64
64
  t = TSUD.new
65
65
  expect(t).to receive(:warning).once.with(/Skipping missing location.*/)
66
66
  ret = t.status
67
- expect(ret).to eq({toadd: [], todel: [], tomod: [], unchg: [], skipd: []})
67
+ expect(ret).to eq(
68
+ { toadd: [], todel: [], tomod: [], unchg: [], skipd: [], clash: [] }
69
+ )
68
70
  end
69
71
 
70
72
  it "finds nothing in empty directory" do
71
73
  FileUtils.mkpath(@project_dir + '/tsud')
72
74
  t = TSUD.new
73
75
  ret = t.status
74
- expect(ret).to eq({toadd: [], todel: [], tomod: [], unchg: [], skipd: []})
76
+ expect(ret).to eq(
77
+ { toadd: [], todel: [], tomod: [], unchg: [], skipd: [], clash: [] }
78
+ )
75
79
  end
76
80
 
77
81
  it "finds things there but not here" do
78
82
  FileUtils.mkpath(@project_dir + '/tsud')
79
83
  t = TSUD.new
80
84
  expect(t).to receive(:list).once.and_return([
81
- {:name=>1},
82
- {:name=>2},
83
- {:name=>3},
85
+ {name: 1},
86
+ {name: 2},
87
+ {name: 3},
84
88
  ])
85
89
  ret = t.status
86
90
  expect(ret).to eq({
87
- :toadd=>[],
88
- :todel=>[
91
+ toadd: [],
92
+ todel: [
89
93
  {
90
- :name=>1,
91
- :synckey=>1,
92
- :synctype=>TSUD.description,
94
+ name: 1,
95
+ synckey: 1,
96
+ synctype: TSUD.description,
93
97
  },
94
98
  {
95
- :name=>2,
96
- :synckey=>2,
97
- :synctype=>TSUD.description,
99
+ name: 2,
100
+ synckey: 2,
101
+ synctype: TSUD.description,
98
102
  },
99
103
  {
100
- :name=>3,
101
- :synckey=>3,
102
- :synctype=>TSUD.description,
104
+ name: 3,
105
+ synckey: 3,
106
+ synctype: TSUD.description,
103
107
  }],
104
- :tomod=>[],
105
- :unchg=>[],
106
- :skipd=>[],
108
+ tomod: [],
109
+ unchg: [],
110
+ skipd: [],
111
+ clash: [],
107
112
  })
108
113
  end
109
114
 
@@ -111,11 +116,11 @@ RSpec.describe MrMurano::SyncUpDown do
111
116
  FileUtils.mkpath(@project_dir + '/tsud')
112
117
  t = TSUD.new
113
118
  expect(t).to receive(:list).once.and_return([
114
- {:name=>1},
115
- {:name=>2},
116
- {:name=>3},
119
+ {name: 1},
120
+ {name: 2},
121
+ {name: 3},
117
122
  ])
118
- ret = t.status({:asdown=>true})
123
+ ret = t.status({asdown: true})
119
124
  expect(ret).to eq({
120
125
  todel: [],
121
126
  toadd: [
@@ -126,6 +131,7 @@ RSpec.describe MrMurano::SyncUpDown do
126
131
  tomod: [],
127
132
  unchg: [],
128
133
  skipd: [],
134
+ clash: [],
129
135
  })
130
136
  end
131
137
 
@@ -135,8 +141,8 @@ RSpec.describe MrMurano::SyncUpDown do
135
141
  FileUtils.touch(@project_dir + '/tsud/two.lua')
136
142
  t = TSUD.new
137
143
  expect(t).to receive(:to_remote_item).and_return(
138
- {:name=>'one.lua'},
139
- {:name=>'two.lua'},
144
+ {name: 'one.lua'},
145
+ {name: 'two.lua'},
140
146
  )
141
147
  ret = t.status
142
148
  expect(ret).to match({
@@ -158,6 +164,7 @@ RSpec.describe MrMurano::SyncUpDown do
158
164
  tomod: [],
159
165
  unchg: [],
160
166
  skipd: [],
167
+ clash: [],
161
168
  })
162
169
  end
163
170
 
@@ -167,12 +174,12 @@ RSpec.describe MrMurano::SyncUpDown do
167
174
  FileUtils.touch(@project_dir + '/tsud/two.lua')
168
175
  t = TSUD.new
169
176
  expect(t).to receive(:list).once.and_return([
170
- {:name=>'one.lua'},
171
- {:name=>'two.lua'},
177
+ {name: 'one.lua'},
178
+ {name: 'two.lua'},
172
179
  ])
173
180
  expect(t).to receive(:to_remote_item).and_return(
174
- {:name=>'one.lua'},
175
- {:name=>'two.lua'},
181
+ {name: 'one.lua'},
182
+ {name: 'two.lua'},
176
183
  )
177
184
  ret = t.status
178
185
  expect(ret).to match({
@@ -194,6 +201,7 @@ RSpec.describe MrMurano::SyncUpDown do
194
201
  toadd: [],
195
202
  unchg: [],
196
203
  skipd: [],
204
+ clash: [],
197
205
  })
198
206
  end
199
207
  it "finds things here and there; but they're the same" do
@@ -202,12 +210,12 @@ RSpec.describe MrMurano::SyncUpDown do
202
210
  FileUtils.touch(@project_dir + '/tsud/two.lua')
203
211
  t = TSUD.new
204
212
  expect(t).to receive(:list).once.and_return([
205
- {:name=>'one.lua'},
206
- {:name=>'two.lua'},
213
+ {name: 'one.lua'},
214
+ {name: 'two.lua'},
207
215
  ])
208
216
  expect(t).to receive(:to_remote_item).and_return(
209
- {:name=>'one.lua'},
210
- {:name=>'two.lua'},
217
+ {name: 'one.lua'},
218
+ {name: 'two.lua'},
211
219
  )
212
220
  expect(t).to receive(:docmp).twice.and_return(false)
213
221
  ret = t.status
@@ -230,6 +238,7 @@ RSpec.describe MrMurano::SyncUpDown do
230
238
  toadd: [],
231
239
  tomod: [],
232
240
  skipd: [],
241
+ clash: [],
233
242
  })
234
243
  end
235
244
 
@@ -238,13 +247,13 @@ RSpec.describe MrMurano::SyncUpDown do
238
247
  FileUtils.touch(@project_dir + '/tsud/one.lua')
239
248
  t = TSUD.new
240
249
  expect(t).to receive(:list).once.and_return([
241
- {:name=>'one.lua'}
250
+ {name: 'one.lua'}
242
251
  ])
243
252
  expect(t).to receive(:to_remote_item).and_return(
244
- {:name=>'one.lua'}
253
+ {name: 'one.lua'}
245
254
  )
246
255
  expect(t).to receive(:dodiff).once.and_return("diffed output")
247
- ret = t.status({:diff=>true})
256
+ ret = t.status({diff: true})
248
257
  expect(ret).to match({
249
258
  tomod: [
250
259
  {
@@ -259,6 +268,7 @@ RSpec.describe MrMurano::SyncUpDown do
259
268
  toadd: [],
260
269
  unchg: [],
261
270
  skipd: [],
271
+ clash: [],
262
272
  })
263
273
  end
264
274
 
@@ -274,209 +284,213 @@ RSpec.describe MrMurano::SyncUpDown do
274
284
  FileUtils.touch(@project_dir + '/tsud/ga/six.lua') # toadd
275
285
  @t = TSUD.new
276
286
  expect(@t).to receive(:list).once.and_return([
277
- MrMurano::SyncUpDown::Item.new({:name=>'eight.lua', :updated_at=>ITEM_UPDATED_AT}), # todel
278
- MrMurano::SyncUpDown::Item.new({:name=>'four.lua', :updated_at=>ITEM_UPDATED_AT}), # unchg
279
- MrMurano::SyncUpDown::Item.new({:name=>'one.lua', :updated_at=>ITEM_UPDATED_AT}), # tomod
280
- MrMurano::SyncUpDown::Item.new({:name=>'seven.lua', :updated_at=>ITEM_UPDATED_AT}), # todel
281
- MrMurano::SyncUpDown::Item.new({:name=>'three.lua', :updated_at=>ITEM_UPDATED_AT}), # unchg
282
- MrMurano::SyncUpDown::Item.new({:name=>'two.lua', :updated_at=>ITEM_UPDATED_AT}), # tomod
287
+ MrMurano::SyncUpDown::Item.new({name: 'eight.lua', updated_at: ITEM_UPDATED_AT}), # todel
288
+ MrMurano::SyncUpDown::Item.new({name: 'four.lua', updated_at: ITEM_UPDATED_AT}), # unchg
289
+ MrMurano::SyncUpDown::Item.new({name: 'one.lua', updated_at: ITEM_UPDATED_AT}), # tomod
290
+ MrMurano::SyncUpDown::Item.new({name: 'seven.lua', updated_at: ITEM_UPDATED_AT}), # todel
291
+ MrMurano::SyncUpDown::Item.new({name: 'three.lua', updated_at: ITEM_UPDATED_AT}), # unchg
292
+ MrMurano::SyncUpDown::Item.new({name: 'two.lua', updated_at: ITEM_UPDATED_AT}), # tomod
283
293
  ])
284
294
  expect(@t).to receive(:to_remote_item).
285
295
  with(anything(), pathname_globs('**/one.lua')).
286
- and_return(MrMurano::SyncUpDown::Item.new({:name=>'one.lua', :updated_at=>ITEM_UPDATED_AT}))
296
+ and_return(MrMurano::SyncUpDown::Item.new({name: 'one.lua', updated_at: ITEM_UPDATED_AT}))
287
297
  expect(@t).to receive(:to_remote_item).
288
298
  with(anything(), pathname_globs('**/two.lua')).
289
- and_return(MrMurano::SyncUpDown::Item.new({:name=>'two.lua', :updated_at=>ITEM_UPDATED_AT}))
299
+ and_return(MrMurano::SyncUpDown::Item.new({name: 'two.lua', updated_at: ITEM_UPDATED_AT}))
290
300
  expect(@t).to receive(:to_remote_item).
291
301
  with(anything(), pathname_globs('**/three.lua')).
292
- and_return(MrMurano::SyncUpDown::Item.new({:name=>'three.lua', :updated_at=>ITEM_UPDATED_AT}))
302
+ and_return(MrMurano::SyncUpDown::Item.new({name: 'three.lua', updated_at: ITEM_UPDATED_AT}))
293
303
  expect(@t).to receive(:to_remote_item).
294
304
  with(anything(), pathname_globs('**/four.lua')).
295
- and_return(MrMurano::SyncUpDown::Item.new({:name=>'four.lua', :updated_at=>ITEM_UPDATED_AT}))
305
+ and_return(MrMurano::SyncUpDown::Item.new({name: 'four.lua', updated_at: ITEM_UPDATED_AT}))
296
306
  expect(@t).to receive(:to_remote_item).
297
307
  with(anything(), pathname_globs('**/five.lua')).
298
- and_return(MrMurano::SyncUpDown::Item.new({:name=>'five.lua', :updated_at=>ITEM_UPDATED_AT}))
308
+ and_return(MrMurano::SyncUpDown::Item.new({name: 'five.lua', updated_at: ITEM_UPDATED_AT}))
299
309
  expect(@t).to receive(:to_remote_item).
300
310
  with(anything(), pathname_globs('**/six.lua')).
301
- and_return(MrMurano::SyncUpDown::Item.new({:name=>'six.lua', :updated_at=>ITEM_UPDATED_AT}))
311
+ and_return(MrMurano::SyncUpDown::Item.new({name: 'six.lua', updated_at: ITEM_UPDATED_AT}))
302
312
 
303
- expect(@t).to receive(:docmp).with(have_attributes({:name=>'one.lua'}),anything()).and_return(true)
304
- expect(@t).to receive(:docmp).with(have_attributes({:name=>'two.lua'}),anything()).and_return(true)
305
- expect(@t).to receive(:docmp).with(have_attributes({:name=>'three.lua'}),anything()).and_return(false)
306
- expect(@t).to receive(:docmp).with(have_attributes({:name=>'four.lua'}),anything()).and_return(false)
313
+ expect(@t).to receive(:docmp).with(have_attributes({name: 'one.lua'}),anything()).and_return(true)
314
+ expect(@t).to receive(:docmp).with(have_attributes({name: 'two.lua'}),anything()).and_return(true)
315
+ expect(@t).to receive(:docmp).with(have_attributes({name: 'three.lua'}),anything()).and_return(false)
316
+ expect(@t).to receive(:docmp).with(have_attributes({name: 'four.lua'}),anything()).and_return(false)
307
317
  end
308
318
 
309
319
  it "Returns all with no filter" do
310
320
  ret = @t.status
311
321
  expect(ret).to match({
312
- :unchg=>[
322
+ unchg: [
313
323
  have_attributes(
314
324
  {
315
- :name=>'four.lua',
316
- :synckey=>'four.lua',
317
- :synctype=>TSUD.description,
318
- :local_path=>pathname_globs('**/four.lua'),
325
+ name: 'four.lua',
326
+ synckey: 'four.lua',
327
+ synctype: TSUD.description,
328
+ local_path: pathname_globs('**/four.lua'),
319
329
  }),
320
330
  have_attributes(
321
331
  {
322
- :name=>'three.lua',
323
- :synckey=>'three.lua',
324
- :synctype=>TSUD.description,
325
- :local_path=>pathname_globs('**/three.lua'),
332
+ name: 'three.lua',
333
+ synckey: 'three.lua',
334
+ synctype: TSUD.description,
335
+ local_path: pathname_globs('**/three.lua'),
326
336
  }),
327
337
  ],
328
- :toadd=>[
338
+ toadd: [
329
339
  have_attributes(
330
340
  {
331
- :name=>'five.lua',
332
- :synckey=>'five.lua',
333
- :synctype=>TSUD.description,
334
- :local_path=>pathname_globs('**/five.lua'),
341
+ name: 'five.lua',
342
+ synckey: 'five.lua',
343
+ synctype: TSUD.description,
344
+ local_path: pathname_globs('**/five.lua'),
335
345
  }),
336
346
  have_attributes(
337
347
  {
338
- :name=>'six.lua',
339
- :synckey=>'six.lua',
340
- :synctype=>TSUD.description,
341
- :local_path=>pathname_globs('**/six.lua'),
348
+ name: 'six.lua',
349
+ synckey: 'six.lua',
350
+ synctype: TSUD.description,
351
+ local_path: pathname_globs('**/six.lua'),
342
352
  }),
343
353
  ],
344
- :todel=>[
354
+ todel: [
345
355
  have_attributes(
346
356
  {
347
- :name=>'eight.lua',
348
- :synckey=>'eight.lua',
349
- :synctype=>TSUD.description,
357
+ name: 'eight.lua',
358
+ synckey: 'eight.lua',
359
+ synctype: TSUD.description,
350
360
  }),
351
361
  have_attributes(
352
362
  {
353
- :name=>'seven.lua',
354
- :synckey=>'seven.lua',
355
- :synctype=>TSUD.description,
363
+ name: 'seven.lua',
364
+ synckey: 'seven.lua',
365
+ synctype: TSUD.description,
356
366
  }),
357
367
  ],
358
- :tomod=>[
368
+ tomod: [
359
369
  have_attributes(
360
370
  {
361
- :name=>'one.lua',
362
- :synckey=>'one.lua',
363
- :synctype=>TSUD.description,
364
- :local_path=>pathname_globs('**/one.lua'),
371
+ name: 'one.lua',
372
+ synckey: 'one.lua',
373
+ synctype: TSUD.description,
374
+ local_path: pathname_globs('**/one.lua'),
365
375
  }),
366
376
  have_attributes(
367
377
  {
368
- :name=>'two.lua',
369
- :synckey=>'two.lua',
370
- :synctype=>TSUD.description,
371
- :local_path=>pathname_globs('**/two.lua'),
378
+ name: 'two.lua',
379
+ synckey: 'two.lua',
380
+ synctype: TSUD.description,
381
+ local_path: pathname_globs('**/two.lua'),
372
382
  }),
373
383
  ],
374
- :skipd=>[],
384
+ skipd: [],
385
+ clash: [],
375
386
  })
376
387
  end
377
388
 
378
389
  it "Finds local path globs" do
379
390
  ret = @t.status({}, ['**/ga/*.lua'])
380
391
  expect(ret).to match({
381
- :unchg=>[ ],
382
- :toadd=>[
392
+ unchg: [ ],
393
+ toadd: [
383
394
  have_attributes(
384
- :name=>'six.lua',
385
- :synckey=>'six.lua',
386
- :synctype=>TSUD.description,
387
- :local_path=>an_instance_of(Pathname)
395
+ name: 'six.lua',
396
+ synckey: 'six.lua',
397
+ synctype: TSUD.description,
398
+ local_path: an_instance_of(Pathname)
388
399
  ),
389
400
  ],
390
- :todel=>[ ],
391
- :tomod=>[
401
+ todel: [ ],
402
+ tomod: [
392
403
  have_attributes(
393
- :name=>'two.lua',
394
- :synckey=>'two.lua',
395
- :synctype=>TSUD.description,
396
- :local_path=>an_instance_of(Pathname)
404
+ name: 'two.lua',
405
+ synckey: 'two.lua',
406
+ synctype: TSUD.description,
407
+ local_path: an_instance_of(Pathname)
397
408
  ),
398
409
  ],
399
- :skipd=>[],
410
+ skipd: [],
411
+ clash: [],
400
412
  })
401
413
  end
402
414
 
403
415
  it "Finds nothing with specific matcher" do
404
416
  ret = @t.status({}, ['#foo'])
405
417
  expect(ret).to match({
406
- :unchg=>[],
407
- :toadd=>[],
408
- :todel=>[],
409
- :tomod=>[],
410
- :skipd=>[],
418
+ unchg: [],
419
+ toadd: [],
420
+ todel: [],
421
+ tomod: [],
422
+ skipd: [],
423
+ clash: [],
411
424
  })
412
425
  end
413
426
 
414
427
  it "gets all the details" do
415
- ret = @t.status({:unselected=>true})
428
+ ret = @t.status({unselected: true})
416
429
  expect(ret).to match({
417
- :unchg=>[
430
+ unchg: [
418
431
  have_attributes(
419
- :name=>'four.lua',
420
- :synckey=>'four.lua',
421
- :synctype=>TSUD.description,
422
- :selected=>true,
423
- :local_path=>pathname_globs('**/four.lua')
432
+ name: 'four.lua',
433
+ synckey: 'four.lua',
434
+ synctype: TSUD.description,
435
+ selected: true,
436
+ local_path: pathname_globs('**/four.lua')
424
437
  ),
425
438
  have_attributes(
426
- :name=>'three.lua',
427
- :synckey=>'three.lua',
428
- :synctype=>TSUD.description,
429
- :selected=>true,
430
- :local_path=>pathname_globs('**/three.lua')
439
+ name: 'three.lua',
440
+ synckey: 'three.lua',
441
+ synctype: TSUD.description,
442
+ selected: true,
443
+ local_path: pathname_globs('**/three.lua')
431
444
  ),
432
445
  ],
433
- :toadd=>[
446
+ toadd: [
434
447
  have_attributes(
435
- :name=>'five.lua',
436
- :synckey=>'five.lua',
437
- :synctype=>TSUD.description,
438
- :selected=>true,
439
- :local_path=>pathname_globs('**/five.lua')
448
+ name: 'five.lua',
449
+ synckey: 'five.lua',
450
+ synctype: TSUD.description,
451
+ selected: true,
452
+ local_path: pathname_globs('**/five.lua')
440
453
  ),
441
454
  have_attributes(
442
- :name=>'six.lua',
443
- :synckey=>'six.lua',
444
- :synctype=>TSUD.description,
445
- :selected=>true,
446
- :local_path=>pathname_globs('**/six.lua')
455
+ name: 'six.lua',
456
+ synckey: 'six.lua',
457
+ synctype: TSUD.description,
458
+ selected: true,
459
+ local_path: pathname_globs('**/six.lua')
447
460
  ),
448
461
  ],
449
- :todel=>[
462
+ todel: [
450
463
  have_attributes(
451
- :name=>'eight.lua',
452
- :selected=>true,
453
- :synckey=>'eight.lua',
454
- :synctype=>TSUD.description,
464
+ name: 'eight.lua',
465
+ selected: true,
466
+ synckey: 'eight.lua',
467
+ synctype: TSUD.description,
455
468
  ),
456
469
  have_attributes(
457
- :name=>'seven.lua',
458
- :selected=>true,
459
- :synckey=>'seven.lua',
460
- :synctype=>TSUD.description,
470
+ name: 'seven.lua',
471
+ selected: true,
472
+ synckey: 'seven.lua',
473
+ synctype: TSUD.description,
461
474
  ),
462
475
  ],
463
- :tomod=>[
476
+ tomod: [
464
477
  have_attributes(
465
- :name=>'one.lua',
466
- :synckey=>'one.lua',
467
- :synctype=>TSUD.description,
468
- :selected=>true,
469
- :local_path=>pathname_globs('**/one.lua')
478
+ name: 'one.lua',
479
+ synckey: 'one.lua',
480
+ synctype: TSUD.description,
481
+ selected: true,
482
+ local_path: pathname_globs('**/one.lua')
470
483
  ),
471
484
  have_attributes(
472
- :name=>'two.lua',
473
- :synckey=>'two.lua',
474
- :synctype=>TSUD.description,
475
- :selected=>true,
476
- :local_path=>pathname_globs('**/two.lua')
485
+ name: 'two.lua',
486
+ synckey: 'two.lua',
487
+ synctype: TSUD.description,
488
+ selected: true,
489
+ local_path: pathname_globs('**/two.lua')
477
490
  ),
478
491
  ],
479
- :skipd=>[],
492
+ skipd: [],
493
+ clash: [],
480
494
  })
481
495
  end
482
496
  end
@@ -491,18 +505,18 @@ RSpec.describe MrMurano::SyncUpDown do
491
505
  end
492
506
  it "finds local items" do
493
507
  expect(@t).to receive(:to_remote_item).and_return(
494
- {:name=>'one.lua'},
495
- {:name=>'two.lua'},
508
+ {name: 'one.lua'},
509
+ {name: 'two.lua'},
496
510
  )
497
511
  ret = @t.localitems(Pathname.new(@project_dir + '/tsud').realpath)
498
512
  expect(ret).to match([
499
513
  {
500
- :name=>'one.lua',
501
- :local_path=>an_instance_of(Pathname)
514
+ name: 'one.lua',
515
+ local_path: an_instance_of(Pathname)
502
516
  },
503
517
  {
504
- :name=>'two.lua',
505
- :local_path=>an_instance_of(Pathname)
518
+ name: 'two.lua',
519
+ local_path: an_instance_of(Pathname)
506
520
  },
507
521
  ])
508
522
  end
@@ -510,31 +524,31 @@ RSpec.describe MrMurano::SyncUpDown do
510
524
  it "takes an array from to_remote_item" do
511
525
  expect(@t).to receive(:to_remote_item).and_return(
512
526
  [
513
- {:name=>'one:1'},
514
- {:name=>'one:2'},
527
+ {name: 'one:1'},
528
+ {name: 'one:2'},
515
529
  ],
516
530
  [
517
- {:name=>'two:1'},
518
- {:name=>'two:2'},
531
+ {name: 'two:1'},
532
+ {name: 'two:2'},
519
533
  ],
520
534
  )
521
535
  ret = @t.localitems(Pathname.new(@project_dir + '/tsud').realpath)
522
536
  expect(ret).to match([
523
537
  {
524
- :name=>'one:1',
525
- :local_path=>an_instance_of(Pathname),
538
+ name: 'one:1',
539
+ local_path: an_instance_of(Pathname),
526
540
  },
527
541
  {
528
- :name=>'one:2',
529
- :local_path=>an_instance_of(Pathname),
542
+ name: 'one:2',
543
+ local_path: an_instance_of(Pathname),
530
544
  },
531
545
  {
532
- :name=>'two:1',
533
- :local_path=>an_instance_of(Pathname),
546
+ name: 'two:1',
547
+ local_path: an_instance_of(Pathname),
534
548
  },
535
549
  {
536
- :name=>'two:2',
537
- :local_path=>an_instance_of(Pathname),
550
+ name: 'two:2',
551
+ local_path: an_instance_of(Pathname),
538
552
  },
539
553
  ])
540
554
  end
@@ -547,7 +561,7 @@ RSpec.describe MrMurano::SyncUpDown do
547
561
  lp = Pathname.new(@project_dir + '/tsud/one.lua').realpath
548
562
  t = TSUD.new
549
563
  expect(t).to receive(:fetch).once.with(1).and_yield("foo")
550
- t.download(lp, {:id=>1, :updated_at=>ITEM_UPDATED_AT})
564
+ t.download(lp, {id: 1, updated_at: ITEM_UPDATED_AT})
551
565
  end
552
566
  end
553
567
 
@@ -618,12 +632,12 @@ RSpec.describe MrMurano::SyncUpDown do
618
632
 
619
633
  it "removes" do
620
634
  expect(@t).to receive(:list).once.and_return([
621
- {:name=>1},
622
- {:name=>2},
623
- {:name=>3},
635
+ {name: 1},
636
+ {name: 2},
637
+ {name: 3},
624
638
  ])
625
639
  expect(@t).to receive(:remove).exactly(3).times
626
- @t.syncup({:delete=>true})
640
+ @t.syncup({delete: true})
627
641
  end
628
642
 
629
643
  it "creates" do
@@ -631,25 +645,25 @@ RSpec.describe MrMurano::SyncUpDown do
631
645
  FileUtils.touch(@project_dir + '/tsud/two.lua')
632
646
 
633
647
  expect(@t).to receive(:upload).twice.with(kind_of(Pathname), kind_of(MrMurano::SyncUpDown::Item), false)
634
- @t.syncup({:create=>true})
648
+ @t.syncup({create: true})
635
649
  end
636
650
 
637
651
  it "updates" do
638
652
  FileUtils.touch(@project_dir + '/tsud/one.lua')
639
653
  FileUtils.touch(@project_dir + '/tsud/two.lua')
640
654
  expect(@t).to receive(:list).once.and_return([
641
- MrMurano::SyncUpDown::Item.new({:name=>'one.lua', :updated_at=>ITEM_UPDATED_AT}),
642
- MrMurano::SyncUpDown::Item.new({:name=>'two.lua', :updated_at=>ITEM_UPDATED_AT})
655
+ MrMurano::SyncUpDown::Item.new({name: 'one.lua', updated_at: ITEM_UPDATED_AT}),
656
+ MrMurano::SyncUpDown::Item.new({name: 'two.lua', updated_at: ITEM_UPDATED_AT})
643
657
  ])
644
658
 
645
659
  expect(@t).to receive(:upload).twice.with(
646
660
  kind_of(Pathname), kind_of(MrMurano::SyncUpDown::Item), true
647
661
  )
648
662
  expect(@t).to receive(:to_remote_item).and_return(
649
- {:name=>'one.lua'},
650
- {:name=>'two.lua'},
663
+ {name: 'one.lua'},
664
+ {name: 'two.lua'},
651
665
  )
652
- @t.syncup({:update=>true})
666
+ @t.syncup({update: true})
653
667
  end
654
668
  end
655
669
 
@@ -670,8 +684,8 @@ RSpec.describe MrMurano::SyncUpDown do
670
684
 
671
685
  it "creates" do
672
686
  expect(@t).to receive(:list).once.and_return([
673
- MrMurano::SyncUpDown::Item.new({:name=>'one.lua', :updated_at=>ITEM_UPDATED_AT}),
674
- MrMurano::SyncUpDown::Item.new({:name=>'two.lua', :updated_at=>ITEM_UPDATED_AT})
687
+ MrMurano::SyncUpDown::Item.new({name: 'one.lua', updated_at: ITEM_UPDATED_AT}),
688
+ MrMurano::SyncUpDown::Item.new({name: 'two.lua', updated_at: ITEM_UPDATED_AT})
675
689
  ])
676
690
 
677
691
  expect(@t).to receive(:fetch).twice.and_yield("--foo\n")
@@ -684,14 +698,14 @@ RSpec.describe MrMurano::SyncUpDown do
684
698
  FileUtils.touch(@project_dir + '/tsud/one.lua')
685
699
  FileUtils.touch(@project_dir + '/tsud/two.lua')
686
700
  expect(@t).to receive(:list).once.and_return([
687
- MrMurano::SyncUpDown::Item.new({:name=>'one.lua', :updated_at=>ITEM_UPDATED_AT}),
688
- MrMurano::SyncUpDown::Item.new({:name=>'two.lua', :updated_at=>ITEM_UPDATED_AT})
701
+ MrMurano::SyncUpDown::Item.new({name: 'one.lua', updated_at: ITEM_UPDATED_AT}),
702
+ MrMurano::SyncUpDown::Item.new({name: 'two.lua', updated_at: ITEM_UPDATED_AT})
689
703
  ])
690
704
 
691
705
  expect(@t).to receive(:fetch).twice.and_yield("--foo\n")
692
706
  expect(@t).to receive(:to_remote_item).and_return(
693
- MrMurano::SyncUpDown::Item.new({:name=>'one.lua', :updated_at=>ITEM_UPDATED_AT}),
694
- MrMurano::SyncUpDown::Item.new({:name=>'two.lua', :updated_at=>ITEM_UPDATED_AT})
707
+ MrMurano::SyncUpDown::Item.new({name: 'one.lua', updated_at: ITEM_UPDATED_AT}),
708
+ MrMurano::SyncUpDown::Item.new({name: 'two.lua', updated_at: ITEM_UPDATED_AT})
695
709
  )
696
710
  @t.syncdown(update: true)
697
711
  expect(FileTest.exist?(@project_dir + '/tsud/one.lua')).to be true
@@ -711,15 +725,15 @@ RSpec.describe MrMurano::SyncUpDown do
711
725
  # FileUtils.touch(@project_dir + '/bundles/mybun/tsud/two.lua')
712
726
  #
713
727
  # expect(@t).to receive(:to_remote_item).and_return(
714
- # {:name=>'two.lua'},{:name=>'one.lua'}
728
+ # {name: 'two.lua'},{name: 'one.lua'}
715
729
  # )
716
730
  # ret = @t.locallist
717
731
  # expect(ret).to match([
718
- # {:name=>'two.lua',
719
- # :bundled=>true,
720
- # :local_path=>an_instance_of(Pathname)},
721
- # {:name=>'one.lua',
722
- # :local_path=>an_instance_of(Pathname)},
732
+ # {name: 'two.lua',
733
+ # bundled: true,
734
+ # local_path: an_instance_of(Pathname)},
735
+ # {name: 'one.lua',
736
+ # local_path: an_instance_of(Pathname)},
723
737
  # ])
724
738
  # end
725
739
  #
@@ -729,7 +743,7 @@ RSpec.describe MrMurano::SyncUpDown do
729
743
  #
730
744
  # expect(@t).to receive(:warning).once.with(/Not downloading into bundled item.*/)
731
745
  #
732
- # @t.download(lp, {:bundled=>true, :name=>'one.lua'})
746
+ # @t.download(lp, {bundled: true, name: 'one.lua'})
733
747
  # end
734
748
  # end
735
749
  end