Module: Fetcher

Defined in:
lib/fetcher.rb,
lib/fetcher/worker.rb,
lib/fetcher/version.rb,
lib/fetcher/cli/opts.rb,
lib/fetcher/cli/runner.rb

Defined Under Namespace

Classes: Error, HttpError, Opts, Runner, Worker

Constant Summary collapse

MAJOR =

todo: namespace inside version or something - why? why not??

0
MINOR =
4
PATCH =
4
VERSION =
[MAJOR,MINOR,PATCH].join('.')

Class Method Summary collapse

Class Method Details

version string for generator meta tag (includes ruby version)



14
15
16
# File 'lib/fetcher/version.rb', line 14

def self.banner
  "fetcher/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
end

.copy(src, dest, opts = {}) ⇒ Object

convenience shortcuts



55
56
57
# File 'lib/fetcher.rb', line 55

def self.copy( src, dest, opts={} )
  Worker.new.copy( src, dest, opts )
end

.get(src) ⇒ Object



63
64
65
# File 'lib/fetcher.rb', line 63

def self.get( src )
  Worker.new.get( src )
end

.mainObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/fetcher.rb', line 34

def self.main

  ## NB: only load (require) cli code if called

  require 'fetcher/cli/runner'
  
  # allow env variable to set RUBYOPT-style default command line options
  #   e.g. -o site 
  fetcheropt = ENV[ 'FETCHEROPT' ]
  
  args = []
  args += fetcheropt.split if fetcheropt
  args += ARGV.dup
  
  Runner.new.run(args)
end

.read(src) ⇒ Object



59
60
61
# File 'lib/fetcher.rb', line 59

def self.read( src )
  Worker.new.read( src )
end

.rootObject



18
19
20
# File 'lib/fetcher/version.rb', line 18

def self.root
  "#{File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )}"
end

.versionObject



9
10
11
# File 'lib/fetcher/version.rb', line 9

def self.version
  VERSION
end