vagrant-grunt 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +20 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +13 -0
- data/lib/vagrant-grunt.rb +13 -0
- data/lib/vagrant-grunt/command.rb +22 -0
- data/lib/vagrant-grunt/middleware.rb +34 -0
- data/lib/vagrant-grunt/version.rb +3 -0
- data/vagrant-grunt.gemspec +60 -0
- metadata +81 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c16a253796d2b5582cb7a85ebb7cff94580e843d
|
4
|
+
data.tar.gz: 0c5299c8a02ef14961eb3055e6f2712351a41099
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b26696676c9b94a4f27435736de3065dc24ea7b8faae8a102eb2905a455192f39996f70bb0f82835c7c736cc7816373c3df8251eac74f241f42c11842140abfa
|
7
|
+
data.tar.gz: 02bc29134497d9cdd94b63eb345ab78b4f7f464a9699277b1625f52a6640b20de1e3e34a3fcb0f55ab5c062bd982ac96a120886b1a3642b908a5dc76a2fe60ec
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Travis McHattie
|
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,29 @@
|
|
1
|
+
# Vagrant::Grunt
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'vagrant-grunt'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install vagrant-grunt
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
|
4
|
+
# Immediately sync all stdout so that tools like buildbot can
|
5
|
+
# immediately load in the output.
|
6
|
+
$stdout.sync = true
|
7
|
+
$stderr.sync = true
|
8
|
+
|
9
|
+
# Change to the directory of this file.
|
10
|
+
Dir.chdir(File.expand_path("../", __FILE__))
|
11
|
+
|
12
|
+
Bundler::GemHelper.install_tasks
|
13
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module VagrantGrunt
|
2
|
+
class GruntCommand < Vagrant.plugin(2, :command)
|
3
|
+
#register "grunt", "Run grunt command inside of the VM environment"
|
4
|
+
#argument :grunt_command, :type => :string, :required => true, :desc => "The grunt command to run on the VM"
|
5
|
+
#class_option :cwd, :type => :string, :default => nil
|
6
|
+
|
7
|
+
def execute
|
8
|
+
puts "Hello World!"
|
9
|
+
0
|
10
|
+
end
|
11
|
+
#def execute
|
12
|
+
# target_vms.each { |vm| execute_on_vm(vm, grunt_command) }
|
13
|
+
#end
|
14
|
+
|
15
|
+
#protected
|
16
|
+
|
17
|
+
# Executes a command on a specific VM.
|
18
|
+
#def execute_on_vm(vm, command)
|
19
|
+
# vm.env.actions.run(:grunt, "grunt.command" => command)
|
20
|
+
#end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module VagrantGrunt
|
2
|
+
# A Vagrant middleware which executes a rake task on a given
|
3
|
+
# VM. This task will run "rake" on the VM that this action sequence
|
4
|
+
# was run on. If an env variable "rake.command" is populated, then
|
5
|
+
# this command will be executed by rake.
|
6
|
+
class Middleware
|
7
|
+
def initialize(app, env)
|
8
|
+
@app = app
|
9
|
+
@env = env
|
10
|
+
end
|
11
|
+
|
12
|
+
def call(env)
|
13
|
+
if env["vm"].created? && env["vm"].vm.running?
|
14
|
+
command = "grunt #{env["grunt.command"]}".strip
|
15
|
+
|
16
|
+
env["vm"].ssh.execute do |ssh|
|
17
|
+
# env.ui.info I18n.t("vagrant.plugins.apache2.executing", :command => command)
|
18
|
+
|
19
|
+
ssh.exec!("#{command}") do |channel, type, data|
|
20
|
+
# Print the data directly to STDOUT, not doing any newlines
|
21
|
+
# or any extra formatting of our own
|
22
|
+
$stdout.print(data) if type != :exit_status
|
23
|
+
end
|
24
|
+
|
25
|
+
# Puts out an ending newline just to make sure we end on a new
|
26
|
+
# line.
|
27
|
+
$stdout.puts
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
@app.call(env)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'vagrant-grunt/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "vagrant-grunt"
|
8
|
+
spec.version = VagrantGrunt::VERSION
|
9
|
+
spec.authors = ["Travis McHattie"]
|
10
|
+
spec.email = ["travis.mchattie@thinksolid.com"]
|
11
|
+
spec.summary = "Vagrant Grunt Plugin"
|
12
|
+
spec.description = "A gem that will allow you to issue custom grunt commands passed into your virtual machine reducing the need for actually having grunt on your local development machine."
|
13
|
+
spec.homepage = "https://git.thinksolid.com/opensource/vagrant-plugins"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
|
24
|
+
spec.required_rubygems_version = ">= 1.3.6"
|
25
|
+
|
26
|
+
# The following block of code determines the files that should be included
|
27
|
+
# in the gem. It does this by reading all the files in the directory where
|
28
|
+
# this gemspec is, and parsing out the ignored files from the gitignore.
|
29
|
+
# Note that the entire gitignore(5) syntax is not supported, specifically
|
30
|
+
# the "!" syntax, but it should mostly work correctly.
|
31
|
+
root_path = File.dirname(__FILE__)
|
32
|
+
all_files = Dir.chdir(root_path) { Dir.glob("**/{*,.*}") }
|
33
|
+
all_files.reject! { |file| [".", ".."].include?(File.basename(file)) }
|
34
|
+
gitignore_path = File.join(root_path, ".gitignore")
|
35
|
+
gitignore = File.readlines(gitignore_path)
|
36
|
+
gitignore.map! { |line| line.chomp.strip }
|
37
|
+
gitignore.reject! { |line| line.empty? || line =~ /^(#|!)/ }
|
38
|
+
|
39
|
+
unignored_files = all_files.reject do |file|
|
40
|
+
# Ignore any directories, the gemspec only cares about files
|
41
|
+
next true if File.directory?(file)
|
42
|
+
|
43
|
+
# Ignore any paths that match anything in the gitignore. We do
|
44
|
+
# two tests here:
|
45
|
+
#
|
46
|
+
# - First, test to see if the entire path matches the gitignore.
|
47
|
+
# - Second, match if the basename does, this makes it so that things
|
48
|
+
# like '.DS_Store' will match sub-directories too (same behavior
|
49
|
+
# as git).
|
50
|
+
#
|
51
|
+
gitignore.any? do |ignore|
|
52
|
+
File.fnmatch(ignore, file, File::FNM_PATHNAME) ||
|
53
|
+
File.fnmatch(ignore, File.basename(file), File::FNM_PATHNAME)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
spec.files = unignored_files
|
58
|
+
spec.executables = unignored_files.map { |f| f[/^bin\/(.*)/, 1] }.compact
|
59
|
+
spec.require_path = 'lib'
|
60
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vagrant-grunt
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Travis McHattie
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2013-06-07 00:00:00 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
prerelease: false
|
16
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: "1.3"
|
21
|
+
name: bundler
|
22
|
+
type: :development
|
23
|
+
requirement: *id001
|
24
|
+
- !ruby/object:Gem::Dependency
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- &id003
|
29
|
+
- ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: "0"
|
32
|
+
name: rake
|
33
|
+
type: :development
|
34
|
+
requirement: *id002
|
35
|
+
description: A gem that will allow you to issue custom grunt commands passed into your virtual machine reducing the need for actually having grunt on your local development machine.
|
36
|
+
email:
|
37
|
+
- travis.mchattie@thinksolid.com
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files: []
|
43
|
+
|
44
|
+
files:
|
45
|
+
- Gemfile
|
46
|
+
- lib/vagrant-grunt/command.rb
|
47
|
+
- lib/vagrant-grunt/middleware.rb
|
48
|
+
- lib/vagrant-grunt/version.rb
|
49
|
+
- lib/vagrant-grunt.rb
|
50
|
+
- LICENSE.txt
|
51
|
+
- Rakefile
|
52
|
+
- README.md
|
53
|
+
- vagrant-grunt.gemspec
|
54
|
+
- .gitignore
|
55
|
+
homepage: https://git.thinksolid.com/opensource/vagrant-plugins
|
56
|
+
licenses:
|
57
|
+
- MIT
|
58
|
+
metadata: {}
|
59
|
+
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- *id003
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 1.3.6
|
73
|
+
requirements: []
|
74
|
+
|
75
|
+
rubyforge_project:
|
76
|
+
rubygems_version: 2.0.3
|
77
|
+
signing_key:
|
78
|
+
specification_version: 4
|
79
|
+
summary: Vagrant Grunt Plugin
|
80
|
+
test_files: []
|
81
|
+
|