Object
# File lib/jeweler/gemspec_helper.rb, line 78 78: def gem_path 79: File.join(@base_dir, 'pkg', parse.file_name) 80: end
Checks whether it uses the version helper or the users defined version.
# File lib/jeweler/gemspec_helper.rb, line 87 87: def has_version? 88: !@spec.version.nil? 89: end
# File lib/jeweler/gemspec_helper.rb, line 60 60: def normalize_files(array_attribute) 61: array = @spec.send(array_attribute) 62: # only keep files, no directories, and sort 63: array = array.select do |path| 64: File.file? File.join(@base_dir, path) 65: end.sort 66: 67: @spec.send("#{array_attribute}=", array) 68: end
# File lib/jeweler/gemspec_helper.rb, line 53 53: def parse 54: data = self.to_ruby 55: parsed_gemspec = nil 56: Thread.new { parsed_gemspec = eval("$SAFE = 3\n#{data}", binding, path) }.join 57: parsed_gemspec 58: end
# File lib/jeweler/gemspec_helper.rb, line 47 47: def path 48: denormalized_path = File.join(@base_dir, "#{@spec.name}.gemspec") 49: absolute_path = File.expand_path(denormalized_path) 50: absolute_path.gsub(Dir.getwd + File::SEPARATOR, '') 51: end
Adds extra space when outputting an array. This helps create better version control diffs, because otherwise it is all on the same line.
# File lib/jeweler/gemspec_helper.rb, line 71 71: def prettyify_array(gemspec_ruby, array_name) 72: gemspec_ruby.gsub(/s\.#{array_name.to_s} = \[.+?\]/) do |match| 73: leadin, files = match[0..2].split("[") 74: leadin + "[\n #{files.split(",").join(",\n ")}\n ]" 75: end 76: end
# File lib/jeweler/gemspec_helper.rb, line 30 30: def to_ruby 31: normalize_files(:files) 32: normalize_files(:files) 33: normalize_files(:extra_rdoc_files) 34: 35: gemspec_ruby = @spec.to_ruby 36: gemspec_ruby = prettyify_array(gemspec_ruby, :files) 37: gemspec_ruby = prettyify_array(gemspec_ruby, :test_files) 38: gemspec_ruby = prettyify_array(gemspec_ruby, :extra_rdoc_files) 39: gemspec_ruby = # Generated by jeweler# DO NOT EDIT THIS FILE DIRECTLY# Instead, edit Jeweler::Tasks in #{Rake.application.rakefile}, and run the gemspec command#{gemspec_ruby} 40: end
# File lib/jeweler/gemspec_helper.rb, line 82 82: def update_version(version) 83: @spec.version = version.to_s 84: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.