slicecraft 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/slicecraft.rb CHANGED
@@ -82,10 +82,11 @@ module Slicecraft
82
82
  else
83
83
  FileUtils.mkdir('zip') unless File.exists?('zip')
84
84
  end
85
- Zip::ZipFile.open(File.join(zip_path, 'source.zip'), Zip::ZipFile::CREATE) do |zipfile|
85
+ Zip::ZipFile.open(zip_file, Zip::ZipFile::CREATE) do |zipfile|
86
86
  add_folder_to_zipfile(zipfile, 'source')
87
87
  add_folder_to_zipfile(zipfile, 'build')
88
88
  end
89
+ FileUtils.chmod(0644, zip_file)
89
90
  end
90
91
 
91
92
  def add_folder_to_zipfile(zipfile, folder)
@@ -98,6 +99,10 @@ module Slicecraft
98
99
  "#{@path}/zip/"
99
100
  end
100
101
 
102
+ def zip_file
103
+ File.join(zip_path, 'source.zip')
104
+ end
105
+
101
106
  def result_url
102
107
  super + '/source.zip'
103
108
  end
@@ -132,6 +132,7 @@ describe Slicecraft::Delivery do
132
132
  it "should create zip folder and file" do
133
133
  Zip::ZipFile.should_receive('open')
134
134
  FileUtils.should_receive('mkdir').with('zip')
135
+ FileUtils.should_receive('chmod').with(0644, '/slice_this/zip/source.zip')
135
136
 
136
137
  delivery.zip
137
138
  end
@@ -146,6 +147,7 @@ describe Slicecraft::Delivery do
146
147
  it "should delete the zip folder and file when a zip file exists" do
147
148
  Zip::ZipFile.should_receive('open')
148
149
  File.should_receive('delete').with('zip/source.zip')
150
+ FileUtils.should_receive('chmod').with(0644, '/slice_this/zip/source.zip')
149
151
 
150
152
  delivery.zip
151
153
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slicecraft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
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-10-25 00:00:00.000000000 Z
12
+ date: 2012-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: commander