File: write.rb

package info (click to toggle)
ruby-tins 1.32.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,248 kB
  • sloc: ruby: 6,659; makefile: 3
file content (19 lines) | stat: -rw-r--r-- 460 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'tins/secure_write'

module Tins
  module Write
    def self.extended(modul)
      modul.extend SecureWrite
      if modul.respond_to?(:write)
        $DEBUG and warn "Skipping inclusion of Tins::Write#write method, include Tins::Write::SecureWrite#secure_write instead"
      else
        class << modul; self; end.instance_eval do
          alias_method :write, :secure_write
        end
      end
      super
    end
  end
end

require 'tins/alias'