Sha256: 6b1db8c5646475dc14c61398bdf94a1abef02a6e9056f45b4e7563286a38966e

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

#!/usr/bin/env ruby

# Copyright (C) 2016 Szymon Kopciewski
#
# This file is part of Mayaml.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
require "mayaml"

def puts_ussage_message
  puts <<-END_HELP
    Ussage: mayaml-check <path_to_yaml_file>
  END_HELP
end

def main(args)
  yaml_path = args.shift
  if yaml_path.nil?
    puts_ussage_message
    exit 1
  elsif File.exist? yaml_path
    Mayaml.accounts_from_file(yaml_path).each { |acc| puts acc.to_str }
  else
    puts "Could not find file: #{yaml_path}"
    exit 1
  end
end

main ARGV if __FILE__ == $PROGRAM_NAME

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mayaml-1.0.2 bin/mayaml-check
mayaml-1.0.1 bin/mayaml-check
mayaml-1.0.0 bin/mayaml-check