vagrant-guest-qnx 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6cde9b1e65cf93cdf5d0787b2ba79fb9b966b1d9
4
+ data.tar.gz: b048d1c24202cee5c3ee84d5fb0a493dac2d7bb4
5
+ SHA512:
6
+ metadata.gz: 1c33dfd42a26a3bb3b901da5f635960149c6506649e915eb5cfe55fbbe6f8dab9201525e287f800332881bf7edaba340572e0cf91bceec590aa527d0d46f1302
7
+ data.tar.gz: 3aa6f1c9be2ea4bb1f4ee815c677f2a24dbe69584d9e3ef63eb0daf82780254ef3673cf56537effa53040f531f89fbf54fe6f1daaa9052fa17d95a1399e9c6dd
@@ -0,0 +1,7 @@
1
+ begin
2
+ require 'vagrant'
3
+ rescue LoadError
4
+ raise 'The Vagrant Guest QNX plugin must be run within vagrant'
5
+ end
6
+
7
+ require_relative 'vagrant/plugin'
@@ -0,0 +1,11 @@
1
+ module VagrantPlugins
2
+ module GuestQNX
3
+ module Cap
4
+ class ChangeHostName
5
+ def self.change_host_name(machine, name)
6
+ machine.communicate.execute("hostname '#{name}'")
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,18 @@
1
+ module VagrantPlugins
2
+ module GuestQNX
3
+ module Cap
4
+ class ConfigureNetworks
5
+ def self.configure_networks(machine,networks)
6
+ machine.ui.warn("networking")
7
+ networks.each do |network|
8
+ if network[:type].to_sym == :static
9
+ machine.communicate.execute("su -c - \"ifconfig wm#{network[:interface]} inet #{network[:ip]} netmask #{network[:netmask]}\"")
10
+ elsif network[:type].to_sym == :dhcp
11
+ machine.communicate.execute("su -c - \"dhcp.client -i wm#{network[:interface]}\"")
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ module VagrantPlugins
2
+ module GuestQNX
3
+ module Cap
4
+ class Halt
5
+ def self.halt(machine)
6
+ begin
7
+ machine.communicate.execute("su -c - \"/bin/shutdown -b\"")
8
+ rescue IOError
9
+ # Ignore, this probably means connection closed because it
10
+ # shut down.
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ require "vagrant"
2
+
3
+ module VagrantPlugins
4
+ module GuestQNX
5
+ class Guest < Vagrant.plugin("2", :guest)
6
+ def detect?(machine)
7
+ machine.communicate.test('uname -s | grep QNX')
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,28 @@
1
+ module VagrantPlugins
2
+ module GuestQNX
3
+ class Plugin < Vagrant.plugin("2")
4
+ name "QNX Neutrino guest."
5
+ description "QNX Neutrino support."
6
+
7
+ guest("qnx") do
8
+ require File.expand_path("../guest", __FILE__)
9
+ Guest
10
+ end
11
+
12
+ guest_capability("qnx", "change_host_name") do
13
+ require_relative "cap/change_host_name"
14
+ Cap::ChangeHostName
15
+ end
16
+
17
+ guest_capability("qnx", "halt") do
18
+ require_relative "cap/halt"
19
+ Cap::Halt
20
+ end
21
+
22
+ guest_capability("qnx", "configure_networks") do
23
+ require_relative "cap/configure_networks"
24
+ Cap::ConfigureNetworks
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1 @@
1
+ require_relative 'qnx/vagrant'
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-guest-qnx
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Vassilis Rizopoulos
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-10-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hoe
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '3.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '3.7'
27
+ description: "A plugin to allow vagrant to recognize instances of QNX Neutrino RTOS.
28
+ \n\nGuest capabilities are limited to what I can find from other providers and map
29
+ to QNX.\n\nCurrently:\n\n * halt\n * change_hostname"
30
+ email:
31
+ - vassilisrizopoulos@gmail.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - lib/vagrant-guest-qnx.rb
37
+ - lib/qnx/vagrant.rb
38
+ - lib/qnx/vagrant/plugin.rb
39
+ - lib/qnx/vagrant/guest.rb
40
+ - lib/qnx/vagrant/cap/halt.rb
41
+ - lib/qnx/vagrant/cap/change_host_name.rb
42
+ - lib/qnx/vagrant/cap/configure_networks.rb
43
+ homepage: http://github.com/damphyr/vagrant-qnx/vagrant-guest-qnx
44
+ licenses:
45
+ - MIT
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options:
49
+ - --main
50
+ - README.md
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubyforge_project: vagrant-guest-qnx
65
+ rubygems_version: 2.0.3
66
+ signing_key:
67
+ specification_version: 4
68
+ summary: A vagrant plugin for QNX Neutrino RTOS guests
69
+ test_files: []