Skip to content

Commit

Permalink
Update gemspec
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Sep 14, 2023
1 parent 6640b48 commit 5379be4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 59 deletions.
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
source "https://rubygems.org"

gem "rake"
gem "yard"

gem "libxml-ruby", require: nil, platforms: :ruby
gem "nokogiri", require: nil
gem "oga", ">= 2.3", require: nil
gem "ox", require: nil, platforms: :ruby

gem "backports", ">= 3.24.1"
gem "rake", ">= 13.0.6"
gem "rspec", ">= 3.12"
gem "rubocop", ">= 1.56.3"
gem "rubocop-performance", ">= 1.19"
Expand All @@ -17,6 +15,7 @@ gem "rubocop-rspec", ">= 2.24"
gem "simplecov", ">= 0.22"
gem "standard", ">= 1.31.1"
gem "standard-performance", ">= 1.2"
gem "yard", ">= 0.9.34"
gem "yardstick", ">= 0.9.9"

gemspec
44 changes: 1 addition & 43 deletions lib/multi_xml/version.rb
Original file line number Diff line number Diff line change
@@ -1,45 +1,3 @@
module MultiXml
module Version
module_function

# @return [Integer]
def major
0
end

# @return [Integer]
def minor
6
end

# @return [Integer]
def patch
0
end

# @return [Integer, NilClass]
def pre
nil
end

# @return [Hash]
def to_h
{
major: major,
minor: minor,
patch: patch,
pre: pre
}
end

# @return [Array]
def to_a
[major, minor, patch, pre].compact
end

# @return [String]
def to_s
to_a.join(".")
end
end
VERSION = Gem::Version.create("0.6.0")
end
40 changes: 28 additions & 12 deletions multi_xml.gemspec
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "multi_xml/version"
require_relative "lib/multi_xml/version"

Gem::Specification.new do |spec|
spec.author = "Erik Berlin"
spec.description = "Provides swappable XML backends utilizing LibXML, Nokogiri, Ox, or REXML."
spec.email = "sferik@gmail.com"
spec.files = %w[.yardopts CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md multi_xml.gemspec] + Dir["lib/**/*.rb"]
spec.homepage = "https://github.com/sferik/multi_xml"
spec.licenses = ["MIT"]
spec.name = "multi_xml"
spec.require_paths = ["lib"]
spec.version = MultiXml::VERSION
spec.authors = ["Erik Berlin"]
spec.email = ["sferik@gmail.com"]

spec.summary = "Provides swappable XML backends utilizing LibXML, Nokogiri, Ox, or REXML."
spec.homepage = "https://github.com/sferik/multi_xml"
spec.license = "MIT"
spec.required_ruby_version = ">= 3.0"
spec.summary = "A generic swappable back-end for XML parsing"
spec.version = MultiXml::Version

spec.metadata["allowed_push_host"] = "https://rubygems.org"

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/sferik/multi_xml"
spec.metadata["changelog_uri"] = "https://github.com/sferik/multi_xml/blob/master/CHANGELOG.md"

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(__dir__) do
`git ls-files -z`.split("\x0").reject do |f|
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
end
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
spec.metadata["rubygems_mfa_required"] = "true"
end
2 changes: 1 addition & 1 deletion spec/parser_shared_example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
expect { MultiXml.parse(@xml)["tag"] }.to raise_error(MultiXml::DisallowedTypeError)
end

xit "returns the correctly parsed YAML when the type is allowed" do
it "returns the correctly parsed YAML when the type is allowed" do
expect(MultiXml.parse(@xml,
disallowed_types: [])["tag"]).to eq(:message => "Have a nice day", 1 => "returns an integer",
"array" => [{ "has-dashes" => true, "has_underscores" => true }])
Expand Down

0 comments on commit 5379be4

Please sign in to comment.