simultaneous 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -90,7 +90,18 @@ end
90
90
  #############################################################################
91
91
 
92
92
  desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
93
- task :release => :build do
93
+ task :push => :build do
94
+ sh "gem push pkg/#{name}-#{version}.gem"
95
+ end
96
+
97
+ desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
98
+ task :release => :tag do
99
+ Rake::Task["push"].invoke
100
+ end
101
+
102
+
103
+ desc "Create tag v#{version}"
104
+ task :tag => :build do
94
105
  unless `git branch` =~ /^\* master$/
95
106
  puts "You must be on the master branch to release!"
96
107
  exit!
@@ -99,7 +110,6 @@ task :release => :build do
99
110
  sh "git tag v#{version}"
100
111
  sh "git push origin master"
101
112
  sh "git push origin v#{version}"
102
- sh "gem push pkg/#{name}-#{version}.gem"
103
113
  end
104
114
 
105
115
  desc "Build #{gem_file} into the pkg directory"
@@ -7,6 +7,7 @@ module Simultaneous
7
7
  # options:
8
8
  # :nice
9
9
  # :logfile - defaults to PWD/log/task_name.log
10
+ # :pwd - the directory that the task should run in
10
11
  #
11
12
  #
12
13
  # name, path_to_binary, options, default_parameters, env
@@ -19,7 +20,7 @@ module Simultaneous
19
20
  end
20
21
 
21
22
  def logfile
22
- (options[:logfile] || options[:log] || default_log_file)
23
+ File.expand_path(options[:logfile] || options[:log] || default_log_file, pwd)
23
24
  end
24
25
 
25
26
  def pwd
@@ -27,11 +28,12 @@ module Simultaneous
27
28
  end
28
29
 
29
30
  def default_log_file
30
- File.expand_path(File.join(Dir.pwd, "log", "#{name}-task.log"))
31
+ File.join(pwd, "log", "#{name}-task.log")
31
32
  end
32
33
 
33
34
  def default_pwd
34
- "/"
35
+ Dir.pwd
35
36
  end
36
37
  end
37
38
  end
39
+
data/lib/simultaneous.rb CHANGED
@@ -4,7 +4,7 @@ require 'socket'
4
4
  require 'eventmachine'
5
5
 
6
6
  module Simultaneous
7
- VERSION = "0.4.1"
7
+ VERSION = "0.4.2"
8
8
 
9
9
  DEFAULT_CONNECTION = "/tmp/simultaneous-server.sock"
10
10
  DEFAULT_PORT = 9999
data/simultaneous.gemspec CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'simultaneous'
16
- s.version = '0.4.1'
17
- s.date = '2012-06-21'
16
+ s.version = '0.4.2'
17
+ s.date = '2013-01-22'
18
18
  s.rubyforge_project = 'simultaneous'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
data/test/test_task.rb CHANGED
@@ -2,20 +2,29 @@ require File.expand_path('../helper', __FILE__)
2
2
 
3
3
  describe Simultaneous::TaskDescription do
4
4
  it "should generate the right default logfile location" do
5
- mock(Dir).pwd { "/application/current" }
5
+ mock(Dir).pwd.times(any_times) { "/application/current" }
6
6
  task = Simultaneous::TaskDescription.new(:fish, "/path/to/fish")
7
7
  task.logfile.must_equal "/application/current/log/fish-task.log"
8
8
  end
9
- it "should generate the right default logfile location" do
9
+
10
+ it "should generate the right default logfile relative to the configured pwd" do
11
+ # mock(Dir).pwd { "/application/current" }
12
+ task = Simultaneous::TaskDescription.new(:fish, "/path/to/fish", {:pwd => "/application/home", :log => "log/task.log"})
13
+ task.logfile.must_equal "/application/home/log/task.log"
14
+ end
15
+
16
+ it "should use the configured logfile location" do
10
17
  task = Simultaneous::TaskDescription.new(:fish, "/path/to/fish", {:logfile => "/var/log/fish.log"})
11
18
  task.logfile.must_equal "/var/log/fish.log"
12
19
  end
13
- it "should generate the right default logfile location" do
20
+
21
+ it "should use the configured log location" do
14
22
  task = Simultaneous::TaskDescription.new(:fish, "/path/to/fish", {:log => "/var/log/fish.log"})
15
23
  task.logfile.must_equal "/var/log/fish.log"
16
24
  end
17
25
 
18
26
  it "should set the right pwd" do
19
- flunk
27
+ task = Simultaneous::TaskDescription.new(:fish, "/path/to/fish", {:pwd => "/application/home", :log => "log/task.log"})
28
+ task.pwd.must_equal "/application/home"
20
29
  end
21
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simultaneous
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.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-06-21 00:00:00.000000000 Z
12
+ date: 2013-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project: simultaneous
157
- rubygems_version: 1.8.21
157
+ rubygems_version: 1.8.24
158
158
  signing_key:
159
159
  specification_version: 2
160
160
  summary: Simultaneous is the background task launcher used by Spontaneous CMS