diff --git a/README.md b/README.md index 2f8f5a6..617f9cd 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,5 @@ Or deploy it! bundle install bundle exec rackup # Launch Dajare server ``` + +hogehoge diff --git a/src/dajare/app.rb b/src/dajare/app.rb index e49d5f6..5da724c 100755 --- a/src/dajare/app.rb +++ b/src/dajare/app.rb @@ -1,4 +1,6 @@ -require "cgi" +# frozen_string_literal: true + +require 'cgi' require 'sinatra/base' require 'sinatra/json' require 'pebbles/dajare' @@ -8,18 +10,18 @@ module Dajare class App < Sinatra::Base set :erb, layout: true - set :views, File.expand_path('./views', __dir__) + set :views, File.expand_path('./views', __dir__) set :public_folder, File.expand_path('../../public', __dir__) enable :logging helpers Dajare::Helpers - get "/" do + get '/' do if params[:text] logger.info params[:text] @original = params[:text] - @original.chomp! if @original + @original&.chomp! @dajare = dajarize(@original.chomp).sample end