capistrano-vexxhost 1.0.2 → 1.0.3

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.
data/Rakefile CHANGED
@@ -1 +1,2 @@
1
+ require "rubygems"
1
2
  require "bundler/gem_tasks"
@@ -1,5 +1,6 @@
1
1
  require 'base64'
2
2
  require 'net/http'
3
+ require 'net/https'
3
4
  require 'json'
4
5
 
5
6
  Capistrano::Configuration.instance(:must_exist).load do
@@ -27,7 +28,7 @@ Capistrano::Configuration.instance(:must_exist).load do
27
28
  response_hash = cpanel_api2_command(server_hostname, auth_string, "RoR", "addapp", {'appname' => application, 'path' => "apps/#{application}"})
28
29
 
29
30
  if response_hash["cpanelresult"]["data"][0]["status"] != 1
30
- raise response_hash["cpanelresult"]["data"][0]["statusmsg"]
31
+ abort " - ERROR: #{response_hash["cpanelresult"]["data"][0]["statusmsg"]}"
31
32
  end
32
33
  end
33
34
 
@@ -38,7 +39,7 @@ Capistrano::Configuration.instance(:must_exist).load do
38
39
  response_hash = cpanel_api2_command(server_hostname, auth_string, "RoR", "startapp", {'appname' => application})
39
40
 
40
41
  if response_hash["cpanelresult"]["data"][0]["status"] != 1
41
- raise response_hash["cpanelresult"]["data"][0]["statusmsg"]
42
+ abort " - ERROR: #{response_hash["cpanelresult"]["data"][0]["statusmsg"]}"
42
43
  else
43
44
  puts response_hash["cpanelresult"]["data"][0]["statusmsg"]
44
45
  end
@@ -52,11 +53,11 @@ Capistrano::Configuration.instance(:must_exist).load do
52
53
 
53
54
  # Empty response = not running
54
55
  if response_hash.nil?
55
- raise "The rails application is not running."
56
+ abort " - ERROR: The rails application is not running."
56
57
  end
57
58
 
58
59
  if response_hash["cpanelresult"]["data"][0]["status"] != 1
59
- raise response_hash["cpanelresult"]["data"][0]["statusmsg"]
60
+ abort " - ERROR: #{response_hash["cpanelresult"]["data"][0]["statusmsg"]}"
60
61
  else
61
62
  puts response_hash["cpanelresult"]["data"][0]["statusmsg"]
62
63
  end
@@ -69,7 +70,7 @@ Capistrano::Configuration.instance(:must_exist).load do
69
70
  response_hash = cpanel_api2_command(server_hostname, auth_string, "RoR", "restartapp", {'appname' => application})
70
71
 
71
72
  if response_hash["cpanelresult"]["data"][0]["status"] != 1
72
- raise response_hash["cpanelresult"]["data"][0]["statusmsg"]
73
+ abort " - ERROR: #{response_hash["cpanelresult"]["data"][0]["statusmsg"]}"
73
74
  else
74
75
  puts response_hash["cpanelresult"]["data"][0]["statusmsg"]
75
76
  end
@@ -82,7 +83,7 @@ Capistrano::Configuration.instance(:must_exist).load do
82
83
  response_hash = cpanel_api2_command(server_hostname, auth_string, "RoR", "setuprewrite", {'appname' => application, 'rewritedomain' => domain, 'rewriteurl' => mount_path})
83
84
 
84
85
  if response_hash["cpanelresult"]["data"][0]["status"] != 1
85
- raise response_hash["cpanelresult"]["data"][0]["statusmsg"]
86
+ abort " - ERROR: #{response_hash["cpanelresult"]["data"][0]["statusmsg"]}"
86
87
  else
87
88
  puts response_hash["cpanelresult"]["data"][0]["statusmsg"]
88
89
  end
@@ -95,7 +96,7 @@ Capistrano::Configuration.instance(:must_exist).load do
95
96
  response_hash = cpanel_api2_command(server_hostname, auth_string, "RoR", "removerewrite", {'appname' => application, 'rewritedomain' => domain, 'rewriteurl' => mount_path})
96
97
 
97
98
  if response_hash["cpanelresult"]["data"][0]["status"] != 1
98
- raise response_hash["cpanelresult"]["data"][0]["statusmsg"]
99
+ abort " - ERROR: #{response_hash["cpanelresult"]["data"][0]["statusmsg"]}"
99
100
  else
100
101
  puts response_hash["cpanelresult"]["data"][0]["statusmsg"]
101
102
  end
@@ -119,14 +120,13 @@ Capistrano::Configuration.instance(:must_exist).load do
119
120
  return (response.body.empty?) ? nil : JSON.parse(response.body.match(/\{(.*)\}/)[0])
120
121
  end
121
122
  else
122
- Net::HTTP.start(hostname, 2083) do |http|
123
- http.use_ssl = true
124
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
125
- request = Net::HTTP::Get.new(request_location, {'Authorization' => "Basic #{authorization}"})
126
- response = http.request(request)
123
+ http = Net::HTTP.new(hostname, 2083)
124
+ http.use_ssl = true
125
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
127
126
 
128
- return (response.body.empty?) ? nil : JSON.parse(response.body.match(/\{(.*)\}/)[0])
129
- end
127
+ request = Net::HTTP::Get.new(request_location, {'Authorization' => "Basic #{authorization}"})
128
+ response = http.request(request)
129
+ return (response.body.empty?) ? nil : JSON.parse(response.body.match(/\{(.*)\}/)[0])
130
130
  end
131
131
  end
132
132
 
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Vexxhost
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,45 +1,60 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: capistrano-vexxhost
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.2
3
+ version: !ruby/object:Gem::Version
4
+ hash: 17
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 3
10
+ version: 1.0.3
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Mohammed Naser
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-04-28 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-09-15 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: capistrano
16
- requirement: &70239984354760 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
22
32
  type: :runtime
23
- prerelease: false
24
- version_requirements: *70239984354760
25
- - !ruby/object:Gem::Dependency
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
26
35
  name: json
27
- requirement: &70239984354340 !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
28
38
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
45
+ version: "0"
33
46
  type: :runtime
34
- prerelease: false
35
- version_requirements: *70239984354340
47
+ version_requirements: *id002
36
48
  description: Capistrano extension allowing deployment Rails applications on VEXXHOST
37
- email:
49
+ email:
38
50
  - mnaser@vexxhost.com
39
51
  executables: []
52
+
40
53
  extensions: []
54
+
41
55
  extra_rdoc_files: []
42
- files:
56
+
57
+ files:
43
58
  - .gitignore
44
59
  - Gemfile
45
60
  - README.md
@@ -48,28 +63,38 @@ files:
48
63
  - lib/capistrano-vexxhost.rb
49
64
  - lib/capistrano-vexxhost/capistrano_integration.rb
50
65
  - lib/capistrano-vexxhost/version.rb
51
- homepage: ''
66
+ homepage: ""
52
67
  licenses: []
68
+
53
69
  post_install_message:
54
70
  rdoc_options: []
55
- require_paths:
71
+
72
+ require_paths:
56
73
  - lib
57
- required_ruby_version: !ruby/object:Gem::Requirement
74
+ required_ruby_version: !ruby/object:Gem::Requirement
58
75
  none: false
59
- requirements:
60
- - - ! '>='
61
- - !ruby/object:Gem::Version
62
- version: '0'
63
- required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ hash: 3
80
+ segments:
81
+ - 0
82
+ version: "0"
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
84
  none: false
65
- requirements:
66
- - - ! '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ hash: 3
89
+ segments:
90
+ - 0
91
+ version: "0"
69
92
  requirements: []
93
+
70
94
  rubyforge_project: capistrano-vexxhost
71
- rubygems_version: 1.8.6
95
+ rubygems_version: 1.8.24
72
96
  signing_key:
73
97
  specification_version: 3
74
98
  summary: Capistrano extension allowing deployment Rails applications on VEXXHOST
75
99
  test_files: []
100
+