Sha256: 3ab08476d9ec3ab309d523b888a4b18cd8b24dacec282177464b1fdeaa08ec64

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

#!/usr/bin/env rake

require 'bundler'
Bundler::GemHelper.install_tasks

require 'rake/testtask'
require 'rubocop/rake_task'

desc 'Run Rubocop to check for style violations'
RuboCop::RakeTask.new

desc 'Run unit tests'
Rake::TestTask.new(:test) do |test|
  test.libs << 'lib' << 'test'
  test.test_files = FileList['test/plugin/*.rb']
  test.verbose = true
end

# Building the gem will use the local file mode, so ensure it's world-readable.
# https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud/issues/53
desc 'Fix file permissions'
task :fix_perms do
  files = [
    'lib/fluent/plugin/*.rb',
    'lib/google/**/*.rb'
  ].flat_map do |file|
    file.include?('*') ? Dir.glob(file) : [file]
  end

  files.each do |file|
    mode = File.stat(file).mode & 0o777
    next unless mode & 0o444 != 0o444

    puts "Changing mode of #{file} from #{mode.to_s(8)} to "\
         "#{(mode | 0o444).to_s(8)}"
    chmod mode | 0o444, file
  end
end

desc 'Run unit tests and RuboCop to check for style violations'
task all: %i[rubocop test fix_perms]

task default: :all

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
fluent-plugin-google-cloud-0.13.3 Rakefile
fluent-plugin-google-cloud-0.13.2 Rakefile
fluent-plugin-vadimberezniker-gcp-0.1.2 Rakefile
fluent-plugin-vadimberezniker-gcp-0.1.1 Rakefile
fluent-plugin-vadimberezniker-gcp-0.1.0 Rakefile
fluent-plugin-google-cloud-0.13.1 Rakefile
fluent-plugin-google-cloud-0.13.0 Rakefile
fluent-plugin-google-cloud-0.12.11 Rakefile