Sha256: 1ee056d407017133592efae786b161ad24500dff61f993b4a50c5cfe91c89915

Contents?: true

Size: 1.38 KB

Versions: 8

Compression:

Stored size: 1.38 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

begin
  Dir.chdir '/home/a/democracy/bin'
rescue StandardError
  nil
end

def speak(a)
  puts a.green
  require 'shellwords'
  return unless false

  system "espeak #{a.shellescape}"
end

<<~EOF
  speak "Documenting"
EOF

Dir.glob('*') do |file|
  case file
  when /DOC|sh$/
    next
  when /YOUTUBE_|LINUX/
    next
  end
  next if File.exist?("../documentation/#{file}") || File.exist?("../documentation/#{file}.exe")

  program = file
  require 'FileUtils'.downcase
  include FileUtils

  mkdir_p '../documentation'
  cd '..'
  cd 'documentation'

  def get_line
    require 'readline'
    $line = ok_or_no = Readline.readline.strip
  end
  $file = file
  $n = 0

  require 'colored'

  include FileUtils
  # require "coloed
  loop do
    cd Dir.home
    cd 'democracy'
    cd 'bin'
    puts "Enter description of the practical utility of   `#{file}'"

    speak "#{file} tool"
    $doc = $stdin.read
    speak $doc
    speak 'Is this good?'

    FileUtils.mkdir_p '../documentation'
    FileUtils.cd '../documentation'

    def g
      $n += 1
      return unless get_line.match?(/y|Y/); # speak "On to the #{$n}th one"

      # speak "yes"
      File.open($file, 'a') do |f|
        puts pwd
        puts $file
        f.puts $doc
      end

      raise 'End'
    end

    begin
      g
    rescue Object
      break
    end

    # puts program
  end
end

Version data entries

8 entries across 8 versions & 4 rubygems

Version Path
elonmusk-1.0.72 ./documentation/doc.rb
ufos-1.0.72 ./documentation/doc.rb
aliens-1.0.72 ./documentation/doc.rb
freespeech-1.0.72 ./documentation/doc.rb
freespeech-1.0.71 ./documentation/doc.rb
elonmusk-1.0.71 ./documentation/doc.rb
ufos-1.0.71 ./documentation/doc.rb
aliens-1.0.71 ./documentation/doc.rb