vagrant-ruby 0.1.0 → 0.2.0

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: c32b7bf20347664e5133c3d1144e2e72ce284026
4
- data.tar.gz: 61312965535dd1ed61db74839cb6ad0628107852
3
+ metadata.gz: 8bf8ed159bb358a5d35db45d371cc69334757dea
4
+ data.tar.gz: 4759fabdbdc6f1152b7f1d3d861193b055319c4e
5
5
  SHA512:
6
- metadata.gz: 6650a2ed95a8bfd9f39d8ad4d24d8d1c62ba74784e2a28b6315e8e0a52999d177d0efeae6f6eead14e84154e02ac18707a3d3591e80ddb0474ee14dfa6d42875
7
- data.tar.gz: f669b4efb39591a7992fd3dcac8930c882a8bc30a6e081293c03e7cc4ab9d9aef4031ea2cb294910ca99025f1af281599a2d334b04f1d1be8e826d429a32e687
6
+ metadata.gz: 9c4943f1034084ed9ea3d1253debed0120cddd8f57def5dd7d685947381f3f19420e61af91f4f6190174f8562e2f2d54ab168879cf8ce9b9811e4c8eda1bcdf6
7
+ data.tar.gz: 51d0ffae863d09e1a9671c6748d8c967ec39c4f927f324682866c0ae4b792466894d570055ca66caf2371e79c78149b0290c0dc8e07eca997e2a2c9aa632ca48
@@ -18,20 +18,21 @@
18
18
  #
19
19
 
20
20
  require 'rubygems'
21
- require 'vagrant/ruby/version'
22
21
 
23
22
  module Vagrant
24
23
  module Ruby
25
- COMMANDS = %w{gem irb rake rdoc ruby}
24
+ COMMANDS = %w{gem irb rake rdoc}
26
25
 
27
26
  class Command < Vagrant.plugin('2', :command)
28
27
  attr_reader :name
28
+ attr_reader :flags
29
29
 
30
30
  def initialize(name)
31
31
  @name = name
32
32
  end
33
33
 
34
- def new(*_) # Oy vey.
34
+ def new(flags, *_)
35
+ @flags = flags
35
36
  self
36
37
  end
37
38
 
@@ -39,16 +40,49 @@ module Vagrant
39
40
  "execute Vagrant's embedded #{name}"
40
41
  end
41
42
 
43
+ def with_clean_env
44
+ if not defined? ::Bundler
45
+ yield
46
+ else
47
+ ::Bundler.with_clean_env do
48
+ yield
49
+ end
50
+ end
51
+ end
52
+
42
53
  def execute
43
- command = File.join(Gem.default_bindir, name)
44
- Process.exec([command, name], *ARGV[1..-1])
54
+ with_clean_env do
55
+ command = File.join(Gem.default_bindir, name)
56
+ Process.exec([command, name], *flags)
57
+ end
58
+ end
59
+ end
60
+
61
+ class Ruby < Command
62
+ def execute
63
+ preflags, subcommand, subflags = split_main_and_subcommand(flags)
64
+ case subcommand
65
+ when 'exec'
66
+ Command.new(subflags.first).new(subflags.slice(1..-1)).execute
67
+ when 'ruby'
68
+ Command.new('ruby').new(preflags + subflags).execute
69
+ else
70
+ Command.new('ruby').new(flags).execute
71
+ end
45
72
  end
46
73
  end
47
74
 
48
75
  class Plugin < Vagrant.plugin('2')
49
76
  name 'ruby'
77
+
78
+ command('ruby') do
79
+ Ruby.new('ruby')
80
+ end
81
+
50
82
  COMMANDS.each do |name|
51
- command(name) { Command.new(name) }
83
+ command(name) do
84
+ Command.new(name)
85
+ end
52
86
  end
53
87
  end
54
88
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2016 Catalyst.net Ltd
2
+ # Copyright (c) 2016-2017 Catalyst.net Ltd
3
3
  #
4
4
  # This file is part of vagrant-ruby.
5
5
  #
@@ -20,6 +20,6 @@
20
20
  module Vagrant
21
21
  module Ruby
22
22
  NAME = 'vagrant-ruby'
23
- VERSION = '0.1.0'
23
+ VERSION = '0.2.0'
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Hanson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-23 00:00:00.000000000 Z
11
+ date: 2017-07-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Adds subcommands for Vagrant's embedded Ruby and associated programs
14
14
  email: evanh@catalyst.net.nz
@@ -16,8 +16,8 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
- - lib/vagrant/ruby.rb
20
- - lib/vagrant/ruby/version.rb
19
+ - lib/vagrant-ruby.rb
20
+ - lib/vagrant-ruby/version.rb
21
21
  homepage: https://gitlab.com/catalyst-it/vagrant-ruby
22
22
  licenses:
23
23
  - GPL-3.0
@@ -38,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  version: '0'
39
39
  requirements: []
40
40
  rubyforge_project:
41
- rubygems_version: 2.5.1
41
+ rubygems_version: 2.6.12
42
42
  signing_key:
43
43
  specification_version: 4
44
44
  summary: Use Vagrant's embedded Ruby commands