Class: Berry

Inherits:
Object
  • Object
show all
Defined in:
lib/berry.rb,
lib/berry/version.rb,
lib/berry/gem_tasks.rb

Defined Under Namespace

Classes: GemTasks

Constant Summary collapse

DEFAULT_FILES =
/(README|LICENSE|bin\/|lib\/)/
VERSION =
"0.1.1"

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Berry

Returns a new instance of Berry.



9
10
11
12
13
14
15
# File 'lib/berry.rb', line 9

def initialize(name, &block)
  @name       = name.to_s.downcase
  @namespace  = @name.capitalize.constantize rescue nil
  @path       = Path(".", :recursive => true, :short => true)
  auto_require_version!
  specification(&block) if block_given?
end

Instance Method Details

#specification(&block) ⇒ Object



17
18
19
# File 'lib/berry.rb', line 17

def specification(&block)
  @gemspec = Gem::Specification.new(&block)
end

#to_specObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/berry.rb', line 21

def to_spec
  @gemspec.name         ||= @name
  @gemspec.version      ||= default_version
  @gemspec.summary      ||= "WIP" 
  @gemspec.author       ||= default_author
  @gemspec.email        ||= default_email
  @gemspec.description  ||= @gemspec.summary
  @gemspec.homepage     ||= default_homepage
  @gemspec.executables  = (@gemspec.executables + default_executables).uniq
  @gemspec.files        = (@gemspec.files + default_files).uniq
  @gemspec.rubyforge_project = "nowarning"
  @gemspec
end