html_mockup 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,9 +9,11 @@ module HtmlMockup
9
9
  Dir.chdir(release.build_path.to_s) do
10
10
  Dir.glob(@pattern).each do |file|
11
11
  path = File.join(release.build_path.to_s, file)
12
- release.log(self, "Cleaning up \"#{path}\" in build")
13
- if inside_build_path release.build_path, path
14
- rm_rf(path)
12
+ if is_inside_build_path(release.build_path, path)
13
+ release.log(self, "Cleaning up \"#{path}\" in build")
14
+ rm_rf(path)
15
+ else
16
+ release.log(self, "FAILED cleaning up \"#{path}\" in build")
15
17
  end
16
18
  end
17
19
  end
@@ -19,9 +21,21 @@ module HtmlMockup
19
21
 
20
22
  protected
21
23
 
22
- def inside_build_path(build_path, pattern)
23
- build_path = Pathname.new(build_path).realpath.to_s
24
- path = Pathname.new(File.join(build_path.to_s, pattern)).realpath.to_s
24
+ def is_inside_build_path(build_path, path)
25
+
26
+ begin
27
+ build_path = Pathname.new(build_path).realpath.to_s
28
+ path = Pathname.new(path)
29
+ if(path.absolute?)
30
+ path = path.realpath.to_s
31
+ else
32
+ path = Pathname.new(File.join(build_path.to_s, path)).realpath.to_s
33
+ end
34
+ rescue Errno::ENOENT
35
+ # Real path does not exist
36
+ return false
37
+ end
38
+
25
39
  if path[build_path]
26
40
  return true
27
41
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html_mockup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2012-11-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
17
- requirement: &70093234338100 !ruby/object:Gem::Requirement
17
+ requirement: &70236893702460 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 0.16.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70093234338100
25
+ version_requirements: *70236893702460
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rack
28
- requirement: &70093234337420 !ruby/object:Gem::Requirement
28
+ requirement: &70236893701860 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70093234337420
36
+ version_requirements: *70236893701860
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: tilt
39
- requirement: &70093234336780 !ruby/object:Gem::Requirement
39
+ requirement: &70236893701080 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70093234336780
47
+ version_requirements: *70236893701080
48
48
  description:
49
49
  email: flurin@digitpaint.nl
50
50
  executables: