Skip to content

Commit

Permalink
gi: Loader supports version
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Mar 22, 2013
1 parent 150d58e commit 28e3ee8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gobject-introspection/lib/gobject-introspection/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,22 @@
module GObjectIntrospection
class Loader
class << self
def load(namespace, base_module)
def load(namespace, base_module, options={})
loader = new(base_module)
loader.version = options[:version]
loader.load(namespace)
end
end

attr_accessor :version
def initialize(base_module)
@base_module = base_module
@version = nil
end

def load(namespace)
repository = Repository.default
repository.require(namespace)
repository.require(namespace, @version)
pre_load(repository, namespace)
repository.each(namespace) do |info|
load_info(info)
Expand Down

0 comments on commit 28e3ee8

Please sign in to comment.