app/models/theme.rb in knitkit-2.0.5 vs app/models/theme.rb in knitkit-2.0.6

- old
+ new

@@ -124,11 +124,11 @@ self.version = about['version'] if about['version'] self.homepage = about['homepage'] if about['homepage'] self.summary = about['summary'] if about['summary'] else name = entry.name.sub(/__MACOSX\//, '') - name = Theme.strip_path(entry.name, theme_root) + name = Theme.strip_path(name, theme_root) data = '' entry.get_input_stream { |io| data = io.read } data = StringIO.new(data) if data.present? theme_file = self.files.where("name = ? and directory = ?", File.basename(name), File.join(self.url,File.dirname(name))).first unless theme_file.nil? @@ -151,13 +151,13 @@ files.each {|file| contents = file_support.get_contents(File.join(file_support.root,file.directory,file.name)) relative_path = file.directory.sub("#{url}",'') path = FileUtils.mkdir_p(File.join(tmp_dir,relative_path)) full_path = File.join(path,file.name) - File.open(full_path, 'w+:ASCII-8BIT') {|f| f.puts(contents) } + File.open(full_path, 'wb+') {|f| f.puts(contents) } zip.add(File.join(relative_path[1..relative_path.length],file.name), full_path) if ::File.exists?(full_path) } - ::File.open(tmp_dir + 'about.yml', 'w') { |f| f.puts(about.to_yaml) } + ::File.open(tmp_dir + 'about.yml', 'wb+') { |f| f.puts(about.to_yaml) } zip.add('about.yml', tmp_dir + 'about.yml') end end end