Sha256: 3395df489f4f7d1df37165b5b1c75bed31018645c1f4cafa994d355e8473eb37

Contents?: true

Size: 827 Bytes

Versions: 10

Compression:

Stored size: 827 Bytes

Contents

puts_debug "read " + __FILE__.foreground(:green)

#def exec_in_dir(cmd,dir)
#  Dir.chdir(dir) { |path| 
#    call=Dev::SystemCall.new(cmd)
#    call.puts_summary
#  }
#end

module Dev

class Environment
   def self.replace_text_in_file(filename,search,replace)
     text1 = File.read(filename)
     text2 = text1.gsub(search) { |str| str=replace }
     File.open(filename,"w") { |f| f.puts text2 } unless text1==text2
   end
   
   def self.dev_root
     dir="~"
     dir=ENV["HOME"] unless ENV["HOME"].nil?
     dir=ENV["USERPROFILE"].gsub('\\','/') unless ENV["USERPROFILE"].nil?
     dir=ENV["DEV_ROOT"].gsub('\\','/') unless ENV["DEV_ROOT"].nil?
     
     return dir
   end
   
   def self.expand_string_variables(str)
     eval("\"#{str.gsub('"','\"')}\"")
   end
end

end # module Dev

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dev-1.0.9 lib/dev/Environment.rb
dev-1.0.8 lib/dev/Environment.rb
dev-1.0.7 lib/dev/Environment.rb
dev-1.0.6 lib/dev/Environment.rb
dev-1.0.5 lib/dev/Environment.rb
dev-1.0.4 lib/dev/Environment.rb
dev-1.0.3 lib/dev/Environment.rb
dev-1.0.2 lib/dev/Environment.rb
dev-1.0.1 lib/dev/Environment.rb
dev-1.0.0 lib/dev/Environment.rb