Sha256: 25c1e2a3cbf9b9bfbd005c566890fa67f7d0259e70b3802bd1234dd76d72ba66
Contents?: true
Size: 933 Bytes
Versions: 25
Compression:
Stored size: 933 Bytes
Contents
# frozen_string_literal: true module RubyCritic module Command module Utils class BuildNumberFile attr_reader :file, :build_number def initialize open_build_number_file end # keep track of the number of builds and # use this build number to create separate directory for each build def update_build_number @build_number = file.read.to_i + 1 write_build_number build_number end def write_build_number file.rewind file.write(build_number) file.close end def open_build_number_file root = Config.root FileUtils.mkdir_p(root) unless File.directory?(root) location = "#{root}/build_number.txt" File.new(location, 'a') unless File.exist?(location) @file = File.open(location, 'r+') end end end end end
Version data entries
25 entries across 25 versions & 2 rubygems