picobox 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/picobox/cli.rb +4 -2
- data/lib/picobox/commands/update_packages.rb +1 -1
- data/lib/picobox/constants.rb +1 -1
- data/lib/picobox/utils/packages.rb +5 -7
- 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: b7b0e8e40c8ceeafa7cb79219419862956e7dbd9
|
4
|
+
data.tar.gz: 7635634d707c967cf388bb9aab972350035911bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff49aa4e1c0e249f33e4818ac7afe17e60db95700e098b58b7843875cb1b7b3838f413421fa08c7a5619210c18368350550ae216ab45906064aa74c881551d32
|
7
|
+
data.tar.gz: d7eb83c9c5c642be3389b8f8420b884974564b4db09c84a1a941365b1fa89099c1a09716e716d52c6259ffa71ae28cf815865d3f93eb99b5c40fa8eb40be74ed
|
data/lib/picobox/cli.rb
CHANGED
@@ -29,7 +29,7 @@ module Picobox
|
|
29
29
|
LONGDESC
|
30
30
|
def remove(service)
|
31
31
|
Picobox.set_verbosity options[:verbose]
|
32
|
-
|
32
|
+
|
33
33
|
Service.new(Os::CurrentOs.get).remove service
|
34
34
|
rescue SignalException
|
35
35
|
exit 1
|
@@ -75,7 +75,9 @@ module Picobox
|
|
75
75
|
|
76
76
|
desc 'version', 'displays current version'
|
77
77
|
def version
|
78
|
-
say Picobox::VERSION
|
78
|
+
say "Picobox: #{Picobox::VERSION}"
|
79
|
+
say "Packages: #{Picobox::Utils::Packages.new(Os::CurrentOs.get).installed_version[1..-1]}"
|
80
|
+
|
79
81
|
rescue SignalException
|
80
82
|
exit 1
|
81
83
|
end
|
@@ -15,7 +15,7 @@ module Picobox
|
|
15
15
|
system("mkdir #{Picobox.packages_dir}")
|
16
16
|
system("tar xvf #{filename} -C #{Picobox.packages_dir} --strip-components=1 #{Picobox.output}")
|
17
17
|
|
18
|
-
Shell::IniFile.get(os)[:packages] = { version: packages.
|
18
|
+
Shell::IniFile.get(os)[:packages] = { version: packages.current_version, last_update: Time.now.to_i }
|
19
19
|
|
20
20
|
publish_event :update_packages_stop
|
21
21
|
end
|
data/lib/picobox/constants.rb
CHANGED
@@ -1,27 +1,25 @@
|
|
1
1
|
module Picobox
|
2
2
|
module Utils
|
3
3
|
class Packages
|
4
|
-
def version() info['tag_name'] end
|
5
4
|
def url() info['tarball_url'] end
|
5
|
+
def current_version() info['tag_name'] end
|
6
|
+
def installed_version() Picobox::Shell::IniFile.get(os)['packages']['version'] end
|
6
7
|
|
7
8
|
def initialize(os)
|
8
9
|
@os = os
|
9
10
|
end
|
10
11
|
|
11
12
|
def update?
|
12
|
-
|
13
|
-
available_version = version
|
14
|
-
|
15
|
-
available_version > installed_version
|
13
|
+
current_version > installed_version
|
16
14
|
end
|
17
15
|
|
18
16
|
def download
|
19
17
|
IO.copy_stream(
|
20
18
|
open(url),
|
21
|
-
"#{os.tmp_dir}/packages_#{
|
19
|
+
"#{os.tmp_dir}/packages_#{current_version}.tar"
|
22
20
|
)
|
23
21
|
|
24
|
-
"#{os.tmp_dir}/packages_#{
|
22
|
+
"#{os.tmp_dir}/packages_#{current_version}.tar"
|
25
23
|
end
|
26
24
|
|
27
25
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picobox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Surzycki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|