rebuild 0.4.3 → 0.5.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 +1 -1
- data/lib/rebuild/cli.rb +1 -1
- data/lib/rebuild/repository.rb +5 -19
- data/lib/rebuild/version.rb +1 -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: a3cee59678ff15e94c4c4834da2fe0700d5f65ec
|
4
|
+
data.tar.gz: 0a01dabb060b94e91d7fcba990f41e67b21850cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f37e7002949ebc34f02e10eeadf19b6d2c1318ea978c85ed544425eb032cee32176cc1d31f51399ebaff08539ecd591a4b00be2956622782059ff6ec6d0b82b
|
7
|
+
data.tar.gz: ae9d109020ba6f5164cef0ce3640756b8747507f4a848f9b9030f49021aa3168b50d023cd59187b33105fce4a366c30d0684a3b6330634c9e480d60583e6003f
|
data/README.md
CHANGED
@@ -51,7 +51,7 @@ $ rebuild -f
|
|
51
51
|
# Repository will be cloned to ~/src/github.com/k0kubun/dotfiles
|
52
52
|
$ rebuild -d ~/src/github.com/k0kubun/dotfiles
|
53
53
|
|
54
|
-
# Run
|
54
|
+
# Run ~/dotfiles/script/*.sh instead of ~/dotfiles/*.sh
|
55
55
|
$ rebuild -s script
|
56
56
|
|
57
57
|
# You can choose which script to run first by shell pipeline
|
data/lib/rebuild/cli.rb
CHANGED
@@ -95,7 +95,7 @@ module Rebuild
|
|
95
95
|
-h, [--help] Show this
|
96
96
|
-v, [--version] Print version
|
97
97
|
-f, [--force-update] By default, git pull is not executed
|
98
|
-
-d, [--directory=/path/to/clone] Default:
|
98
|
+
-d, [--directory=/path/to/clone] Default: ~/PROJECT
|
99
99
|
-s, [--scriptdir=/script/placed/dir] Default: '' (root)
|
100
100
|
|
101
101
|
EOS
|
data/lib/rebuild/repository.rb
CHANGED
@@ -3,8 +3,6 @@ require 'fileutils'
|
|
3
3
|
|
4
4
|
module Rebuild
|
5
5
|
class Repository
|
6
|
-
DEFAULT_DIRECTORY = '/tmp'
|
7
|
-
|
8
6
|
def initialize(path, options)
|
9
7
|
@user, @repo = path.split('/')
|
10
8
|
@directory = options[:directory]
|
@@ -57,31 +55,19 @@ module Rebuild
|
|
57
55
|
end
|
58
56
|
|
59
57
|
def repo_path
|
60
|
-
File.join(upper_directory, directory_name)
|
61
|
-
end
|
62
|
-
|
63
|
-
def directory_name
|
64
58
|
if @directory
|
65
|
-
|
59
|
+
File.expand_path(@directory)
|
66
60
|
else
|
67
|
-
@repo
|
61
|
+
File.join(default_directory, @repo)
|
68
62
|
end
|
69
63
|
end
|
70
64
|
|
71
65
|
def upper_directory
|
72
|
-
|
73
|
-
expanded_directory.gsub(/[^\/]+\/?$/, '')
|
74
|
-
else
|
75
|
-
user_path
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
def expanded_directory
|
80
|
-
File.expand_path(@directory, `pwd`.strip)
|
66
|
+
repo_path.gsub(/[^\/]+\/?/, '')
|
81
67
|
end
|
82
68
|
|
83
|
-
def
|
84
|
-
File.
|
69
|
+
def default_directory
|
70
|
+
File.expand_path('~')
|
85
71
|
end
|
86
72
|
end
|
87
73
|
end
|
data/lib/rebuild/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rebuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unindent
|