{"id":19319810,"url":"https://github.com/hyperoslo/obix","last_synced_at":"2025-04-22T17:32:23.185Z","repository":{"id":6189830,"uuid":"7420299","full_name":"hyperoslo/obix","owner":"hyperoslo","description":"Ruby OBIX parser","archived":false,"fork":false,"pushed_at":"2014-10-10T21:46:23.000Z","size":512,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-05-09T16:36:25.415Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperoslo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-03T09:15:12.000Z","updated_at":"2024-05-09T16:36:25.416Z","dependencies_parsed_at":"2022-09-09T09:01:21.620Z","dependency_job_id":null,"html_url":"https://github.com/hyperoslo/obix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fobix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fobix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fobix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperoslo%2Fobix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperoslo","download_url":"https://codeload.github.com/hyperoslo/obix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223902239,"owners_count":17222338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T01:25:21.109Z","updated_at":"2024-11-10T01:25:21.703Z","avatar_url":"https://github.com/hyperoslo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OBIX\n\n[![Code Climate](https://img.shields.io/codeclimate/github/hyperoslo/obix.svg?style=flat)](https://codeclimate.com/github/hyperoslo/obix)\n\nRuby OBIX parser.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'obix'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install obix\n\n## Usage\n\n### Parse an object\n\n```xml\n\u003c!-- thermostat.xml --\u003e\n\u003cobj href=\"http://domain/thermostat\"\u003e\n  \u003creal name=\"spaceTemp\" unit=\"obix:units/fahrenheit\" val=\"67.2\"/\u003e\n  \u003creal name=\"setpoint\" unit=\"obix:units/fahrenheit\" val=\"72.0\"/\u003e\n  \u003cbool name=\"furnaceOn\" val=\"true\"/\u003e\n\u003c/obj\u003e\n```\n\n```ruby\n# thermostat.rb\nthermostat = OBIX.parse file: \"thermostat.xml\"\n\nthermostat.href # =\u003e \"http://domain/thermostat/\"\n\ntemperature = thermostat.objects.find { |obj| obj.name == \"spaceTemp\" }\ntemperature.val # =\u003e 67.2\n```\n\n### Build an object\n\n```ruby\n# thermostat.rb\nobject = OBIX::Builder.new do\n  obj href: \"http://domain/thermostat\" do\n    real name: \"spaceTemp\", unit: \"obix:units/fahrenheit\" val: 67.2\n    real name: \"setpoint\", unit: \"obix:units/fahrenheit\" val: 72.0\n    bool name: \"furnaceOn\", val: true\n  end\nend\n```\n\n### Invoke an operation\n\n```xml\n\u003c!-- furnace.xml --\u003e\n\u003cobj href=\"http://domain/furnace\"\u003e\n  \u003cbool name=\"active\" val=\"false\"/\u003e\n  \u003cop name=\"activate\" href=\"http://domain/furnace/activate\" in=\"obix:Nil\" out=\"obix:Nil\"/\u003e\n  \u003cop name=\"deactivate\" href=\"http://domain/furnace/deactivate\" in=\"obix:Nil\" out=\"obix:Nil\"/\u003e\n\u003c/obj\u003e\n```\n\n```ruby\n# furnace.rb\nfurnace = OBIX.parse file: \"furnace.xml\"\n\nactivate = furnace.objects.find { |obj| obj.name == \"activate\" }\nactivate.invoke\n```\n\n### Create a watch\n\n```ruby\n# Create a new watch...\nwatch = OBIX::Watch.make url: \"http://domain/watchservice\"\n\n# ... or connect to an existing watch\nwatch = OBIX::Watch.connect url: \"http://domain/watchservice/watch1\"\n\n# Add objects to the watch\nwatch.add [\"/thermostat\", \"/furnace\"]\n\n# Remove objects from the watch\nwatch.remove [\"/furnace\"]\n\n# Poll everything\nwatch.all\n\n# Poll changes\nwatch.changes\n\n# Delete the watch\nwatch.delete\n```\n\n### Query an object's history\n\n```ruby\nhistory = OBIX::History.new url: \"http://domain/history\"\n\nhistory.query start: 2.year.ago, end: 1.year.ago\n```\n\n### Query alarms\n\n```ruby\nalarms = OBIX::Alarms.new url: \"http://domain/alarmservice\"\n\nalarms.query start: 2.years.ago, end: 1.year.ago\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Credits\n\nHyper made this. We're a digital communications agency with a passion for good code,\nand if you're using this library we probably want to hire you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperoslo%2Fobix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperoslo%2Fobix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperoslo%2Fobix/lists"}