bunpack 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 70a8ec457d444d58f01466e1f72d0de6a768caa8
4
+ data.tar.gz: 50e619202702c2106b00284dae7cc3995c54ab8f
5
+ SHA512:
6
+ metadata.gz: 454bda717784003a04889eeac83fc2add730230e8fd321a4bb54b9b2177d6ba1613a112209993f3b061bea274745e396c2003848bab72eca724618d0565e234b
7
+ data.tar.gz: 492b991aaf5322720b4aba5907c22195fb05c03f8c11291bc5ab100e791c3e6c01c1ff89b1dbd24f6af1cec894996593e40f26000ac88c016084fca267aca0fc
@@ -0,0 +1,3 @@
1
+ Gemfile.lock
2
+ tmp
3
+ pkg
@@ -0,0 +1 @@
1
+ language: ruby
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Blendle
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ bunpack
2
+ =======
3
+
4
+ Removes __MACOSX folder from zip archives
5
+
6
+ ## Dependencies
7
+ * atool
@@ -0,0 +1,7 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new
5
+
6
+ task default: :cucumber
7
+
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'tmpdir'
4
+ require 'pathname'
5
+
6
+ if ARGV.size != 1
7
+ STDERR.puts "Usage: #{File.basename $0} ARCHIVE"
8
+ exit 64
9
+ end
10
+
11
+ ORIG_ARCHIVE = ARGV.join ' '
12
+ TMP_DIR = Pathname Dir.mktmpdir
13
+
14
+ begin
15
+ archive = TMP_DIR + File.basename(ORIG_ARCHIVE)
16
+ FileUtils.cp ORIG_ARCHIVE, archive
17
+
18
+ if archive.extname == '.zip' && `unzip -l #{archive}` =~ /__MACOSX/
19
+ system "zip --delete '#{archive}' '__MACOSX/*'"
20
+ end
21
+
22
+ system "aunpack '#{archive}'"
23
+ ensure
24
+ FileUtils.rm_rf TMP_DIR
25
+ end
26
+
@@ -0,0 +1,19 @@
1
+ # coding: utf-8
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = 'bunpack'
5
+ spec.version = '1.0.0'
6
+ spec.licenses = ['MIT']
7
+ spec.authors = ["Pepijn Looije"]
8
+ spec.email = ["pepijn@blendle.nl"]
9
+ spec.homepage = "http://blendle.nl"
10
+ spec.summary = %q{The best way to manage your application's dependencies}
11
+ spec.description = %q{Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably}
12
+
13
+ spec.add_development_dependency 'aruba', '>= 0.5.0'
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.test_files = spec.files.grep(%r{^features/})
17
+
18
+ spec.executables = %w(bunpack)
19
+ end
@@ -0,0 +1,29 @@
1
+ @announce
2
+ Feature: Extraction
3
+ Scenario: Extracting a zip archive with __MACOSX directory
4
+ Given the following base64 encoded zip archive:
5
+ """
6
+ UEsDBAoAAAAAAAaRlkQAAAAAAAAAAAAAAAAJABwAX19NQUNPU1gvVVQJAAPsk1ZT8pNWU3V4CwABBPUBAAAEFAAAAFBLAwQKAAAAAACOkJZEAAAAAAAAAAAAAAAACAAcAGFyY2hpdmUvVVQJAAMLk1ZT8pNWU3V4CwABBPUBAAAEFAAAAFBLAwQKAAAAAACOkJZEAAAAAAAAAAAAAAAAEwAcAGFyY2hpdmUvaGVsbG9fd29ybGRVVAkAAwuTVlNgk1ZTdXgLAAEE9QEAAAQUAAAAUEsBAh4DCgAAAAAABpGWRAAAAAAAAAAAAAAAAAkAGAAAAAAAAAAQAP1BAAAAAF9fTUFDT1NYL1VUBQAD7JNWU3V4CwABBPUBAAAEFAAAAFBLAQIeAwoAAAAAAI6QlkQAAAAAAAAAAAAAAAAIABgAAAAAAAAAEADtQUMAAABhcmNoaXZlL1VUBQADC5NWU3V4CwABBPUBAAAEFAAAAFBLAQIeAwoAAAAAAI6QlkQAAAAAAAAAAAAAAAATABgAAAAAAAAAAACkgYUAAABhcmNoaXZlL2hlbGxvX3dvcmxkVVQFAAMLk1ZTdXgLAAEE9QEAAAQUAAAAUEsFBgAAAAADAAMA9gAAANIAAAAAAA==
7
+ """
8
+ When I successfully run `bunpack archive.zip`
9
+ Then the file "archive/__MACOSX" should not exist
10
+ And a file named "archive/hello_world" should exist
11
+
12
+ Scenario: Extracting a tar archive without __MACOSX directory
13
+ Given the following base64 encoded tgz archive:
14
+ """
15
+ H4sIACO4VlMAA+3RTQ6CMBCGYY7SGzi0HTyOIQoB0wipf9e3AXSlJiawIL7P5ttM2mm/Mu6b9lZtsgWJyFbVDFmMKdaPOTG5dVbVebFqJHe5k8zokks9Xc+XMqZV+qpvj6fPc2msrr+cM73jlStRTv03VQjd7t7FcJj9jvQfhfe/9K9OXWZk9k3e+PP+AQAAAAAAAAAAAAAAAKzXAxSLKCkAKAAA
16
+ """
17
+ When I successfully run `bunpack archive.tgz`
18
+ Then the file "archive/__MACOSX" should not exist
19
+ And a file named "archive/hello_world" should exist
20
+
21
+ Scenario: Extracting a zip archive without __MACOSX directory
22
+ Given the following base64 encoded zip archive:
23
+ """
24
+ UEsDBAoAAAAAANGRlkQAAAAAAAAAAAAAAAAIABwAYXJjaGl2ZS9VVAkAA2qVVlNvlVZTdXgLAAEE9QEAAAQUAAAAUEsDBAoAAAAAAI6QlkQAAAAAAAAAAAAAAAATABwAYXJjaGl2ZS9oZWxsb193b3JsZFVUCQADC5NWU+qUVlN1eAsAAQT1AQAABBQAAABQSwECHgMKAAAAAADRkZZEAAAAAAAAAAAAAAAACAAYAAAAAAAAABAA7UEAAAAAYXJjaGl2ZS9VVAUAA2qVVlN1eAsAAQT1AQAABBQAAABQSwECHgMKAAAAAACOkJZEAAAAAAAAAAAAAAAAEwAYAAAAAAAAAAAApIFCAAAAYXJjaGl2ZS9oZWxsb193b3JsZFVUBQADC5NWU3V4CwABBPUBAAAEFAAAAFBLBQYAAAAAAgACAKcAAACPAAAAAAA=
25
+ """
26
+ When I successfully run `bunpack archive.zip`
27
+ Then the file "archive/__MACOSX" should not exist
28
+ And a file named "archive/hello_world" should exist
29
+
@@ -0,0 +1,8 @@
1
+ require 'base64'
2
+
3
+ Given /^the following base64 encoded (.*) archive:$/ do |extension, data|
4
+ File.open "tmp/aruba/archive.#{extension}", 'w' do |file|
5
+ file.write Base64.decode64 data
6
+ end
7
+ end
8
+
@@ -0,0 +1 @@
1
+ require 'aruba/cucumber'
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bunpack
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Pepijn Looije
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aruba
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.5.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.5.0
27
+ description: Bundler manages an application's dependencies through its entire life,
28
+ across many machines, systematically and repeatably
29
+ email:
30
+ - pepijn@blendle.nl
31
+ executables:
32
+ - bunpack
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - .gitignore
37
+ - .travis.yml
38
+ - Gemfile
39
+ - LICENSE
40
+ - README.md
41
+ - Rakefile
42
+ - bin/bunpack
43
+ - bunpack.gemspec
44
+ - features/extraction.feature
45
+ - features/step_definitions/application_steps.rb
46
+ - features/support/env.rb
47
+ homepage: http://blendle.nl
48
+ licenses:
49
+ - MIT
50
+ metadata: {}
51
+ post_install_message:
52
+ rdoc_options: []
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ requirements: []
66
+ rubyforge_project:
67
+ rubygems_version: 2.2.2
68
+ signing_key:
69
+ specification_version: 4
70
+ summary: The best way to manage your application's dependencies
71
+ test_files:
72
+ - features/extraction.feature
73
+ - features/step_definitions/application_steps.rb
74
+ - features/support/env.rb