tasks/github-gem.rake in request-log-analyzer-1.11.0 vs tasks/github-gem.rake in request-log-analyzer-1.11.1
- old
+ new
@@ -11,21 +11,23 @@
FileList['*.gemspec'].first
end
# Detects the main include file of this project using heuristics
def self.detect_main_include
- if detect_gemspec_file =~ /^(\.*)\.gemspec$/ && File.exist?("lib/#{$1}.rb")
- "lib/#{$1}.rb"
+ if File.exist?(File.expand_path("../lib/#{File.basename(detect_gemspec_file, '.gemspec').gsub(/-/, '/')}.rb", detect_gemspec_file))
+ "lib/#{File.basename(detect_gemspec_file, '.gemspec').gsub(/-/, '/')}.rb"
elsif FileList['lib/*.rb'].length == 1
FileList['lib/*.rb'].first
else
nil
end
end
class RakeTasks
+ include Rake::DSL if Rake.const_defined?('DSL')
+
attr_reader :gemspec, :modified_files
attr_accessor :gemspec_file, :task_namespace, :main_include, :root_dir, :spec_pattern, :test_pattern, :remote, :remote_branch, :local_branch
# Initializes the settings, yields itself for configuration
# and defines the rake tasks based on the gemspec file.
@@ -340,11 +342,11 @@
# Updates the tasks file using the latest file found on Github
def update_tasks_task
require 'net/https'
require 'uri'
- uri = URI.parse('https://github.com/wvanbergen/github-gem/raw/master/tasks/github-gem.rake')
+ uri = URI.parse('https://raw.github.com/wvanbergen/github-gem/master/tasks/github-gem.rake')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
response = http.request(Net::HTTP::Get.new(uri.path))
@@ -360,6 +362,6 @@
else
raise "Download failed with HTTP status #{response.code}!"
end
end
end
-end
+end
\ No newline at end of file