<commit_before>require_relative 'day'

class Month

	attr_reader :month, :year

	MONTHS_ARRAY = [nil, "January", "February",
						  "March", "April", "May", "June",
						  "July", "August", "September",
						  "October", "November", "December"]

	DAYS_IN_MONTH_ARRAY = [nil, 31, 28, 31,
									 30, 31, 30, 31,
									 31, 30, 31, 30,
									 31]

	def length

		DAYS_IN_MONTH_ARRAY[@month]

	end

	def leap_year
		if @year % 4 == 0 or @year % 400 == 0
			regular_leap_year = true
		else
			regular_leap_year = false
		end


		if @year % 100 == 0 and @year % 400 != 0
			century_leap_year = true
		else
			century_leap_year = false
		end

		if regular_leap_year == true and century_leap_year == false
			true
		else
			false
		end

	end

	def initialize(month, year)
		@month = month.to_i
		@year = year.to_i
	end

	def name
		MONTHS_ARRAY[@month]
	end

	def to_s

		header = "#{name} #{@year}".center(20).rstrip
		sub_head = "Su Mo Tu We Th Fr Sa"
		body = String.new

		(1..length).each do |i|
			body << i.to_s.center(3)
		end

		first_day_of_month = Day.new(@month, @year).month_start
		body.prepend(" ".center(3) * first_day_of_month)

<commit_msg>small reafactor in leap_year method.<commit_after>require_relative 'day'

class Month

	attr_reader :month, :year

	MONTHS_ARRAY = [nil, "January", "February",
						  "March", "April", "May", "June",
						  "July", "August", "September",
						  "October", "November", "December"]

	DAYS_IN_MONTH_ARRAY = [nil, 31, 28, 31,
									 30, 31, 30, 31,
									 31, 30, 31, 30,
									 31]

	def length

		DAYS_IN_MONTH_ARRAY[@month]

	end

	def leap_year

		if @year % 4 == 0 or @year % 400 == 0
			regular_leap_year = true
		else
			regular_leap_year = false
		end


		if @year % 100 == 0 and @year % 400 != 0
			century_leap_year = true
		else
			century_leap_year = false
		end

		regular_leap_year and !century_leap_year

	end

	def initialize(month, year)
		@month = month.to_i
		@year = year.to_i
	end

	def name
		MONTHS_ARRAY[@month]
	end

	def to_s

		header = "#{name} #{@year}".center(20).rstrip
		sub_head = "Su Mo Tu We Th Fr Sa"
		body = String.new

		(1..length).each do |i|
			body << i.to_s.center(3)
		end

		first_day_of_month = Day.new(@month, @year).month_start
		body.prepend(" ".center(3) * first_day_of_month)


{'fraction_non_alphanumeric': 0.12962157459765114, 'fraction_numerical': 0.037407568508046975, 'mean_word_length': 2.872053872053872, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3543171', 'n_tokens_mistral': 1160, 'n_tokens_neox': 871, 'n_words': 235}