bin/nilac in nilac-0.0.4.1.6 vs bin/nilac in nilac-0.0.4.1.7

- old
+ new

@@ -6,10 +6,11 @@ #Nila and Nilac are being crafted by Adhithya Rajasekaran and Sri Madhavi Rajasekaran require 'slop' require 'fileutils' + def compile(input_file_path,*output_file_name) def read_file_line_by_line(input_path) file_id = open(input_path) @@ -3132,11 +3133,11 @@ return remaining_string[0...remaining_string.length-path_finder] end -nilac_version = "0.0.4.1.6" +nilac_version = "0.0.4.1.7" opts = Slop.parse do on :c, :compile=, 'Compile Nila File', as:Array, delimiter:":" on :h, :help, 'Help With Nilac' do @@ -3170,22 +3171,64 @@ on :v, :version, 'Output Nilac Version No' do puts nilac_version end + on :r, :run=, 'Run Nila File', as:Array - on :m, :buildmac, 'Build Nilac for Linux/Mac/Rubygems' do + on :b, :build, 'Build Nilac for Linux/Mac/Rubygems' do file_path = Dir.pwd + "/src/nilac.rb" - puts file_path - create_mac_executable(file_path) FileUtils.mv("#{file_path[0...-3]}","#{Dir.pwd}/bin/nilac") puts "Build Successful!" + + end + + on :u, :update, 'Check if Nilac is up to date.' do + + outdated_gems = `gem outdated` + + outdated_gems = outdated_gems.split("\n") + + outdated = false + + old_version = "" + + new_version = "" + + outdated_gems.each do |gem_name| + + if gem_name.include?("nilac") + + outdated = true + + old_version = gem_name.split("(")[1].split(")")[0].split("<")[0].lstrip + + new_version = gem_name.split("(")[1].split(")")[0].split("<")[1].lstrip.rstrip + + break + + end + + end + + if outdated + + exec = `gem update nilac` + + puts "Your version of Nilac (#{old_version}) was outdated! We have automatically updated you to the latest version (#{new_version})." + + + else + + puts "Your version of Nilac is up to date!" + + end end end opts = opts.to_hash