vagrant-iniconfig 0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 43bf5b2fd850f96dd9ad47cb5f6878cdd2f80995
4
+ data.tar.gz: 590d4316f86217b9db31eb9200747082dfbffe55
5
+ SHA512:
6
+ metadata.gz: c9ae7982b0a0cda4b6bdf36375264f1841ffd685ac0b1945f653455162257a84cfc8f26d0a887fe927f1170f387b80519190e50f9adefd2c40f049594bd81c5d
7
+ data.tar.gz: 16fcb0da50a515a1514026af0b0214959a74442542273844523e743a8aa7f781e41d8f7906a7c6e8ff7f0923c247e3a6365a337b6055cf747aa5b94180435db6
data/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ Vagrantfile
19
+ pkg/
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vagrant-iniconfig.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git"
8
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Daniel Enman
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,37 @@
1
+ # Vagrant::Iniconfig
2
+
3
+ Use a INI file to manage your configuration for Vagrant. This might be useful
4
+ if you are using Vagrant in multiple environments, and want to use different
5
+ configuration options for each environment.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'vagrant-iniconfig'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install vagrant-iniconfig
20
+ $ vagrant plugin install pkg/vagrant-iniconfig-0.1.gem
21
+
22
+ ## Usage
23
+
24
+ In your Vagrantfile, add
25
+
26
+ Vagrant.require_plugin 'vagrant-iniconfig'
27
+
28
+ Then in your configuration
29
+
30
+ VAGRANTFILE_API_VERSION = "2"
31
+ Vagrant.config(VAGRANTFILE_API_VERSION) do |config|
32
+ ...
33
+ config.ini.file = 'path/to/file.ini'
34
+
35
+ Your INI configurations are then available on
36
+
37
+ config.ini.config
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ Dir.chdir(File.expand_path("../", __FILE__))
5
+
6
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,10 @@
1
+ require_relative "vagrant-iniconfig/plugin"
2
+ require_relative "vagrant-iniconfig/version"
3
+
4
+ module VagrantPlugins
5
+ module IniConfig
6
+ def self.source_root
7
+ @source_root ||= Pathname.new(File.expand_path('../../', __FILE__))
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,31 @@
1
+ require "vagrant"
2
+ require "inifile"
3
+
4
+ module VagrantPlugins
5
+ module IniConfig
6
+ class Config < Vagrant.plugin("2", :config)
7
+ attr_accessor :file
8
+ attr_accessor :config
9
+
10
+ def initialize
11
+ @file = UNSET_VALUE
12
+ @config = UNSET_VALUE
13
+
14
+ @_finalized = false
15
+ end
16
+
17
+ def file=(file)
18
+ @file = file
19
+ @config = IniFile.load file
20
+ end
21
+
22
+ def finalize!
23
+ @file = nil if @file == UNSET_VALUE
24
+ @config = nil if @config == UNSET_VALUE
25
+
26
+ @_finalized = true
27
+ end
28
+ end
29
+ end
30
+ end
31
+
@@ -0,0 +1,28 @@
1
+ begin
2
+ require "vagrant"
3
+ rescue LoadError
4
+ raise "Sorry, you can only use this plugin in a Vagrant environment"
5
+ end
6
+
7
+ require_relative "version"
8
+
9
+ if Vagrant::VERSION < "1.2.0"
10
+ raise "Sorry, this plugin only works on Vagrant 1.2.0+"
11
+ end
12
+
13
+ module VagrantPlugins
14
+ module IniConfig
15
+ class Plugin < Vagrant.plugin('2')
16
+ name "IniConfig"
17
+ description <<-DESCRIPTION
18
+ Use Ini configuration files in Vagrant
19
+ DESCRIPTION
20
+
21
+ config(:ini) do
22
+ require_relative "config"
23
+ Config
24
+ end
25
+ end
26
+ end
27
+ end
28
+
@@ -0,0 +1,5 @@
1
+ module VagrantPlugins
2
+ module IniConfig
3
+ VERSION = "0.1"
4
+ end
5
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ require 'vagrant-iniconfig/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "vagrant-iniconfig"
9
+ spec.version = VagrantPlugins::IniConfig::VERSION
10
+ spec.authors = ["Daniel Enman"]
11
+ spec.email = ["enmand@gmail.com"]
12
+ spec.description = %q{Use ini-based configuration in your Vagrantfile}
13
+ spec.summary = %q{Use ini-based configuration in your Vagrantfile}
14
+ spec.homepage = "https://github.com/enmand/vagrant-iniconfig"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files`.split($/)
18
+ spec.require_path = "lib"
19
+
20
+ spec.add_runtime_dependency "inifile"
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.3"
23
+ spec.add_development_dependency "rake"
24
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-iniconfig
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Enman
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: inifile
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Use ini-based configuration in your Vagrantfile
56
+ email:
57
+ - enmand@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - lib/vagrant-iniconfig.rb
68
+ - lib/vagrant-iniconfig/config.rb
69
+ - lib/vagrant-iniconfig/plugin.rb
70
+ - lib/vagrant-iniconfig/version.rb
71
+ - vagrant-iniconfig.gemspec
72
+ homepage: https://github.com/enmand/vagrant-iniconfig
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.0.14
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Use ini-based configuration in your Vagrantfile
96
+ test_files: []