Skip to content

Commit

Permalink
Added max % to ansirain status.
Browse files Browse the repository at this point in the history
  • Loading branch information
onewheelskyward committed Aug 5, 2015
1 parent 460fbac commit f1b1da8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/lita/handlers/forecasts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def do_the_rain_chance_thing(forecast, chars, key, use_color = config.colors)
if use_color
str = get_colored_string(data, key, str, get_rain_range_colors)
end

# Add max
str += " max #{data_points.max * 100}%"
str
end

Expand Down
6 changes: 3 additions & 3 deletions lita-forecast-io.gemspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Gem::Specification.new do |spec|
spec.name = 'lita-forecast-io'
spec.name = 'lita-onewheel-forecast-io'
spec.version = '0.0.0'
spec.authors = ['Andrew Kreps']
spec.email = ['andrew.kreps@gmail.com']
spec.description = %q{A text interface to Forecast.io's weather data.}
spec.summary = %q{Summarize THIS!}
spec.homepage = 'https://github.com/onewheelskyward/lita-forecast-io'
spec.homepage = 'https://github.com/onewheelskyward/lita-onewheel-forecast-io'
spec.license = 'MIT'
spec.metadata = { 'lita_plugin_type' => 'handler'}

Expand All @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'lita', '~> 4.3'

spec.add_development_dependency 'bundler', '~> 1.3'
spec.add_development_dependency 'pry-byebug', '~> 3.1'
# spec.add_development_dependency 'pry-byebug', '~> 3.1'
spec.add_development_dependency 'rake', '~> 10.4'
spec.add_development_dependency 'rack-test', '~> 0.6'
spec.add_development_dependency 'rspec', '~> 3.0'
Expand Down
5 changes: 5 additions & 0 deletions spec/lita/handlers/forecast_io_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@
expect(replies.last).to include("|\u000302_☃\u000306▃\u000310▅\u000303▅\u000309▅\u000311▇\u000308▇\u000307█\u000304█\u000313█\u000302__________________________________________________\u0003|")
end

it '!ansirain return max chance' do
send_message 'ansirain Paris'
expect(replies.last).to include('max 100%')
end

it '!ansirain no minutes' do
allow(RestClient).to receive(:get) { File.open('spec/mock_weather_no_minute.json').read }
send_message 'ansirain'
Expand Down

0 comments on commit f1b1da8

Please sign in to comment.