You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
618 B
Ruby
32 lines
618 B
Ruby
#!/usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
#
|
|
# Copyright (c) 2018-2020 Andre Richter <andre.o.richter@gmail.com>
|
|
|
|
require 'fileutils'
|
|
|
|
WITH_EXTRA = '[X0-9]'
|
|
NO_EXTRA = '[0-9]'
|
|
|
|
def tutorial_folders(with_extra = true, testable = false)
|
|
crates = Dir['*/Cargo.toml']
|
|
|
|
crates.delete_if do |x|
|
|
s = with_extra ? WITH_EXTRA : NO_EXTRA
|
|
|
|
!/[#{s}][0-9]/.match?(x[0..1])
|
|
end
|
|
|
|
if testable
|
|
crates.delete_if do |x|
|
|
x[0..1].to_i < 13
|
|
end
|
|
end
|
|
|
|
crates.sort!
|
|
end
|
|
|
|
puts tutorial_folders if $PROGRAM_NAME == __FILE__
|