fix lint errors
This commit is contained in:
parent
93e86e0f17
commit
5c2c7ec3b7
2
app.rb
2
app.rb
@ -432,7 +432,7 @@ get "/chunked/:delay" do
|
||||
delay = Float(params[:delay])
|
||||
stream do |out|
|
||||
30.times do |i|
|
||||
out << jsonify({id: i, message: i % 2 == 0 ? "tick" : "tock"})
|
||||
out << jsonify({id: i, message: (i % 2).zero? ? "tick" : "tock"})
|
||||
sleep delay
|
||||
end
|
||||
end
|
||||
|
@ -31,9 +31,8 @@ class Config
|
||||
end
|
||||
|
||||
def to_json(options = nil)
|
||||
if options &&
|
||||
options.key?(:pretty) &&
|
||||
options[:pretty] == true
|
||||
if options&.key?(:pretty) &&
|
||||
options[:pretty] == true
|
||||
JSON.pretty_generate as_json(options)
|
||||
else
|
||||
JSON.generate as_json(options)
|
||||
|
@ -4,7 +4,7 @@ $LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
|
||||
|
||||
require "sensitive"
|
||||
|
||||
ALPHABET = ('a' .. 'z').reduce(:concat)
|
||||
ALPHABET = ("a".."z").reduce(:concat)
|
||||
|
||||
describe "Sensitive" do
|
||||
before do
|
||||
@ -20,7 +20,7 @@ describe "Sensitive" do
|
||||
end
|
||||
|
||||
it "test using different mask character" do
|
||||
s = Sensitive.new ALPHABET, ch: "x"
|
||||
s = Sensitive.new ALPHABET, ch: "x"
|
||||
_(s.to_s).must_equal "x"
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user