vlad-thin 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. data/README.rdoc +1 -1
  2. data/VERSION +1 -1
  3. data/lib/vlad/thin.rb +27 -22
  4. data/vlad-thin.gemspec +10 -9
  5. metadata +8 -13
data/README.rdoc CHANGED
@@ -8,7 +8,7 @@ Yell at me (via an issue) if thin’s bundled vlad.rake changes, I’m totally n
8
8
 
9
9
  == Thanks
10
10
 
11
- * [MichaelXavier](https://github.com/MichaelXavier)
11
+ * https://github.com/MichaelXavier
12
12
 
13
13
  == Copyright
14
14
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.2.0
data/lib/vlad/thin.rb CHANGED
@@ -7,8 +7,8 @@ namespace :vlad do
7
7
  ##
8
8
  # Thin app server
9
9
 
10
- set :thin_address, "127.0.0.1"
11
- set :thin_command, 'thin'
10
+ set :thin_address, nil
11
+ set :thin_command, "thin"
12
12
  set(:thin_conf) { "#{shared_path}/thin_cluster.conf" }
13
13
  set :thin_environment, "production"
14
14
  set :thin_group, nil
@@ -19,46 +19,51 @@ namespace :vlad do
19
19
  set :thin_prefix, nil
20
20
  set :thin_servers, 2
21
21
  set :thin_user, nil
22
+
23
+ set :thin_uses_bundler, true
22
24
 
23
25
  desc "Prepares application servers for deployment. thin
24
26
  configuration is set via the thin_* variables.".cleanup
25
27
 
26
28
  remote_task :setup_app, :roles => :app do
27
-
28
- raise(ArgumentError, "Please provide either thin_socket or thin_port") if thin_port.nil? && thin_socket.nil?
29
-
30
29
  cmd = [
31
- "#{thin_command} config",
32
- "-s #{thin_servers}",
33
- ("-S #{thin_socket}" if thin_socket),
34
- "-e #{thin_environment}",
35
- "-a #{thin_address}",
36
- "-c #{current_path}",
37
- "-C #{thin_conf}",
38
- ("-P #{thin_pid_file}" if thin_pid_file),
39
- ("-l #{thin_log_file}" if thin_log_file),
40
- ("--user #{thin_user}" if thin_user),
41
- ("--group #{thin_group}" if thin_group),
42
- ("--prefix #{thin_prefix}" if thin_prefix),
43
- ("-p #{thin_port}" if thin_port),
30
+ "config",
31
+ (%(-s "#{thin_servers}") if thin_servers),
32
+ (%(-S "#{thin_socket}") if thin_socket),
33
+ (%(-e "#{thin_environment}") if thin_environment),
34
+ (%(-a "#{thin_address}") if thin_address),
35
+ %(-c "#{current_path}"),
36
+ (%(-C "#{thin_conf}") if thin_conf),
37
+ (%(-P "#{thin_pid_file}") if thin_pid_file),
38
+ (%(-l "#{thin_log_file}") if thin_log_file),
39
+ (%(--user "#{thin_user}") if thin_user),
40
+ (%(--group "#{thin_group}") if thin_group),
41
+ (%(--prefix "#{thin_prefix}") if thin_prefix),
42
+ (%(-p "#{thin_port}") if thin_port),
44
43
  ].compact.join ' '
45
44
 
46
- run cmd
45
+ thin(cmd)
47
46
  end
48
47
 
49
48
  def thin(cmd) # :nodoc:
50
- "#{thin_command} #{cmd} -C #{thin_conf}"
49
+ command = if thin_uses_bundler
50
+ %(BUNDLE_GEMFILE="#{current_path}/Gemfile" bundle exec #{thin_command} #{cmd} -C "#{thin_conf}")
51
+ else
52
+ %(#{thin_command} #{cmd} -C "#{thin_conf}")
53
+ end
54
+
55
+ %(cd "#{current_path}" && #{command})
51
56
  end
52
57
 
53
58
  desc "Restart the app servers"
54
59
 
55
60
  remote_task :start_app, :roles => :app do
56
- run thin("restart -O -s #{thin_servers}")
61
+ run thin(%(restart -O -s "#{thin_servers}"))
57
62
  end
58
63
 
59
64
  desc "Stop the app servers"
60
65
 
61
66
  remote_task :stop_app, :roles => :app do
62
- run thin("stop -s #{thin_servers}")
67
+ run thin(%(stop -s "#{thin_servers}"))
63
68
  end
64
69
  end
data/vlad-thin.gemspec CHANGED
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "vlad-thin"
8
- s.version = "1.1.1"
7
+ s.name = %q{vlad-thin}
8
+ s.version = "1.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Phil Smith"]
12
- s.date = "2012-03-02"
13
- s.description = "This is thin's own example/vlad.rake in a gem"
14
- s.email = "phil.h.smith@gmail.com"
12
+ s.date = %q{2013-02-06}
13
+ s.description = %q{This is thin's own example/vlad.rake in a gem}
14
+ s.email = %q{phil.h.smith@gmail.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
17
  "README.rdoc"
@@ -25,15 +25,16 @@ Gem::Specification.new do |s|
25
25
  "lib/vlad/thin.rb",
26
26
  "vlad-thin.gemspec"
27
27
  ]
28
- s.homepage = "http://github.com/phs/vlad-thin"
28
+ s.homepage = %q{http://github.com/phs/vlad-thin}
29
29
  s.require_paths = ["lib"]
30
- s.rubygems_version = "1.8.17"
31
- s.summary = "Control thin with vlad"
30
+ s.rubygems_version = %q{1.3.6}
31
+ s.summary = %q{Control thin with vlad}
32
32
 
33
33
  if s.respond_to? :specification_version then
34
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
34
35
  s.specification_version = 3
35
36
 
36
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
37
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
37
38
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
38
39
  else
39
40
  s.add_dependency(%q<rspec>, [">= 1.2.9"])
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vlad-thin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 1
8
- - 1
9
- - 1
10
- version: 1.1.1
7
+ - 2
8
+ - 0
9
+ version: 1.2.0
11
10
  platform: ruby
12
11
  authors:
13
12
  - Phil Smith
@@ -15,17 +14,16 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2012-03-02 00:00:00 Z
17
+ date: 2013-02-06 00:00:00 -08:00
18
+ default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rspec
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
24
  requirements:
26
25
  - - ">="
27
26
  - !ruby/object:Gem::Version
28
- hash: 13
29
27
  segments:
30
28
  - 1
31
29
  - 2
@@ -50,6 +48,7 @@ files:
50
48
  - VERSION
51
49
  - lib/vlad/thin.rb
52
50
  - vlad-thin.gemspec
51
+ has_rdoc: true
53
52
  homepage: http://github.com/phs/vlad-thin
54
53
  licenses: []
55
54
 
@@ -59,27 +58,23 @@ rdoc_options: []
59
58
  require_paths:
60
59
  - lib
61
60
  required_ruby_version: !ruby/object:Gem::Requirement
62
- none: false
63
61
  requirements:
64
62
  - - ">="
65
63
  - !ruby/object:Gem::Version
66
- hash: 3
67
64
  segments:
68
65
  - 0
69
66
  version: "0"
70
67
  required_rubygems_version: !ruby/object:Gem::Requirement
71
- none: false
72
68
  requirements:
73
69
  - - ">="
74
70
  - !ruby/object:Gem::Version
75
- hash: 3
76
71
  segments:
77
72
  - 0
78
73
  version: "0"
79
74
  requirements: []
80
75
 
81
76
  rubyforge_project:
82
- rubygems_version: 1.8.17
77
+ rubygems_version: 1.3.6
83
78
  signing_key:
84
79
  specification_version: 3
85
80
  summary: Control thin with vlad