picobox 0.2.4 → 0.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 475edf01fc2f21de1b7200dc0559ceb2431e879a
4
- data.tar.gz: 719c2471673127f21bfc025e6235c190499e2f01
3
+ metadata.gz: 8ed4f8c0e2dec278d5f4cfd6978f567b7ac41c3b
4
+ data.tar.gz: bc23fbcb13649a2b223d982510a485b0e064ffaa
5
5
  SHA512:
6
- metadata.gz: 9dd433d1bb5e55d655d35b041ef528c2675a80f1cb440f3ba714344825203130b16447b31c2cce8f7a6c2d72eba2d33645d26aa61011cecfc4f3ef504f588112
7
- data.tar.gz: 92a7e808490894bb9c81410e6b85ddc3bd378794fe2e06de049e1b7cb7e5fcbc38027652c36b2825b89632a4dd80f8336c81cadaeda47bb4df86358a3e67ea94
6
+ metadata.gz: fc143f7f5f712ac59aa1afa3b40481208a6c939aad3190940aa30633089057ea898ec86e916ed189af650f74f71ab8d5ca04fe1eabd6c74ce29b51ab4ca1b817
7
+ data.tar.gz: d1100aede4e1e63558ff2416e9d94433114f73c0f7721a747f68fcc8a11fb7fbd13346ec2d2d3ce55bcbb17c66abdc45bb80dd63560c0173d7c4ce8f2cc29a47
data/README.md CHANGED
@@ -130,7 +130,7 @@ $ bundle exec byebug -R localhost:8989
130
130
  - [ ] Block most commands if picobox not installed
131
131
  - [ ] Some services should install thier own volumes
132
132
  - [ ] Box update function
133
-
133
+ - [ ] Remove TTY::File, TTY::Prompt dependency (needs native extensions)
134
134
  **http://blog.cloud66.com/using-ssh-private-keys-securely-in-docker-build/
135
135
 
136
136
  ## Contributing
@@ -64,9 +64,6 @@ RUN apt-get install -y nano git
64
64
  # make nano work
65
65
  RUN echo "export TERM=xterm" >> /etc/bash.bashrc
66
66
 
67
- # hook up cache volume
68
- ENV BUNDLE_PATH /bundle
69
-
70
67
  # working dir
71
68
  WORKDIR $APP_HOME
72
69
 
@@ -15,7 +15,6 @@ services:
15
15
  - bundle
16
16
  environment:
17
17
  RAILS_ENV: development
18
- BUNDLE_PATH: "/bundle"
19
18
  hostname: picobox
20
19
  ports:
21
20
  - 80:3000
@@ -29,7 +28,6 @@ services:
29
28
  - bundle
30
29
  environment:
31
30
  RAILS_ENV: test
32
- BUNDLE_PATH: "/bundle"
33
31
  hostname: picobox_test
34
32
  webpack:
35
33
  build: "."
@@ -40,11 +38,10 @@ services:
40
38
  - ".:/var/www:cached"
41
39
  environment:
42
40
  RAILS_ENV: development
43
- BUNDLE_PATH: "/bundle"
44
41
  hostname: picobox
45
42
  ports:
46
43
  - 8080:8080
47
44
  bundle:
48
45
  image: busybox
49
46
  volumes:
50
- - bundle-data:/bundle:cached
47
+ - bundle-data:/usr/local/bundle:cached
@@ -36,9 +36,6 @@ RUN apt-get install -y nano git
36
36
  # make nano work
37
37
  RUN echo "export TERM=xterm" >> /etc/bash.bashrc
38
38
 
39
- # hook up cache volume
40
- ENV BUNDLE_PATH /bundle
41
-
42
39
  # working dir
43
40
  WORKDIR $APP_HOME
44
41
 
@@ -13,10 +13,8 @@ services:
13
13
  - ".:/var/www:cached"
14
14
  volumes_from:
15
15
  - bundle
16
- environment:
17
- BUNDLE_PATH: "/bundle"
18
16
  hostname: picobox
19
17
  bundle:
20
18
  image: busybox
21
19
  volumes:
22
- - bundle-data:/bundle:cached
20
+ - bundle-data:/usr/local/bundle:cached
@@ -2,7 +2,7 @@ module Picobox
2
2
  module Commands
3
3
  class GetRootPermission < Picobox::Utils::VisitorByOs
4
4
  def visit_darwin subject
5
-
5
+
6
6
  end
7
7
 
8
8
 
@@ -1,6 +1,6 @@
1
1
  module Picobox
2
2
  # names for files / directories
3
- VERSION = '0.2.4'
3
+ VERSION = '0.2.5'
4
4
  HOMEPAGE = 'https://github.com/surzycki/picobox'
5
5
  CONFIG_DIR = '.picobox'
6
6
  PROJECT_INI = 'project.ini'
@@ -8,17 +8,19 @@ module Picobox
8
8
  def config_dir() "#{home_dir}/#{Picobox::CONFIG_DIR}" end
9
9
 
10
10
  def shell_extensions() "#{config_dir}/#{Picobox::SHELL_EXTENSIONS}" end
11
+ def user() "#{ENV['USER']}" end
11
12
  def user_shell() "#{ENV['SHELL']}" end
12
13
 
13
14
  # download and install
14
- def docker_filename() end
15
- def docker_url() end
16
- def docker_installer() end
17
- def docker_installed?() end
15
+ def docker_filename() end
16
+ def docker_url() end
17
+ def docker_installer() end
18
+ def docker_installed?() end
19
+ def docker_compose_installed?() end
18
20
 
19
21
  def docker_version?() `docker --version`.strip end
20
22
  def docker_compose_version?() `docker-compose --version`.strip end
21
-
23
+
22
24
  def to_s() raise ::NotImplementedError, 'must override to_s' end
23
25
 
24
26
  def project_root() Utils::Project.new(self).root end
@@ -6,7 +6,12 @@ module Picobox
6
6
  def docker_filename() 'Docker.dmg' end
7
7
  def docker_url() "https://download.docker.com/mac/stable/#{docker_filename}" end
8
8
  def docker_installer() "#{tmp_dir}/#{docker_filename}" end
9
- def docker_installed?() File.exist?('/Applications/Docker.app') end
9
+
10
+ def docker_installed?() File.exist?('/Applications/Docker.app') end
11
+ def docker_compose_installed() true end
12
+
13
+ def distro() :darwin end
14
+ def su() Os::Distro.su(self) end
10
15
 
11
16
  def to_s() :darwin end
12
17
  end
@@ -1,12 +1,12 @@
1
1
  module Picobox
2
2
  module Os
3
- class Distro
3
+ class Distro
4
4
  class << self
5
5
  def distro
6
6
  case `lsb_release -ids`.strip
7
7
  when /(Ubuntu)/
8
8
  :ubuntu
9
- when /(Debian)/
9
+ when /(Debian)/
10
10
  :debian
11
11
  when /(Fedora)/
12
12
  :fedora
@@ -20,10 +20,17 @@ module Picobox
20
20
  'sh -c'
21
21
  elsif TTY::Which.exist?('sudo')
22
22
  'sudo -E sh -c'
23
- elsif TTY::Which.exist?('su')
24
- 'su -c'
25
23
  else
26
- raise StandardError, "Error: this installer needs the ability to run commands as root.\n We are unable to find either 'sudo' or 'su' available to make this happen."
24
+ message = <<-END.gsub(/^\s+\|/, '')
25
+ |This installer needs the ability to run commands as root.
26
+ | We are unable to find 'sudo' available to make this happen.
27
+ |
28
+ | Either:
29
+ | * Install sudo and add yourself to sudoers
30
+ | * Run as root
31
+ |
32
+ END
33
+ raise StandardError, message
27
34
  end
28
35
  end
29
36
  end
@@ -3,20 +3,18 @@ module Picobox
3
3
  class Linux < Abstract
4
4
  class << self
5
5
  def to_s() :linux end
6
-
6
+
7
7
  def docker_installed?() TTY::Which.exist?('docker') end
8
8
  def docker_compose_installed?() TTY::Which.exist?('docker-compose') end
9
9
 
10
10
  def docker_compose_url() "https://github.com/docker/compose/releases/download/1.16.1/docker-compose-Linux-#{self.arch}" end
11
11
  def docker_compose() "/usr/local/bin/docker-compose" end
12
12
 
13
- def user() "#{ENV['USER']}" end
14
-
15
13
  def release() `lsb_release -cs`.strip end
16
14
  def kernel() `uname -r`.strip end
17
15
  def arch() `uname -m`.strip end
18
16
  def distro() Os::Distro.distro end
19
- def su() Os::Distro.su(self) end
17
+ def su() Os::Distro.su(self) end
20
18
  end
21
19
  end
22
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picobox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Surzycki