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

Test on all the Ruby versions we support #43

Merged
merged 4 commits into from
Jul 30, 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
5 changes: 3 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Style/HashSyntax:
Enabled: true
Style/PreferredHashMethods:
Exclude:
- 'lib/mixlib/log/formatter.rb'
24 changes: 17 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
sudo: false
language: ruby
cache: bundler
sudo: false
rvm:
- 2.4.3
- 2.5.0

matrix:
include:
- rvm: 2.2.10
- rvm: 2.3.7
- rvm: 2.4.4
- rvm: 2.5.1
- rvm: ruby-head
allow_failures:
- rvm: ruby-head

branches:
only:
- master
script:
- bundle exec rake
- master

bundler_args: --without docs development

script: bundle exec rake
25 changes: 23 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,28 @@ source "https://rubygems.org"

gemspec

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.7"
gem "cucumber"
gem "rake"
end

group :development do
gem "rdoc"
gem "bundler"
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")
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,21 @@ Log.init('/tmp/logfile', 7) # log to /tmp/logfile, rotate every day

Enjoy!

## Documentation

All documentation is written using YARD. You can generate a by running:

```
rake docs
```

## Contributing

For information on contributing to this project see <https://github.com/chef/chef/blob/master/CONTRIBUTING.md>
For information on contributing to this project please see our [Contributing Documentation](https://github.com/chef/chef/blob/master/CONTRIBUTING.md)

## License
## License & Copyright

- Copyright:: Copyright (c) 2008-2016 Chef Software, Inc.
- Copyright:: Copyright (c) 2008-2018 Chef Software, Inc.
- License:: Apache License, Version 2.0

```text
Expand Down
33 changes: 20 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
require "bundler/gem_tasks"
require "rdoc/task"
require "rspec/core/rake_task"
require "cucumber/rake/task"

RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = "spec/**/*_spec.rb"
end

task default: [:style, :spec, :features]

# For rubygems-test
task test: :spec
Bundler::GemHelper.install_tasks

RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = "rdoc"
rdoc.title = "mixlib-log #{Mixlib::Log::VERSION}"
rdoc.rdoc_files.include("README*")
rdoc.rdoc_files.include("lib/**/*.rb")
desc "Run specs"
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = "spec/**/*_spec.rb"
end

Cucumber::Rake::Task.new(:features) do |t|
Expand All @@ -30,5 +22,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 "yard"
YARD::Rake::YardocTask.new(:docs)
rescue LoadError
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/log"
ARGV.clear
IRB.start
end
2 changes: 1 addition & 1 deletion lib/mixlib/log/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Mixlib
module Log
VERSION = "2.0.6"
VERSION = "2.0.6".freeze
end
end
6 changes: 0 additions & 6 deletions mixlib-log.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ require "mixlib/log/version"
Gem::Specification.new do |gem|
gem.name = "mixlib-log"
gem.version = Mixlib::Log::VERSION
gem.platform = Gem::Platform::RUBY
gem.summary = "A gem that provides a simple mixin for log functionality"
gem.email = "[email protected]"
gem.homepage = "https://www.chef.io"
gem.license = "Apache-2.0"
gem.authors = ["Chef Software, Inc."]
gem.has_rdoc = true
gem.extra_rdoc_files = ["README.md", "LICENSE", "NOTICE"]
gem.files = Dir["lib/**/*"] + Dir["spec/**/*"] + ["Gemfile", "Rakefile", ".gemtest", "mixlib-log.gemspec"]
gem.required_ruby_version = ">= 2.2"
gem.add_development_dependency "rake"
gem.add_development_dependency "rspec", "~> 3.7"
gem.add_development_dependency "chefstyle"
gem.add_development_dependency "cucumber"
end