rails-zero 0.0.5 → 0.0.6

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: 3480522c5871ac125de6f0ff286696c0acf4bab5
4
- data.tar.gz: c72184c5167de7d855b49298effc49eacb8d132c
3
+ metadata.gz: 633d49c207a8742a7222135569aeff6c659bb9b4
4
+ data.tar.gz: 3a480e119c0ee13841f9841db8d52863bb47ea72
5
5
  SHA512:
6
- metadata.gz: 41800cc6b46b39979fd77abd319eb89bcd1957db85c1959ab41753bbb6d9cab648c8f96eb26ce485324e4128d52a745f0bcffb5f729512eecc806a77b69bb303
7
- data.tar.gz: 7eadf53f97ebf2e7b83abb1f0dfc24c6a2f01080718193911a2dc12c6de263249ca329532653836e777883e61062b9d812402293309052171617f4eafc6654bf
6
+ metadata.gz: c87b300472f1a8b5b7789be70ec49e644f4f29c4426cdc0a44b051f6023da58e71c45321279f72a551f4402c1a59399ed45cde784184e04b84badc5176bbf98b
7
+ data.tar.gz: 1a7ae46814a4623ccc5ca2eb8392129c459293645b76138caa34b2cc35e1f4f66c20414a4c3cdec5c0fce54927b8fa46bcebe11d188744ac47d1c146775b3bfa
@@ -1,6 +1,8 @@
1
1
  module RailsZero
2
2
  class GitDeployer
3
3
  def run
4
+ remove_dir
5
+ create_dir
4
6
  extract_package
5
7
  push_package
6
8
  end
@@ -26,10 +28,11 @@ module RailsZero
26
28
  end
27
29
 
28
30
  def extract_package
29
- remove_dir
30
- create_dir
31
+ raise RailsZero::MissingPackageError, "Package #{package_path} does not exist"\
32
+ unless File.exists?(package_path)
31
33
  command = "tar -xf #{package_path} -C #{dir}"
32
34
  stdout_str, stderr_str, status = Open3.capture3(command)
35
+ raise RailsZero::Error, stderr_str if status.exitstatus > 0
33
36
  end
34
37
 
35
38
  def push_package
@@ -41,7 +44,13 @@ module RailsZero
41
44
  commands << "#{git_binary} commit -m \"Deploy.\""
42
45
  commands << "#{git_binary} push -u --force origin master"
43
46
  stdout_str, stderr_str, status = Open3.capture3(commands.join(" && "))
47
+ raise RailsZero::GitError,
48
+ "Cannot git-deploy #{extracted_package_path} (binary=#{git_binary} "\
49
+ "remote=#{git_remote_url}): #{stdout_str} #{stderr_str}" \
50
+ if status.exitstatus > 0
44
51
  end
52
+ rescue Errno::ENOENT => e
53
+ raise RailsZero::Error, e.message
45
54
  end
46
55
 
47
56
  def git_binary
@@ -1,5 +1,6 @@
1
1
  require "rails_zero/engine"
2
2
  require "rails_zero/config"
3
+ require "rails_zero/errors"
3
4
  require 'actionpack/page_caching/railtie'
4
5
  require 'capybara/dsl'
5
6
  require 'open3'
@@ -0,0 +1,11 @@
1
+ module RailsZero
2
+ class Error < StandardError
3
+ end
4
+
5
+ class MissingPackageError < Error
6
+ end
7
+
8
+ class GitError < Error
9
+
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module RailsZero
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Bissinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-13 00:00:00.000000000 Z
11
+ date: 2014-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -90,6 +90,7 @@ files:
90
90
  - lib/rails_zero/config.rb
91
91
  - lib/rails_zero/drivers/poltergeist.rb
92
92
  - lib/rails_zero/engine.rb
93
+ - lib/rails_zero/errors.rb
93
94
  - lib/rails_zero/version.rb
94
95
  - lib/rails_zero.rb
95
96
  - lib/tasks/rails_zero.rake