Git Product home page Git Product logo

smtuc's Introduction

SMTUC ๐ŸšŒ

An unofficial gem built on top of an unofficial API. For more information about the API used here and its available methods, see sdsantos/smtuc-api. Feel free to add to this and send in your pull requests.

Installing the gem

Either build the gem from the source code (see below), or install it via rubygems

gem install smtuc

Working with the gem source code

To build a new version of the gem:

rake build

You can then install it:

rake install

If you built a new version of the gem and want to push it to rubygems.org use rake release. This will automatically tag the source code according to the new version and create a new release on github.

$ rake release
smtuc 0.0.3 built to pkg/smtuc-0.0.3.gem.
Tagged v0.0.3.
Pushed git commits and tags.
Pushed smtuc 0.0.3 to rubygems.org

See all other available rake tasks`:

rake --tasks

Using the gem

# Require the gem itself
require 'smtuc'

# Get all the known stops
all_stops = SMTUC::Stop.all

# Get information on a specific stop
stop = SMTUC::Stop.find '1402'

# And a stop's next arrivals
stop.arrivals

# Find a stop by location
stop = SMTUC::Stop.by_location(40.25532913208008, -8.433822631835938, 100)

# Get all the known lines
lines = SMTUC::Line.all

# Get information on a specific line
line = SMTUC::Line.find '7T'

Alternatively, if working with the source code, you can open a console with the gem already loaded

bin/console

irb(main):001:0> SMTUC::Stop.all

Want to contribute? Here's a TODO list of pending things

Generic/QOL updates

  • Specs! This has none.

Updates to SMTUC::Line

Updates to SMTUC::Stop

  • Search stops by keyword

Create SMTUC::GTFS

  • Implement an export function that creates a GTFS-ready "feed"

smtuc's People

Contributors

fredoliveira avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.