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