parity 0.1.1 → 0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0698fa82d8c213ab44c52cb3fce810562de1f473
4
- data.tar.gz: 46a3715c5db2394ae33ad4b6f2de32db42c36206
5
- SHA512:
6
- metadata.gz: 3f8d844f83bd34cc98c3d04cb85815fab30b8d0490d7c345b7f92c3a981a66d231ce5d845a9420f965a89d95d5a9ec0eb232191f19ce7f81b6976afee11b86c9
7
- data.tar.gz: b9d1f976654e6bb6716a07ea03be643f680c9d0b5ff39df916d7a9aeaaf6e4137e332dc8aa1f2f705ac261247492ccbc2b20940baefb8b9e216293b04e24df2d
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: 3d5038776c07559517e0de8f9278754215aa74f4
4
+ data.tar.gz: 129527e531a784012fd1f695bbc6580418a7ec02
5
+ !binary "U0hBNTEy":
6
+ metadata.gz: 2557b6005704ac2890b37180c4f294d4e6d22ed77e29cd4b995c09c25380a8b0e4164a7711fb27a00cf479547a0a0108cdd9b415f1d982ef93a766b76bf84f12
7
+ data.tar.gz: ffed63bebbd526f76373b9295abf6587f568bc57c29c44fe3db999f39f5f97a0caf227ac28544e579345ad07a03a4052d9611cddb17361281c6d72fd06e7dd61
data/lib/parity/backup.rb CHANGED
@@ -2,9 +2,8 @@ require 'yaml'
2
2
 
3
3
  module Parity
4
4
  class Backup
5
- def initialize(from: from, to: to)
6
- @from = from
7
- @to = to
5
+ def initialize(args)
6
+ @from, @to = args.values_at(:from, :to)
8
7
  end
9
8
 
10
9
  def restore
@@ -10,7 +10,7 @@ module Parity
10
10
  if self.class.private_method_defined?(subcommand)
11
11
  send(subcommand)
12
12
  else
13
- Kernel.system "heroku #{pass_through} --remote #{environment}"
13
+ run_via_cli
14
14
  end
15
15
  end
16
16
 
@@ -18,6 +18,14 @@ module Parity
18
18
 
19
19
  attr_accessor :environment, :subcommand, :arguments
20
20
 
21
+ def open
22
+ run_via_cli
23
+ end
24
+
25
+ def run_via_cli
26
+ Kernel.system "heroku #{pass_through} --remote #{environment}"
27
+ end
28
+
21
29
  def backup
22
30
  Kernel.system "heroku pgbackups:capture --expire --remote #{environment}"
23
31
  end
@@ -50,7 +58,7 @@ module Parity
50
58
  end
51
59
 
52
60
  def pass_through
53
- [subcommand, arguments].join(' ')
61
+ [subcommand, arguments].join(' ').strip
54
62
  end
55
63
  end
56
64
  end
metadata CHANGED
@@ -1,20 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Croak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-03 00:00:00.000000000 Z
11
+ date: 2013-10-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: |2
14
- Devevelopment/staging/production parity is intended to decrease the time
15
- between a developer writing code and having it deployed, make it possible
16
- for the same people who wrote the code to deploy it and watch its behavior
17
- in production, and reduce the number of tools necessary to manage.
13
+ description: ! " Devevelopment/staging/production parity is intended to decrease
14
+ the time\n between a developer writing code and having it deployed, make it possible\n
15
+ \ for the same people who wrote the code to deploy it and watch its behavior\n
16
+ \ in production, and reduce the number of tools necessary to manage.\n"
18
17
  email:
19
18
  - dan@thoughtbot.com
20
19
  executables:
@@ -46,12 +45,12 @@ require_paths:
46
45
  - lib
47
46
  required_ruby_version: !ruby/object:Gem::Requirement
48
47
  requirements:
49
- - - '>='
48
+ - - ! '>='
50
49
  - !ruby/object:Gem::Version
51
50
  version: '0'
52
51
  required_rubygems_version: !ruby/object:Gem::Requirement
53
52
  requirements:
54
- - - '>='
53
+ - - ! '>='
55
54
  - !ruby/object:Gem::Version
56
55
  version: '0'
57
56
  requirements: []