tasks/this.rb in launchy-2.2.0-java vs tasks/this.rb in launchy-2.3.0
- old
+ new
@@ -23,11 +23,11 @@
# Public: Initialize ThisProject
#
# Yields self
def initialize(&block)
- @exclude_from_manifest = %r/tmp$|\.(git|DS_Store)|^(doc|coverage|pkg)|Gemfile*|\.gemspec$|\.swp$|\.jar|\.rvmrc$|~$/
+ @exclude_from_manifest = %r/\.(git|DS_Store)|^(doc|coverage|pkg|tmp)|Gemfile*|\.(gemspec|swp|jar|bundle|so|rvmrc)$|~$/
@gemspecs = Hash.new
yield self if block_given?
end
# Public: return the version of ThisProject
@@ -52,11 +52,11 @@
# path - the relative path in the project of the file to parse
# section_name - the section out of the file from which to parse data
#
# Retuns the text of the section as an array of paragrphs.
def section_of( file, section_name )
- re = /^=+ (.*)$/
+ re = /^[=#]+ (.*)$/
sectional = project_path( file )
parts = sectional.read.split( re )[1..-1]
parts.map! { |p| p.strip }
sections = Hash.new
@@ -75,12 +75,12 @@
# root.
#
# path - the relative path of the file from the project root
#
# Returns the Pathname of the file
- def project_path( relative_path )
- project_root.join( relative_path )
+ def project_path( *relative_path )
+ project_root.join( *relative_path )
end
# Internal: The absolute path of this file
#
# Returns the Pathname of this file.
@@ -108,10 +108,17 @@
manifest_file = project_path( "Manifest.txt" )
abort "You need a Manifest.txt" unless manifest_file.readable?
manifest_file.readlines.map { |l| l.strip }
end
+ # Internal: Return the files that define the extensions
+ #
+ # Returns an Array
+ def extension_conf_files
+ manifest.grep( /extconf.rb\Z/ )
+ end
+
# Internal: Returns the gemspace associated with the current ruby platform
def platform_gemspec
gemspecs[platform]
end
@@ -128,12 +135,12 @@
spec.files = manifest
spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
spec.test_files = spec.files.grep(/^spec/)
- spec.extra_rdoc_files += spec.files.grep(/(txt|rdoc)$/)
- spec.rdoc_options = [ "--main" , 'README.rdoc',
+ spec.extra_rdoc_files += spec.files.grep(/(txt|rdoc|md)$/)
+ spec.rdoc_options = [ "--main" , 'README.md',
"--markup", "tomdoc" ]
end
end
# Internal: Return the gemspec for the ruby platform
@@ -178,10 +185,10 @@
(RUBY_PLATFORM == "java") ? 'java' : Gem::Platform::RUBY
end
# Internal: Return the DESCRIPTION section of the README.rdoc file
def description_section
- section_of( 'README.rdoc', 'DESCRIPTION')
+ section_of( 'README.md', 'DESCRIPTION')
end
# Internal: Return the summary text from the README
def summary
description_section.first