fuburake 0.9.5.29 → 0.9.5.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/lib/fubudocs.rb +1 -1
  3. data/lib/fuburake.rb +110 -4
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTMzZGE3MTBlNDg2YTNhZDliZWRiYzJjYWUzZWNlNTA5MmZhYzNmNA==
4
+ YjFlODUzNmUyNTA0ODExODkyMjhhOGJiOWEyZjA5NDZlODY5NzE0NQ==
5
5
  data.tar.gz: !binary |-
6
- MjY0ZDE1MzdmYzU0ODkzZTAzYWY1OTExMjNjOTQzZWVhNWZmYzZkYw==
6
+ NjhhZDE3ZWU3ZTM1MTFjODQ3NWFkZjExMzY1NTdiZjZmZDA5ZGM2Mw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZDRjYTU3Y2ExNjY5YzU1MjIyMWQ2YjM0MjhkYjQ5ZjU0YjQzNTE4NjQxNjk2
10
- MjJjNDA1MjU3MjQzZjU5YWU1NDYwZDUzMTY4MjIyODhjNzIzZTBkOWY1YTFh
11
- YzgzNWRjMzQ5ZjZmNDNkYzNmMjU2MGZlZjhmMjA3N2RhYTZkMjc=
9
+ OGNjZTJkMWFiNzYzYmRkMDBlZGJkZTIyNjc5MWEzZmQ1YjUwNmUwZTM0M2Qy
10
+ Y2VlMWY0N2E0Mzk1ZTc3NjIyZDAwMGE4ZWMyNTYzNzZhNGQ0MDFhYjFiM2E2
11
+ MDQ4ZDczNjhkYWNiZTRiYjExOTRlODhhZDM3YjM1ODgzZGRjMjc=
12
12
  data.tar.gz: !binary |-
13
- YzZiYzE4ZmE2NDYzZjQzZThlN2M2ODljOTdkZmUzYzZkYTBmMWIzZmNiMTkx
14
- M2E0ZDkwYTdmMmQzYjViOGVkNWNkNjZhNjRmYTY4MGQ5MDk3NDE4ZGE2YjRm
15
- ZDg3NzJiODFjYzI3ZmU5YzIxM2MyZTcyNWNhM2EzYjNkYzhjYTM=
13
+ ZTk2MTJkN2I2MzNhZTE4NTY2OGZkZTYyMzM0OTE0OGYzYzk0Njc3Yjc3ZTky
14
+ NjVhYTk2ZjI4M2JkZDNiMWU0NzIwMjVjNzQwNDRlNzY0MjdkNTA0NTEzNmQ0
15
+ Njk3MTM2OTYwZDEwY2JiOGRhYTFmY2NmYWEwNmVkMjlkODg5ZWI=
data/lib/fubudocs.rb CHANGED
@@ -62,7 +62,7 @@ end
62
62
 
63
63
  def clean
64
64
  cleanDirectory @export_dir
65
- Dir.delete @export_dir
65
+ Dir.delete @export_dir unless !Dir.exists?(@export_dir)
66
66
  end
67
67
 
68
68
  def create_branch
data/lib/fuburake.rb CHANGED
@@ -259,6 +259,107 @@ module FubuRake
259
259
  end
260
260
 
261
261
 
262
+ class BottleServices
263
+ def initialize(options)
264
+ @directory = options[:dir]
265
+ @prefix = options.fetch(:prefix, 'service')
266
+ @command = File.join(@directory, 'BottleServiceRunner')
267
+
268
+ consoleTask = Rake::Task.define_task "#{@prefix}:console" do
269
+ sh "start #{@command}"
270
+ end
271
+ consoleTask.add_description "Run service in console at #{@directory}"
272
+
273
+ to_task 'install', to_install_args(options), "Install the service locally"
274
+ to_task 'start', to_start_stop_args('start', options), "Start the service locally"
275
+ to_task 'stop', to_start_stop_args('stop', options), "Stop the service locally"
276
+ to_task 'uninstall', to_start_stop_args('uninstall', options), "Stop the service locally"
277
+
278
+ cleanTask = Rake::Task.define_task "#{@prefix}:clean" do
279
+ dir = File.join(@directory, 'fubu-content')
280
+ cleanDirectory dir
281
+ end
282
+ cleanTask.add_description "Cleans out any exploded bottle content at fubu-content"
283
+ end
284
+
285
+ def to_start_stop_args(verb, options)
286
+ args = "#{verb}"
287
+
288
+ if (options[:name] != nil)
289
+ args += " -servicename:#{options[:name]}"
290
+ end
291
+
292
+ if (options[:instance] != nil)
293
+ args += " -i:#{options[:instance]}"
294
+ end
295
+
296
+ return args
297
+ end
298
+
299
+ def to_install_args(options)
300
+ args = "install";
301
+
302
+ if (options[:name] != nil)
303
+ args += " -servicename:#{options[:name]}"
304
+ end
305
+
306
+ if (options[:instance] != nil)
307
+ args += " -i:#{options[:instance]}"
308
+ end
309
+
310
+ if (options[:user] != nil)
311
+ args += " -u:#{options[:user]}"
312
+ end
313
+
314
+ if (options[:password] != nil)
315
+ args += " -p:#{options[:password]}"
316
+ end
317
+
318
+ if (options[:autostart] == true)
319
+ args += " --autostart"
320
+ end
321
+
322
+ if (options[:manual] == true)
323
+ args += " --manual"
324
+ end
325
+
326
+ if (options[:disabled] == true)
327
+ args += " --disabled"
328
+ end
329
+
330
+ if (options[:delayed] == true)
331
+ args += " --delayed"
332
+ end
333
+
334
+ if (options[:local_service] == true)
335
+ args += " --localservice"
336
+ end
337
+
338
+ if (options[:network_service] == true)
339
+ args += " --networkservice"
340
+ end
341
+
342
+ if (options[:interactive] == true)
343
+ args += " --interactive"
344
+ end
345
+
346
+ if (options[:description] != nil)
347
+ args += ' -d:"' + options[:description] + "'"
348
+ end
349
+
350
+ return args
351
+ end
352
+
353
+ def to_task(name, args, description)
354
+ task = Rake::Task.define_task "#{@prefix}:#{name}" do
355
+ sh "#{@command} #{args}"
356
+ end
357
+
358
+ task.add_description description
359
+ return task
360
+ end
361
+ end
362
+
262
363
  end
263
364
 
264
365
 
@@ -280,10 +381,15 @@ def waitfor(&block)
280
381
  end
281
382
 
282
383
  def cleanDirectory(dir)
283
- puts 'Cleaning directory ' + dir
284
- FileUtils.rm_rf dir;
285
- waitfor { !exists?(dir) }
286
- Dir.mkdir dir
384
+ if exists?(dir)
385
+ puts 'Cleaning directory ' + dir
386
+ FileUtils.rm_rf dir;
387
+ waitfor { !exists?(dir) }
388
+ end
389
+
390
+ if dir == 'artifacts'
391
+ Dir.mkdir 'artifacts'
392
+ end
287
393
  end
288
394
 
289
395
  def cleanFile(file)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuburake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5.29
4
+ version: 0.9.5.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy D. Miller
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-09-20 00:00:00.000000000 Z
13
+ date: 2013-09-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ripple-cli