Sha256: aedca60f61b1443d6ec63e259f3f130da32d978e647221e1fd9a22561d967fbd

Contents?: true

Size: 726 Bytes

Versions: 2

Compression:

Stored size: 726 Bytes

Contents

require "feels/bad/man/version"

module Feels
  module Bad
    module Man
      def self.good_cocktail(directory)
        raise ArgumentError, "directory plz" if File.file?(directory)
        Dir.glob("#{File.expand_path(ARGV.first)}/**/*.rb").each do |file|
          fucked_up = []
          File.open(file).each_line.map do |line|
            fucked_up << line.sub(/\s*/) do |match|
              Array.new(5).map do
                case rand(2)
                when 0
                  "\t" * rand(2)
                when 1
                  " " * rand(3)
                end
              end.join
            end
          end

          File.open(file, "w").puts(fucked_up.join)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
feels-bad-man-0.1.1 lib/feels/bad/man.rb
feels-bad-man-0.1.0 lib/feels/bad/man.rb