dapp 0.14.23 → 0.14.24
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.
- checksums.yaml +4 -4
- data/bin/dapp +51 -30
- data/lib/dapp/cli/command/base.rb +2 -2
- data/lib/dapp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9f115f393447629b3885271e12e4f94c46e3d84
|
4
|
+
data.tar.gz: b94cc48fc7d207507671a6277d9d068584ffed25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
6
|
-
|
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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
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
|
data/lib/dapp/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|