-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from RoboticCheese/jdh-linux
Add support for a bunch of Linux platforms
- Loading branch information
Showing
23 changed files
with
531 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Encoding: UTF-8 | ||
# | ||
# Cookbook Name:: gimp | ||
# Library:: provider_gimp_app_debian | ||
# | ||
# Copyright 2015 Jonathan Hartman | ||
# | ||
# 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 'chef/provider/lwrp_base' | ||
require 'chef/dsl/include_recipe' | ||
require_relative 'provider_gimp_app' | ||
require_relative 'provider_gimp_app_package' | ||
|
||
class Chef | ||
class Provider | ||
class GimpApp < Provider::LWRPBase | ||
# A GIMP provider for Ubuntu/Debian. | ||
# | ||
# @author Jonathan Hartman <j@p4nt5.com> | ||
class Debian < GimpApp::Package | ||
include Chef::DSL::IncludeRecipe | ||
|
||
private | ||
|
||
# | ||
# Update APT's cache before trying to install the GIMP package. | ||
# | ||
# (see GimpApp::Package#install!) | ||
# | ||
def install! | ||
include_recipe 'apt' | ||
super | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Encoding: UTF-8 | ||
# | ||
# Cookbook Name:: gimp | ||
# Library:: provider_gimp_app_freebsd | ||
# | ||
# Copyright 2015 Jonathan Hartman | ||
# | ||
# 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 'chef/provider/lwrp_base' | ||
require 'chef/dsl/include_recipe' | ||
require_relative 'provider_gimp_app' | ||
require_relative 'provider_gimp_app_package' | ||
|
||
class Chef | ||
class Provider | ||
class GimpApp < Provider::LWRPBase | ||
# A GIMP provider for FreeBSD. | ||
# | ||
# @author Jonathan Hartman <j@p4nt5.com> | ||
class Freebsd < GimpApp::Package | ||
include Chef::DSL::IncludeRecipe | ||
|
||
private | ||
|
||
# | ||
# Update Ports before trying to install the GIMP package. | ||
# | ||
# (see GimpApp::Package#install!) | ||
# | ||
def install! | ||
include_recipe 'freebsd::portsnap' | ||
super | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Encoding: UTF-8 | ||
# | ||
# Cookbook Name:: gimp | ||
# Library:: provider_gimp_app_opensuse | ||
# | ||
# Copyright 2015 Jonathan Hartman | ||
# | ||
# 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 'chef/provider/lwrp_base' | ||
require 'chef/dsl/include_recipe' | ||
require_relative 'provider_gimp_app' | ||
require_relative 'provider_gimp_app_package' | ||
|
||
class Chef | ||
class Provider | ||
class GimpApp < Provider::LWRPBase | ||
# A GIMP provider for OpenSUSE. | ||
# | ||
# @author Jonathan Hartman <j@p4nt5.com> | ||
class Opensuse < GimpApp::Package | ||
include Chef::DSL::IncludeRecipe | ||
|
||
# | ||
# Update Zypper before trying to install the GIMP package. | ||
# | ||
# (see GimpApp::Package#install!) | ||
# | ||
def install! | ||
include_recipe 'zypper' | ||
super | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Encoding: UTF-8 | ||
# | ||
# Cookbook Name:: gimp | ||
# Library:: provider_gimp_app_package | ||
# | ||
# Copyright 2015 Jonathan Hartman | ||
# | ||
# 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 'chef/provider/lwrp_base' | ||
require_relative 'provider_gimp_app' | ||
|
||
class Chef | ||
class Provider | ||
class GimpApp < Provider::LWRPBase | ||
# A generic GIMP provider for package-based platforms. | ||
# | ||
# @author Jonathan Hartman <j@p4nt5.com> | ||
class Package < GimpApp | ||
private | ||
|
||
# | ||
# (see GimpApp#install!) | ||
# | ||
def install! | ||
package 'gimp' do | ||
version new_resource.version | ||
action :install | ||
end | ||
end | ||
|
||
# | ||
# (see GimpApp#remove!) | ||
# | ||
def remove! | ||
package 'gimp' do | ||
action :remove | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Encoding: UTF-8 | ||
# | ||
# Cookbook Name:: gimp | ||
# Library:: provider_gimp_app_rhel | ||
# | ||
# Copyright 2015 Jonathan Hartman | ||
# | ||
# 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 'chef/provider/lwrp_base' | ||
require_relative 'provider_gimp_app' | ||
require_relative 'provider_gimp_app_package' | ||
|
||
class Chef | ||
class Provider | ||
class GimpApp < Provider::LWRPBase | ||
# A GIMP provider for Red Hat and its variants. | ||
# | ||
# @author Jonathan Hartman <j@p4nt5.com> | ||
class Rhel < GimpApp::Package | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Encoding: UTF-8 | ||
|
||
require_relative '../spec_helper' | ||
require_relative '../../libraries/provider_gimp_app_debian' | ||
|
||
describe Chef::Provider::GimpApp::Debian do | ||
let(:name) { 'default' } | ||
let(:new_resource) { Chef::Resource::GimpApp.new(name, nil) } | ||
let(:provider) { described_class.new(new_resource, nil) } | ||
|
||
describe '#install!' do | ||
it 'uses an package to install GIMP' do | ||
p = provider | ||
expect(p).to receive(:include_recipe).with('apt') | ||
expect(p).to receive(:package).with('gimp').and_yield | ||
expect(p).to receive(:version).with(nil) | ||
expect(p).to receive(:action).with(:install) | ||
p.send(:install!) | ||
end | ||
end | ||
end |
Oops, something went wrong.