picobox 0.3.41 → 0.3.52
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -5
- data/lib/picobox.rb +1 -1
- data/lib/picobox/boxes/manifest.rb +3 -3
- data/lib/picobox/cli.rb +12 -12
- data/lib/picobox/commands/build_service.rb +2 -2
- data/lib/picobox/commands/update_packages.rb +7 -7
- data/lib/picobox/constants.rb +3 -7
- data/lib/picobox/os/abstract.rb +8 -3
- data/lib/picobox/services/installer.rb +1 -1
- data/lib/picobox/services/manifest.rb +3 -3
- data/lib/picobox/shell/startup_script.rb +3 -7
- data/lib/picobox/system.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cec22d0f2fb1a73b84e33438ccaba3a2152bb97
|
4
|
+
data.tar.gz: 90bc3839758d3a7184ed99ab86154f283e898b3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c905b22f26df3d228720a4b8dbc828ac38180862d03887d59779712d5afe79aea00b962f87ed786502908632446903221bad230e5e1524cb85a8ff33c5c940c
|
7
|
+
data.tar.gz: 9bfaaa3410d93a5264751b5e80c39b71ea7c7ff52401592c36d3af99a9cc1d0a7087207c801b2374cb00a7005a9416fff711a364e89920ab20a114a9103212f7
|
data/README.md
CHANGED
@@ -103,7 +103,7 @@ Options:
|
|
103
103
|
|
104
104
|
To run the tests you'll need ruby 2.3 since we are using the <<~EOS operator (un-indented multiline strings)
|
105
105
|
|
106
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `
|
106
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
107
107
|
|
108
108
|
To use without installing, use:
|
109
109
|
|
@@ -131,11 +131,10 @@ $ gem install pkg/picobox-x.x.x.gem
|
|
131
131
|
|
132
132
|
**debug during an aruba test run**
|
133
133
|
|
134
|
-
|
134
|
+
|
135
135
|
```ruby
|
136
|
-
|
137
|
-
|
138
|
-
Byebug.start_server('localhost', 8989)
|
136
|
+
export REMOTE_DEBUG=true
|
137
|
+
guard -g wip
|
139
138
|
```
|
140
139
|
then connect using:
|
141
140
|
```bash
|
data/lib/picobox.rb
CHANGED
@@ -6,7 +6,7 @@ module Picobox
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def list
|
9
|
-
result = Dir.glob("#{
|
9
|
+
result = Dir.glob("#{os.box_packages_dir}/*").select {|f| File.directory? f}
|
10
10
|
result.map {|r| strip_path(r) }.sort!
|
11
11
|
end
|
12
12
|
|
@@ -48,7 +48,7 @@ module Picobox
|
|
48
48
|
attr_reader :os, :type
|
49
49
|
|
50
50
|
def package_dir
|
51
|
-
"#{
|
51
|
+
"#{os.box_packages_dir}/#{type}"
|
52
52
|
end
|
53
53
|
|
54
54
|
def strip_path(file)
|
@@ -56,4 +56,4 @@ module Picobox
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
59
|
-
end
|
59
|
+
end
|
data/lib/picobox/cli.rb
CHANGED
@@ -4,7 +4,7 @@ module Picobox
|
|
4
4
|
long_desc <<-LONGDESC
|
5
5
|
LONGDESC
|
6
6
|
def build(service = nil)
|
7
|
-
Picobox.set_verbosity options[:
|
7
|
+
Picobox.set_verbosity !options[:silent]
|
8
8
|
|
9
9
|
Service.new(Os::CurrentOs.get).build service
|
10
10
|
rescue SignalException
|
@@ -16,7 +16,7 @@ module Picobox
|
|
16
16
|
long_desc <<-LONGDESC
|
17
17
|
LONGDESC
|
18
18
|
def add(*services)
|
19
|
-
Picobox.set_verbosity options[:
|
19
|
+
Picobox.set_verbosity !options[:silent]
|
20
20
|
|
21
21
|
Service.new(Os::CurrentOs.get).add services
|
22
22
|
rescue SignalException
|
@@ -28,7 +28,7 @@ module Picobox
|
|
28
28
|
long_desc <<-LONGDESC
|
29
29
|
LONGDESC
|
30
30
|
def remove(service)
|
31
|
-
Picobox.set_verbosity options[:
|
31
|
+
Picobox.set_verbosity !options[:silent]
|
32
32
|
|
33
33
|
Service.new(Os::CurrentOs.get).remove service
|
34
34
|
rescue SignalException
|
@@ -59,7 +59,7 @@ module Picobox
|
|
59
59
|
class CLI < Thor
|
60
60
|
include Utils::Output
|
61
61
|
|
62
|
-
class_option :
|
62
|
+
class_option :silent, desc: 'Silence output', type: :boolean
|
63
63
|
|
64
64
|
#desc 'dns SUBCOMMAND', 'do things with the DNS'
|
65
65
|
#long_desc <<-LONGDESC
|
@@ -86,7 +86,7 @@ module Picobox
|
|
86
86
|
long_desc <<-LONGDESC
|
87
87
|
LONGDESC
|
88
88
|
def install
|
89
|
-
Picobox.set_verbosity options[:
|
89
|
+
Picobox.set_verbosity !options[:silent]
|
90
90
|
System.new(Os::CurrentOs.get).install
|
91
91
|
rescue SignalException
|
92
92
|
exit 1
|
@@ -97,7 +97,7 @@ module Picobox
|
|
97
97
|
long_desc <<-LONGDESC
|
98
98
|
LONGDESC
|
99
99
|
def update
|
100
|
-
Picobox.set_verbosity options[:
|
100
|
+
Picobox.set_verbosity !options[:silent]
|
101
101
|
System.new(Os::CurrentOs.get).install
|
102
102
|
rescue SignalException
|
103
103
|
exit 1
|
@@ -108,7 +108,7 @@ module Picobox
|
|
108
108
|
long_desc <<-LONGDESC
|
109
109
|
LONGDESC
|
110
110
|
def uninstall
|
111
|
-
Picobox.set_verbosity options[:
|
111
|
+
Picobox.set_verbosity !options[:silent]
|
112
112
|
System.new(Os::CurrentOs.get).uninstall
|
113
113
|
rescue SignalException
|
114
114
|
exit 1
|
@@ -119,7 +119,7 @@ module Picobox
|
|
119
119
|
long_desc <<-LONGDESC
|
120
120
|
LONGDESC
|
121
121
|
def init(box)
|
122
|
-
Picobox.set_verbosity options[:
|
122
|
+
Picobox.set_verbosity !options[:silent]
|
123
123
|
|
124
124
|
os = Os::CurrentOs.get
|
125
125
|
|
@@ -136,7 +136,7 @@ module Picobox
|
|
136
136
|
long_desc <<-LONGDESC
|
137
137
|
LONGDESC
|
138
138
|
def start()
|
139
|
-
Picobox.set_verbosity options[:
|
139
|
+
Picobox.set_verbosity !options[:silent]
|
140
140
|
System.new(Os::CurrentOs.get).start
|
141
141
|
rescue SignalException
|
142
142
|
exit 1
|
@@ -147,7 +147,7 @@ module Picobox
|
|
147
147
|
long_desc <<-LONGDESC
|
148
148
|
LONGDESC
|
149
149
|
def stop()
|
150
|
-
Picobox.set_verbosity options[:
|
150
|
+
Picobox.set_verbosity !options[:silent]
|
151
151
|
System.new(Os::CurrentOs.get).stop
|
152
152
|
rescue SignalException
|
153
153
|
exit 1
|
@@ -158,7 +158,7 @@ module Picobox
|
|
158
158
|
long_desc <<-LONGDESC
|
159
159
|
LONGDESC
|
160
160
|
def restart()
|
161
|
-
Picobox.set_verbosity options[:
|
161
|
+
Picobox.set_verbosity !options[:silent]
|
162
162
|
System.new(Os::CurrentOs.get).restart
|
163
163
|
rescue SignalException
|
164
164
|
exit 1
|
@@ -207,4 +207,4 @@ module Picobox
|
|
207
207
|
exit 1
|
208
208
|
end
|
209
209
|
end
|
210
|
-
end
|
210
|
+
end
|
@@ -8,7 +8,7 @@ module Picobox
|
|
8
8
|
def visit_darwin subject
|
9
9
|
publish_event :build_service_start, service
|
10
10
|
system "docker-compose build #{service} #{Picobox.output}"
|
11
|
-
publish_event :build_service_stop
|
11
|
+
publish_event :build_service_stop
|
12
12
|
end
|
13
13
|
|
14
14
|
|
@@ -20,4 +20,4 @@ module Picobox
|
|
20
20
|
attr_reader :service
|
21
21
|
end
|
22
22
|
end
|
23
|
-
end
|
23
|
+
end
|
@@ -11,9 +11,9 @@ module Picobox
|
|
11
11
|
|
12
12
|
filename = packages.download
|
13
13
|
|
14
|
-
system("rm -rf #{
|
15
|
-
system("mkdir #{
|
16
|
-
system("tar xvf #{filename} -C #{
|
14
|
+
system("rm -rf #{os.packages_dir}")
|
15
|
+
system("mkdir #{os.packages_dir}")
|
16
|
+
system("tar xvf #{filename} -C #{os.packages_dir} --strip-components=1 #{Picobox.output}")
|
17
17
|
|
18
18
|
Shell::IniFile.get(os)[:packages] = { version: packages.current_version, last_update: Time.now.to_i }
|
19
19
|
|
@@ -32,9 +32,9 @@ module Picobox
|
|
32
32
|
|
33
33
|
filename = packages.download
|
34
34
|
|
35
|
-
system("sudo rm -rf #{
|
36
|
-
system("sudo mkdir #{
|
37
|
-
system("sudo tar xvf #{filename} -C #{
|
35
|
+
system("sudo rm -rf #{os.packages_dir}")
|
36
|
+
system("sudo mkdir #{os.packages_dir}")
|
37
|
+
system("sudo tar xvf #{filename} -C #{os.packages_dir} --strip-components=1 #{Picobox.output}")
|
38
38
|
|
39
39
|
Shell::IniFile.get(os)[:packages] = { version: packages.current_version, last_update: Time.now.to_i }
|
40
40
|
|
@@ -43,4 +43,4 @@ module Picobox
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
46
|
-
end
|
46
|
+
end
|
data/lib/picobox/constants.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Picobox
|
2
2
|
# names for files / directories
|
3
|
-
VERSION = '0.3.
|
3
|
+
VERSION = '0.3.52'
|
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'
|
@@ -10,11 +10,7 @@ module Picobox
|
|
10
10
|
|
11
11
|
|
12
12
|
module_function
|
13
|
-
def root()
|
14
|
-
def packages_dir() "#{Picobox.root}/packages" end
|
15
|
-
def box_packages_dir() "#{packages_dir}/boxes" end
|
16
|
-
def service_packages_dir() "#{packages_dir}/services" end
|
17
|
-
def extensions_dir() "#{packages_dir}/shell" end
|
13
|
+
def root() File.expand_path('../../..', __FILE__) end
|
18
14
|
|
19
15
|
def output() @output end
|
20
16
|
def verbose?() @verbose end
|
@@ -27,4 +23,4 @@ module Picobox
|
|
27
23
|
@output = '> /dev/null 2>&1'
|
28
24
|
end
|
29
25
|
end
|
30
|
-
end
|
26
|
+
end
|
data/lib/picobox/os/abstract.rb
CHANGED
@@ -5,9 +5,14 @@ module Picobox
|
|
5
5
|
def tmp_dir() '/tmp' end
|
6
6
|
def home_dir() "#{ENV['HOME']}" end
|
7
7
|
def current_dir() `pwd`.strip end
|
8
|
-
def config_dir() "#{home_dir}/#{Picobox::CONFIG_DIR}" end
|
9
8
|
|
10
|
-
def
|
9
|
+
def config_dir() "#{home_dir}/#{Picobox::CONFIG_DIR}" end
|
10
|
+
def packages_dir() "#{config_dir}/packages" end
|
11
|
+
def box_packages_dir() "#{packages_dir}/boxes" end
|
12
|
+
def service_packages_dir() "#{packages_dir}/services" end
|
13
|
+
def extensions_dir() "#{packages_dir}/shell" end
|
14
|
+
def shell_extensions() "#{extensions_dir}/#{Picobox::SHELL_EXTENSIONS}" end
|
15
|
+
|
11
16
|
def user() "#{ENV['USER']}" end
|
12
17
|
def user_shell() "#{ENV['SHELL']}" end
|
13
18
|
|
@@ -32,4 +37,4 @@ module Picobox
|
|
32
37
|
end
|
33
38
|
end
|
34
39
|
end
|
35
|
-
end
|
40
|
+
end
|
@@ -6,7 +6,7 @@ module Picobox
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def list
|
9
|
-
result = Dir.glob("#{
|
9
|
+
result = Dir.glob("#{os.service_packages_dir}/*").select {|f| File.directory? f}
|
10
10
|
result.map {|r| strip_path(r) }.sort!
|
11
11
|
end
|
12
12
|
|
@@ -35,7 +35,7 @@ module Picobox
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def package_dir
|
38
|
-
"#{
|
38
|
+
"#{os.service_packages_dir}/#{type}"
|
39
39
|
end
|
40
40
|
|
41
41
|
def strip_path(file)
|
@@ -47,4 +47,4 @@ module Picobox
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
50
|
-
end
|
50
|
+
end
|
@@ -21,7 +21,7 @@ module Picobox
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def install_extensions
|
24
|
-
source = "#{
|
24
|
+
source = "#{os.extensions_dir}/extensions.bash"
|
25
25
|
dest = os.shell_extensions
|
26
26
|
|
27
27
|
TTY::File.copy_file source, dest
|
@@ -45,13 +45,9 @@ module Picobox
|
|
45
45
|
end
|
46
46
|
|
47
47
|
private
|
48
|
-
def source_file
|
49
|
-
"~/#{Picobox::CONFIG_DIR}/#{Picobox::SHELL_EXTENSIONS}"
|
50
|
-
end
|
51
|
-
|
52
48
|
def extension
|
53
|
-
"# added by picobox\nsource #{
|
49
|
+
"# added by picobox\nsource #{os.shell_extensions}"
|
54
50
|
end
|
55
51
|
end
|
56
52
|
end
|
57
|
-
end
|
53
|
+
end
|
data/lib/picobox/system.rb
CHANGED
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.52
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Surzycki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -420,7 +420,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
420
420
|
version: '0'
|
421
421
|
requirements: []
|
422
422
|
rubyforge_project:
|
423
|
-
rubygems_version: 2.
|
423
|
+
rubygems_version: 2.5.2.3
|
424
424
|
signing_key:
|
425
425
|
specification_version: 4
|
426
426
|
summary: Docker development environment for humans
|