Sha256: e8b8ce7f87cda7ced21f2eae4fd4339a6c10a584ef4f4a63fea1b475e6b89433

Contents?: true

Size: 358 Bytes

Versions: 23

Compression:

Stored size: 358 Bytes

Contents

module SugarHigh
  module FileMutate
    module AppendContent
      def append content=nil, &block
        File.append self.path, content, &block
      end

      module ClassMethods
        def append path, content=nil, &block
          File.open(path, 'a') do |f|
            f.puts content ||= yield
          end
        end 
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
sugar-high-0.5.5 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.5.4 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.5.3 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.5.1 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.5.0 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.9.5 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.9.3 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.9.2 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.9.1 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.9 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.8 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.7 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.6.4 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.6.3 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.6.2 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.6.1 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.6 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.5.2 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.5 lib/sugar-high/file_mutate/append_content.rb
sugar-high-0.4.4.2 lib/sugar-high/file_mutate/append_content.rb