-
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.
- Loading branch information
1 parent
7d91ef2
commit 47ac530
Showing
10 changed files
with
102 additions
and
3 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
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
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_opensuse' | ||
|
||
describe Chef::Provider::GimpApp::Opensuse 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 a package to install GIMP' do | ||
p = provider | ||
expect(p).to receive(:include_recipe).with('zypper') | ||
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 |
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,11 @@ | ||
# Encoding: UTF-8 | ||
# | ||
# rubocop:disable SingleSpaceBeforeFirstArg | ||
name 'zypper' | ||
maintainer 'test' | ||
maintainer_email 'example@example.com' | ||
license 'apache2' | ||
description 'zypper' | ||
long_description 'zypper' | ||
version '0.0.1' | ||
# rubocop:enable SingleSpaceBeforeFirstArg |
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