Sha256: fe56967b46bd7a0ffda4090033eb40012e6073f9462575b3a7c8b2bfc2ccf3d4

Contents?: true

Size: 636 Bytes

Versions: 19

Compression:

Stored size: 636 Bytes

Contents

class Numeric

  def megabytes
    self * 1024 * 1024
  end
  alias_method :megabyte, :megabytes

  def in_megabytes
    self.to_f / 1.megabyte
  end

end

class Object

  def blank?
    false
  end

end

class NilClass 

  def blank?
    true
  end

end

class Array 

  alias_method :blank?, :empty?

end

class String

  alias_method :blank?, :empty?

end

module FileUtils

  def sh(*cmd)
    options = Hash === cmd.last ? cmd.pop : {}
    puts "* #{cmd.join(' ')}"
    raise "Command failed: #{$?}" unless system(cmd.join(' '))
  end
  module_function :sh

  def sudo(*cmd)
    sh ["sudo", *cmd]
  end
  module_function :sudo

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
system-builder-0.0.23 lib/system_builder/core_ext.rb
system-builder-0.0.22 lib/system_builder/core_ext.rb
system-builder-0.0.21 lib/system_builder/core_ext.rb
system-builder-0.0.20 lib/system_builder/core_ext.rb
system-builder-0.0.19 lib/system_builder/core_ext.rb
system-builder-0.0.18 lib/system_builder/core_ext.rb
system-builder-0.0.17 lib/system_builder/core_ext.rb
system-builder-0.0.16 lib/system_builder/core_ext.rb
system-builder-0.0.15 lib/system_builder/core_ext.rb
system-builder-0.0.14 lib/system_builder/core_ext.rb
system-builder-0.0.13 lib/system_builder/core_ext.rb
system-builder-0.0.12 lib/system_builder/core_ext.rb
system-builder-0.0.10 lib/system_builder/core_ext.rb
system-builder-0.0.9 lib/system_builder/core_ext.rb
system-builder-0.0.7 lib/system_builder/core_ext.rb
system-builder-0.0.6 lib/system_builder/core_ext.rb
system-builder-0.0.5 lib/system_builder/core_ext.rb
system-builder-0.0.4 lib/system_builder/core_ext.rb
system-builder-0.0.3 lib/system_builder/core_ext.rb