Sha256: bc589cc90a0d1d9b89c4abcd3033e9b1d9786ff56aa7634314425a51e9570b8d

Contents?: true

Size: 1.39 KB

Versions: 38

Compression:

Stored size: 1.39 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

puts Dir.pwd

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

38 entries across 38 versions & 6 rubygems

Version Path
ufos-1.0.94 ./documentation/doc.rb
aliens-1.0.94 ./documentation/doc.rb
freespeech-1.0.94 ./documentation/doc.rb
elonmusk-1.0.94 ./documentation/doc.rb
politics-1.0.94 ./documentation/doc.rb
democracy-1.0.94 ./documentation/doc.rb
democracy-1.0.93 ./documentation/doc.rb
ufos-1.0.91 ./documentation/doc.rb
aliens-1.0.91 ./documentation/doc.rb
freespeech-1.0.91 ./documentation/doc.rb
elonmusk-1.0.91 ./documentation/doc.rb
politics-1.0.91 ./documentation/doc.rb
politics-1.0.89 ./documentation/doc.rb
ufos-1.0.87 ./documentation/doc.rb
aliens-1.0.87 ./documentation/doc.rb
freespeech-1.0.87 ./documentation/doc.rb
elonmusk-1.0.87 ./documentation/doc.rb
politics-1.0.87 ./documentation/doc.rb
ufos-1.0.88 ./documentation/doc.rb
aliens-1.0.88 ./documentation/doc.rb