effuse 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/ChangeLog.md +5 -0
  2. data/README.md +2 -0
  3. data/bin/effuse +10 -2
  4. data/effuse.gemspec +1 -1
  5. metadata +2 -2
data/ChangeLog.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.1.0 (April 28 2012)
4
+
5
+ * Added `--prefix`
6
+ * Fix: Ruby 1.8 compatibility in reading `.effuseignore`
7
+
3
8
  ## 1.0.0 (April 9 2012)
4
9
 
5
10
  * Added `--no-backup`
data/README.md CHANGED
@@ -45,6 +45,8 @@ Usage: effuse [OPTION...] [DEST]
45
45
  -y, --noconfirm CHOICE Assume CHOICE on file conflicts
46
46
  -n, --no-backup Do not create backup files
47
47
 
48
+ -p --prefix PREFIX Prefix relative paths with PREFIX
49
+
48
50
  -v, --verbose Show verbose output
49
51
  -h, --help Show this message
50
52
  ```
data/bin/effuse CHANGED
@@ -8,10 +8,11 @@ options = OpenStruct.new(:verbose => false,
8
8
  :clean => false,
9
9
  :noconfirm => nil,
10
10
  :backup => true,
11
+ :prefix => '',
11
12
  :exclude => %w[.effuseignore .git .gitignore .gitmodules *~ .*~ .*.swp])
12
13
 
13
14
  if File.exist?('.effuseignore')
14
- File.open('.effuseignore').lines do |line|
15
+ File.open('.effuseignore').lines.each do |line| # Ruby 1.8 (.each)
15
16
  options.exclude << line.chomp
16
17
  end
17
18
  end
@@ -45,6 +46,12 @@ OptionParser.new do |o|
45
46
 
46
47
  o.separator ''
47
48
 
49
+ o.on('-p', '--prefix PREFIX', 'Prefix relative paths with PREFIX') do |prefix|
50
+ options.prefix = prefix
51
+ end
52
+
53
+ o.separator ''
54
+
48
55
  o.on('-v', '--verbose', 'Show verbose output') do
49
56
  options.verbose = true
50
57
  end
@@ -84,7 +91,8 @@ dirs.each do |dir|
84
91
  end
85
92
 
86
93
  puts "found #{file}" if options.verbose
87
- dest = File.join([dest_dir] + file.split('/')[1..-1])
94
+ relpath = file.split('/')[1..-1]
95
+ dest = File.join([dest_dir, options.prefix + relpath[0]] + relpath[1..-1])
88
96
  files[File.expand_path(file)] = dest # Shakes fist at Ruby 1.8 (File.absolute_path)
89
97
  end
90
98
  end
data/effuse.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'effuse'
3
- s.version = '1.0.0'
3
+ s.version = '1.1.0'
4
4
  s.authors = ['Curtis McEnroe']
5
5
  s.email = ['programble@gmail.com']
6
6
  s.homepage = 'https://github.com/programble/effuse'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effuse
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-09 00:00:00.000000000 Z
12
+ date: 2012-04-28 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A tool for managing symlinks
15
15
  email: