Skip to content

Commit 0e3090c

Browse files
committed
Updated gem management tasks
1 parent ab55f10 commit 0e3090c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tasks/github-gem.rb

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def self.detect_gemspec_file
1313

1414
# Detects the main include file of this project using heuristics
1515
def self.detect_main_include
16-
if detect_gemspec_file =~ /^(\.*)\.gemspec$/ && File.exist?("lib/#{$1}.rb")
17-
"lib/#{$1}.rb"
16+
if File.exist?(File.expand_path("../lib/#{File.basename(detect_gemspec_file, '.gemspec').gsub(/-/, '/')}.rb", detect_gemspec_file))
17+
"lib/#{File.basename(detect_gemspec_file, '.gemspec').gsub(/-/, '/')}.rb"
1818
elsif FileList['lib/*.rb'].length == 1
1919
FileList['lib/*.rb'].first
2020
else
@@ -24,6 +24,8 @@ def self.detect_main_include
2424

2525
class RakeTasks
2626

27+
include Rake::DSL if Rake.const_defined?('DSL')
28+
2729
attr_reader :gemspec, :modified_files
2830
attr_accessor :gemspec_file, :task_namespace, :main_include, :root_dir, :spec_pattern, :test_pattern, :remote, :remote_branch, :local_branch
2931

@@ -342,7 +344,7 @@ def update_tasks_task
342344
require 'net/https'
343345
require 'uri'
344346

345-
uri = URI.parse('https://github.com/wvanbergen/github-gem/raw/master/tasks/github-gem.rake')
347+
uri = URI.parse('https://raw.github.com/wvanbergen/github-gem/master/tasks/github-gem.rake')
346348
http = Net::HTTP.new(uri.host, uri.port)
347349
http.use_ssl = true
348350
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

0 commit comments

Comments
 (0)