Parse *.gemspec file. Convert to Ruby Hash object.
See parse_gemspec-cli (repo) for the command-line version.
require 'parse_gemspec'
gemspec_path = 'path/to/you_want_to_parse.gemspec'
ParseGemspec::Specification.load(gemspec_path).to_hash_object
=> {:name=>"you_want_to_parse",
:version=>"1.3.0",
:authors=>["sanemat"],
:description=>"Description you want to parse.",
:email=>["[email protected]"],
:homepage=>"https://example.com/you_want_to_parse",
:licenses=>["MIT"],
:metadata=>{},
:summary=>"Summary you want to parse."}
Required
Type: string
*.gemspec
's path.
- name
- version
- authors
- description
- homepage
- licences
- metadata
- summary
Add this line to your application's Gemfile:
gem 'parse_gemspec'
And then execute:
$ bundle
Or install it yourself as:
$ gem install parse_gemspec
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/packsaddle/ruby-parse_gemspec. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
© sanemat
The gem is available as open source under the terms of the MIT License.