vagrant-gatling-rsync 0.2.0.beta.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9e1559210c5d53464d5743885ac7165583e2e02
4
- data.tar.gz: e98378351c68c501c0f5f9ce2651354f0e311cf7
3
+ metadata.gz: 5efa02572fb29f90b58dab6e9e30316510de6e5f
4
+ data.tar.gz: a666035292ee9f25dd6183b4a250551d52e43b61
5
5
  SHA512:
6
- metadata.gz: 3f6b6b2e9f9acdb5df864d295cfcf114992e108a171ff0ca1c1efce2f53da11123c45454e73ac31a2711b64b5673a9505ba577a04136b133a319ce6dcf8c2775
7
- data.tar.gz: f7fd3be884f09f4f0aa8f9e24e793715e9fcdc02bafe859b40d0b994dbb14c14917c2dd8cc84a915abbc726c127742c9bc9f0627f0f4d339c2da5503b7dbc5b9
6
+ metadata.gz: bae64c5eab5aab245c2fc27d7771227944e1129565462c4df34698da5b50696d9905149cc88a2de16403130a9558552aebf0d4263e203c48d99ef93715694035
7
+ data.tar.gz: dcb41db757d7a03ee9350758d167103d0152feda01356e88b46b98294c1a6f46c53fd21c83b26256584af3415af43755b5bfc6e57e870fd064a8c09362831947
@@ -1,3 +1,17 @@
1
+ ## 0.9.0 (June 28, 2015)
2
+
3
+ This release adds two big features: Windows support and automatic sync on startup.
4
+
5
+ It also adds the `config.gatling.rsync_on_startup` configuration option to turn automatic rsync on startup off if you
6
+ do not want it.
7
+
8
+ It also updates the Gemfile to use Vagrant 1.7.2 for development. The gem should still work with Vagrant 1.5.1+.
9
+
10
+ FEATURES:
11
+
12
+ - Add support for Windows. Thanks to @mfradcourt for wiring it up. [GH-21]
13
+ - Add automatic sync startup on `vagrant up` or `vagrant reload` if rsync folders are present. [GH-14]
14
+
1
15
  ## 0.1.0 (January 04, 2015)
2
16
 
3
17
  This release adds feature parity with Vagrant core rsync-auto by doing a sync when gatling-rsync is started.
@@ -10,7 +24,7 @@ FEATURES:
10
24
 
11
25
  This release adds notification of time and duration of rsyncs.
12
26
 
13
- It also adds the config.gatling.time_format configuration option to allow customization of the time format string when
27
+ It also adds the `config.gatling.time_format` configuration option to allow customization of the time format string when
14
28
  time information is printed to the console.
15
29
 
16
30
  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
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :development do
7
- gem "vagrant", :git => "https://github.com/mitchellh/vagrant.git", :tag => 'v1.6.3'
7
+ gem "vagrant", :git => "https://github.com/mitchellh/vagrant.git", :tag => 'v1.7.2'
8
8
  end
9
9
 
10
10
  group :plugins do
data/README.md CHANGED
@@ -5,8 +5,8 @@ potential cost of more rsync actions.
5
5
 
6
6
  ## Getting started
7
7
 
8
- To get started, you need to have Vagrant 1.5.1 installed on your Linux or
9
- Mac OS X host machine. To install the plugin, use the following command.
8
+ To get started, you need to have Vagrant 1.5.1 installed on your Linux, Mac, or
9
+ Windows host machine. To install the plugin, use the following command.
10
10
 
11
11
  ```bash
12
12
  vagrant plugin install vagrant-gatling-rsync
@@ -39,6 +39,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
39
39
  config.gatling.latency = 2.5
40
40
  config.gatling.time_format = "%H:%M:%S"
41
41
  end
42
+
43
+ # Automatically sync when machines with rsync folders come up.
44
+ config.gatling.rsync_on_startup = true
42
45
  end
43
46
  ```
44
47
 
@@ -49,6 +52,11 @@ command to sync files.
49
52
  vagrant gatling-rsync-auto
50
53
  ```
51
54
 
55
+ As of version 0.9.0, vagrant-gatling-rsync will automatically start the sync
56
+ engine on `vagrant up` or `vagrant reload` when the machines that you bring up
57
+ have one or more rsync folders defined. You can disable this behavior by
58
+ setting `config.gatling.rsync_on_startup` to false.
59
+
52
60
  ## Why "gatling"?
53
61
 
54
62
  The gatling gun was the first gun capable of firing continuously.
@@ -5,7 +5,7 @@
5
5
  VAGRANTFILE_API_VERSION = "2"
6
6
 
7
7
  Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8
- config.vm.box = "hashicorp/precise64"
8
+ config.vm.box = "centos/7"
9
9
 
10
10
  config.vm.provider "docker" do |d, override|
11
11
  d.image = "smerrill/vagrant-centos"
@@ -19,12 +19,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
19
19
  override.ssh.port = 22
20
20
  end
21
21
 
22
- # Share an additional folder to the guest VM. The first argument is
23
- # the path on the host to the actual folder. The second argument is
24
- # the path on the guest to mount the folder. And the optional third
25
- # argument is a set of non-required options.
26
- config.vm.synced_folder "../files", "/opt/vagrant/rsynced_folder", type: "rsync",
27
- rsync__exclude: [".git/", ".idea/"]
22
+ config.vm.provider "lxc" do |d, override|
23
+ override.vm.box = "smerrill/centos-7"
24
+ end
28
25
 
29
26
  # When using gatling rsync in your projects, you should wrap these configs in
30
27
  # an 'if Vagrant.has_plugin?("vagrant-gatling-rsync")' test.
@@ -33,7 +30,21 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
33
30
  config.gatling.latency = 0.4
34
31
  config.gatling.time_format = "%H:%M:%S"
35
32
 
36
- # Gatling rsync can run `vagrant gatling-rsync-auto` after the machines in
37
- # your Vagrant environment start if you set this to true.
33
+ # Gatling rsync will run `vagrant gatling-rsync-auto` after the machines in
34
+ # your Vagrant environment start unles you set this to false.
38
35
  config.gatling.rsync_on_startup = true
36
+
37
+ # Add a multi-box setup.
38
+ config.vm.define "rsync", primary: true do |m|
39
+ m.vm.synced_folder "../files", "/opt/vagrant/rsynced_folder", type: "rsync",
40
+ rsync__exclude: [".git/", ".idea/"]
41
+ end
42
+
43
+ config.vm.define "rsync2", primary: true do |m|
44
+ m.vm.synced_folder "../files", "/opt/vagrant/rsynced_folder", type: "rsync",
45
+ rsync__exclude: [".git/", ".idea/"]
46
+ end
47
+
48
+ config.vm.define "norsync" do |m|
49
+ end
39
50
  end
@@ -14,6 +14,7 @@ module VagrantPlugins
14
14
  autoload :Errors, lib_path.join("errors")
15
15
  autoload :ListenOSX, lib_path.join("listen/listenosx")
16
16
  autoload :ListenLinux, lib_path.join("listen/listenlinux")
17
+ autoload :ListenWindows, lib_path.join("listen/listenwindows")
17
18
 
18
19
  # This returns the path to the source of this plugin.
19
20
  #
@@ -3,12 +3,18 @@ require "vagrant"
3
3
  module VagrantPlugins
4
4
  module GatlingRsync
5
5
  class StartupRsync
6
+ include Vagrant::Action::Builtin::MixinSyncedFolders
7
+
6
8
  def initialize(app, env)
7
9
  @app = app
8
10
  @gatling_startup_registered = false
11
+ @rsync_folder_count = 0
9
12
  end
10
13
 
11
14
  def call(env)
15
+ folders = synced_folders(env[:machine])
16
+ @rsync_folder_count += folders[:rsync].size if folders.key?(:rsync)
17
+
12
18
  @app.call(env)
13
19
 
14
20
  # Ensure only one at_exit block is registered.
@@ -28,9 +34,11 @@ module VagrantPlugins
28
34
  exit exit_status
29
35
  end
30
36
 
31
- # @TODO: Translate.
32
- env[:ui].info "Invoking gatling-rsync-auto."
33
- env[:machine].env.cli("gatling-rsync-auto")
37
+ # Don't run if there are no rsynced folders.
38
+ unless @rsync_folder_count == 0 then
39
+ env[:ui].info I18n.t("vagrant_gatling_rsync.startup_sync")
40
+ env[:machine].env.cli("gatling-rsync-auto")
41
+ end
34
42
  end
35
43
 
36
44
  @gatling_startup_registered = true
@@ -94,9 +94,11 @@ module VagrantPlugins
94
94
  ListenOSX.new(paths, ignores, latency, @logger, self.method(:callback)).run
95
95
  when /linux/
96
96
  ListenLinux.new(paths, ignores, latency, @logger, self.method(:callback)).run
97
+ when /cygwin|mswin|mingw|bccwin|wince|emx/
98
+ ListenWindows.new(paths, ignores, latency, @logger, self.method(:callback)).run
97
99
  else
98
100
  # @TODO: Raise this earlier?
99
- raise Errors::OnlyOSXLinuxSupportError
101
+ raise Errors::OSNotSupportedError
100
102
  end
101
103
 
102
104
  0
@@ -17,7 +17,7 @@ module VagrantPlugins
17
17
  @latency = 1.5 if @latency == UNSET_VALUE
18
18
  @time_format = "%I:%M:%S %p" if @time_format == UNSET_VALUE
19
19
  if @rsync_on_startup == UNSET_VALUE
20
- @rsync_on_startup = false
20
+ @rsync_on_startup = true
21
21
  else
22
22
  @rsync_on_startup = !!@rsync_on_startup
23
23
  end
@@ -7,8 +7,8 @@ module VagrantPlugins
7
7
  error_namespace("vagrant_gatling_rsync.errors")
8
8
  end
9
9
 
10
- class OnlyOSXLinuxSupportError < VagrantGatlingRsyncError
11
- error_key(:only_osx_linux_support)
10
+ class OSNotSupportedError < VagrantGatlingRsyncError
11
+ error_key(:os_not_supported)
12
12
  end
13
13
 
14
14
  class Vagrant15RequiredError < VagrantGatlingRsyncError
@@ -18,7 +18,7 @@ module VagrantPlugins
18
18
  monitor = WDM::Monitor.new
19
19
  changes = Queue.new
20
20
  @paths.keys.each do |path|
21
- monitor.watch_recursively(path) { |change| changes << change }
21
+ monitor.watch_recursively(path.dup) { |change| changes << change }
22
22
  end
23
23
  Thread.new { monitor.run! }
24
24
 
@@ -19,6 +19,7 @@ module VagrantPlugins
19
19
  end
20
20
 
21
21
  action_hook "startup-rsync" do |hook|
22
+ setup_i18n
22
23
  require_relative "action/startup_rsync"
23
24
  hook.after Vagrant::Action::Builtin::SyncedFolders, StartupRsync
24
25
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module GatlingRsync
3
- VERSION = "0.2.0.beta.1"
3
+ VERSION = "0.9.0"
4
4
  end
5
5
  end
@@ -2,9 +2,11 @@ en:
2
2
  vagrant_gatling_rsync:
3
3
  gatling_ran: |-
4
4
  %{date}: The rsync operation completed in %{milliseconds} milliseconds.
5
+ startup_sync: |-
6
+ vagrant-gatling-rsync is starting the sync engine because you have at least one rsync folder. To disable this behavior, set `config.gatling.rsync_on_startup = false` in your Vagrantfile.
5
7
  errors:
6
- only_osx_linux_support: |-
7
- The vagrant-gatling-rsync plugin currently only supports Max OS X and Linux hosts.
8
+ os_not_supported: |-
9
+ The vagrant-gatling-rsync plugin does not support your OS.
8
10
  vagrant_15_required: |-
9
11
  The vagrant-gatling-rsync plugin requires Vagrant 1.5.1 or newer to function.
10
12
 
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-gatling-rsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.beta.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Merrill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-28 00:00:00.000000000 Z
11
+ date: 2015-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.8.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.8.1
69
69
  description: The gatling-rsync plugin runs on Mac and Linux and is far less CPU-intensive
@@ -74,8 +74,8 @@ executables: []
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
- - .gitignore
78
- - .ruby-version
77
+ - ".gitignore"
78
+ - ".ruby-version"
79
79
  - CHANGELOG.md
80
80
  - Gemfile
81
81
  - LICENSE
@@ -104,17 +104,17 @@ require_paths:
104
104
  - lib
105
105
  required_ruby_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - '>='
107
+ - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  requirements:
112
- - - '>'
112
+ - - ">="
113
113
  - !ruby/object:Gem::Version
114
- version: 1.3.1
114
+ version: '0'
115
115
  requirements: []
116
116
  rubyforge_project:
117
- rubygems_version: 2.0.14
117
+ rubygems_version: 2.4.5
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: A lighter-weight Vagrant plugin for watching and rsyncing directories.