Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to rubocop 0.35 #63

Merged
merged 1 commit into from
Apr 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions fluent-plugin-google-cloud.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ eos
gem.version = '0.4.16'
gem.authors = ['Todd Derr', 'Alex Robinson']
gem.email = ['salty@google.com']

gem.required_ruby_version = Gem::Requirement.new('>= 2.0')

gem.files = Dir['**/*'].keep_if { |file| File.file?(file) }
gem.test_files = gem.files.grep(/^(test)/)
gem.require_paths = ['lib']
gem.required_ruby_version = Gem::Requirement.new('>= 2.0')

gem.add_runtime_dependency 'fluentd', '~> 0.10'
gem.add_runtime_dependency 'google-api-client', '> 0.9'
Expand All @@ -28,7 +26,7 @@ eos

gem.add_development_dependency 'mocha', '~> 1.1'
gem.add_development_dependency 'rake', '~> 10.3'
gem.add_development_dependency 'rubocop', '= 0.34.2'
gem.add_development_dependency 'rubocop', '= 0.35.0'
gem.add_development_dependency 'webmock', '~> 1.17'
gem.add_development_dependency 'test-unit', '~> 3.0'
end
10 changes: 5 additions & 5 deletions lib/fluent/plugin/out_google_cloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,11 @@ def detect_platform

begin
open('http://' + METADATA_SERVICE_ADDR) do |f|
if (f.meta['metadata-flavor'] == 'Google')
if f.meta['metadata-flavor'] == 'Google'
@log.info 'Detected GCE platform'
return Platform::GCE
end
if (f.meta['server'] == 'EC2ws')
if f.meta['server'] == 'EC2ws'
@log.info 'Detected EC2 platform'
return Platform::EC2
end
Expand Down Expand Up @@ -765,7 +765,7 @@ def set_payload(record, entry, is_container_json)
end
end

def log_name(tag, commonLabels)
def log_name(tag, common_labels)
if @service_name == CLOUDFUNCTIONS_SERVICE
return 'cloud-functions'
elsif @running_on_managed_vm
Expand All @@ -775,8 +775,8 @@ def log_name(tag, commonLabels)
# For Kubernetes logs, use just the container name as the log name
# if we have it.
container_name_key = "#{CONTAINER_SERVICE}/container_name"
if commonLabels && commonLabels.key?(container_name_key)
return commonLabels[container_name_key]
if common_labels && common_labels.key?(container_name_key)
return common_labels[container_name_key]
end
end
tag
Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_out_google_cloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ def verify_log_entries(n, params, payload_type = 'textPayload')
assert entry.key?(payload_type), 'Entry did not contain expected ' \
"#{payload_type} key: " + entry.to_s
# Check the payload for textPayload, otherwise it's up to the caller.
if (payload_type == 'textPayload')
if payload_type == 'textPayload'
assert_equal "test log entry #{i}", entry['textPayload'], batch
end
end
Expand Down