rspreadsheet.gemspec in rspreadsheet-0.2.15 vs rspreadsheet.gemspec in rspreadsheet-0.3

- old
+ new

@@ -16,12 +16,18 @@ 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_installed?(pkgname) + system("dpkg-query -l #{pkgname} | grep -q '^i'") + end + # runtime dependencies - spec.add_runtime_dependency 'libxml-ruby', '~>2.7' # parsing XML files + unless package_installed?('ruby-libxml') + spec.add_runtime_dependency 'libxml-ruby', '~>2.7' # parsing XML files + end spec.add_runtime_dependency 'rubyzip', '~>1.1' # opening zip files spec.add_runtime_dependency 'andand', '~>1.3' # development dependencies spec.add_development_dependency "bundler", "~> 1.5" @@ -30,10 +36,16 @@ spec.add_development_dependency "rspec", '~>2' # testing spec.add_development_dependency 'pry-nav', '~>0' # enables pry 'next', 'step' commands # optional and testing spec.add_development_dependency "coveralls", '~>0.7' - spec.add_development_dependency "guard", '~>2.6' - spec.add_development_dependency "guard-rspec", '~>2.6' + + if RUBY_VERSION.split('.')[0] != "1" + # ruby_dep starts to require ruby 2.2.5 which raises errors with ruby 1.9.3 +# 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 +