summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-07-30 18:11:27 -0700
committerGitHub <noreply@github.com>2018-07-30 18:11:27 -0700
commita721ab468daa216719b0d877c347200cfacd2de7 (patch)
tree5151405bc0ff0e186a4c869184aca73793ff9660
parent5799e62ec161d092a29a832d6132015f8a0f5b7f (diff)
parentaa04176a2298bf44f45eb3a76172103ba4d2d04a (diff)
downloadmixlib-authentication-a721ab468daa216719b0d877c347200cfacd2de7.tar.gz
Merge pull request #41 from chef/cleanup
Update testing boilerplate
-rw-r--r--.github/ISSUE_TEMPLATE.md21
-rw-r--r--.gitignore29
-rw-r--r--.travis.yml8
-rw-r--r--Gemfile28
-rw-r--r--README.md18
-rw-r--r--Rakefile26
-rw-r--r--lib/mixlib/authentication.rb4
-rw-r--r--lib/mixlib/authentication/digester.rb4
-rw-r--r--lib/mixlib/authentication/http_authentication_request.rb4
-rw-r--r--lib/mixlib/authentication/signatureverification.rb6
-rw-r--r--lib/mixlib/authentication/signedheaderauth.rb6
-rw-r--r--lib/mixlib/authentication/version.rb3
-rw-r--r--mixlib-authentication.gemspec5
-rw-r--r--spec/mixlib/authentication/digester_spec.rb17
-rw-r--r--spec/mixlib/authentication/http_authentication_request_spec.rb5
-rw-r--r--spec/mixlib/authentication/mixlib_authentication_spec.rb8
-rw-r--r--spec/spec_helper.rb6
17 files changed, 157 insertions, 41 deletions
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..f229e13
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,21 @@
+# Version:
+
+[Version of the project installed]
+
+# Environment: [Details about the environment such as the Operating System, cookbook details, etc...]
+
+# Scenario:
+
+[What you are trying to achieve and you can't?]
+
+# Steps to Reproduce:
+
+[If you are filing an issue what are the things we need to do in order to repro your problem?]
+
+# Expected Result:
+
+[What are you expecting to happen as the consequence of above reproduction steps?]
+
+# Actual Result:
+
+[What actually happens after the reproduction steps?]
diff --git a/.gitignore b/.gitignore
index 5036739..6ea052c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,27 @@
-pkg/
-*.swp
-
+_yardoc
+.bundle
+.config
+.DS_Store
+.idea
+.rake_tasks~
+.rspec
+.ruby-version
+.rvmrc
+.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 d5193e2..8134b8f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,8 +9,10 @@ before_install:
matrix:
include:
- - rvm: 2.5.1
+ - rvm: 2.2.10
+ - rvm: 2.3.7
- rvm: 2.4.4
+ - rvm: 2.5.1
- rvm: ruby-head
allow_failures:
- rvm: ruby-head
@@ -19,4 +21,6 @@ branches:
only:
- master
-script: bundle exec rake ci
+bundler_args: --without docs development
+
+script: bundle exec rake
diff --git a/Gemfile b/Gemfile
index c283b6a..13fafb8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,8 +1,32 @@
source "https://rubygems.org"
+
gemspec
-group(:development) do
- gem "pry"
+group :docs do
+ gem "yard"
+ gem "redcarpet"
+ gem "github-markup"
+end
+
+group :test do
+ gem "chefstyle", "=0.4.0" # pin needed until we drop Ruby 2.0/2.1 support
+ gem "rspec-core", "~> 3.2"
+ gem "rspec-mocks", "~> 3.2"
+ gem "rspec-expectations", "~> 3.2"
+ gem "rake"
gem "mixlib-log", "~> 2"
gem "net-ssh"
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 b777b18..6dd314b 100644
--- a/README.md
+++ b/README.md
@@ -3,9 +3,21 @@
Mixlib::Authentication provides a class-based header signing authentication object, like the one used in Chef.
-## License
-- Author:: Christopher Brown ([cb@chef.io](mailto:cb@chef.io))
-- Copyright:: Copyright (c) 2009-2016 Chef Software, Inc.
+## Documentation
+
+All documentation is written using YARD. You can generate a by running:
+
+```
+rake docs
+```
+
+## Contributing
+
+For information on contributing to this project please see our [Contributing Documentation](https://github.com/chef/chef/blob/master/CONTRIBUTING.md)
+
+## License & Copyright
+
+- Copyright:: Copyright (c) 2009-2018 Chef Software, Inc.
- License:: Apache License, Version 2.0
```text
diff --git a/Rakefile b/Rakefile
index 7be508e..d6c0027 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,9 +1,14 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"
-RSpec::Core::RakeTask.new(:spec)
+task default: [:style, :spec]
-task default: :spec
+Bundler::GemHelper.install_tasks
+
+desc "Run specs"
+RSpec::Core::RakeTask.new(:spec) do |spec|
+ spec.pattern = "spec/**/*_spec.rb"
+end
begin
require "chefstyle"
@@ -12,7 +17,20 @@ begin
task.options += ["--display-cop-names", "--no-color"]
end
rescue LoadError
- puts "chefstyle/rubocop is not available."
+ puts "chefstyle/rubocop is not available. bundle install first to make sure all dependencies are installed."
end
-task ci: [:style, :spec]
+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/authentication"
+ ARGV.clear
+ IRB.start
+end
diff --git a/lib/mixlib/authentication.rb b/lib/mixlib/authentication.rb
index b27e06e..167ed22 100644
--- a/lib/mixlib/authentication.rb
+++ b/lib/mixlib/authentication.rb
@@ -1,6 +1,6 @@
#
-# Author:: Christopher Brown (<cb@opscode.com>)
-# Copyright:: Copyright (c) 2009 Opscode, Inc.
+# Author:: Christopher Brown (<cb@chef.io>)
+# Copyright:: Copyright (c) 2009-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/mixlib/authentication/digester.rb b/lib/mixlib/authentication/digester.rb
index f826b4c..a4d6c5d 100644
--- a/lib/mixlib/authentication/digester.rb
+++ b/lib/mixlib/authentication/digester.rb
@@ -1,6 +1,6 @@
#
-# Author:: Christopher Brown (<cb@opscode.com>)
-# Copyright:: Copyright (c) 2009 Opscode, Inc.
+# Author:: Christopher Brown (<cb@chef.io>)
+# Copyright:: Copyright (c) 2009-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/mixlib/authentication/http_authentication_request.rb b/lib/mixlib/authentication/http_authentication_request.rb
index 32b8e72..967c0e3 100644
--- a/lib/mixlib/authentication/http_authentication_request.rb
+++ b/lib/mixlib/authentication/http_authentication_request.rb
@@ -1,6 +1,6 @@
#
-# Author:: Daniel DeLeo (<dan@opscode.com>)
-# Copyright:: Copyright (c) 2010 Opscode, Inc.
+# Author:: Daniel DeLeo (<dan@chef.io>)
+# Copyright:: Copyright (c) 2010-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/mixlib/authentication/signatureverification.rb b/lib/mixlib/authentication/signatureverification.rb
index 33094d2..1dfafd6 100644
--- a/lib/mixlib/authentication/signatureverification.rb
+++ b/lib/mixlib/authentication/signatureverification.rb
@@ -1,7 +1,7 @@
#
-# Author:: Christopher Brown (<cb@opscode.com>)
-# Author:: Christopher Walters (<cw@opscode.com>)
-# Copyright:: Copyright (c) 2009, 2010 Opscode, Inc.
+# Author:: Christopher Brown (<cb@chef.io>)
+# Author:: Christopher Walters (<cw@chef.io>)
+# Copyright:: Copyright (c) 2009-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/mixlib/authentication/signedheaderauth.rb b/lib/mixlib/authentication/signedheaderauth.rb
index 7df3555..2a54c76 100644
--- a/lib/mixlib/authentication/signedheaderauth.rb
+++ b/lib/mixlib/authentication/signedheaderauth.rb
@@ -1,7 +1,7 @@
#
-# Author:: Christopher Brown (<cb@opscode.com>)
-# Author:: Christopher Walters (<cw@opscode.com>)
-# Copyright:: Copyright (c) 2009, 2010 Opscode, Inc.
+# Author:: Christopher Brown (<cb@chef.io>)
+# Author:: Christopher Walters (<cw@chef.io>)
+# Copyright:: Copyright (c) 2009-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/mixlib/authentication/version.rb b/lib/mixlib/authentication/version.rb
index 4f8ae82..d0e4ce5 100644
--- a/lib/mixlib/authentication/version.rb
+++ b/lib/mixlib/authentication/version.rb
@@ -1,4 +1,5 @@
-# Copyright:: Copyright (c) 2010-2015 Chef Software, Inc.
+#
+# Copyright:: Copyright (c) 2010-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/mixlib-authentication.gemspec b/mixlib-authentication.gemspec
index 0830546..4f2b9e3 100644
--- a/mixlib-authentication.gemspec
+++ b/mixlib-authentication.gemspec
@@ -4,7 +4,6 @@ require "mixlib/authentication/version"
Gem::Specification.new do |s|
s.name = "mixlib-authentication"
s.version = Mixlib::Authentication::VERSION
- s.platform = Gem::Platform::RUBY
s.summary = "Mixes in simple per-request authentication"
s.description = s.summary
s.license = "Apache-2.0"
@@ -15,8 +14,4 @@ Gem::Specification.new do |s|
s.require_path = "lib"
s.files = %w{LICENSE README.md Gemfile Rakefile NOTICE} + Dir.glob("*.gemspec") +
Dir.glob("{lib,spec}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
-
- %w{rspec-core rspec-expectations rspec-mocks}.each { |gem| s.add_development_dependency gem, "~> 3.2" }
- s.add_development_dependency "chefstyle"
- s.add_development_dependency "rake", "~> 11"
end
diff --git a/spec/mixlib/authentication/digester_spec.rb b/spec/mixlib/authentication/digester_spec.rb
index 4688d5c..c54efa5 100644
--- a/spec/mixlib/authentication/digester_spec.rb
+++ b/spec/mixlib/authentication/digester_spec.rb
@@ -1,3 +1,20 @@
+#
+# Copyright:: Copyright (c) 2018 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# 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.
+#
+
require "mixlib/authentication/digester"
describe Mixlib::Authentication::Digester do
diff --git a/spec/mixlib/authentication/http_authentication_request_spec.rb b/spec/mixlib/authentication/http_authentication_request_spec.rb
index 7c45df1..d62d67e 100644
--- a/spec/mixlib/authentication/http_authentication_request_spec.rb
+++ b/spec/mixlib/authentication/http_authentication_request_spec.rb
@@ -1,5 +1,6 @@
-# Author:: Daniel DeLeo (<dan@opscode.com>)
-# Copyright:: Copyright (c) 2010 Opscode, Inc.
+#
+# Author:: Daniel DeLeo (<dan@chef.io>)
+# Copyright:: Copyright (c) 2010-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/mixlib/authentication/mixlib_authentication_spec.rb b/spec/mixlib/authentication/mixlib_authentication_spec.rb
index 6985741..7d9b484 100644
--- a/spec/mixlib/authentication/mixlib_authentication_spec.rb
+++ b/spec/mixlib/authentication/mixlib_authentication_spec.rb
@@ -1,8 +1,8 @@
#
-# Author:: Tim Hinderliter (<tim@opscode.com>)
-# Author:: Christopher Walters (<cw@opscode.com>)
-# Author:: Christopher Brown (<cb@opscode.com>)
-# Copyright:: Copyright (c) 2009, 2010 Opscode, Inc.
+# Author:: Tim Hinderliter (<tim@chef.io>)
+# Author:: Christopher Walters (<cw@chef.io>)
+# Author:: Christopher Brown (<cb@chef.io>)
+# Copyright:: Copyright (c) 2009-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index be55155..4fd27f0 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,7 +1,7 @@
#
-# Author:: Tim Hinderliter (<tim@opscode.com>)
-# Author:: Christopher Walters (<cw@opscode.com>)
-# Copyright:: Copyright (c) 2009, 2010 Opscode, Inc.
+# Author:: Tim Hinderliter (<tim@chef.io>)
+# Author:: Christopher Walters (<cw@chef.io>)
+# Copyright:: Copyright (c) 2009-2018 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");