vagrant_cmd 0.0.1
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.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +1 -0
- data/lib/cmd.rb +21 -0
- data/lib/vagrant_cmd.rb +14 -0
- data/lib/vagrant_cmd/version.rb +3 -0
- data/vagrant_cmd.gemspec +23 -0
- metadata +74 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 TODO: Write your name
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# VagrantCmd
|
2
|
+
|
3
|
+
Vagrant plugin. execute windows cmd.exe with Vagrant environment variable
|
4
|
+
on windows host. PATH, GEM_HOME, ...
|
5
|
+
|
6
|
+
Vagrant for windows embedded ruby, gem, and MinGW system ( Minimalist GNU for Windows ).
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Install Vagrant 1.1 and execute
|
11
|
+
|
12
|
+
$ vagrant plugin install vagrant_cmd
|
13
|
+
|
14
|
+
## Usage
|
15
|
+
|
16
|
+
execute cmd.exe
|
17
|
+
$ vagrant cmd
|
18
|
+
|
19
|
+
and You can execute ruby, gem, ls ( MinGW commands ), ....
|
20
|
+
|
21
|
+
execute gem
|
22
|
+
$ vagrant cmd gem
|
23
|
+
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/cmd.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require "log4r"
|
2
|
+
|
3
|
+
module VagrantCmd
|
4
|
+
class Cmd < Vagrant.plugin("2", :command)
|
5
|
+
@logger = Log4r::Logger.new("VagrantCmd::Command")
|
6
|
+
def execute
|
7
|
+
args = ARGV.dup.drop_while{|i| i != "cmd" }
|
8
|
+
args.shift
|
9
|
+
env = {
|
10
|
+
"PATH" => File.join(@env.gems_path,'bin')+';'+ENV["PATH"]
|
11
|
+
}
|
12
|
+
if args.size > 0
|
13
|
+
args.unshift("/c")
|
14
|
+
else
|
15
|
+
env["PROMPT"]="[VAGRANT]$P$G"
|
16
|
+
end
|
17
|
+
@logger.info("execute cmd "+args.join(" "))
|
18
|
+
return system(env,"cmd",*args) ? 0 : 1
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/vagrant_cmd.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require "vagrant_cmd/version"
|
2
|
+
|
3
|
+
module VagrantCmd
|
4
|
+
class VagrantCmd < Vagrant.plugin("2")
|
5
|
+
name "vagrant_cmd"
|
6
|
+
description <<-DESC
|
7
|
+
The `cmd` command run cmd.exe on host machine with Vagrant environment ( PATH, GEM_HOME ...)
|
8
|
+
DESC
|
9
|
+
command "cmd" do
|
10
|
+
require_relative "cmd"
|
11
|
+
Cmd
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/vagrant_cmd.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'vagrant_cmd/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "vagrant_cmd"
|
8
|
+
gem.version = VagrantCmd::VERSION
|
9
|
+
gem.authors = ["nazoking"]
|
10
|
+
gem.email = ["nazoking@gmail.com"]
|
11
|
+
gem.summary = %q{vagrant plugin. execute cmd.exe with vagrant environment variable}
|
12
|
+
gem.description = <<-DESC
|
13
|
+
vagrant plugin. add `cmd` sub-command.
|
14
|
+
The `cmd` command run cmd.exe on host machine with Vagrant environment ( PATH, GEM_HOME ...)
|
15
|
+
DESC
|
16
|
+
|
17
|
+
gem.homepage = "https://github.com/nazoking/vagrant_cmd"
|
18
|
+
|
19
|
+
gem.files = `git ls-files`.split($/)
|
20
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
21
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
22
|
+
gem.require_paths = ["lib"]
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vagrant_cmd
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- nazoking
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2013-04-16 00:00:00 Z
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: " vagrant plugin. add `cmd` sub-command.\n The `cmd` command run cmd.exe on host machine with Vagrant environment ( PATH, GEM_HOME ...)\n"
|
22
|
+
email:
|
23
|
+
- nazoking@gmail.com
|
24
|
+
executables: []
|
25
|
+
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files: []
|
29
|
+
|
30
|
+
files:
|
31
|
+
- .gitignore
|
32
|
+
- Gemfile
|
33
|
+
- LICENSE.txt
|
34
|
+
- README.md
|
35
|
+
- Rakefile
|
36
|
+
- lib/cmd.rb
|
37
|
+
- lib/vagrant_cmd.rb
|
38
|
+
- lib/vagrant_cmd/version.rb
|
39
|
+
- vagrant_cmd.gemspec
|
40
|
+
homepage: https://github.com/nazoking/vagrant_cmd
|
41
|
+
licenses: []
|
42
|
+
|
43
|
+
post_install_message:
|
44
|
+
rdoc_options: []
|
45
|
+
|
46
|
+
require_paths:
|
47
|
+
- lib
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
hash: 3
|
54
|
+
segments:
|
55
|
+
- 0
|
56
|
+
version: "0"
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 3
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
version: "0"
|
66
|
+
requirements: []
|
67
|
+
|
68
|
+
rubyforge_project:
|
69
|
+
rubygems_version: 1.8.15
|
70
|
+
signing_key:
|
71
|
+
specification_version: 3
|
72
|
+
summary: vagrant plugin. execute cmd.exe with vagrant environment variable
|
73
|
+
test_files: []
|
74
|
+
|