Top Level Namespace

Defined Under Namespace

Modules: WkhtmltopdfInstaller

Instance Method Summary collapse

Instance Method Details

#makefile_dirObject



23
24
25
# File 'ext/extconf.rb', line 23

def makefile_dir
  File.dirname(__FILE__)
end

#package_urlObject



32
33
34
# File 'ext/extconf.rb', line 32

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

#probeObject



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

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



19
20
21
# File 'ext/extconf.rb', line 19

def version
  WkhtmltopdfInstaller::GEM_VERSION
end