vagrant-gatling-rsync 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/Gemfile +1 -1
- data/README.md +6 -0
- data/example/vagrant/Vagrantfile +17 -4
- data/lib/vagrant-gatling-rsync.rb +1 -1
- data/lib/vagrant-gatling-rsync/command/rsync_auto.rb +17 -3
- data/lib/vagrant-gatling-rsync/config.rb +4 -1
- data/lib/vagrant-gatling-rsync/plugin.rb +1 -7
- data/lib/vagrant-gatling-rsync/version.rb +1 -1
- data/locales/en.yml +4 -2
- data/vagrant-gatling-rsync.gemspec +3 -2
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7e90735d5b30fc728ce9def9abc606eba65a780
|
4
|
+
data.tar.gz: 97ffd1da36b10c33132168c0cacf6f68219f9520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88804ec3406328978c34cb02e33ec8e62d7ab7c0459b099d60d13c38357675edad2f2442690902d100d827d836752109b23e66b67327dd0563018d45bdbfdabd
|
7
|
+
data.tar.gz: d46d7d7848cf6aecff2f7470c597f0b10d4e5d71adb70c281088a0a6f4c3ef5d063fb0fbe88f51d2602418e5500b6f16e91ab7577809868e9011f52136a5a1b9
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
## 0.0.4 (August 24, 2014)
|
2
|
+
|
3
|
+
This release adds notification of time and duration of rsyncs.
|
4
|
+
|
5
|
+
It also adds the config.gatling.time_format configuration option to allow customization of the time format string when
|
6
|
+
time information is printed to the console.
|
7
|
+
|
8
|
+
It also updates the Gemfile to use Vagrant 1.6.4 so that I can test on Linux using the Docker provider. This should not
|
9
|
+
have any impact on using the gem with 1.5.1+ versions of Vagrant, however.
|
10
|
+
|
11
|
+
FEATURES:
|
12
|
+
|
13
|
+
- Add output to note when an rsync finishes and how long it took. [GH-7, GH-10]
|
14
|
+
|
15
|
+
BUG FIXES:
|
16
|
+
|
17
|
+
- The plugin now correctly outputs an error instead of failing to load on Vagrant versions < 1.5.1. [GH-11]
|
18
|
+
|
1
19
|
## 0.0.3 (May 02, 2014)
|
2
20
|
|
3
21
|
Bugfix release.
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -17,6 +17,11 @@ vagrant plugin install vagrant-gatling-rsync
|
|
17
17
|
Add the following information to the Vagrantfile to set the coalescing
|
18
18
|
threshold in seconds. If you do not set it, it will default to 1.5.
|
19
19
|
|
20
|
+
You may also specify what
|
21
|
+
[Time.strftime](http://www.ruby-doc.org/core-2.0.0/Time.html#method-i-strftime)
|
22
|
+
options the plugin will use when it reports on completed rsyncs. The default is
|
23
|
+
"%I:%M:%S %p".
|
24
|
+
|
20
25
|
You will also need to have at least one synced folder set to type "rsync"
|
21
26
|
to use the plugin.
|
22
27
|
|
@@ -32,6 +37,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
32
37
|
# Configure the window for gatling to coalesce writes.
|
33
38
|
if Vagrant.has_plugin?("vagrant-gatling-rsync")
|
34
39
|
config.gatling.latency = 2.5
|
40
|
+
config.gatling.time_format = "%H:%M:%S"
|
35
41
|
end
|
36
42
|
end
|
37
43
|
```
|
data/example/vagrant/Vagrantfile
CHANGED
@@ -7,6 +7,18 @@ VAGRANTFILE_API_VERSION = "2"
|
|
7
7
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
8
8
|
config.vm.box = "hashicorp/precise64"
|
9
9
|
|
10
|
+
config.vm.provider "docker" do |d, override|
|
11
|
+
d.image = "smerrill/vagrant-centos"
|
12
|
+
d.has_ssh = true
|
13
|
+
|
14
|
+
# This is needed if you have non-Docker provisioners in the Vagrantfile.
|
15
|
+
override.vm.box = nil
|
16
|
+
|
17
|
+
# Ensure Vagrant knows the SSH port. See
|
18
|
+
# https://github.com/mitchellh/vagrant/issues/3772.
|
19
|
+
override.ssh.port = 22
|
20
|
+
end
|
21
|
+
|
10
22
|
# Share an additional folder to the guest VM. The first argument is
|
11
23
|
# the path on the host to the actual folder. The second argument is
|
12
24
|
# the path on the guest to mount the folder. And the optional third
|
@@ -14,8 +26,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
14
26
|
config.vm.synced_folder "../files", "/opt/vagrant/rsynced_folder", type: "rsync",
|
15
27
|
rsync__exclude: [".git/", ".idea/"]
|
16
28
|
|
17
|
-
# Configure the window for gatling to coalesce writes.
|
18
|
-
|
19
|
-
|
20
|
-
|
29
|
+
# Configure the window for gatling to coalesce writes. Note that when using
|
30
|
+
# outside of a development environment like this one, you should wrap these
|
31
|
+
# statements in an 'if Vagrant.has_plugin?("vagrant-gatling-rsync")' test.
|
32
|
+
config.gatling.latency = 0.4
|
33
|
+
config.gatling.time_format = "%H:%M:%S"
|
21
34
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# This file is required because Vagrant's plugin system expects
|
2
|
-
#
|
2
|
+
# an eponymous ruby file matching the rubygem.
|
3
3
|
#
|
4
4
|
# So this gem is called 'vagrant-gatling-rsync' and thus vagrant tries
|
5
5
|
# to require "vagrant-gatling-rsync"
|
@@ -6,6 +6,12 @@ require "vagrant"
|
|
6
6
|
module VagrantPlugins
|
7
7
|
module GatlingRsync
|
8
8
|
class GatlingRsyncAuto < Vagrant.plugin(2, :command)
|
9
|
+
# This is a sanity check to make sure no one is attempting to install
|
10
|
+
# this into an early Vagrant version.
|
11
|
+
if Vagrant::VERSION < "1.5.1"
|
12
|
+
raise Errors::Vagrant15RequiredError
|
13
|
+
end
|
14
|
+
|
9
15
|
include Vagrant::Action::Builtin::MixinSyncedFolders
|
10
16
|
|
11
17
|
def self.synopsis
|
@@ -121,12 +127,20 @@ module VagrantPlugins
|
|
121
127
|
tosync.each do |folders|
|
122
128
|
folders.each do |opts|
|
123
129
|
ssh_info = opts[:machine].ssh_info
|
124
|
-
if ssh_info
|
125
|
-
VagrantPlugins::SyncedFolderRSync::RsyncHelper.rsync_single(opts[:machine], ssh_info, opts[:opts])
|
126
|
-
end
|
130
|
+
do_rsync(opts[:machine], ssh_info, opts[:opts]) if ssh_info
|
127
131
|
end
|
128
132
|
end
|
129
133
|
end
|
134
|
+
|
135
|
+
def do_rsync(machine, ssh_info, opts)
|
136
|
+
start_time = Time.new
|
137
|
+
VagrantPlugins::SyncedFolderRSync::RsyncHelper.rsync_single(machine, ssh_info, opts)
|
138
|
+
end_time = Time.new
|
139
|
+
machine.ui.info(I18n.t(
|
140
|
+
"vagrant_gatling_rsync.gatling_ran",
|
141
|
+
date: end_time.strftime(machine.config.gatling.time_format),
|
142
|
+
milliseconds: (end_time - start_time) * 1000))
|
143
|
+
end
|
130
144
|
end
|
131
145
|
end
|
132
146
|
end
|
@@ -2,15 +2,18 @@ require "vagrant"
|
|
2
2
|
|
3
3
|
module VagrantPlugins
|
4
4
|
module GatlingRsync
|
5
|
-
class Config < Vagrant.plugin(
|
5
|
+
class Config < Vagrant.plugin(2, :config)
|
6
6
|
attr_accessor :latency
|
7
|
+
attr_accessor :time_format
|
7
8
|
|
8
9
|
def initialize
|
9
10
|
@latency = UNSET_VALUE
|
11
|
+
@time_format = UNSET_VALUE
|
10
12
|
end
|
11
13
|
|
12
14
|
def finalize!
|
13
15
|
@latency = 1.5 if @latency == UNSET_VALUE
|
16
|
+
@time_format = "%I:%M:%S %p" if @time_format == UNSET_VALUE
|
14
17
|
end
|
15
18
|
|
16
19
|
# @TODO: This does not appear to be called.
|
@@ -4,15 +4,9 @@ rescue LoadError
|
|
4
4
|
raise "The Vagrant gatling rsync plugin must be run within Vagrant."
|
5
5
|
end
|
6
6
|
|
7
|
-
# This is a sanity check to make sure no one is attempting to install
|
8
|
-
# this into an early Vagrant version.
|
9
|
-
if Vagrant::VERSION < "1.5.1"
|
10
|
-
raise Errors::Vagrant15RequiredError
|
11
|
-
end
|
12
|
-
|
13
7
|
module VagrantPlugins
|
14
8
|
module GatlingRsync
|
15
|
-
class Plugin < Vagrant.plugin(
|
9
|
+
class Plugin < Vagrant.plugin(2)
|
16
10
|
name "Gatling Rsync"
|
17
11
|
description <<-DESC
|
18
12
|
Rsync large project directories to your Vagrant VM without using many resources on the host.
|
data/locales/en.yml
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
en:
|
2
2
|
vagrant_gatling_rsync:
|
3
|
+
gatling_ran: |-
|
4
|
+
%{date}: The rsync operation completed in %{milliseconds} milliseconds.
|
3
5
|
errors:
|
4
6
|
only_osx_linux_support: |-
|
5
|
-
|
7
|
+
The vagrant-gatling-rsync plugin currently only supports Max OS X and Linux hosts.
|
6
8
|
vagrant_15_required: |-
|
7
|
-
|
9
|
+
The vagrant-gatling-rsync plugin requires Vagrant 1.5.1 or newer to function.
|
8
10
|
|
@@ -13,8 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
|
17
|
-
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject {|f| f.start_with?('example/files')}
|
18
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
19
|
spec.require_paths = ["lib"]
|
@@ -22,4 +21,6 @@ Gem::Specification.new do |spec|
|
|
22
21
|
spec.add_development_dependency "bundler", "~> 1.5"
|
23
22
|
spec.add_development_dependency "rake"
|
24
23
|
spec.add_development_dependency "pry"
|
24
|
+
# Make Vagrant work on Linux for development.
|
25
|
+
spec.add_development_dependency "json", "~> 1.8.1"
|
25
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-gatling-rsync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Merrill
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: json
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.8.1
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.8.1
|
55
69
|
description: The gatling-rsync plugin runs on Mac and Linux and is far less CPU-intensive
|
56
70
|
than the built-in rsync-auto.
|
57
71
|
email:
|
@@ -67,7 +81,6 @@ files:
|
|
67
81
|
- LICENSE
|
68
82
|
- README.md
|
69
83
|
- Rakefile
|
70
|
-
- example/files/.gitkeep
|
71
84
|
- example/vagrant/Vagrantfile
|
72
85
|
- lib/vagrant-gatling-rsync.rb
|
73
86
|
- lib/vagrant-gatling-rsync/command/rsync_auto.rb
|
@@ -100,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
113
|
version: '0'
|
101
114
|
requirements: []
|
102
115
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
116
|
+
rubygems_version: 2.1.11
|
104
117
|
signing_key:
|
105
118
|
specification_version: 4
|
106
119
|
summary: A lighter-weight Vagrant plugin for watching and rsyncing directories.
|