rubyment 0.4.25421155 → 0.4.25421159

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rubyment.rb +3 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 223806d4e749c22e87f11f4d8ae60bc9fceb30fb
4
- data.tar.gz: 001a571bbec4ff8541f1df6900991b5fbcc7614e
3
+ metadata.gz: 8db412f7ffa002c3c790bf5fe2d00e97d4301166
4
+ data.tar.gz: 9d5ea274e0dd6cc852b5f628a6bc994f9d901719
5
5
  SHA512:
6
- metadata.gz: 0057e911dc8939e732294246c15279618c2e116ca85537d332f4a4fb7030ee0118eb6553eb30577d4fca7559f2033717c91a03d2f9dbb583653d0304fb8d425c
7
- data.tar.gz: 5bb729c19882a52e50e20fcdbff9f930416c767f1328c4775699c3a431fef83db3996dc968653a543ee359a76eb4b62f5c10127b15ae8f0528326077118bafc3
6
+ metadata.gz: f7cc5f28c22e5c8326bfe514e7c2b16593a266a309a609c1500cc133daf3797ca4eaa8e918f2ee0f06032b1c08c071627f861a053932df98aa759ca3c29bfd00
7
+ data.tar.gz: a553496ab70250016db9989637e2be513374b0ccb8095c0ed47826e3152ae61922e987c6a4a19ba3a84a500e60056ee1770b2aeaf7c02ef4eb16a50a9f831f67
data/lib/rubyment.rb CHANGED
@@ -120,6 +120,7 @@ class Rubyment
120
120
  # file can be a url, if 'open-uri' is available.
121
121
  def file_backup file = __FILE__ , dir = '/tmp/', append = ('-' + Time.now.hash.abs.to_s), prepend='/'
122
122
  stderr = @memory[:stderr]
123
+ debug = @memory[:debug]
123
124
  (require 'open-uri') && open_uri = true
124
125
  require 'fileutils'
125
126
  file_is_filename = true
@@ -128,9 +129,9 @@ class Rubyment
128
129
  ) || (
129
130
  contents = File.read file rescue (file_is_filename = false) || file
130
131
  )
131
- stderr.puts "location = dir:#{dir} + prepend:#{prepend} + (#{file_is_filename} && #{file} || '' ) + #{append}"
132
+ debug && (stderr.puts "location = dir:#{dir} + prepend:#{prepend} + (#{file_is_filename} && #{file} || '' ) + #{append}")
132
133
  location = dir + prepend + (file_is_filename && file || '' ) + append
133
- stderr.puts "FileUtils.mkdir_p File.dirname #{location}" # note "~" doesn't work
134
+ debug && (stderr.puts "FileUtils.mkdir_p File.dirname #{location}")
134
135
  FileUtils.mkdir_p File.dirname location # note "~" doesn't work
135
136
  File.write location, contents
136
137
  contents
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.25421155
4
+ version: 0.4.25421159
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribamar Santarosa