From 59abeb482a91541248a285ff2e68c88896275493 Mon Sep 17 00:00:00 2001 From: Shubham Kumar Date: Sun, 10 Mar 2024 21:59:22 +0100 Subject: [PATCH] chore: refactor contributions.rb --- contributions.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contributions.rb b/contributions.rb index 1c834f1..7ba63e9 100644 --- a/contributions.rb +++ b/contributions.rb @@ -23,8 +23,8 @@ def run private - def fetch_and_update_readme(project, url, readme_path, commit_message, git_username, git_email) - uri = URI(url) + def fetch_and_update_readme(project, gitlab_url, readme_path, commit_message, git_username, git_email) + uri = URI(gitlab_url) req = Net::HTTP::Get.new(uri) response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http| @@ -44,8 +44,8 @@ def fetch_and_update_readme(project, url, readme_path, commit_message, git_usern def update_readme_content(project, readme_path, merged_count) readme_content = File.read(readme_path) - start_marker = '' - end_marker = '' + start_marker = '' + end_marker = '' updated_readme_content = readme_content.gsub(/#{start_marker}.*#{end_marker}/m, "#{start_marker}\nPull requests merged in #{project}: #{merged_count}\n#{end_marker}") File.write(readme_path, updated_readme_content) end