Top Level Namespace

Defined Under Namespace

Modules: WkhtmltopdfInstaller

Instance Method Summary collapse

Instance Method Details

#makefile_dirObject



25
26
27
# File 'ext/extconf.rb', line 25

def makefile_dir
  File.dirname(__FILE__)
end

#package_urlObject



34
35
36
# File 'ext/extconf.rb', line 34

def package_url
  "https://github.com/vovayartsev/wkhtmltopdf-installer-ruby/releases/download/#{version}/wkhtmltox-#{version}.#{probe.platform}.#{probe.ext}"
end

#probeObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'ext/extconf.rb', line 8

def probe
  @probe ||= case RUBY_PLATFORM
             when /x86_64-darwin.*/
               OpenStruct.new(script: 'macos', platform: 'macos_cocoa', ext: 'pkg')
             when /x86_64-linux/
               OpenStruct.new(script: 'linux', platform: 'linux_amd64', ext: 'deb')
             when /i[3456]86-linux/
               OpenStruct.new(script: 'linux', platform: 'linux_i386', ext: 'deb')
             else
               raise NotImplementedError "Unsupported ruby platform #{RUBY_PLATFORM}"
             end
end

#versionObject



21
22
23
# File 'ext/extconf.rb', line 21

def version
  WkhtmltopdfInstaller::BINARIES_VERSION
end