Sha256: 9ad3c72daaaefb800d9664502f0fe1212cc3fa2590acbbc0d522a8a8261bc686

Contents?: true

Size: 1.05 KB

Versions: 71

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 & 0777
    next unless mode & 0444 != 0444
    puts "Changing mode of #{file} from #{mode.to_s(8)} to "\
         "#{(mode | 0444).to_s(8)}"
    chmod mode | 0444, file
  end
end

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

task default: :all

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
fluent-plugin-google-cloud-0.12.10 Rakefile
fluent-plugin-google-cloud-0.12.9 Rakefile
fluent-plugin-google-cloud-0.12.8 Rakefile
fluent-plugin-google-cloud-0.12.7 Rakefile
fluent-plugin-google-cloud-0.12.6 Rakefile
fluent-plugin-google-cloud-0.12.5 Rakefile
fluent-plugin-google-cloud-0.12.5.rc.1 Rakefile
fluent-plugin-google-cloud-0.12.4 Rakefile
fluent-plugin-google-cloud-0.12.3 Rakefile
fluent-plugin-google-cloud-0.12.2 Rakefile
fluent-plugin-google-cloud-0.12.1 Rakefile
fluent-plugin-google-cloud-0.12.0 Rakefile
fluent-plugin-google-cloud-0.11.1 Rakefile
fluent-plugin-google-cloud-0.11.0 Rakefile
fluent-plugin-google-cloud-0.10.9 Rakefile
fluent-plugin-google-cloud-0.10.8 Rakefile
fluent-plugin-google-cloud-0.10.7 Rakefile
fluent-plugin-google-cloud-0.10.6 Rakefile
fluent-plugin-google-cloud-0.10.5 Rakefile
fluent-plugin-google-cloud-0.10.4 Rakefile