diff options
| author | KOBAYASHI Shuji <[email protected]> | 2020-11-20 16:58:08 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2020-11-20 16:58:08 +0900 |
| commit | 56a60fa7b70c92f6155c0798af2ef0b12dc36adb (patch) | |
| tree | 05df65170dbbb911b0aee08121f4bf783fff8faf /lib/mruby-core-ext.rb | |
| parent | 5dc9a8249fc92de089627cad17b5d5b7a5f0a505 (diff) | |
| download | mruby-56a60fa7b70c92f6155c0798af2ef0b12dc36adb.tar.gz mruby-56a60fa7b70c92f6155c0798af2ef0b12dc36adb.zip | |
Move `lib/mruby-core-ext.rb` to `lib/mruby/core_ext.rb` for consistency
Diffstat (limited to 'lib/mruby-core-ext.rb')
| -rw-r--r-- | lib/mruby-core-ext.rb | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/mruby-core-ext.rb b/lib/mruby-core-ext.rb deleted file mode 100644 index 433f1bb1a..000000000 --- a/lib/mruby-core-ext.rb +++ /dev/null @@ -1,29 +0,0 @@ -autoload :Pathname, 'pathname' - -class Object - class << self - def attr_block(*syms) - syms.flatten.each do |sym| - class_eval "def #{sym}(&block);block.call(@#{sym}) if block_given?;@#{sym};end" - end - end - end -end - -class String - def relative_path_from(dir) - Pathname.new(File.expand_path(self)).relative_path_from(Pathname.new(File.expand_path(dir))).to_s - end - - def relative_path - relative_path_from(Dir.pwd) - end -end - -def _pp(cmd, src, tgt=nil, options={}) - return if Rake.verbose - - width = 5 - template = options[:indent] ? "%#{width*options[:indent]}s %s %s" : "%-#{width}s %s %s" - puts template % [cmd, src, tgt ? "-> #{tgt}" : nil] -end |
