whenever 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -6,4 +6,3 @@ rvm:
6
6
  - jruby
7
7
  - jruby-18mode
8
8
  - jruby-19mode
9
- - jruby-head
data/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  * Time zone support
4
4
 
5
5
 
6
+ ### 0.8.2 / January 10, 2013
7
+
8
+ * Fix Capistrano host options. [Igor Yamolov, Wes Morgan]
9
+
10
+ * Improve JRuby test support. [Igor Yamolov]
11
+
12
+ * Use correct release path in Cap task. [Wes Morgan]
13
+
14
+
6
15
  ### 0.8.1 / December 22nd, 2012
7
16
 
8
17
  * Fix multiserver roles bug. [Wes Morgan]
data/README.md CHANGED
@@ -225,4 +225,4 @@ Compatible with Ruby 1.8.7-1.9.3, JRuby, and Rubinius. [![Build Status](https://
225
225
 
226
226
  ----
227
227
 
228
- Copyright © 2012 Javan Makhmali
228
+ Copyright © 2013 Javan Makhmali
@@ -18,7 +18,7 @@ Capistrano::Configuration.instance(:must_exist).load do
18
18
  args = {
19
19
  :command => fetch(:whenever_command),
20
20
  :flags => fetch(:whenever_update_flags),
21
- :path => fetch(:release_path)
21
+ :path => fetch(:latest_release)
22
22
  }
23
23
 
24
24
  if whenever_servers.any?
@@ -30,6 +30,7 @@ Capistrano::Configuration.instance(:must_exist).load do
30
30
  args[:path] = fetch(:previous_release)
31
31
  else
32
32
  # clear the crontab if no previous release
33
+ args[:path] = fetch(:release_path)
33
34
  args[:flags] = fetch(:whenever_clear_flags)
34
35
  end
35
36
 
@@ -31,7 +31,7 @@ module Whenever
31
31
  roles_arg = roles.empty? ? "" : " --roles #{roles.join(',')}"
32
32
 
33
33
  command = "cd #{args[:path]} && #{args[:command]} #{args[:flags]}#{roles_arg}"
34
- run command, whenever_options.merge(:hosts => server.host)
34
+ run command, whenever_options.merge(:hosts => server)
35
35
  end
36
36
  end
37
37
 
@@ -1,3 +1,3 @@
1
1
  module Whenever
2
- VERSION = '0.8.1'
2
+ VERSION = '0.8.2'
3
3
  end
data/test/test_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # Want to test the files here, in lib, not in an installed version of the gem.
2
2
  $:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
3
3
  require 'whenever'
4
-
4
+ require 'test/unit'
5
5
  require 'shoulda'
6
6
  require 'mocha'
7
7
 
@@ -15,4 +15,4 @@ end
15
15
 
16
16
  class Test::Unit::TestCase
17
17
  include TestExtensions
18
- end
18
+ end
@@ -99,9 +99,10 @@ class CapistranoSupportTest < Test::Unit::TestCase
99
99
 
100
100
  context "with some servers defined" do
101
101
  setup do
102
- @mock_server1, @mock_server2 = mock(), mock()
102
+ @mock_server1, @mock_server2, @mock_server3 = mock("Server1"), mock("Server2"), mock("Server3")
103
103
  @mock_server1.stubs(:host).returns("server1.foo.com")
104
104
  @mock_server2.stubs(:host).returns("server2.foo.com")
105
+ @mock_server3.stubs(:host => "server3.foo.com", :port => 1022, :user => 'test')
105
106
  @mock_servers = [@mock_server1, @mock_server2]
106
107
  end
107
108
 
@@ -112,8 +113,8 @@ class CapistranoSupportTest < Test::Unit::TestCase
112
113
  roles = [:role1, :role2]
113
114
  @capistrano.stubs(:whenever_options).returns({:roles => roles})
114
115
 
115
- @capistrano.expects(:run).once.with('cd /foo/bar && whenever --flag1 --flag2 --roles role1', {:roles => [:role1, :role2], :hosts => 'server1.foo.com'})
116
- @capistrano.expects(:run).once.with('cd /foo/bar && whenever --flag1 --flag2 --roles role2', {:roles => [:role1, :role2], :hosts => 'server2.foo.com'})
116
+ @capistrano.expects(:run).once.with('cd /foo/bar && whenever --flag1 --flag2 --roles role1', {:roles => roles, :hosts => @mock_server1})
117
+ @capistrano.expects(:run).once.with('cd /foo/bar && whenever --flag1 --flag2 --roles role2', {:roles => roles, :hosts => @mock_server2})
117
118
 
118
119
  @capistrano.whenever_run_commands(:command => "whenever",
119
120
  :path => "/foo/bar",
@@ -122,11 +123,25 @@ class CapistranoSupportTest < Test::Unit::TestCase
122
123
 
123
124
  should "call run w/ all role args for servers w/ >1 role" do
124
125
  @capistrano.stubs(:role_names_for_host).with(@mock_server1).returns([:role1, :role3])
125
- @capistrano.stubs(:whenever_servers).returns([@mock_servers.first])
126
+ @capistrano.stubs(:whenever_servers).returns([@mock_server1])
126
127
  roles = [:role1, :role2, :role3]
127
128
  @capistrano.stubs(:whenever_options).returns({:roles => roles})
128
129
 
129
- @capistrano.expects(:run).once.with('cd /foo/bar && whenever --flag1 --flag2 --roles role1,role3', {:roles => [:role1, :role2, :role3], :hosts => 'server1.foo.com'})
130
+ @capistrano.expects(:run).once.with('cd /foo/bar && whenever --flag1 --flag2 --roles role1,role3', {:roles => roles, :hosts => @mock_server1})
131
+
132
+ @capistrano.whenever_run_commands(:command => "whenever",
133
+ :path => "/foo/bar",
134
+ :flags => "--flag1 --flag2")
135
+ end
136
+
137
+ should "call run w/ proper server options (port, user)" do
138
+ @capistrano.stubs(:role_names_for_host).with(@mock_server3).returns([:role3])
139
+ @capistrano.stubs(:whenever_servers).returns([@mock_server3])
140
+ @capistrano.stubs(:whenever_options).returns({:roles => [:role3]})
141
+
142
+ @capistrano.expects(:run).once.with do |command, options|
143
+ options[:hosts].user == "test" && options[:hosts].port == 1022
144
+ end
130
145
 
131
146
  @capistrano.whenever_run_commands(:command => "whenever",
132
147
  :path => "/foo/bar",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whenever
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-22 00:00:00.000000000 Z
12
+ date: 2013-01-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chronic