fpm-cookery 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v0.13.0 (2013-01-28)
2
+ * Make local file source behave like the remote url source. (#14)
3
+
1
4
  # v0.12.0 (2013-01-28)
2
5
  * Copy source files with no or unknown file extension to
3
6
  the source dir. (smasset)
@@ -31,11 +31,11 @@ module FPM
31
31
  when '.zip'
32
32
  safesystem('unzip', '-d', local_path.basename('.zip'), local_path)
33
33
  else
34
- unless local_path.basename.exist?
34
+ if !local_path.directory? && !local_path.basename.exist?
35
35
  Dir.mkdir(local_path.basename)
36
36
  end
37
37
 
38
- safesystem('cp', '-f', local_path, local_path.basename)
38
+ FileUtils.cp_r(local_path, local_path.basename)
39
39
  end
40
40
  extracted_source
41
41
  end
@@ -5,23 +5,18 @@ require 'fileutils'
5
5
  module FPM
6
6
  module Cookery
7
7
  class SourceHandler
8
- class LocalPath < FPM::Cookery::SourceHandler::Template
8
+ class LocalPath < FPM::Cookery::SourceHandler::Curl
9
9
  CHECKSUM = false
10
10
  NAME = :local_path
11
11
 
12
12
  def fetch
13
- # No need to fetch anything. The files are on the disk already.
14
- Log.info "Local path: #{source.path}"
15
- @local_path = source.path
16
- end
17
-
18
- def extract
19
- extracted_source = (builddir/File.basename(local_path)).to_s
20
-
21
- FileUtils.rm_rf(extracted_source)
22
- FileUtils.cp_r(source.path, extracted_source)
23
-
24
- extracted_source
13
+ if local_path.exist?
14
+ Log.info "Using cached file #{local_path}"
15
+ else
16
+ Log.info "Copying #{source.path} to cache"
17
+ FileUtils.cp_r(source.path, cachedir)
18
+ end
19
+ local_path
25
20
  end
26
21
  end
27
22
  end
@@ -1,5 +1,5 @@
1
1
  module FPM
2
2
  module Cookery
3
- VERSION = '0.12.0'
3
+ VERSION = '0.13.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fpm-cookery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: