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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 402514d6b3f2e61a23162e553a374ebf16b2b858
4
- data.tar.gz: 64e4e09effbadcb2ee9abd0fb7be6e05b0a60035
3
+ metadata.gz: b7b0e8e40c8ceeafa7cb79219419862956e7dbd9
4
+ data.tar.gz: 7635634d707c967cf388bb9aab972350035911bf
5
5
  SHA512:
6
- metadata.gz: 31eb5aa3df0845d2f88c2e3d0e3a6d3e0f0ec4fcb8492e612659f8e5c3b2787cae10bdad6508252b1b67f4d3d87703dee3086d602276bde7150e9f704ce525e9
7
- data.tar.gz: 2c5bbb347a212554698af4fa6d6d39c4e9f7765f058cca52c7ee2c7357583f60b99184fb4615aa9fdf026703b4c2aaf55a365bba68410941d70ccf48c1f290c3
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.version, last_update: Time.now.to_i }
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
@@ -1,6 +1,6 @@
1
1
  module Picobox
2
2
  # names for files / directories
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  HOMEPAGE = 'https://github.com/surzycki/picobox'
5
5
  PACKAGES_INFO_URL = 'https://api.github.com/repos/picobox/packages/releases/latest'
6
6
  CONFIG_DIR = '.picobox'
@@ -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
- installed_version = Picobox::Shell::IniFile.get(os)['packages']['version']
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_#{version}.tar"
19
+ "#{os.tmp_dir}/packages_#{current_version}.tar"
22
20
  )
23
21
 
24
- "#{os.tmp_dir}/packages_#{version}.tar"
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.0
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-09-27 00:00:00.000000000 Z
11
+ date: 2017-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug