lib/gemplate/gem.rb in gemplate-2.0.4 vs lib/gemplate/gem.rb in gemplate-2.0.5

- old
+ new

@@ -1,17 +1,18 @@ +# frozen_string_literal: true require 'rugged' require 'pathname' require 'fileutils' require 'curb' require 'octoauth' require 'octokit' ## # Bootstrap tool for new gems module Gemplate - TEMPLATE = "#{Pathname.new(__FILE__).parent.parent.parent}/template" - LICENSE_URL = 'https://raw.githubusercontent.com/akerl/licenses/master' + TEMPLATE = "#{Pathname.new(__FILE__).parent.parent.parent}/template".freeze + LICENSE_URL = 'https://raw.githubusercontent.com/akerl/licenses/master'.freeze ## # Gem directory object class Gem def initialize(params = {}) @@ -36,11 +37,11 @@ end private def create_directory - fail "#{@name} already exists" if File.exist? @name + raise "#{@name} already exists" if File.exist? @name FileUtils.cp_r TEMPLATE, @name end def dependencies source = "#{TEMPLATE}/../gemplate.gemspec" @@ -51,10 +52,10 @@ def add_license url = "#{LICENSE_URL}/#{@license}.txt" File.open('LICENSE', 'w') do |fh| license = Curl::Easy.perform(url) if license.response_code == 404 - fail ArgumentError, 'Invalid license name provided' + raise ArgumentError, 'Invalid license name provided' end fh.write license.body_str end end