Skip to content

Commit ef0d4e7

Browse files
committed
Add the FrozenStrings magic comment
1 parent eb7ecf7 commit ef0d4e7

37 files changed

+91
-17
lines changed

lib/facter/apt_reboot_required.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# apt_reboot_required.rb
24
Facter.add(:apt_reboot_required) do
35
confine osfamily: 'Debian'

lib/facter/apt_update_last_success.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'facter'
24

35
# This is derived from the file /var/lib/apt/periodic/update-success-stamp

lib/facter/apt_updates.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
apt_package_updates = nil
24
apt_dist_updates = nil
35

lib/puppet/provider/apt_key/apt_key.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'open-uri'
24
require 'net/ftp'
35
require 'tempfile'
@@ -166,7 +168,7 @@ def tempfile(content)
166168
end
167169
end
168170
unless found_match
169-
raise(_('The id in your manifest %{_resource} and the fingerprint from content/source don\'t match. Check for an error in the id and content/source is legitimate.') % { _resource: resource[:name] }) # rubocop:disable Metrics/LineLength
171+
raise(_('The id in your manifest %{_resource} and the fingerprint from content/source don\'t match. Check for an error in the id and content/source is legitimate.') % { _resource: resource[:name] }) # rubocop:disable Layout/LineLength
170172
end
171173
else
172174
warning('/usr/bin/gpg cannot be found for verification of the id.')

lib/puppet/type/apt_key.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'pathname'
24
require 'puppet/parameter/boolean'
35

spec/acceptance/01_apt_class_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper_acceptance'
24

35
describe 'apt class' do

spec/acceptance/apt_key_provider_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper_acceptance'
24

35
PUPPETLABS_GPG_KEY_SHORT_ID = 'EF8D349F'.freeze

spec/acceptance/apt_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper_acceptance'
24

35
everything_everything_pp = <<-MANIFEST

spec/acceptance/init_task_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# run a test task
24
require 'spec_helper_acceptance'
35

spec/classes/apt_backports_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt::backports', type: :class do

spec/classes/apt_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
sources_list = { ensure: 'file',

spec/classes/apt_update_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt::update', type: :class do

spec/defines/conf_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24
describe 'apt::conf', type: :define do
35
let :pre_condition do

spec/defines/key_compat_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
def contains_apt_key_example(title)

spec/defines/key_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
GPG_KEY_ID = '6F6B15509CF8E59E6E469F327F438280EF8D349F'.freeze

spec/defines/mark_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt::mark', type: :define do

spec/defines/pin_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24
describe 'apt::pin', type: :define do
35
let :pre_condition do

spec/defines/ppa_spec.rb

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24
describe 'apt::ppa' do
35
let :pre_condition do
@@ -21,8 +23,8 @@
2123
it { is_expected.not_to contain_package('python-software-properties') }
2224
it {
2325
is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow+type').that_notifies('Class[Apt::Update]').with(environment: [],
24-
command: '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow+type || (rm /etc/apt/sources.list.d/needs-such_substitution-wow_type-trusty.list && false)', # rubocop:disable Metrics/LineLength
25-
unless: '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow_type-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow_type.gpg', # rubocop:disable Metrics/LineLength
26+
command: '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow+type || (rm /etc/apt/sources.list.d/needs-such_substitution-wow_type-trusty.list && false)', # rubocop:disable Layout/LineLength
27+
unless: '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow_type-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow_type.gpg', # rubocop:disable Layout/LineLength
2628
user: 'root',
2729
logoutput: 'on_failure')
2830
}
@@ -44,8 +46,8 @@
4446

4547
it {
4648
is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: [],
47-
command: '/usr/bin/add-apt-repository -y ppa:user/foo || (rm /etc/apt/sources.list.d/user-ubuntu-foo-wily.list && false)', # rubocop:disable Metrics/LineLength
48-
unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-ubuntu-foo-wily.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user_ubuntu_foo.gpg', # rubocop:disable Metrics/LineLength
49+
command: '/usr/bin/add-apt-repository -y ppa:user/foo || (rm /etc/apt/sources.list.d/user-ubuntu-foo-wily.list && false)', # rubocop:disable Layout/LineLength
50+
unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-ubuntu-foo-wily.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user_ubuntu_foo.gpg', # rubocop:disable Layout/LineLength
4951
user: 'root',
5052
logoutput: 'on_failure')
5153
}
@@ -77,8 +79,8 @@
7779
it { is_expected.to contain_package('software-properties-common') }
7880
it {
7981
is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with('environment' => [],
80-
'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow || (rm /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && false)', # rubocop:disable Metrics/LineLength
81-
'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow.gpg', # rubocop:disable Metrics/LineLength
82+
'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow || (rm /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && false)', # rubocop:disable Layout/LineLength
83+
'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow.gpg', # rubocop:disable Layout/LineLength
8284
'user' => 'root',
8385
'logoutput' => 'on_failure')
8486
}
@@ -113,8 +115,8 @@
113115
it { is_expected.not_to contain_package('python-software-properties') }
114116
it {
115117
is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with('environment' => [],
116-
'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow || (rm /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && false)', # rubocop:disable Metrics/LineLength
117-
'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow.gpg', # rubocop:disable Metrics/LineLength
118+
'command' => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow || (rm /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && false)', # rubocop:disable Layout/LineLength
119+
'unless' => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow.gpg', # rubocop:disable Layout/LineLength
118120
'user' => 'root',
119121
'logoutput' => 'on_failure')
120122
}
@@ -153,8 +155,8 @@
153155
it { is_expected.to contain_package('software-properties-common') }
154156
it {
155157
is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: [],
156-
command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Metrics/LineLength
157-
unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Metrics/LineLength
158+
command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Layout/LineLength
159+
unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Layout/LineLength
158160
user: 'root',
159161
logoutput: 'on_failure')
160162
}
@@ -187,8 +189,8 @@
187189
it { is_expected.to contain_package('software-properties-common') }
188190
it {
189191
is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: ['http_proxy=http://localhost:8080'],
190-
command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Metrics/LineLength
191-
unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Metrics/LineLength
192+
command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Layout/LineLength
193+
unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Layout/LineLength
192194
user: 'root',
193195
logoutput: 'on_failure')
194196
}
@@ -221,8 +223,8 @@
221223
it { is_expected.to contain_package('software-properties-common') }
222224
it {
223225
is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: ['http_proxy=http://localhost:8180'],
224-
command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Metrics/LineLength
225-
unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Metrics/LineLength
226+
command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Layout/LineLength
227+
unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Layout/LineLength
226228
user: 'root',
227229
logoutput: 'on_failure')
228230
}
@@ -255,8 +257,8 @@
255257
it { is_expected.to contain_package('software-properties-common') }
256258
it {
257259
is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: ['http_proxy=http://localhost:8180', 'https_proxy=https://localhost:8180'],
258-
command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Metrics/LineLength
259-
unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Metrics/LineLength
260+
command: '/usr/bin/add-apt-repository ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Layout/LineLength
261+
unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Layout/LineLength
260262
user: 'root',
261263
logoutput: 'on_failure')
262264
}

spec/defines/setting_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt::setting' do

spec/defines/source_compat_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt::source', type: :define do

spec/defines/source_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt::source' do

spec/spec_helper_local.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
if ENV['COVERAGE'] == 'yes'
24
require 'simplecov'
35
require 'simplecov-console'

spec/unit/facter/apt_dist_has_updates_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt_has_dist_updates fact' do

spec/unit/facter/apt_dist_package_security_updates_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt_package_security_dist_updates fact' do

spec/unit/facter/apt_dist_package_updates_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt_package_dist_updates fact' do

spec/unit/facter/apt_dist_security_updates_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt_security_updates fact' do

spec/unit/facter/apt_dist_updates_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt_updates fact' do

spec/unit/facter/apt_has_updates_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt_has_updates fact' do

spec/unit/facter/apt_package_security_updates_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt_package_security_updates fact' do

spec/unit/facter/apt_package_updates_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt_package_updates fact' do

spec/unit/facter/apt_reboot_required_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt_reboot_required fact' do

spec/unit/facter/apt_security_updates_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt_security_updates fact' do

spec/unit/facter/apt_update_last_success_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt_update_last_success fact' do

spec/unit/facter/apt_updates_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe 'apt_updates fact' do

spec/unit/puppet/provider/apt_key_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe Puppet::Type.type(:apt_key).provider(:apt_key) do

spec/unit/puppet/type/apt_key_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24
require 'puppet'
35

tasks/init.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/opt/puppetlabs/puppet/bin/ruby
2+
# frozen_string_literal: true
3+
24
require 'json'
35
require 'open3'
46
require 'puppet'

0 commit comments

Comments
 (0)