Issue #175 #176

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@ploubser

version 0.4.0 seems broken with ruby 1.8

  • Changed mktmpdir parameters to make the correct directories on 1.8
  • Fixed (badly) Find.find to work with 1.8
  • Changed File.write to File.open to work with 1.8
@ploubser ploubser Issue #175
version 0.4.0 seems broken with ruby 1.8
- Changed mktmpdir parameters to make the correct directories on 1.8
- Fixed (badly) Find.find to work with 1.8
- Changed File.write to File.open to work with 1.8
61b9183
@jordansissel
Owner

Did you mean to make all those whitespace changes? (Don't worry about reverting, just verifying)

@jordansissel jordansissel commented on the diff Mar 19, 2012
lib/fpm/package.rb
@@ -268,11 +268,16 @@ def files
# Find will print the path you're searching first, so skip it and return
# the rest. Also trim the leading path such that '#{staging_path}/' is removed
# from the path before returning.
- return Find.find(staging_path) \
- .select { |path| path != staging_path } \
- .collect { |path| path[staging_path.length + 1.. -1] }
+ files = []
@jordansissel
jordansissel Mar 19, 2012 owner

blah, I hate ruby stdlib sometimes :(

@jordansissel jordansissel commented on the diff Mar 19, 2012
lib/fpm/package.rb
@@ -268,11 +268,16 @@ def files
# Find will print the path you're searching first, so skip it and return
# the rest. Also trim the leading path such that '#{staging_path}/' is removed
# from the path before returning.
- return Find.find(staging_path) \
- .select { |path| path != staging_path } \
- .collect { |path| path[staging_path.length + 1.. -1] }
+ files = []
+
+ Find.find(staging_path) do |x|
+ files << x
+ end
+
+ files.select { |path| path != staging_path } \
@jordansissel
jordansissel Mar 19, 2012 owner

fwiw, I don't like implicit return :)

Don't worry about fixing this, I'll fix it when I merge.

@jordansissel jordansissel commented on the diff Mar 19, 2012
lib/fpm/package/deb.rb
@@ -190,7 +190,7 @@ def output(output_path)
raise FileAlreadyExists.new(output_path) if File.exists?(output_path)
# create 'debian-binary' file, required to make a valid debian package
- File.write(build_path("debian-binary"), "2.0\n")
+ File.open(build_path("debian-binary"), "w") {|f| f.puts "2.0\n"}
@jordansissel
jordansissel Mar 19, 2012 owner

LGTM.

This should be fixed anyway in the next release of ruby backports, but this patch is great until then :)

@jordansissel
jordansissel Mar 19, 2012 owner

Actually, there's a bunch of whitespace inconsistencies here. I'll hand merge some of this and also provide a monkeypatch for File.write until a backports release supports it.

@ploubser
ploubser Mar 19, 2012

Sorry about the white spaces, was in a hurry and I didn't notice them.

@jordansissel
jordansissel Mar 19, 2012 owner

No worries :)

@jordansissel
Owner

Ok - finished reading the patch. I'll take the mktmpdir and find fixes (woo!) but I'll fix the File.write problems with monkeypatching since ruby backports is due for a release soon and it has this fixed.

Will merge this by hand. Thanks for your work! :)

@jordansissel
Owner

fpm 0.4.1 released, all specs passing on ruby 1.8.7.

@indrat indrat pushed a commit to indrat/fpm that referenced this pull request Mar 21, 2012
@jordansissel - Add monkeypatches for File.write under Ruby 1.8.7 (will remove
  monkeypatches once the next version of the 'backports' gem  is
  released)
  Fixes #175, fixes #176.
269a61d
@indrat indrat pushed a commit to indrat/fpm that referenced this pull request Mar 21, 2012
@jordansissel - Fix Dir.mktmpdir invocations to work in both ruby 1.8 and 1.9
  (Fixes #175, fixes #176)
1f1f795
@indrat indrat pushed a commit to indrat/fpm that referenced this pull request Mar 21, 2012
@jordansissel Patch in File::write until the next backports gem is released (fixes #…
…175, fixes #176)
f5d30d8
@prof-milki prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014
jls Fix Find.find() calls for 1.8.7 (fixes #175, fixes #176) 697130e
@prof-milki prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014
jls - Add monkeypatches for File.write under Ruby 1.8.7 (will remove
  monkeypatches once the next version of the 'backports' gem  is
  released)
  Fixes #175, fixes #176.
f7f7b57
@prof-milki prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014
jls - Fix Dir.mktmpdir invocations to work in both ruby 1.8 and 1.9
  (Fixes #175, fixes #176)
a86a430
@prof-milki prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014
jls Patch in File::write until the next backports gem is released (fixes #…
…175, fixes #176)
852503d
@prof-milki prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014
@jordansissel Fix Find.find() calls for 1.8.7 (fixes #175, fixes #176) b3f223c
@prof-milki prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014
@jordansissel - Add monkeypatches for File.write under Ruby 1.8.7 (will remove
  monkeypatches once the next version of the 'backports' gem  is
  released)
  Fixes #175, fixes #176.
b27c5ca
@prof-milki prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014
@jordansissel - Fix Dir.mktmpdir invocations to work in both ruby 1.8 and 1.9
  (Fixes #175, fixes #176)
b161da5
@prof-milki prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014
@jordansissel Patch in File::write until the next backports gem is released (fixes #…
…175, fixes #176)
f21a2be
@jordansissel jordansissel added a commit that referenced this pull request Apr 24, 2015
@jordansissel - Add monkeypatches for File.write under Ruby 1.8.7 (will remove
  monkeypatches once the next version of the 'backports' gem  is
  released)
  Fixes #175, fixes #176.
9725be9
@jordansissel jordansissel added a commit that referenced this pull request Jun 20, 2016
@jordansissel - Add monkeypatches for File.write under Ruby 1.8.7 (will remove
  monkeypatches once the next version of the 'backports' gem  is
  released)
  Fixes #175, fixes #176.
47bce16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment