vagrant-yarrs-and-yamls 0.9 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MzAwNzA5MDhlZGNiYTg0MWRlMTgzZmIxZGMyMWNiMjcwN2FlYjcwMA==
5
- data.tar.gz: !binary |-
6
- MTY2YjNjZGM3OTc5YzAxNDk5NDRhZTZhNDY4YzEwOTM3YmY3MDE5Zg==
2
+ SHA1:
3
+ metadata.gz: 5620eba7b20e6720970bb799fdaecc771fe5feac
4
+ data.tar.gz: 33877ae687ba5a202b554b5e6e88b5def2fba024
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MWRmMjFjZGMxZDVlYTk5YzEzZGJlMjE2NDJkMTAxNGE3Y2M3NmFjM2RkYWVl
10
- MTkyYWY1OGNmMDA2ZTc5YWE0MGVmMzhlZjQyMTdlMGNmMTJiZTI5NzAzYWU5
11
- NWIwZjUwMDkwMDVmNTZjMTUyZDBkOGZhNzllYzBlMjk1MTQ4MWQ=
12
- data.tar.gz: !binary |-
13
- NTNkZGE5MTI0NDg1YWIxZmUzNjFjMmNiNDk5NGQ3NTc5ZjI2OTRhNjVkMjY3
14
- M2VjNzk2ZmEwYzdjOTY4NGUxZTYxMjMxZWIyYmEwZjQ2NGJkOTVhNmRhZDA0
15
- NmRhYzA5M2JmZjc2M2Q4MWQ0NDA4ODk0YWY0M2YzMDZjNTU5ZGQ=
6
+ metadata.gz: eaa35c6987f7b9e57ecba55e1c221001ac16bd591c91b72d7f2c84da2ea2dc051c8636d4fada0c3a0ecb7b492e47a89c0b09e7496683b67a84f0a0d7a745462e
7
+ data.tar.gz: c49c1015333976256307e01eeff0412c30a232833fc0ea01b18da84568bd23c5cec6d51748755adc398111f97d5e0dbe19829949806f8699513db703ef19efd0
@@ -0,0 +1,19 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
5
+ # configures the configuration version (we support older styles for
6
+ # backwards compatibility). Please don't change it unless you know what
7
+ # you're doing.
8
+ Vagrant.configure(2) do |config|
9
+ # The most common configuration options are documented and commented below.
10
+ # For a complete reference, please see the online documentation at
11
+ # https://docs.vagrantup.com.
12
+
13
+ # Advanced use:
14
+ # yarrs('Yarrs.yaml', config) do |hostname, settings|
15
+ # end
16
+
17
+ # Regular use:
18
+ yarrs('Yarrs.yaml', config)
19
+ end
data/Yarrs.example.yaml CHANGED
@@ -3,18 +3,29 @@
3
3
  # For more information and examples, please see the online documentation at
4
4
  # https://github.com/ptahdunbar/yarrs-and-yamls
5
5
  ---
6
- boxes:
7
- - hostname: vagrant
8
- box: ubuntu/trusty64
9
- ip: "10.10.10.100"
10
- synced_folders:
11
- - host: "."
12
- guest: "/var/www"
13
- # type: "nfs"
14
- owner: "www-data"
15
- group: "www-data"
16
- mount_options:
17
- - dmode=775
18
- - fmode=667
19
- provision:
20
- - path: script.sh
6
+ hostname: vagrant
7
+ box: ubuntu/trusty64
8
+ ip: "10.10.10.100"
9
+ update: true
10
+ # nodejs: true
11
+ # php:
12
+ # - xdebug
13
+ # - composer
14
+ # - wp
15
+ # databases:
16
+ # - foo
17
+ # - bar
18
+ # synced_folders:
19
+ # - host: "."
20
+ # guest: "/var/www"
21
+ # type: "nfs"
22
+ # #owner: "www-data"
23
+ # #group: "www-data"
24
+ # #mount_options:
25
+ # # - dmode=775
26
+ # # - fmode=667
27
+ # provision:
28
+ # - path: provision/apache2.sh
29
+ # variables:
30
+ # - key: FOO
31
+ # value: bar
@@ -0,0 +1,54 @@
1
+ require_relative "api"
2
+
3
+ module VagrantPlugins
4
+ module YarrsAndYamls
5
+ class Plugin < Vagrant.plugin(2)
6
+ class Command < Vagrant.plugin(2, :command)
7
+
8
+ def synopsis
9
+ "generates a starter Yarrs.yaml"
10
+ end
11
+
12
+ def execute
13
+ create_vagrant_file
14
+ create_yaml_file("Yarrs.yaml")
15
+
16
+ @env.ui.success("yarrs-and-yamls: Successfully created Yarrs.yaml file!")
17
+ @env.ui.success("yarrs-and-yamls: Next step - edit Yarrs.yaml then vagrant up")
18
+ 0
19
+ end
20
+
21
+ def create_vagrant_file
22
+ source = File.expand_path('../../../Vagrantfile.example', __FILE__)
23
+ dest = Dir.pwd + '/Vagrantfile'
24
+ copy_file source, dest
25
+ end
26
+
27
+ def create_yaml_file(file)
28
+ source = File.expand_path('../../../Yarrs.example.yaml', __FILE__)
29
+ dest = Dir.pwd + "/#{file}"
30
+ copy_file source, dest
31
+ end
32
+
33
+ def copy_file(source, dest)
34
+ source = File.realpath(source)
35
+ backup_file(dest)
36
+ FileUtils.copy_file source, dest
37
+ end
38
+
39
+ def backup_file(source)
40
+ dest = timestamp_filename(source)
41
+ FileUtils.mv source, dest, :force => true if File.exists? source
42
+ end
43
+
44
+ def timestamp_filename(file)
45
+ dir = File.dirname(file)
46
+ base = File.basename(file, ".*")
47
+ time = Time.now.to_i
48
+ ext = File.extname(file)
49
+ File.join(dir, "#{base}.bak.#{time}#{ext}")
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -6,49 +6,9 @@ module VagrantPlugins
6
6
  class Plugin < Vagrant.plugin(2)
7
7
  name "vagrant-yarrs-and-yamls"
8
8
 
9
- @@config = false
10
-
11
- action_hook(:init, :environment_unload) { maybe_create_yaml_file }
12
- # action_hook(:load_config, Plugin::ALL_ACTIONS) { load_config }
13
-
14
- def self.maybe_create_yaml_file
15
- ARGV.each do |arg|
16
- if arg.include?('init') || arg.include?('--yaml') || arg.include?('--yamls') || arg.include?('--yarrs')
17
- self.create_vagrant_file
18
- self.create_yaml_file
19
- end
20
- end
21
- end
22
-
23
- def self.create_vagrant_file
24
- source = __FILE__ + '/../../../example.Vagrantfile'
25
- dest = Dir.pwd + '/Vagrantfile'
26
- self.copy_file source, dest
27
- end
28
-
29
- def self.create_yaml_file
30
- source = __FILE__ + '/../../../Yarrs.example.yaml'
31
- dest = Dir.pwd + '/Yarrs.example.yaml'
32
- self.copy_file source, dest
33
- end
34
-
35
- def self.copy_file(source, dest)
36
- source = File.realpath(source)
37
- self.backup_file(dest)
38
- FileUtils.copy_file source, dest
39
- end
40
-
41
- def self.backup_file(source)
42
- dest = self.timestamp_filename(source)
43
- FileUtils.mv source, dest, :force => true if File.exists? source
44
- end
45
-
46
- def self.timestamp_filename(file)
47
- dir = File.dirname(file)
48
- base = File.basename(file, ".*")
49
- time = Time.now.to_i
50
- ext = File.extname(file)
51
- File.join(dir, "#{base}.bak.#{time}#{ext}")
9
+ command "yarrs" do
10
+ require_relative "command"
11
+ Command
52
12
  end
53
13
  end
54
14
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module YarrsAndYamls
3
- VERSION = '0.9'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-yarrs-and-yamls
3
3
  version: !ruby/object:Gem::Version
4
- version: !binary |-
5
- MC45
4
+ version: 1.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Pirate Dunbar
@@ -23,8 +22,8 @@ files:
23
22
  - LICENSE.txt
24
23
  - README.md
25
24
  - Rakefile
25
+ - Vagrantfile.example
26
26
  - Yarrs.example.yaml
27
- - example.Vagrantfile
28
27
  - lib/scripts/apache2.sh
29
28
  - lib/scripts/apache2_ssl.sh
30
29
  - lib/scripts/base.sh
@@ -69,6 +68,7 @@ files:
69
68
  - lib/templates/xdebug.ini
70
69
  - lib/vagrant-yarrs-and-yamls.rb
71
70
  - lib/vagrant-yarrs-and-yamls/api.rb
71
+ - lib/vagrant-yarrs-and-yamls/command.rb
72
72
  - lib/vagrant-yarrs-and-yamls/plugin.rb
73
73
  - lib/vagrant-yarrs-and-yamls/version.rb
74
74
  - vagrant-yarrs-and-yamls.gemspec
@@ -82,17 +82,17 @@ require_paths:
82
82
  - lib
83
83
  required_ruby_version: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - ! '>='
85
+ - - '>='
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - ! '>='
90
+ - - '>='
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  requirements: []
94
94
  rubyforge_project:
95
- rubygems_version: 2.4.8
95
+ rubygems_version: 2.1.11
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Configure your Vagrantfile using YAML
data/example.Vagrantfile DELETED
@@ -1,10 +0,0 @@
1
- # -*- mode: ruby -*-
2
- # vi: set ft=ruby :
3
-
4
- Vagrant.configure(2) do |config|
5
- yarrs_and_yamls('Vagrantfile.yaml', config) do |hostname, settings|
6
- config.vm.define hostname do |node|
7
- ## Add your configuration to Vagrantfile.yml
8
- end
9
- end
10
- end