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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 833475cf0dd3f12fe168484ed356d4ff8589354e
4
- data.tar.gz: 23fab3334ccd0d8941f74123bb6b0fd29378f85a
3
+ metadata.gz: 30b4d9cee0c2dd9e654552023610892ca6ad053d
4
+ data.tar.gz: 89755f439cb2ac93fd42f6d0a686a88e0754656c
5
5
  SHA512:
6
- metadata.gz: b8efd400f07322ab0ba1d858d635cc8416b8049d13d11ef25aa5d3f75f691972600f64ea3d9b2d83fae6629af6f525cd43debda09a4728500a8a9948815a81da
7
- data.tar.gz: f338cc3ed44dfa6498b1f0b91e86a348020584dc75bbcb596ef70d69643aa8a697c9f153cd6f8a35ebd7f5acbc3fccee01d4026d0fd01a275fad859e03822a26
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`` ... Apply mode
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
- $ bundle
67
+ % bundle
66
68
  ```
67
69
 
68
70
  Or install it yourself as:
69
71
 
70
72
  ```sh
71
- $ gem install ghq_transfer
73
+ % gem install ghq_transfer
72
74
  ```
73
75
 
74
76
  ## Contributing
@@ -1,3 +1,3 @@
1
1
  module GhqTransfer
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
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 @options[:valth]
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.1.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-01 00:00:00.000000000 Z
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.