vagrant-lxss-plugin 0.0.1 → 0.1.2

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: ee38d5c2fb47a3656e3cee7398839e337f5010f4
4
- data.tar.gz: 57cdcb81eaebf34f449a56c8b315d99d1a5db5a8
3
+ metadata.gz: 35abb438782703a15fc982c8fcc260f039c9cbce
4
+ data.tar.gz: 7a11713022ebaf95cf70250fdf41671292e8234b
5
5
  SHA512:
6
- metadata.gz: 007e5eff95831526c0edebb52575dba447d7965719c837f2b57a9d4ea14019d6f1529dd15820b8433c118a76fe6b9331a3c6b00001a74c92c9ad5fa804984ee3
7
- data.tar.gz: 3a98aa80133cf5558776f2dfb966c8fef865e95b9ff5ef6e6c47f8a59b47a37e0f2a064fb426444e53385168ddc69a0556e8a0e3ff1e2f0220ec017f872a2099
6
+ metadata.gz: 97371b5ce681258c0836b669a13244b2b1d3b2dadac16350e33270fa31dee3e4b0e6ca8f3c647e15ff89162e3de9a23d4bd4385505d6a79393b1caada6afbde8
7
+ data.tar.gz: bb90c6e691f9a1737619138f05178be6f8f0f6f492253d4b5b5006950f9e053c941a53c4a902b31a4abcb853335a2b3eae5d473af9c51308a7de7a8cbfdf63f6
data/.gitignore CHANGED
@@ -8,4 +8,4 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  Gemfile.lock
11
- .tags*
11
+ tags
data/Gemfile CHANGED
@@ -2,6 +2,7 @@ source "http://rubygems.org"
2
2
 
3
3
  group :development do
4
4
  gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
5
+ gem "rake"
5
6
  end
6
7
 
7
8
  group :plugins do
data/README.MD CHANGED
@@ -1,4 +1,43 @@
1
1
  vagrant-lxss-plugin
2
2
  ===================
3
3
 
4
+ [![Gem Version ](https://img.shields.io/gem/v/vagrant-lxss-plugin.svg?style=flat-square)](https://rubygems.org/gems/vagrant-lxss-plugin)
5
+ [![Gem Downloads](https://img.shields.io/gem/dt/vagrant-lxss-plugin.svg?style=flat-square)](https://rubygems.org/gems/vagrant-lxss-plugin)
6
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/csh/vagrant-lxss-plugin/master/LICENSE)
7
+ [![GitHub issues](https://img.shields.io/github/issues/csh/vagrant-lxss-plugin.svg?style=flat-square)](https://github.com/csh/vagrant-lxss-plugin/issues)
8
+
4
9
  Simple plugin to enable you to SSH into Vagrant machines using Bash on Ubuntu on Windows.
10
+
11
+ _This serves as a way of getting me back into Ruby, so there may be some silly bugs._
12
+
13
+ ### Installation
14
+
15
+ Obviously to make use of this plugin you must have Bash on Ubuntu on Windows installed,
16
+ I won't cover that here so here's [a nice article][install_bash] on how to do it.
17
+
18
+ Install the plugin from RubyGems using the following command:
19
+
20
+ ```
21
+ vagrant plugin install vagrant-lxss-plugin
22
+ ```
23
+
24
+ Alternatively if you feel like the `master` branch is more up-to-date than the
25
+ released version then you may run the following commands to install the latest
26
+ version:
27
+
28
+ ```
29
+ git clone https://github.com/csh/vagrant-lxss-plugin.git
30
+ cd vagrant-lxss-plugin
31
+ rake build
32
+ vagrant plugin install pkg/vagrant-lxss-plugin-x.x.x.gem
33
+ ```
34
+
35
+ ### Usage
36
+
37
+ Once the plugin is installed you simply use `bash` instead of `ssh` when connecting to a VM.
38
+
39
+ ```
40
+ vagrant bash homestead-7
41
+ ```
42
+
43
+ [install_bash]: http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
@@ -1,3 +1,4 @@
1
1
  require 'vagrant-lxss-plugin/command'
2
2
  require 'vagrant-lxss-plugin/plugin'
3
3
  require 'vagrant-lxss-plugin/version'
4
+ require 'vagrant-lxss-plugin/errors'
@@ -1,3 +1,4 @@
1
+ require_relative 'errors'
1
2
  require 'optparse'
2
3
 
3
4
  module VagrantLxss
@@ -7,8 +8,7 @@ module VagrantLxss
7
8
  end
8
9
 
9
10
  def execute
10
- raise Vagrant::Errors::CapabilityHostNotDetected unless is_win_x?
11
- raise Vagrant::Errors::CapabilityNotFound unless is_bash_installed?
11
+ raise VagrantLxss::RequiredProcessNotFound unless is_bash_installed?
12
12
 
13
13
  options = {
14
14
  :help => false
@@ -38,7 +38,7 @@ module VagrantLxss
38
38
  ssh_options = ["#{ssh_info[:username]}@#{ssh_info[:host]}"]
39
39
  ssh_options += ["-p #{ssh_info[:port]}"] if ssh_info[:port] != 22
40
40
  ssh_options += ["-A"] if ssh_info[:forward_agent]
41
- ssh_options += ["-v"]
41
+ # ssh_options += ["-v"]
42
42
 
43
43
  key_file = nil
44
44
  dir = nil
@@ -58,27 +58,14 @@ module VagrantLxss
58
58
  end
59
59
 
60
60
  command = "C:\\Windows\\system32\\bash.exe -c 'ssh #{ssh_options.join(' ')}'"
61
- @logger.info("Full command: #{command}")
62
- output = system(command)
63
- @logger.info("Output: #{output}")
61
+ @logger.debug("Full command: \"#{command}\"")
62
+ system(command)
64
63
  return 0
65
64
  end
66
65
  end
67
66
 
68
67
  def is_bash_installed?
69
- system("C:\\Windows\\system32\\bash.exe -c 'echo \"hello\"'")
70
- end
71
-
72
- def is_win_x?
73
- false unless Gem.win_platform?
74
- result = `cmd /C ver`
75
- return result =~ /\[Version 10.*\]/
76
- end
77
-
78
- def convert_path (path)
79
- path = path.gsub '\\', '/'
80
- path = path.gsub (/^([A-Z])\:\//i) { '/mnt/' << $1.downcase << '/' }
81
- return path
68
+ return system("C:\\Windows\\system32\\bash.exe -c 'printf \"\n\"'")
82
69
  end
83
70
  end
84
71
  end
@@ -0,0 +1,18 @@
1
+ module VagrantLxss
2
+ class RequiredProcessNotFound < Vagrant::Errors::VagrantError
3
+ error_message <<-EOF
4
+ Could not find Bash installed on your system.
5
+ Please follow the guide here to enable it:
6
+ http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
7
+
8
+ If you are not using Windows 10 then you won't be able to make use of this
9
+ plugin out of the box. You may work around this by placing a valid bash
10
+ executable in the following directory:
11
+ C:\\Windows\\system32\\
12
+
13
+ The executable path is hardcoded to prevent potential blunders where some
14
+ powerusers may have other bash executables in their %PATH%. You will not
15
+ receive any support if you use a third party executable.
16
+ EOF
17
+ end
18
+ end
@@ -6,7 +6,7 @@ module VagrantLxss
6
6
  description "vagrant-lxss-plugin allows you to ssh into your virtual machines using Bash on Ubuntu on Windows 10"
7
7
 
8
8
  command "bash" do
9
- require File.expand_path("../command", __FILE__)
9
+ require_relative 'command'
10
10
  Command
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module VagrantLxss
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-lxss-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connor Spencer Harries
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-01 00:00:00.000000000 Z
11
+ date: 2016-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,7 @@ files:
52
52
  - Rakefile
53
53
  - lib/vagrant-lxss-plugin.rb
54
54
  - lib/vagrant-lxss-plugin/command.rb
55
+ - lib/vagrant-lxss-plugin/errors.rb
55
56
  - lib/vagrant-lxss-plugin/plugin.rb
56
57
  - lib/vagrant-lxss-plugin/version.rb
57
58
  - vagrant-lxss-plugin.gemspec