parity 0.2.1 → 0.3.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
2
  SHA1:
3
- metadata.gz: 144ca0937253621df58687c414829082856bca29
4
- data.tar.gz: ac74e8487bfc859501d52b67858957cb2b7d25e4
3
+ metadata.gz: ba2da5e28e45e4da467bb10816894ec696ea09e9
4
+ data.tar.gz: bccaf36f3dd62f5a12da6c22579d94b85073dcce
5
5
  SHA512:
6
- metadata.gz: 7273199617ff4cc35942c752570899730ab118dd00828d9fbf214db343814dc8edbad2648c617e4568beeac3dd0fbff830677ed590aac607b2c3275565f44625
7
- data.tar.gz: 36c8c4b80d50b9ed634032eb46bf7b91c5b4aae6e93636d7a39d544e27aba50e83dc326d9d6ee4a1364781c459d205dc63e19ad2bbedb35ea967927ff4f47521
6
+ metadata.gz: 919d2eb79df6ecd477739a1d05990a21c2822462576fa6e2f43c7e1b5164341db3ff651405fb491d7e10d2d78d32b3c167f086f9d307727adc81705814cfe980
7
+ data.tar.gz: 3f3cb32cb5406fb538890abaa0308711176883a42050f225cef5ab70e83371cdf361c4b8b60b1c60be05fcf86b4392d58b7da6b8ac5705f2d7b300c4aedc632b
data/README.md CHANGED
@@ -3,6 +3,21 @@ Parity
3
3
 
4
4
  Shell commands for development, staging, and production parity for Heroku apps.
5
5
 
6
+ Prerequisites
7
+ -------------
8
+
9
+ Your development machine will need these command-line programs:
10
+
11
+ curl
12
+ heroku
13
+ pg_restore
14
+
15
+ On a Mac, `curl` is installed by default and the other programs can be installed
16
+ with Homebrew:
17
+
18
+ brew install heroku-toolbelt
19
+ brew install postgres --no-python
20
+
6
21
  Install
7
22
  -------
8
23
 
@@ -14,17 +29,30 @@ This installs three shell commands:
14
29
  staging
15
30
  production
16
31
 
17
- Your development machine will also need these command-line programs:
32
+ Customization
33
+ -------------
18
34
 
19
- curl
20
- heroku
21
- pg_restore
35
+ If you have Heroku environments beyond staging and production (such as a feature
36
+ environment for each developer), you can add a [binstub] to the `bin` folder of
37
+ your application. Custom environments share behavior with staging: they can be
38
+ backed up and can restore from production.
22
39
 
23
- On a Mac, `curl` is installed by default and the other programs can be installed
24
- with Homebrew:
40
+ [binstub]: https://github.com/sstephenson/rbenv/wiki/Understanding-binstubs
25
41
 
26
- brew install heroku-toolbelt
27
- brew install postgres --no-python
42
+ Here's an example binstub for a 'feature-geoff' environment, hosted at
43
+ myapp-feature-geoff.herokuapp.com.
44
+
45
+ ```ruby
46
+ #!/usr/bin/env ruby
47
+
48
+ require 'parity'
49
+
50
+ if ARGV.empty?
51
+ puts Parity::Usage.new
52
+ else
53
+ Parity::HerokuEnvironment.new('feature-geoff', ARGV).run
54
+ end
55
+ ```
28
56
 
29
57
  Usage
30
58
  -----
@@ -93,6 +121,11 @@ Parity.configure do |config|
93
121
  end
94
122
  ```
95
123
 
124
+ Contributing
125
+ ------------
126
+
127
+ Please see CONTRIBUTING.md for details.
128
+
96
129
  Credits
97
130
  -------
98
131
 
@@ -5,5 +5,5 @@ require File.join(File.dirname(__FILE__), '..', 'lib', 'parity')
5
5
  if ARGV.empty?
6
6
  puts Parity::Usage.new
7
7
  else
8
- Parity::Development.new(ARGV).run
8
+ Parity::Environment.new('development', ARGV).run
9
9
  end
@@ -5,5 +5,5 @@ require File.join(File.dirname(__FILE__), '..', 'lib', 'parity')
5
5
  if ARGV.empty?
6
6
  puts Parity::Usage.new
7
7
  else
8
- Parity::Production.new(ARGV).run
8
+ Parity::Environment.new('production', ARGV).run
9
9
  end
@@ -5,5 +5,5 @@ require File.join(File.dirname(__FILE__), '..', 'lib', 'parity')
5
5
  if ARGV.empty?
6
6
  puts Parity::Usage.new
7
7
  else
8
- Parity::Staging.new(ARGV).run
8
+ Parity::Environment.new('staging', ARGV).run
9
9
  end
@@ -1,7 +1,5 @@
1
1
  require 'parity/configuration'
2
- require 'parity/development'
3
- require 'parity/staging'
4
- require 'parity/production'
2
+ require 'parity/environment'
5
3
  require 'parity/usage'
6
4
 
7
5
  Parity.configure
@@ -1,3 +1,5 @@
1
+ require 'parity/backup'
2
+
1
3
  module Parity
2
4
  class Environment
3
5
  def initialize(environment, subcommands)
@@ -30,6 +32,14 @@ module Parity
30
32
  Kernel.system "heroku pgbackups:capture --expire --remote #{environment}"
31
33
  end
32
34
 
35
+ def restore
36
+ if environment == "production"
37
+ $stdout.puts "Parity does not support restoring backups into your production environment."
38
+ else
39
+ Backup.new(from: arguments.first, to: environment).restore
40
+ end
41
+ end
42
+
33
43
  def console
34
44
  Kernel.system "heroku run rails console --remote #{environment}"
35
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.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: 2014-01-07 00:00:00.000000000 Z
11
+ date: 2014-07-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  Devevelopment/staging/production parity is intended to decrease the time
@@ -31,10 +31,7 @@ files:
31
31
  - lib/parity.rb
32
32
  - lib/parity/backup.rb
33
33
  - lib/parity/configuration.rb
34
- - lib/parity/development.rb
35
34
  - lib/parity/environment.rb
36
- - lib/parity/production.rb
37
- - lib/parity/staging.rb
38
35
  - lib/parity/usage.rb
39
36
  homepage: https://github.com/croaky/parity
40
37
  licenses:
@@ -56,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
53
  version: '0'
57
54
  requirements: []
58
55
  rubyforge_project:
59
- rubygems_version: 2.2.0
56
+ rubygems_version: 2.2.2
60
57
  signing_key:
61
58
  specification_version: 4
62
59
  summary: Shell commands for development, staging, and production parity.
@@ -1,16 +0,0 @@
1
- require 'parity/backup'
2
- require 'parity/environment'
3
-
4
- module Parity
5
- class Development < Environment
6
- def initialize(subcommands)
7
- super 'development', subcommands
8
- end
9
-
10
- private
11
-
12
- def restore
13
- Backup.new(from: arguments.first, to: 'development').restore
14
- end
15
- end
16
- end
@@ -1,9 +0,0 @@
1
- require 'parity/environment'
2
-
3
- module Parity
4
- class Production < Environment
5
- def initialize(subcommands)
6
- super 'production', subcommands
7
- end
8
- end
9
- end
@@ -1,16 +0,0 @@
1
- require 'parity/backup'
2
- require 'parity/environment'
3
-
4
- module Parity
5
- class Staging < Environment
6
- def initialize(subcommands)
7
- super 'staging', subcommands
8
- end
9
-
10
- private
11
-
12
- def restore
13
- Backup.new(from: arguments.first, to: 'staging').restore
14
- end
15
- end
16
- end