Skip to content

Commit

Permalink
Merge pull request #6 from RoboticCheese/jdh-update-deps
Browse files Browse the repository at this point in the history
Update the dependencies
  • Loading branch information
hartmantis committed Feb 28, 2017
2 parents 42fe4a2 + 9c32736 commit 38ff4d1
Show file tree
Hide file tree
Showing 47 changed files with 461 additions and 431 deletions.
12 changes: 12 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-02-14 12:46:54 -0800 using RuboCop version 0.47.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 6
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 77
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ before_script:
- cp .kitchen.travis.yml .kitchen.local.yml

script:
- chef exec rake && chef exec kitchen test
- chef exec bundle exec rake && chef exec bundle exec kitchen test
18 changes: 11 additions & 7 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true

source 'https://supermarket.chef.io'

metadata

cookbook 'private-internet-access_test',
path: 'test/fixtures/cookbooks/private-internet-access_test'
cookbook 'private_internet_access_test',
path: 'spec/support/cookbooks/private_internet_access_test'
cookbook 'private_internet_access_app_test',
path: 'spec/support/cookbooks/private_internet_access_app_test'
group :unit do
cookbook 'resource_test',
path: 'spec/support/cookbooks/resource_test'
end

group :integration do
cookbook 'private-internet-access_test',
path: 'test/fixtures/cookbooks/private-internet-access_test'
end
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
Private Internet Access Cookbook CHANGELOG
==========================================

v?.?.? (????-??-??)
-------------------
Unreleased
----------
- Remove the windows cookbook dep and update the dmg dep
- Update the installer script path for MacOS

v1.0.0 (2015-11-28)
-------------------
Expand Down
24 changes: 12 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true

source 'https://rubygems.org'

group :development do
gem 'yard-chef'
gem 'guard'
gem 'guard-foodcritic'
gem 'guard-rspec'
gem 'guard-kitchen'
gem 'guard-rspec'
gem 'yard-chef'
end

group :test do
gem 'rake'
gem 'rubocop'
gem 'foodcritic'
gem 'rspec'
gem 'chefspec'
gem 'simplecov'
gem 'simplecov-console'
gem 'coveralls'
gem 'fauxhai'
gem 'test-kitchen'
gem 'foodcritic'
gem 'kitchen-localhost'
gem 'kitchen-vagrant'
gem 'winrm-transport'
gem 'rake'
gem 'rspec'
gem 'rubocop'
gem 'simplecov'
gem 'simplecov-console'
gem 'test-kitchen'
gem 'winrm-fs'
end

Expand All @@ -36,6 +36,6 @@ group :deploy do
end

group :production do
gem 'chef', '>= 12.5'
gem 'berkshelf'
gem 'chef', '>= 12.6'
end
3 changes: 2 additions & 1 deletion Guardfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true

guard :rspec, all_on_start: true, notification: false do
watch(%r{^spec/.+_spec\.rb$})
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ It consumes the [dmg](https://supermarket.chef.io/cookbooks/dmg) and
[windows](https://supermarket.chef.io/cookbooks/windows) cookbooks to support
OS X and Windows installs.

As of v1.0.0, it uses custom resources that require Chef 12.5 or greater.
As of v1.1.0, it uses custom resources that require Chef 12.6 or greater.

Usage
=====
Expand Down Expand Up @@ -115,7 +115,7 @@ License & Authors
=================
- Author: Jonathan Hartman <j@p4nt5.com>

Copyright 2014-2015 Jonathan Hartman
Copyright 2014-2017, Jonathan Hartman

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true

require 'rubygems'
require 'bundler/setup'
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ build_script:
- copy .kitchen.appveyor.yml .kitchen.local.yml

test_script:
- chef exec kitchen test
- chef exec bundle exec kitchen test
5 changes: 3 additions & 2 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true
#
# Cookbook Name:: private-internet-access
# Attributes:: default
#
# Copyright 2014-2015 Jonathan Hartman
# Copyright 2014-2017, Jonathan Hartman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
5 changes: 3 additions & 2 deletions libraries/matchers.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true
#
# Cookbook Name:: private-internet-access
# Library:: matchers
#
# Copyright 2014-2015 Jonathan Hartman
# Copyright 2014-2017, Jonathan Hartman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
5 changes: 3 additions & 2 deletions libraries/resource_private_internet_access.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true
#
# Cookbook Name:: private-internet-access
# Library:: resource_private_internet_access
#
# Copyright 2014-2015 Jonathan Hartman
# Copyright 2014-2017, Jonathan Hartman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
5 changes: 3 additions & 2 deletions libraries/resource_private_internet_access_app.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true
#
# Cookbook Name:: private-internet-access
# Library:: resource_private_internet_access_app
#
# Copyright 2014-2015 Jonathan Hartman
# Copyright 2014-2017, Jonathan Hartman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
7 changes: 4 additions & 3 deletions libraries/resource_private_internet_access_app_mac_os_x.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true
#
# Cookbook Name:: private-internet-access
# Library:: resource_private_internet_access_app_mac_os_x
#
# Copyright 2014-2015 Jonathan Hartman
# Copyright 2014-2017, Jonathan Hartman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -46,7 +47,7 @@ class PrivateInternetAccessAppMacOsX < PrivateInternetAccessApp
execute 'Run PIA installer' do
command ::File.join(Chef::Config[:file_cache_path],
'Private\\ Internet\\ Access\\ Installer.app',
'Contents/MacOS/runner')
'Contents/MacOS/runner.sh')
creates PATH
end
end
Expand Down
24 changes: 14 additions & 10 deletions libraries/resource_private_internet_access_app_windows.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true
#
# Cookbook Name:: private-internet-access
# Library:: resource_private_internet_access_app_windows
#
# Copyright 2014-2015 Jonathan Hartman
# Copyright 2014-2017, Jonathan Hartman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -19,6 +20,8 @@
#

require 'chef/resource'
require 'chef/resource/windows_package'
require 'chef/provider/package/windows'
require_relative 'resource_private_internet_access_app'

class Chef
Expand Down Expand Up @@ -55,9 +58,14 @@ class PrivateInternetAccessAppWindows < PrivateInternetAccessApp
# and let Chef handle any timeouts.
ruby_block 'Wait for PIA installer' do
block do
r = windows_package('Private Internet Access Support Files')
p = Chef::Provider::WindowsCookbookPackage.new(r, run_context)
sleep 1 until p.current_installed_version
r = Chef::Resource::WindowsPackage.new(
'Private Internet Access Support Files'
)
until Chef::Provider::Package::Windows.new(r, run_context)
.package_provider
.installed_version
sleep 1
end
end
end
end
Expand All @@ -67,13 +75,9 @@ class PrivateInternetAccessAppWindows < PrivateInternetAccessApp
# behind.
#
action :remove do
windows_package 'Private Internet Access Support Files' do
package 'Private Internet Access Support Files' do
action :remove
end
directory PATH do
recursive true
action :delete
end
end

#
Expand Down
7 changes: 4 additions & 3 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true

name 'private-internet-access'
maintainer 'Jonathan Hartman'
Expand All @@ -7,13 +8,13 @@
description 'Installs/configures the Private Internet Access VPN app'
long_description 'Installs/configures the Private Internet Access VPN app'
version '1.0.1'
chef_version '>= 12.6'

source_url 'https://github.com/roboticcheese/private-internet-access-chef'
issues_url 'https://github.com/roboticcheese/private-internet-access-chef/' \
'issues'

depends 'dmg', '~> 2.2'
depends 'windows', '~> 1.36'
depends 'dmg', '~> 3.1'

supports 'mac_os_x'
supports 'windows'
5 changes: 3 additions & 2 deletions recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true
#
# Cookbook Name:: private-internet-access
# Recipe:: default
#
# Copyright 2014-2015 Jonathan Hartman
# Copyright 2014-2017, Jonathan Hartman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
8 changes: 5 additions & 3 deletions spec/recipes/default_spec.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Encoding: UTF-8
# encoding: utf-8
# frozen_string_literal: true

require 'spec_helper'

describe 'private-internet-access::default' do
let(:platform) { { platform: 'mac_os_x', version: '10.10' } }
let(:source) { nil }
let(:runner) do
ChefSpec::ServerRunner.new do |node|
ChefSpec::ServerRunner.new(platform) do |node|
unless source.nil?
node.set['private_internet_access']['app']['source'] = source
node.normal['private_internet_access']['app']['source'] = source
end
end
end
Expand Down
25 changes: 25 additions & 0 deletions spec/resources.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# encoding: utf-8
# frozen_string_literal: true

require_relative 'spec_helper'

shared_context 'resources' do
%i(resource name platform platform_version action).each { |p| let(p) { nil } }
let(:properties) { {} }
let(:runner) do
ChefSpec::SoloRunner.new(
step_into: resource, platform: platform, version: platform_version
) do |node|
%i(resource name action).each do |p|
next if send(p).nil?
node.default['resource_test'][p] = send(p)
end
properties.each do |k, v|
next if v.nil?
node.default['resource_test']['properties'][k] = v
end
end
end
let(:converge) { runner.converge('resource_test') }
let(:chef_run) { converge }
end
Loading

0 comments on commit 38ff4d1

Please sign in to comment.