raykit 0.0.462 → 0.0.464

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
  SHA256:
3
- metadata.gz: 3240f8b6c93054e3356f90c76e597d91f259c00e6ab464aa24638aef05a6ac7b
4
- data.tar.gz: ee3ef6b433551c1145df166e275572088a83673f619e086a439e5c90b30350bb
3
+ metadata.gz: f1e4a2d60ca424ebdb9000823856de5c8c6ae6ffc31b9a8946a86ec3570132e7
4
+ data.tar.gz: 9063a6a81a610d259378410074d6e682defa123dd15b7ea9804e6ebffe801295
5
5
  SHA512:
6
- metadata.gz: ecaf07313b78338232954248692e04331ce7ea86f93acfa9a5f3bbdcb1461dcfdc93f469e3bf8fb8b52863c1ad73cd885c300ca8fe28657a13415799dd4d5b90
7
- data.tar.gz: cf7e834052c93cf12ebf16db9af5cb20c47abf16d6579df9fd15386ac152147ba3e8b9bdb87524ba07998556f3115ac0d5b009d25e4c5019bd7fc1c6ec659c8c
6
+ metadata.gz: ee69ff1a3ac6bc02e3feb48678d9e7d24b5745d0b810af1ef2daaebcfe3ff9d5d3354811180cc02fa851537babd94c8048f147f58d6cc4d020a65899ae162ee2
7
+ data.tar.gz: 4d1fe36adf299a5db6cdc50bfdf6d2224eae2271a8e8df42a4ec46192f8e58499e8b05f69aa1679331e04e4859ce0f446b91d7a7ad9c932d72d96f88647e9a0d
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
-
3
2
  module Raykit
4
3
  module Git
5
4
  # Functionality to manage a local clone of a git repository
@@ -181,15 +180,6 @@ module Raykit
181
180
  end
182
181
  end
183
182
  end
184
-
185
- def backup
186
- if ENV["GIT_BACKUP_DIR"] && !ENV["GIT_BACKUP_DIR"].empty?
187
- puts "Backing up #{GIT_DIRECTORY.repository.url}"
188
- Raykit::Git::Repository::backup GIT_DIRECTORY.repository.url, "#{ENV["GIT_BACKUP_DIR"]}/#{GIT_DIRECTORY.repository.relative_path}"
189
- else
190
- puts "Environment variable GIT_BACKUP_DIR is not set"
191
- end
192
- end
193
183
  end
194
184
  end
195
185
  end
@@ -229,6 +229,16 @@ module Raykit
229
229
  FileUtils.rm_rf(make_dir) if (cmd.exitstatus == 0)
230
230
  cmd
231
231
  end
232
+
233
+ def self.backup(url, backup_dir)
234
+ if (Dir.exist?(backup_dir))
235
+ Dir.chdir(backup_dir) do
236
+ run("git pull")
237
+ end
238
+ else
239
+ run("git clone #{url} \"#{backup_dir}\"")
240
+ end
241
+ end
232
242
  end
233
243
  end
234
244
  end
data/lib/raykit.rb CHANGED
@@ -16,6 +16,15 @@ SECRETS = Raykit::Secrets.new
16
16
  REPOSITORIES = Raykit::Git::Repositories.new("#{Raykit::Environment.get_dev_dir("log")}/Raykit.Git.Repositories.json")
17
17
  GIT_DIRECTORY = Raykit::Git::Directory.new(Rake.application.original_dir)
18
18
 
19
+ def backup_git_directory
20
+ if ENV["GIT_BACKUP_DIR"] && !ENV["GIT_BACKUP_DIR"].empty?
21
+ puts "Backing up #{GIT_DIRECTORY.repository.url}"
22
+ Raykit::Git::Repository::backup GIT_DIRECTORY.repository.url, "#{ENV["GIT_BACKUP_DIR"]}/#{GIT_DIRECTORY.repository.relative_path}"
23
+ else
24
+ puts "Environment variable GIT_BACKUP_DIR is not set"
25
+ end
26
+ end
27
+
19
28
  NUGET_DIR = Raykit::Environment::get_dev_dir("nuget")
20
29
  PUBLISH_DIR = Raykit::Environment::get_dev_dir("publish")
21
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raykit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.462
4
+ version: 0.0.464
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow