Skip to content

Commit

Permalink
Cleaning up some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
acant committed Apr 14, 2017
1 parent 0d33861 commit 78b2c88
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lib/gitdocs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ def self.log_error(message)

##############################################################################

private_class_method

# @return [void]
def self.init_log
return if @initialized
Expand All @@ -77,4 +75,5 @@ def self.init_log
Celluloid.logger.level = Initializer.verbose ? Logger::DEBUG : Logger::INFO
@initialized = true
end
private_class_method :init_log
end
4 changes: 2 additions & 2 deletions lib/gitdocs/browser_app.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- encoding : utf-8 -*-

require 'sinatra/base'
require 'uri'
require 'cgi'
require 'haml'
require 'mimetype_fu'
require 'gitdocs/rendering_helper'
Expand All @@ -27,7 +27,7 @@ def repository
def path
halt(404) unless repository
@path ||= Repository::Path.new(
repository, URI.decode(params[:splat].first)
repository, CGI.unescape(params[:splat].first)
)
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/gitdocs/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def restart
method_option :pid, type: :string, aliases: '-P'
method_option :interval, type: :numeric, aliases: '-i', default: 15
method_option :notification, type: :boolean, aliases: '-n', default: true
method_option :sync, type: :boolean, aliases: '-s', default: 'full'
method_option :sync, type: :string, aliases: '-s', default: 'full', enum: %w(full fetch)
def add(path)
Share.create_by_path!(
normalize_path(path),
Expand All @@ -83,7 +83,7 @@ def add(path)
method_option :pid, type: :string, aliases: '-P'
method_option :interval, type: :numeric, aliases: '-i', default: 15
method_option :notification, type: :boolean, aliases: '-n', default: true
method_option :sync, type: :boolean, aliases: '-s', default: 'full'
method_option :sync, type: :string, aliases: '-s', default: 'full', enum: %w(full fetch)
def create(path, remote)
Repository.clone(path, remote)
Share.create_by_path!(
Expand Down
5 changes: 4 additions & 1 deletion test/unit/notifier_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@
subject { notifier.disconnect }

describe 'not connected' do
before { subject }
before do
notifier.instance_variable_set(:@notifier, nil)
subject
end
it { notifier.instance_variable_get(:@notifier).must_equal(nil) }
end

Expand Down

0 comments on commit 78b2c88

Please sign in to comment.