-
Notifications
You must be signed in to change notification settings - Fork 17
/
rspreadsheet.gemspec
61 lines (49 loc) · 2.86 KB
/
rspreadsheet.gemspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rspreadsheet/version'
Gem::Specification.new do |spec|
spec.name = "rspreadsheet"
spec.version = Rspreadsheet::VERSION
spec.authors = ["Jakub A.Těšínský"]
spec.email = ["jAkub.cz (A is at)"]
spec.summary = 'Manipulating LibreOffice Calc (OpenDocument Spreadsheet) files from Ruby (read / create / modify).'
spec.description = 'Manipulating LibreOffice Calc (OpenDocument Spreadsheet) files with Ruby. This gem can create new, read existing files abd modify them. When modyfying files, it tries to change as little as possible, making it as much forward compatible as possible.'
spec.homepage = "https://github.com/gorn/rspreadsheet"
spec.license = "GPL"
spec.files = `git ls-files -z`.split("\x0")
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
def self.package_natively_installed?(pkgname)
# if the shell fails, the system command returns nil. In that case we assume that the package is NOT installed. It might be overkill, because I am supresing the stderr as well
(system("dpkg-query -l #{pkgname} 2>/dev/null | grep -q '^i'")==true) or # debian based
(system("rpm -qa 2>/dev/null | grep -q '#{pkgname}' ")==true) or # rpm based
(system("pkg_info -q -e '#{pkgname}-*' >/dev/null 2>&1")==true) # OpenBSD and alike (although OpenBSD registers the gem as a gem, so this is perhaps unnecessary
end
# runtime dependencies
unless package_natively_installed?('ruby-libxml')
spec.add_runtime_dependency 'libxml-ruby', '>=3.0' # parsing XML files
end
spec.add_runtime_dependency 'rubyzip', '>=1.3' # opening zip files
spec.add_runtime_dependency 'andand', '>=1.3'
# development dependencies
spec.add_development_dependency "bundler", '>= 1.5', '<3' # some 2.5 rubyies contain already bundler 2 included
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4.5')
# ruby 2.4.5 and up
spec.add_development_dependency "rake", '>=10.0'
else
# ruby up to 2.4.5
spec.add_development_dependency "rake", '~>0.9'
end
# testig - see http://bit.ly/1n5yM51
spec.add_development_dependency "rspec", '>=2.0' # running tests
spec.add_development_dependency 'pry-nav', '>=0.0' # enables pry 'next', 'step' commands
spec.add_development_dependency "coveralls", '>=0.7' # inspecting coverage of tests
# optional and testing
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.2.5')
# spec.add_development_dependency "guard", '~>2.13'
# spec.add_development_dependency "guard-rspec", '~>4.6'
end
# spec.add_development_dependency 'equivalent-xml' # implementing xml diff
end