Module: Babushka::UriHelpers

Included in:
DepContext
Defined in:
lib/babushka/helpers/uri_helpers.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) handle_source(uri, &block)



21
22
23
24
# File 'lib/babushka/helpers/uri_helpers.rb', line 21

def handle_source uri, &block
  deprecated! '2013-04-21', :instead => 'Resource.extract(uri) { ... }'
  Resource.extract uri, &block
end

- (Object) process_sources(&block)



12
13
14
15
16
17
18
19
# File 'lib/babushka/helpers/uri_helpers.rb', line 12

def process_sources &block
  deprecated! '2013-04-21', :instead => 'sources.each {|uri| Resource.extract(uri) { ... } }'
  uris = source.map(&uri_processor(:escape)).map(&uri_processor(:parse))
  extra_uris = extra_source.map(&uri_processor(:escape)).map(&uri_processor(:parse)) if respond_to?(:extra_source)

  extra_uris.each {|uri| Resource.extract(uri) } unless extra_uris.nil?
  uris.all? {|uri| Resource.extract(uri, &block) } unless uris.nil?
end

- (Object) setup_source_uris



4
5
6
# File 'lib/babushka/helpers/uri_helpers.rb', line 4

def setup_source_uris
  deprecated! '2013-04-21', :method_name => "#setup_source_uris isn't required anymore and now has no effect, and so"
end

- (Object) uri_processor(method_name)



8
9
10
# File 'lib/babushka/helpers/uri_helpers.rb', line 8

def uri_processor(method_name)
  L{|uri| URI.send(method_name, uri.respond_to?(:call) ? uri.call : uri.to_s) }
end