lib/inochi/inochi.rb in inochi-2.0.1 vs lib/inochi/inochi.rb in inochi-3.0.0

- old
+ new

@@ -16,16 +16,16 @@ WEBSITE = 'http://snk.tuxfamily.org/lib/inochi/' ## # Number of this release of this project. # - VERSION = '2.0.1' + VERSION = '3.0.0' ## # Date of this release of this project. # - RELDATE = '2010-04-25' + RELDATE = '2010-04-27' ## # Description of this release of this project. # def self.inspect @@ -53,10 +53,11 @@ # # this project needs any version of the "yet_another_example" gem # "yet_another_example" => [], # } # RUNTIME = { + 'ember' => [ '>= 0.3.0' , '< 1' ], # for eRuby templates 'highline' => [ '>= 1.5' , '< 2' ], # for echoless password entry 'mechanize' => [ '~> 1' ], # for publishing announcements 'nokogiri' => [ '>= 1.4' , '< 2' ], # for parsing HTML and XML 'rake' => [ '>= 0.8.4' , '< 1' ], # for Inochi::Engine 'ronn' => [ '>= 0.5' , '< 1' ], # for making UNIX man pages @@ -82,28 +83,19 @@ # DEVTIME = { 'dfect' => [ '>= 1.1.0', '< 2' ], # for unit testing } - ## - # Loads the correct version (as defined by the {RUNTIME} or {DEVTIME} - # constant in this module) of the given gem or the gem that contains - # the given library. - # - def self.require gem_name_or_library - # prepare the correct version of the gem for loading - if respond_to? :gem - gem_name = gem_name_or_library.to_s.sub(%r{/.*$}, '') - if gem_version = RUNTIME[gem_name] || DEVTIME[gem_name] + # establish gem version dependencies + if respond_to? :gem + [RUNTIME, DEVTIME].each do |deps| + deps.each do |gem_name, gem_version| begin - gem gem_name, *gem_version + gem gem_name, *Array(gem_version) rescue LoadError => error warn "#{self.inspect}: #{error}" end end end - - # do the loading - super end end