Repository URL to install this package:
|
Version:
1.7.3 ▾
|
# frozen_string_literal: true
require 'rake/tasklib'
require_relative 'helpers'
module Faculty
module Rake
# Functions for initializing a new app
module InitShared
private
def create_base_branch
puts bold 'Creating base branch to aid merging changes from the template in the future'
system 'git branch base'
system 'git push --quiet --set-upstream origin base'
end
def remove_from_rakefile
system "sed -i '/#{self.class.name}.new/d' Rakefile"
end
def rename_within_files(rename_list)
title_parts = []
substitutions = []
rename_list.each do |rename|
title_parts.push "#{rename[:from]} -> #{rename[:to]}"
substitutions.push "'s/#{rename[:from]}/#{rename[:to]}/g'"
end
puts bold "Rename #{title_parts.join ', '}"
system "find ./ -type d -name '.git' -prune -o -type f " \
"-exec sed -ri -e #{substitutions.join ' -e '} {} \\; -print"
end
end
end
end