From ad2e4af4f47bfa24e04964710380d2428754b12a Mon Sep 17 00:00:00 2001 From: Michael Cordell Date: Sat, 1 Mar 2014 17:41:24 -0800 Subject: [PATCH] Convert Readme to markdown for github --- README => README.md | 71 ++++++++++++++++++++++++++++----------------- noaa.gemspec | 2 +- 2 files changed, 45 insertions(+), 28 deletions(-) rename README => README.md (61%) diff --git a/README b/README.md similarity index 61% rename from README rename to README.md index fd6480c..d7b127b 100644 --- a/README +++ b/README.md @@ -1,57 +1,74 @@ -= noaa +#noaa -* http://github.com/outoftime/noaa +- [http://github.com/outoftime/noaa](ttp://github.com/outoftime/noaa) -== Description: +##Description: noaa is a library that provides an API for the National Oceanic and Atmospheric Association's weather data feeds. It currently provides access to two types of data: current conditions (through NOAA::CurrentConditions) and daily forecasts (through NOAA::Forecast). -== Features: +##Features: - Find both current conditions and daily forecasts using lat/lng. - Access all relevant data returned by the NOAA using a simple and intuitive API -== Requirements: +##Requirements: - libxml-ruby >= 0.9.7 (if there is demand, I could look into allowing REXML as a fallback - shoot me an email) - geokit >= 1.5.0 -== Installation: +##Installation: - sudo gem sources --add http://gems.github.com (only if you haven't done this before) - sudo gem install outoftime-noaa - sudo noaa-update-stations +```bash +sudo gem install noaa +``` -== Usage: - # Get current conditions - conditions = NOAA.current_conditions(lat, lng) - puts "The temperature is currently #{conditions.temperature} degrees, with #{conditions.weather_description.downcase} conditions." - - # Get closest weather station, then get current conditions - # See discussion in documentation of NOAA.current_conditions - # for why this is a good idea - station_id = NOAA::Station.closest_to(lat, lng).id - # persist the station id wherever... - conditions = NOAA.current_conditions_for_station(station_id) +```bash +sudo noaa-update-stations +``` - # Get four-day forecast - forecast = NOAA.forecast(4, lat, lng) # This method should not be called more than once an hour for a given lat/lng - ['today', 'tomorrow', (Date.today + 2).to_s, (Date.today + 3).to_s].each_with_index do |date, i| - puts "The high for #{date} will be #{forecast[i].high}" - end +##Usage: + +###Get current conditions + +```ruby +conditions = NOAA.current_conditions(lat, lng) +puts "The temperature is currently #{conditions.temperature} degrees, with #{conditions.weather_description.downcase} conditions." +``` + + +###Get closest weather station, then get current conditions + +```ruby +# See discussion in documentation of NOAA.current_conditions +# for why this is a good idea +station_id = NOAA::Station.closest_to(lat, lng).id +# persist the station id wherever... +conditions = NOAA.current_conditions_at_station(station_id) +``` + + + +### Get four-day forecast + +```ruby +forecast = NOAA.forecast(4, lat, lng) # This method should not be called more than once an hour for a given lat/lng +['today', 'tomorrow', (Date.today + 2).to_s, (Date.today + 3).to_s].each_with_index do |date, i| + puts "The high for #{date} will be #{forecast[i].high}" +end +``` See the API documentation for further discussion. -== Contact: +##Contact: Mat Brown (mat@patch.com) I'm always open to feature requests, bugs, and patches. -== License: +##License: (The MIT License) diff --git a/noaa.gemspec b/noaa.gemspec index c5f6148..9397b29 100644 --- a/noaa.gemspec +++ b/noaa.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |s| s.description = %q{Ruby API for National Oceanic and Atmospheric Administration weather data} s.email = %q{mat@patch.com} s.executables = ["noaa-update-stations"] - s.files = Dir.glob('{bin,lib,test,data}/**/*') + %w(CHANGELOG README) + s.files = Dir.glob('{bin,lib,test,data}/**/*') + %w(CHANGELOG README.md) s.has_rdoc = true s.homepage = %q{http://github.com/outoftime/noaa} s.post_install_message = %q{Be sure to update the weather station list: