dapp 0.14.23 → 0.14.24

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: d8d1da8a8160be7b50b53511057698ca7bae2637
4
- data.tar.gz: 62438a0975a40ba15c49e6d066b9ab48f847eee8
3
+ metadata.gz: f9f115f393447629b3885271e12e4f94c46e3d84
4
+ data.tar.gz: b94cc48fc7d207507671a6277d9d068584ffed25
5
5
  SHA512:
6
- metadata.gz: 721388743f11b178777d376b689f91f2620ca0ea748cd62a89b9b0f3ff171eb9371e04af0531be573d60f84ab3918221accb943265d398b0b209c53fac9daa76
7
- data.tar.gz: 9f504db1d359a3aeecdb0b8bdbb630618b2729926b6895e4987f0acb99c15559da14708f32f8ff10b792e042f325493d68f8b29081d6eb7154700d7d90a2e65a
6
+ metadata.gz: 341313c84ab7ad2217e24de1ae5eae2a8070442e7707f6a2639efa1ac8d3cc9d14fc076430028451c3c1797356bf65ef1922ffdd940b4bdff02a30cd813aed5e
7
+ data.tar.gz: b393d1e4c7f645217d6ce432c4f8cf7ac6a46bb8986d393abece6f04be9bd1a084420db01ccaffe26e8c6d5445582d2302bf09e86ff7d191e19b1f71bf799b4c
data/bin/dapp CHANGED
@@ -2,42 +2,63 @@
2
2
  # -*- mode: ruby -*-
3
3
  # vi: set ft=ruby :
4
4
 
5
- require 'rubygems'
6
- require 'dapp'
5
+ def with_dapp_running_lock(&blk)
6
+ begin
7
+ file = ::File.open("/tmp/dapp_running.lock", ::File::RDWR | ::File::CREAT, 0o644)
8
+
9
+ if ARGV[0] == 'update'
10
+ unless file.flock(::File::LOCK_EX | ::File::LOCK_NB)
11
+ puts "There are other active dapp processes, exiting without update"
12
+ exit(0)
13
+ end
14
+ else
15
+ file.flock(::File::LOCK_SH)
16
+ end
17
+
18
+ yield
19
+ ensure
20
+ file.close
21
+ end
22
+ end
23
+
24
+ with_dapp_running_lock do
25
+ require 'rubygems'
26
+ require 'dapp'
7
27
 
8
- begin
9
28
  begin
10
29
  begin
11
- Dapp::CLI.new.run
12
- rescue Dapp::Error::Base => e
13
- unless (message = Dapp::Helper::NetStatus.before_error_message(e)).empty?
14
- $stderr.puts(message)
15
- end
30
+ begin
31
+ Dapp::CLI.new.run
32
+ rescue Dapp::Error::Base => e
33
+ unless (message = Dapp::Helper::NetStatus.before_error_message(e)).empty?
34
+ $stderr.puts(message)
35
+ end
16
36
 
37
+ raise
38
+ end
39
+ rescue ::SystemExit
17
40
  raise
18
- end
19
- rescue ::SystemExit
20
- raise
21
- rescue ::Exception => e
22
- "/tmp/dapp-stacktrace-#{SecureRandom.uuid}.out".tap do |filename|
23
- ::File.open(filename, 'w') do |dapp_stacktrace|
24
- dapp_stacktrace.write "#{e.backtrace.join("\n")}\n"
41
+ rescue ::Exception => e
42
+ "/tmp/dapp-stacktrace-#{SecureRandom.uuid}.out".tap do |filename|
43
+ ::File.open(filename, 'w') do |dapp_stacktrace|
44
+ dapp_stacktrace.write "#{e.backtrace.join("\n")}\n"
45
+ end
46
+ $stderr.puts "\033[1m\033[90mStacktrace dumped to #{filename}\033[0m"
25
47
  end
26
- $stderr.puts "\033[1m\033[90mStacktrace dumped to #{filename}\033[0m"
27
- end
28
48
 
29
- raise
49
+ raise
50
+ end
51
+ rescue Dapp::Error::Shellout => e
52
+ $stderr.puts(Dapp::Helper::NetStatus.message(e))
53
+ exit 1
54
+ rescue Dapp::Error::Base, NetStatus::Exception => e
55
+ $stderr.puts(Dapp::Dapp.paint_string(Dapp::Helper::NetStatus.message(e), :warning))
56
+ exit 1
57
+ rescue Interrupt => _e
58
+ $stderr.puts(Dapp::Dapp.paint_string('Interrupted', :warning))
59
+ exit 1
60
+ rescue Errno::EACCES => _e
61
+ $stderr.puts(Dapp::Dapp.paint_string('Permission denied!', :warning))
62
+ exit 1
30
63
  end
31
- rescue Dapp::Error::Shellout => e
32
- $stderr.puts(Dapp::Helper::NetStatus.message(e))
33
- exit 1
34
- rescue Dapp::Error::Base, NetStatus::Exception => e
35
- $stderr.puts(Dapp::Dapp.paint_string(Dapp::Helper::NetStatus.message(e), :warning))
36
- exit 1
37
- rescue Interrupt => _e
38
- $stderr.puts(Dapp::Dapp.paint_string('Interrupted', :warning))
39
- exit 1
40
- rescue Errno::EACCES => _e
41
- $stderr.puts(Dapp::Dapp.paint_string('Permission denied!', :warning))
42
- exit 1
43
64
  end
@@ -71,8 +71,8 @@ module Dapp
71
71
  raise
72
72
  end
73
73
 
74
- def cli_options(**kvargs)
75
- config.merge(**kvargs)
74
+ def cli_options(**kwargs)
75
+ config.merge(**kwargs)
76
76
  end
77
77
  end
78
78
  end
@@ -1,4 +1,4 @@
1
1
  module Dapp
2
- VERSION = '0.14.23'.freeze
2
+ VERSION = '0.14.24'.freeze
3
3
  BUILD_CACHE_VERSION = 16
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.23
4
+ version: 0.14.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Stolyarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-21 00:00:00.000000000 Z
11
+ date: 2017-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout