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

Move deps to the Gemfile and expand Rake tasks #25

Merged
merged 1 commit into from
Jul 27, 2018
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
36 changes: 27 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ 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
- bundle --version
- gem update --system
- gem --version

script:
- bundle exec rake ci
script: bundle exec rake
26 changes: 25 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -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")
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/chef/mixlib-archive>. 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.
```
31 changes: 18 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
2 changes: 1 addition & 1 deletion lib/mixlib/archive/tar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Mixlib
class Archive
class Tar
TAR_LONGLINK = "././@LongLink"
TAR_LONGLINK = "././@LongLink".freeze

attr_reader :options
attr_reader :archive
Expand Down
2 changes: 1 addition & 1 deletion lib/mixlib/archive/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Mixlib
class Archive
VERSION = "0.4.9"
VERSION = "0.4.9".freeze
end
end
5 changes: 1 addition & 4 deletions mixlib-archive.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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