Skip to content

Commit e903791

Browse files
authored
Merge pull request #5 from hw-cookbooks/cookstyle_bot/cookstyle_6_17_5
Signed-off-by: Tim Smith <[email protected]>
2 parents 95d1181 + 87f550b commit e903791

File tree

5 files changed

+62
-64
lines changed

5 files changed

+62
-64
lines changed

Berksfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
cookbook "apt"
2-
cookbook "yum"
3-
cookbook "git"
4-
cookbook "build-essential"
5-
cookbook "python"
6-
cookbook "runit"
7-
cookbook "statsite", :path => "."
1+
cookbook 'apt'
2+
cookbook 'yum'
3+
cookbook 'git'
4+
cookbook 'build-essential'
5+
cookbook 'python'
6+
cookbook 'runit'
7+
cookbook 'statsite', path: '.'
88

99
group :test do
10-
cookbook "graphite"
10+
cookbook 'graphite'
1111
end

Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
source 'https://rubygems.org'
22

33
group :test do
4-
gem "test-kitchen", "~> 1.0.0.alpha.0"
5-
gem "kitchen-vagrant", "~> 0.6.0"
6-
gem "berkshelf", :github => "RiotGames/berkshelf"
4+
gem 'test-kitchen', '~> 1.0.0.alpha.0'
5+
gem 'kitchen-vagrant', '~> 0.6.0'
6+
gem 'berkshelf', github: 'RiotGames/berkshelf'
77
end
88

99
group :lxc do
10-
gem "kitchen-lxc", :git => "git://github.com/portertech/kitchen-lxc"
10+
gem 'kitchen-lxc', git: 'git://github.com/portertech/kitchen-lxc'
1111
end

attributes/default.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
default[:statsite][:path] = "/opt/statsite"
2-
default[:statsite][:repo] = "git://github.com/armon/statsite.git"
3-
default[:statsite][:ref] = "HEAD"
4-
default[:statsite][:conf] = "/etc/statsite.conf"
5-
default[:statsite][:owner] = "statsite"
6-
default[:statsite][:group] = "statsite"
1+
default[:statsite][:path] = '/opt/statsite'
2+
default[:statsite][:repo] = 'git://github.com/armon/statsite.git'
3+
default[:statsite][:ref] = 'HEAD'
4+
default[:statsite][:conf] = '/etc/statsite.conf'
5+
default[:statsite][:owner] = 'statsite'
6+
default[:statsite][:group] = 'statsite'
77
default[:statsite][:port] = 8125
8-
default[:statsite][:loglevel] = "INFO"
8+
default[:statsite][:loglevel] = 'INFO'
99
default[:statsite][:flush_interval] = 10
1010
default[:statsite][:timer_eps] = 0.01
11-
default[:statsite][:stream_command] = ""
11+
default[:statsite][:stream_command] = ''
1212

13-
default[:statsite][:service_type] = "runit"
13+
default[:statsite][:service_type] = 'runit'

metadata.rb

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
maintainer "Heavy Water Ops, Inc"
2-
maintainer_email "[email protected]"
3-
license "Apache 2.0"
4-
description "Installs/Configures statsite"
5-
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6-
name "statsite"
7-
version "0.0.3"
1+
maintainer 'Heavy Water Ops, Inc'
2+
maintainer_email '[email protected]'
3+
license 'Apache-2.0'
4+
description 'Installs/Configures statsite'
5+
name 'statsite'
6+
version '0.0.3'
87

9-
depends "git"
10-
depends "build-essential"
11-
depends "python"
12-
depends "runit"
8+
depends 'git'
9+
depends 'python'
10+
depends 'runit'

recipes/default.rb

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
# Cookbook Name:: statsite
2+
# Cookbook:: statsite
33
# Recipe:: default
44
#
5-
# Copyright 2013, Heavy Water Ops, Inc
5+
# Copyright:: 2013, Heavy Water Ops, Inc
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.
@@ -17,73 +17,73 @@
1717
# limitations under the License.
1818
#
1919

20-
#checkout
21-
include_recipe "git"
20+
# checkout
21+
include_recipe 'git'
2222

23-
git node[:statsite][:path] do
24-
repository node[:statsite][:repo]
25-
reference node[:statsite][:ref]
23+
git node['statsite']['path'] do
24+
repository node['statsite']['repo']
25+
reference node['statsite']['ref']
2626
action :sync
27-
not_if { ::FileTest.directory?("#{node[:statsite][:path]}/.git") }
27+
not_if { ::FileTest.directory?("#{node['statsite']['path']}/.git") }
2828
end
2929

3030
# build
31-
include_recipe "build-essential"
32-
include_recipe "python"
31+
build_essential 'install compilation tools'
32+
include_recipe 'python'
3333

34-
package "scons"
34+
package 'scons'
3535

36-
execute "scons" do
37-
cwd node[:statsite][:path]
36+
execute 'scons' do
37+
cwd node['statsite']['path']
3838
action :run
39-
creates "statsite"
39+
creates 'statsite'
4040
end
4141

4242
# configure
43-
group node[:statsite][:group] do
43+
group node['statsite']['group'] do
4444
system true
4545
action :create
4646
end
4747

48-
user node[:statsite][:owner] do
48+
user node['statsite']['owner'] do
4949
system true
50-
group node[:statsite][:group]
50+
group node['statsite']['group']
5151
end
5252

5353
# service
54-
service_type = node[:statsite][:service_type]
54+
service_type = node['statsite']['service_type']
5555

5656
case service_type
5757
when 'upstart'
5858
service_resource = 'service[statsite]'
5959

60-
template "/etc/init/statsite.conf" do
61-
source "upstart.statsite.erb"
62-
mode "0644"
60+
template '/etc/init/statsite.conf' do
61+
source 'upstart.statsite.erb'
62+
mode '0644'
6363
variables(
64-
:conf => node[:statsite][:conf],
65-
:path => node[:statsite][:path],
66-
:user => node[:statsite][:owner],
67-
:group => node[:statsite][:group]
64+
conf: node['statsite']['conf'],
65+
path: node['statsite']['path'],
66+
user: node['statsite']['owner'],
67+
group: node['statsite']['group']
6868
)
6969
end
7070

71-
service "statsite" do
71+
service 'statsite' do
7272
provider Chef::Provider::Service::Upstart
73-
supports :restart => true, :status => true
73+
supports restart: true, status: true
7474
action [:enable, :start]
7575
end
7676
else
7777
service_resource = 'runit_service[statsite]'
7878

79-
include_recipe "runit"
80-
runit_service "statsite"
79+
include_recipe 'runit'
80+
runit_service 'statsite'
8181
end
8282

8383
# template
84-
template node[:statsite][:conf] do
85-
owner node[:statsite][:owner]
86-
notifies :restart, "service[statsite]", :delayed
84+
template node['statsite']['conf'] do
85+
owner node['statsite']['owner']
86+
notifies :restart, 'service[statsite]', :delayed
8787
end
8888

8989

0 commit comments

Comments
 (0)