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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a7575b09b41fd4f14f726a60a9397b4c418b06c
4
- data.tar.gz: 7f46253e1cb540fa95cf4ba102506cb7ba57d945
3
+ metadata.gz: a3cee59678ff15e94c4c4834da2fe0700d5f65ec
4
+ data.tar.gz: 0a01dabb060b94e91d7fcba990f41e67b21850cb
5
5
  SHA512:
6
- metadata.gz: f9ed8d867c7dd5c9daf83aeeb64d6f64a1cbf835caaa7896dd632b3515c4526ae66f0504db960791bab6991e137cc77f7f27f1a454b58b3cc5d2949d8690dceb
7
- data.tar.gz: 208da4cf0dc9d5285a855394066267d6cf736f8501c762c1dce9067a03d3840abf71cf48ce980d6f3990ab29ffcbf9f184b106bce3eb563a64a0d021d0aae8f9
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 /tmp/k0kubun/dotfiles/script/*.sh instead of /tmp/k0kubun/dotfiles/*.sh
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
@@ -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: /tmp/USER/PROJECT
98
+ -d, [--directory=/path/to/clone] Default: ~/PROJECT
99
99
  -s, [--scriptdir=/script/placed/dir] Default: '' (root)
100
100
 
101
101
  EOS
@@ -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
- expanded_directory.gsub(/\/$/, '').match(/[^\/]+$/).to_s
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
- if @directory
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 user_path
84
- File.join(DEFAULT_DIRECTORY, @user)
69
+ def default_directory
70
+ File.expand_path('~')
85
71
  end
86
72
  end
87
73
  end
@@ -1,3 +1,3 @@
1
1
  module Rebuild
2
- VERSION = '0.4.3'
2
+ VERSION = '0.5.0'
3
3
  end
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.3
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-27 00:00:00.000000000 Z
11
+ date: 2014-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unindent