roger 0.12.2 → 0.12.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +3 -0
- data/lib/roger/release/cleaner.rb +16 -8
- data/roger.gemspec +1 -1
- data/test/unit/release/cleaner_test.rb +21 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDNkNDAwZjFmOTYxZWVmYjE5MDYwYmFmZWQ5OTU2YmU4Zjc1NzczZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjExZDc0NjVhMGYwNzYzNTM2ZTFhMjFlZGZmMTY5MjE3MWUxZDQ3ZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2UxNjZmMDJjOGVlMmQxOGQ3ODhiYzVhNjMzOGI2ZjYyOGM0YThhMDE1YjUz
|
10
|
+
OWEwYWMwYjBhNDk4MGU0MTEzMGRlMDYxNDVlNjJjY2UwYjkxNmRkMmQ2ZjA5
|
11
|
+
NDZjNmRhNmNhNWZhNDhkMjBhYjg1NzkwNjBhZjg5YTI1ZTkyYjQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjMzZDJjZDM0YWRhZDcwNGIyNmM5ZDUzOTc0OWE3ZmM1ZWUzMWRjMTYxNDA5
|
14
|
+
OTYxYTgwMzJlNmQ2MjY4MDcxOWZmNDgxZDYyMTk2NzM0ZmE4MTc0NDJlODhl
|
15
|
+
MTAxZGQ5NGZmOWU1NDNjMmVmNTEzN2M5NjBjZjUzMWYzZTUwZjY=
|
data/CHANGELOG.md
CHANGED
@@ -1,25 +1,33 @@
|
|
1
1
|
module Roger
|
2
2
|
class Release::Cleaner
|
3
3
|
def initialize(pattern)
|
4
|
-
@pattern = pattern
|
4
|
+
@pattern = [pattern].flatten
|
5
5
|
end
|
6
6
|
|
7
7
|
def call(release, options = {})
|
8
8
|
# We switch to the build path and append the globbed files for safety, so even if you manage to sneak in a
|
9
9
|
# pattern like "/**/*" it won't do you any good as it will be reappended to the path
|
10
10
|
Dir.chdir(release.build_path.to_s) do
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
release.log(self, "Cleaning up \"#{path}\" in build")
|
15
|
-
rm_rf(path)
|
16
|
-
else
|
17
|
-
release.log(self, "FAILED cleaning up \"#{path}\" in build")
|
11
|
+
@pattern.each do |pattern|
|
12
|
+
Dir.glob(pattern).each do |file|
|
13
|
+
self.clean_path(release, file)
|
18
14
|
end
|
19
15
|
end
|
20
16
|
end
|
21
17
|
end
|
22
18
|
|
19
|
+
def clean_path(release, file)
|
20
|
+
path = File.join(release.build_path.to_s, file)
|
21
|
+
if is_inside_build_path(release.build_path, path)
|
22
|
+
release.log(self, "Cleaning up \"#{path}\" in build")
|
23
|
+
rm_rf(path)
|
24
|
+
true
|
25
|
+
else
|
26
|
+
release.log(self, "FAILED cleaning up \"#{path}\" in build")
|
27
|
+
false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
23
31
|
protected
|
24
32
|
|
25
33
|
def is_inside_build_path(build_path, path)
|
data/roger.gemspec
CHANGED
@@ -8,6 +8,27 @@ class CleanerTest < Test::Unit::TestCase
|
|
8
8
|
@base = File.dirname(__FILE__) + "/../../project"
|
9
9
|
end
|
10
10
|
|
11
|
+
def test_use_array_as_pattern
|
12
|
+
dirs = ["dir1", "dir2"]
|
13
|
+
|
14
|
+
dirs.each do |dir|
|
15
|
+
path = @base + "/" +dir
|
16
|
+
mkdir path unless File.directory?(path)
|
17
|
+
assert(File.directory?(path))
|
18
|
+
end
|
19
|
+
|
20
|
+
project = Roger::Project.new(@base)
|
21
|
+
release = Roger::Release.new(project, :build_path => Pathname.new(@base))
|
22
|
+
|
23
|
+
cleaner = Roger::Release::Cleaner.new(dirs)
|
24
|
+
cleaner.call(release)
|
25
|
+
|
26
|
+
dirs.each do |dir|
|
27
|
+
path = @base + "/" + dir
|
28
|
+
assert(!File.directory?(path))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
11
32
|
def test_only_clean_inside_build_path_relative
|
12
33
|
|
13
34
|
cleaner = Roger::Release::Cleaner.new(@base)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Flurin Egger
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-08-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
228
|
version: '0'
|
229
229
|
requirements: []
|
230
230
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.
|
231
|
+
rubygems_version: 2.2.2
|
232
232
|
signing_key:
|
233
233
|
specification_version: 4
|
234
234
|
summary: Roger is a set of tools to create self-containing HTML mockups.
|