ghq_transfer 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -3
- data/lib/ghq_transfer/version.rb +1 -1
- data/lib/ghq_transfer.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30b4d9cee0c2dd9e654552023610892ca6ad053d
|
4
|
+
data.tar.gz: 89755f439cb2ac93fd42f6d0a686a88e0754656c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f092c84c2cb5259714ba78ae15343bd8c725893185ca1da017301ef874d4efdc47a892ffcb07dcc2893cea971f9142323ffb6a9ac0b6711d4f760c338f95c63
|
7
|
+
data.tar.gz: 2306385dc8267411070486dc2a9150227e0512efdb9a04e97722316322f43da113cf0fe4ba2e1cc5dc54bf734b1452ad97d67e0614b7f1de5d681ee7e986d789
|
data/README.md
CHANGED
@@ -11,7 +11,9 @@ Transfer local repositories from flatten directory style to [ghq](https://github
|
|
11
11
|
Options:
|
12
12
|
|
13
13
|
* `--dry-run` ... Dry run mode (First of all, You'll run this)
|
14
|
-
* `--valth
|
14
|
+
* `--valth` ... Apply mode
|
15
|
+
|
16
|
+
The `--dry-run` option overrides the `--valth` option if both are used.
|
15
17
|
|
16
18
|
## 1. Execute dry run mode
|
17
19
|
|
@@ -62,13 +64,13 @@ gem 'ghq_transfer'
|
|
62
64
|
And then execute:
|
63
65
|
|
64
66
|
```sh
|
65
|
-
|
67
|
+
% bundle
|
66
68
|
```
|
67
69
|
|
68
70
|
Or install it yourself as:
|
69
71
|
|
70
72
|
```sh
|
71
|
-
|
73
|
+
% gem install ghq_transfer
|
72
74
|
```
|
73
75
|
|
74
76
|
## Contributing
|
data/lib/ghq_transfer/version.rb
CHANGED
data/lib/ghq_transfer.rb
CHANGED
@@ -9,6 +9,8 @@ module GhqTransfer
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def run
|
12
|
+
puts valth? ? '*** VALTH!! ***' : '*** dry run ***'
|
13
|
+
|
12
14
|
ghq_root = Pathname(`ghq root`.chomp)
|
13
15
|
|
14
16
|
Dir.glob(ghq_root.join('*')).each do |src|
|
@@ -36,7 +38,7 @@ module GhqTransfer
|
|
36
38
|
|
37
39
|
puts "#{src} -> #{dest_path}"
|
38
40
|
|
39
|
-
if
|
41
|
+
if valth?
|
40
42
|
FileUtils.mkdir_p(dest_dir)
|
41
43
|
|
42
44
|
FileUtils.mv(src, dest_path)
|
@@ -49,6 +51,10 @@ module GhqTransfer
|
|
49
51
|
|
50
52
|
private
|
51
53
|
|
54
|
+
def valth?
|
55
|
+
@options[:dry_run].! && @options[:valth]
|
56
|
+
end
|
57
|
+
|
52
58
|
def extract_paths_from_ssh(url)
|
53
59
|
/git@(.+):(.+)\/(.+)/ === url
|
54
60
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ghq_transfer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Koichi ITO
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Transfer local repositories from flatten directory style to ghq convention
|
14
14
|
style.
|