From 981e5515b8d4cc2bd6965ebb19e630a48fdb5f7e Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Wed, 4 Oct 2017 19:21:55 -0700 Subject: [PATCH] Rubocop + add licenses --- .rubocop.yml | 6 +++--- Gemfile | 1 - Rakefile | 1 - lib/thermite/cargo.rb | 5 ++--- lib/thermite/config.rb | 1 - lib/thermite/custom_binary.rb | 1 - lib/thermite/fiddle.rb | 1 - lib/thermite/github_release_binary.rb | 1 - lib/thermite/package.rb | 1 - lib/thermite/tasks.rb | 1 - lib/thermite/util.rb | 1 - test/lib/thermite/cargo_test.rb | 19 +++++++++++++++++ test/lib/thermite/config_test.rb | 19 +++++++++++++++++ test/lib/thermite/custom_binary_test.rb | 21 ++++++++++++++++++- .../thermite/github_release_binary_test.rb | 1 - test/lib/thermite/package_test.rb | 19 +++++++++++++++++ test/lib/thermite/util_test.rb | 19 +++++++++++++++++ test/test_helper.rb | 19 +++++++++++++++++ 18 files changed, 120 insertions(+), 17 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 7d092d9..5f25920 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,9 @@ AllCops: - 'vendor/**/*' TargetRubyVersion: 2.1 +Layout/EmptyLineAfterMagicComment: + Enabled: false + Lint/EndAlignment: Enabled: true EnforcedStyleAlignWith: variable @@ -25,9 +28,6 @@ Metrics/LineLength: Metrics/MethodLength: Max: 20 -Style/EmptyLineAfterMagicComment: - Enabled: false - # When support for Ruby < 2.3 is dropped, re-enable Style/IndentHeredoc: Enabled: false diff --git a/Gemfile b/Gemfile index c218106..0f7544c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- # frozen_string_literal: true source 'https://rubygems.org' diff --git a/Rakefile b/Rakefile index 3580c5d..3171a34 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- # frozen_string_literal: true # # Copyright (c) 2016 Mark Lee and contributors diff --git a/lib/thermite/cargo.rb b/lib/thermite/cargo.rb index 07901b7..c269a59 100644 --- a/lib/thermite/cargo.rb +++ b/lib/thermite/cargo.rb @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- # frozen_string_literal: true # # Copyright (c) 2016 Mark Lee and contributors @@ -86,12 +85,12 @@ def inform_user_about_cargo # `require_severity` is the verb that indicates how important Rust is to the library. # def cargo_msg(require_severity) - <s/%s') mock_module.config.stubs(:toml).returns(package: { version: '4.5.6' }) Net::HTTP.stubs(:get_response).returns('location' => 'redirect') mock_module.stubs(:http_get).returns('tarball') diff --git a/test/lib/thermite/github_release_binary_test.rb b/test/lib/thermite/github_release_binary_test.rb index 31863fd..089b2e1 100644 --- a/test/lib/thermite/github_release_binary_test.rb +++ b/test/lib/thermite/github_release_binary_test.rb @@ -1,4 +1,3 @@ -# -*- encoding: utf-8 -*- # frozen_string_literal: true # # Copyright (c) 2016, 2017 Mark Lee and contributors diff --git a/test/lib/thermite/package_test.rb b/test/lib/thermite/package_test.rb index a3dea48..ce00ba8 100644 --- a/test/lib/thermite/package_test.rb +++ b/test/lib/thermite/package_test.rb @@ -1,3 +1,22 @@ +# frozen_string_literal: true +# +# Copyright (c) 2016, 2017 Mark Lee and contributors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +# associated documentation files (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, publish, distribute, +# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all copies or +# substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT +# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + require 'fileutils' require 'tmpdir' require 'test_helper' diff --git a/test/lib/thermite/util_test.rb b/test/lib/thermite/util_test.rb index 9962055..80b48a6 100644 --- a/test/lib/thermite/util_test.rb +++ b/test/lib/thermite/util_test.rb @@ -1,3 +1,22 @@ +# frozen_string_literal: true +# +# Copyright (c) 2016, 2017 Mark Lee and contributors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +# associated documentation files (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, publish, distribute, +# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all copies or +# substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT +# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + require 'tempfile' require 'test_helper' require 'thermite/util' diff --git a/test/test_helper.rb b/test/test_helper.rb index 4e39583..e83bf0a 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,22 @@ +# frozen_string_literal: true +# +# Copyright (c) 2016, 2017 Mark Lee and contributors +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +# associated documentation files (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, publish, distribute, +# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all copies or +# substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT +# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + require 'simplecov' SimpleCov.start do load_profile 'test_frameworks'