diff --git a/.gitignore b/.gitignore index 0cb6eeb..803f56c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,27 @@ -/.bundle/ -/.yardoc -/Gemfile.lock -/_yardoc/ -/coverage/ -/doc/ -/pkg/ -/spec/reports/ -/tmp/ +_yardoc +.bundle +.config +.DS_Store +.idea +.rvmrc +.rake_tasks~ +.rspec +.ruby-version +.yardoc +.yardopts +*.gem +*.rbc +*.sw? +bin/ +coverage +doc +Gemfile.local +Gemfile.lock +InstalledFiles +lib/bundler/man +pkg +spec/reports +test/tmp +test/version_tmp +tmp +vendor diff --git a/.travis.yml b/.travis.yml index 1111476..439e848 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,16 +9,18 @@ addons: matrix: include: + - rvm: 2.3.7 - rvm: 2.4.4 - rvm: 2.5.1 - rvm: ruby-head allow_failures: - rvm: ruby-head + branches: only: - master -bundler_args: --without changelog +bundler_args: --without docs development before_install: - gem install bundler @@ -26,5 +28,4 @@ before_install: - gem update --system - gem --version -script: - - bundle exec rake ci +script: bundle exec rake diff --git a/Gemfile b/Gemfile index c54a684..fd39b75 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,30 @@ source "https://rubygems.org" -# Specify your gem's dependencies in mixlib-archive.gemspec gemspec gem "ffi-libarchive" + +group :docs do + gem "yard" + gem "redcarpet" + gem "github-markup" +end + +group :test do + gem "chefstyle", git: "https://github.com/chef/chefstyle.git", branch: "master" + gem "rspec", "~> 3.0" + gem "rake" +end + +group :development do + gem "pry" + gem "pry-byebug" + gem "pry-stack_explorer" + gem "rb-readline" +end + +instance_eval(ENV["GEMFILE_MOD"]) if ENV["GEMFILE_MOD"] + +# If you want to load debugging tools into the bundle exec sandbox, +# add these additional dependencies into Gemfile.local +eval_gemfile(__FILE__ + ".local") if File.exist?(__FILE__ + ".local") diff --git a/README.md b/README.md index 89d1934..30119da 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,33 @@ tar.create(%w{ file.rb file2.rb }, gzip: true) After checking out the repo, run `bundle` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also run `bundle console` for an interactive prompt that will allow you to experiment. +## Documentation + +All documentation is written using YARD. You can generate a by running: + +``` +rake docs +``` + ## Contributing -Bug reports and pull requests are welcome on GitHub at . This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Community Guidelines](https://docs.chef.io/community_guidelines.html) code of conduct. +For information on contributing to this project please see our [Contributing Documentation](https://github.com/chef/chef/blob/master/CONTRIBUTING.md) -## License +## License & Copyright -The gem is available as open source under the terms of the Apache License, v2 +- Copyright:: Copyright (c) 2017-2018 Chef Software, Inc. +- License:: Apache License, Version 2.0 + +```text +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` diff --git a/Rakefile b/Rakefile index 853e9d2..d3a818f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,13 +1,14 @@ require "bundler/gem_tasks" require "rspec/core/rake_task" -require "mixlib/archive/version" -RSpec::Core::RakeTask.new(:spec) +task default: [:style, :spec] -task :default => :spec +Bundler::GemHelper.install_tasks -desc "Run tests for Travis CI" -task ci: [:style, :spec] +desc "Run specs" +RSpec::Core::RakeTask.new(:spec) do |spec| + spec.pattern = "spec/**/*_spec.rb" +end begin require "chefstyle" @@ -16,16 +17,20 @@ begin task.options += ["--display-cop-names", "--no-color"] end rescue LoadError - puts "chefstyle/rubocop is not available. gem install chefstyle to do style checking." + puts "chefstyle/rubocop is not available. bundle install first to make sure all dependencies are installed." end begin - require "github_changelog_generator/task" - - GitHubChangelogGenerator::RakeTask.new :changelog do |config| - config.issues = false - config.future_release = Mixlib::Archive::VERSION - end + require "yard" + YARD::Rake::YardocTask.new(:docs) rescue LoadError - puts "github_changelog_generator is not available. gem install github_changelog_generator to generate changelogs" + puts "yard is not available. bundle install first to make sure all dependencies are installed." +end + +task :console do + require "irb" + require "irb/completion" + require "mixlib/archive" + ARGV.clear + IRB.start end diff --git a/lib/mixlib/archive/tar.rb b/lib/mixlib/archive/tar.rb index 628b612..30c8f9e 100644 --- a/lib/mixlib/archive/tar.rb +++ b/lib/mixlib/archive/tar.rb @@ -5,7 +5,7 @@ module Mixlib class Archive class Tar - TAR_LONGLINK = "././@LongLink" + TAR_LONGLINK = "././@LongLink".freeze attr_reader :options attr_reader :archive diff --git a/lib/mixlib/archive/version.rb b/lib/mixlib/archive/version.rb index b71fdc6..fd6c306 100644 --- a/lib/mixlib/archive/version.rb +++ b/lib/mixlib/archive/version.rb @@ -1,5 +1,5 @@ module Mixlib class Archive - VERSION = "0.4.9" + VERSION = "0.4.9".freeze end end diff --git a/mixlib-archive.gemspec b/mixlib-archive.gemspec index 40e85e7..101ea43 100644 --- a/mixlib-archive.gemspec +++ b/mixlib-archive.gemspec @@ -12,13 +12,10 @@ Gem::Specification.new do |spec| spec.summary = %q{A simple interface to various archive formats} spec.description = spec.summary spec.homepage = "https://chef.io" - spec.license = "APACHE-2.0" + spec.license = "Apache-2.0" spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } spec.require_paths = ["lib"] - spec.add_development_dependency "rake", "~> 12" - spec.add_development_dependency "rspec", "~> 3.0" - spec.add_development_dependency "chefstyle" spec.add_dependency "mixlib-log" end