db_backups 0.0.11 → 0.0.12

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: b8d7579f62b5d40e73c071e4052901aa9bf87264
4
- data.tar.gz: 8862446550adb30fbddedec039500b5f373de7de
3
+ metadata.gz: ea768e7ae5ee438f97a82492a8c20f33b3f1793d
4
+ data.tar.gz: a101c6236d9fe6ce40892bdeda06c2641c004545
5
5
  SHA512:
6
- metadata.gz: 9bf444e4a79e19504669b621edd447b07b208eb8ec00fbeb4d73451f02dc63082a410ad1197158e81b0f8a2617d0cf52f403d90435fddc1a6514d5050a029058
7
- data.tar.gz: 07f9faec4be081e530b6f19faaf8b2c82f3b370b4cd71e142c7394bed805c4096a53921a14fb0b0bd583e7de0652ce0a07f036295b3d147c840eb7b4b5e12f33
6
+ metadata.gz: f387399abcfd2bc3087398b9768b558d48fc10b958aeac1eb76343223cca2a310242975dd7c6c73a7c74063dc7afc03e73e82eb79d007100aa30686f8b8360c0
7
+ data.tar.gz: f7b4fa9e8bc5332373c4bce01759aa46fcd1e7ec936064ec534a2c76c965c56fc8e03559ffc1ee82b734a4840d7b1859e7b1770016c38c18c701a8c0c2b42ea3
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## (unreleased) [![Gem Version](https://badge.fury.io/rb/db_backups.png)](http://badge.fury.io/rb/db_backups)
4
4
 
5
+ ## 0.0.12 (Jul 24, 2013)
6
+
7
+ * Add version command
8
+ * Get app name from APP_NAME env var (default to use current directory name)
9
+
5
10
  ## 0.0.11 (Jul 23, 2013)
6
11
 
7
12
  * Add CHANGELOG
@@ -5,11 +5,15 @@ require 'rubygems/package'
5
5
  require 'open3'
6
6
 
7
7
  require 'optitron'
8
- require 'db_backups/container'
9
- require 'db_backups/db_config'
8
+ require 'db_backups'
10
9
 
11
10
  class DbBackups::CLI < Optitron::CLI
12
11
 
12
+ class_opt :app_name,
13
+ 'App name (Or use APP_NAME env var, default: current directory name)',
14
+ :in => %w{staging uat production} ,
15
+ :default => 'production'
16
+
13
17
  class_opt :environment,
14
18
  'Source Environment (NB. Destination Environment comes from RAILS_ENV var, default: development)',
15
19
  :in => %w{staging uat production} ,
@@ -19,6 +23,12 @@ class DbBackups::CLI < Optitron::CLI
19
23
  '(defaults to ord - Chicago)',
20
24
  :default => 'ord'
21
25
 
26
+ # eergh... is it possible to use `--version` for version?
27
+ desc 'Version'
28
+ def version
29
+ puts DbBackups::VERSION
30
+ end
31
+
22
32
  desc 'Index backups'
23
33
  def index
24
34
  puts container
@@ -91,13 +101,12 @@ class DbBackups::CLI < Optitron::CLI
91
101
  def app_dir
92
102
  @app_dir ||= begin
93
103
  pwd = `basename $(pwd)`.strip
94
- pwd = `basename $(cd ..; pwd)`.strip if pwd == 'current'
104
+ pwd == 'current' ? `basename $(cd ..; pwd)`.strip : pwd
95
105
  end
96
106
  end
97
107
 
98
108
  def app
99
- # TODO - fix the yuk :(
100
- @app ||= app_dir == 'travel_management_platform' ? 'tmp' : app_dir
109
+ @app ||= ENV.fetch('APP_NAME', app_dir)
101
110
  end
102
111
 
103
112
  def environment
@@ -0,0 +1,3 @@
1
+ require 'db_backups/version'
2
+ require 'db_backups/container'
3
+ require 'db_backups/db_config'
@@ -9,6 +9,7 @@ module DbBackups
9
9
  attr_reader :app, :environment
10
10
 
11
11
  def initialize(app, environment, opts={})
12
+ puts "Connecting to container for app: #{app.inspect} in environment: #{environment.inspect} #{opts.inspect unless opts.empty?} ..."
12
13
  @app = app
13
14
  @environment = environment
14
15
  @opts = opts
@@ -1,3 +1,3 @@
1
1
  module DbBackups
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db_backups
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-23 00:00:00.000000000 Z
11
+ date: 2013-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: optitron
@@ -81,6 +81,7 @@ files:
81
81
  - Rakefile
82
82
  - bin/db_backups
83
83
  - db_backups.gemspec
84
+ - lib/db_backups.rb
84
85
  - lib/db_backups/container.rb
85
86
  - lib/db_backups/db_backup.rb
86
87
  - lib/db_backups/db_config.rb