Sha256: 6c03bf0a8ec079ffe998739dc9016266486bc545703a7200b52f62e614667e67
Contents?: true
Size: 508 Bytes
Versions: 15
Compression:
Stored size: 508 Bytes
Contents
require 'tempfile' class Object def own_methods methods - self.class.methods end IRT::EDITORS.each_pair do |name, short| # with IDEs we cannot come back after editing next if name == :edit define_method(name) do t = Tempfile.new(['', '.yml']) t << to_yaml t.flush IRT.edit_with(name, t.path) return self unless File.exists?( t.path ) obj = YAML::load_file t.path t.close obj end alias_method short, name if short end end
Version data entries
15 entries across 15 versions & 1 rubygems