syncoku 0.0.5 → 0.0.6

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: f2b1693d31d1a0ed199286aa7167b68abd719319
4
- data.tar.gz: a34c02a95916b6852e1d25a4f9825e14173287b4
3
+ metadata.gz: 8f8b9fffe969e9ee7c3af090f432905389bbddc3
4
+ data.tar.gz: cf3a8cb3c0d8fa6056c5ba5eef1e0ccb70ab4156
5
5
  SHA512:
6
- metadata.gz: d835a4fb2294b2b2fcee19556a023339bf343b17fa5bdf835242c56b7921cd7089ddc1b573e99940b5674351d6d4c5c11c053cc0f86e400e8ee8caf4ee6eb148
7
- data.tar.gz: 7f5b02196add0e55ff6501df51b9e613af8c5e91535674144658eeb92b3363712c3e45dfd86e5e5c18866a718039291c495c63ffe4d2ca081e9585b31a254491
6
+ metadata.gz: d05acec9101f75a5d77d7d044fc10e7659aadd874dff9f5e9319a785048924abab66ca80c2291d01c627dcc1611de722a1e00bca8f1aa459be02c67140986204
7
+ data.tar.gz: 56bfc98a76661cc88141b4eb72d2c3a276651f17a89d9e6e088dd93d45c10f624fc37a06253a82ed2597595788283544df2a4a4528f0d315b04a3c7505011c19
@@ -1,6 +1,7 @@
1
1
  module Syncoku
2
2
  module CaptureBackup
3
3
  include Runnable
4
+ include Git
4
5
 
5
6
  def capture
6
7
  puts "Capturing #{production_app_name} backup..."
@@ -14,7 +15,7 @@ module Syncoku
14
15
 
15
16
 
16
17
  def production_app_name
17
- @production_app_name ||= run_command("git remote -v | grep production | grep push").match(/heroku[^:]*:(.*)\.git/)[1]
18
+ @production_app_name ||= extract_app_name 'production'
18
19
  end
19
20
 
20
21
  end
@@ -0,0 +1,8 @@
1
+ module Syncoku
2
+ module Git
3
+
4
+ def extract_app_name(name)
5
+ run_command("git remote -v | grep #{name} | grep push").match(/(\/|:)([^\/:]*)\.git/)[2]
6
+ end
7
+ end
8
+ end
@@ -3,6 +3,7 @@ module Syncoku
3
3
  # Responsible for syncing to a remote app
4
4
  class Remote
5
5
  include Runnable
6
+ include Git
6
7
 
7
8
  attr_reader :remote
8
9
 
@@ -28,7 +29,7 @@ module Syncoku
28
29
  end
29
30
 
30
31
  def app_name
31
- @app_name ||= run_command("git remote -v | grep #{remote} | grep push").match(/heroku\.com:(.*)\.git/)[1]
32
+ @app_name ||= extract_app_name remote
32
33
  end
33
34
 
34
35
  end
@@ -1,3 +1,3 @@
1
1
  module Syncoku
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/lib/syncoku.rb CHANGED
@@ -4,6 +4,7 @@ require 'rake'
4
4
  require 'yaml'
5
5
  require 'io/console'
6
6
  require "syncoku/runnable"
7
+ require "syncoku/git"
7
8
  require "syncoku/capture_backup"
8
9
  require "syncoku/control"
9
10
  require "syncoku/local"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syncoku
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
  - Bill Horsman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-13 00:00:00.000000000 Z
11
+ date: 2016-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -69,6 +69,7 @@ files:
69
69
  - lib/syncoku.rb
70
70
  - lib/syncoku/capture_backup.rb
71
71
  - lib/syncoku/control.rb
72
+ - lib/syncoku/git.rb
72
73
  - lib/syncoku/local.rb
73
74
  - lib/syncoku/local_db.rb
74
75
  - lib/syncoku/remote.rb