Class Index [+]

Quicksearch

Jeweler::Specification

Extend a Gem::Specification instance with this module to give it Jeweler super-cow powers.

files

a Rake::FileList of anything that is in git and not gitignored. You can include/exclude this default set, or override it entirely

test_files

Similar to gem.files, except it’s only things under the spec, test, or examples directory.

extra_rdoc_files

a Rake::FileList including files like README*, ChangeLog*, and LICENSE*

executables

uses anything found in the bin/ directory.

Public Class Methods

filelist_attribute(name) click to toggle source
    # File lib/jeweler/specification.rb, line 13
13:     def self.filelist_attribute(name)
14:       code = %{
15:         def #{name}
16:           if @#{name} && @#{name}.class != FileList
17:             @#{name} = FileList[@#{name}]
18:           end
19:           @#{name} ||= FileList[]
20:         end
21:         def #{name}=(value)
22:           @#{name} = FileList[value]
23:         end
24:       }
25: 
26:       module_eval code, __FILE__, __LINE__ - 9
27:     end

Public Instance Methods

ruby_code(obj) click to toggle source

Used by Specification#to_ruby to generate a ruby-respresentation of a Gem::Specification

    # File lib/jeweler/specification.rb, line 81
81:     def ruby_code(obj)
82:       case obj
83:       when Rake::FileList then obj.uniq.to_a.inspect
84:       else super
85:       end
86:     end
set_jeweler_defaults(base_dir, git_base_dir = nil) click to toggle source

Assigns the Jeweler defaults to the Gem::Specification

    # File lib/jeweler/specification.rb, line 34
34:     def set_jeweler_defaults(base_dir, git_base_dir = nil)
35:       base_dir = File.expand_path(base_dir)
36:       #breakpoint
37:       git_base_dir = if git_base_dir
38:                        File.expand_path(git_base_dir)
39:                      else
40:                        base_dir
41:                      end
42:       can_git = git_base_dir && base_dir.include?(git_base_dir) && File.directory?(File.join(git_base_dir, '.git'))
43: 
44:       Dir.chdir(git_base_dir) do
45:         if can_git
46:           require 'git'
47:           repo = Git.open(git_base_dir) if can_git
48:         end
49: 
50:         if blank?(files) && repo
51:           base_dir_with_trailing_separator = File.join(base_dir, "")
52: 
53:           self.files = (repo.ls_files(base_dir).keys - repo.lib.ignored_files).map do |file|
54:             #breakpoint
55:             File.expand_path(file).sub(base_dir_with_trailing_separator, "")
56:           end
57:         end
58: 
59:         if blank?(test_files) && repo
60:           self.test_files = FileList['{spec,test,examples}/**/*.rb'] - repo.lib.ignored_files
61:         end
62: 
63:         if blank?(executables)
64:           self.executables = Dir['bin/*'].map { |f| File.basename(f) }
65:         end
66: 
67:         if blank?(extensions)
68:           self.extensions = FileList['ext/**/extconf.rb']
69:         end
70: 
71:         self.has_rdoc = true
72:         rdoc_options << '--charset=UTF-8'
73: 
74:         if blank?(extra_rdoc_files)
75:           self.extra_rdoc_files = FileList['README*', 'ChangeLog*', 'LICENSE*', 'TODO']
76:         end
77:       end
78:     end

Private Instance Methods

blank?(value) click to toggle source
    # File lib/jeweler/specification.rb, line 90
90:     def blank?(value)
91:       value.nil? || value.empty?
92:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.