diff --git a/Rakefile b/Rakefile index 439a877..420c0ac 100644 --- a/Rakefile +++ b/Rakefile @@ -4,11 +4,11 @@ require 'rubygems/package_task' require 'rake/testtask' BASE_DIR = File.expand_path(File.dirname(__FILE__)) +GEMSPEC_PATH = File.join(BASE_DIR, 'putty-key.gemspec') +spec = TOPLEVEL_BINDING.eval(File.read(GEMSPEC_PATH), GEMSPEC_PATH) task :default => :test -spec = eval(File.read('putty-key.gemspec')) - # Attempt to find the private key and return a spec with added options for # signing the gem if found. def add_signing_key(spec) diff --git a/putty-key.gemspec b/putty-key.gemspec index d046a6e..eac9165 100644 --- a/putty-key.gemspec +++ b/putty-key.gemspec @@ -1,4 +1,4 @@ -require File.expand_path(File.join('..', 'lib', 'putty', 'key', 'version'), __FILE__) +require_relative 'lib/putty/key/version' Gem::Specification.new do |s| s.name = 'putty-key'