From f8e592d88f67c5ef9e45bc99d126ebbcb4c0a55f Mon Sep 17 00:00:00 2001 From: Sourav Goswami Date: Tue, 25 Aug 2020 11:55:41 +0530 Subject: [PATCH] convert.rb should support at least Ruby 2.4 and beyond convert.rb --- generator/convert.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/generator/convert.rb b/generator/convert.rb index 27d2823..380c6e9 100644 --- a/generator/convert.rb +++ b/generator/convert.rb @@ -2,6 +2,10 @@ # Frozen_String_Literal: true # Written by Sourav Goswami +## Check Ruby version +abort "Error! Atleast Ruby 2.4 is needed! You are running #{RUBY_VERSION} (#{RUBY_PLATFORM})" if RUBY_VERSION.split(?.).first(2).join.to_i < 24 + +# Location of the base cursors BASE = File.join(__dir__, 'oreo_base_cursors') # Configuration file to read @@ -20,6 +24,9 @@ INDEX_THEME = proc do |x| end ### Code ### +Kernel.class_exec { define_method(:then) { |&block| block === self } } +Dir.define_singleton_method(:children) { |arg| Dir.entries(arg).drop(2) } + puts "Error with the output directory. Does it exist? Is it writable?" unless File.writable?(OUT_DIR) colours = {}