https://github.com/l3r8yj/jini
Jini helps you build an XPATH and then modify its parts via simple fluent interface.
https://github.com/l3r8yj/jini
ruby rubygem
Last synced: 8 months ago
JSON representation
Jini helps you build an XPATH and then modify its parts via simple fluent interface.
- Host: GitHub
- URL: https://github.com/l3r8yj/jini
- Owner: l3r8yJ
- License: mit
- Created: 2022-09-14T22:49:03.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-09-26T20:05:33.000Z (over 1 year ago)
- Last Synced: 2025-04-12T23:56:16.854Z (about 1 year ago)
- Topics: ruby, rubygem
- Language: Ruby
- Homepage: https://rubygems.org/gems/jini
- Size: 188 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[
](https://l3r8yj.github.io/jini.github/)
[](https://badge.fury.io/rb/jini)
[](https://hitsofcode.com/github/l3r8yJ/jini/view)
The class [`Jini`](https://www.rubydoc.info/gems/jini/1.3.0/Jini) helps you build an XPATH.
```ruby
require 'jini'
xpath = Jini.new
.add_node('parent') # addition a path node
.add_node('child') # addition a path node
.add_attr('key', 'value') # addition an attribute
.remove_node('child') # removes node
.to_s # convert it to a string
puts(xpath) # -> xpath: /parent[@key="value"]
```
The full list of methods is [here](https://www.rubydoc.info/gems/jini/1.3.0).
Install it:
```bash
$ gem install jini
```
Or add this to your `Gemfile`:
```bash
gem 'jini'
```
Pay attention, it is not a parser. The only functionality this gem provides
is _building_ XPATHs.
## New features requests
If you find an error, or you want to add new functionality, just create a new `Issue`
and describe what happened, also try to add/fix something and send pull request.