specinfra 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a45539de9d55e75398235a31c2d29db9cda0d916
4
- data.tar.gz: 31b5004acc76fca0b907176445e7db9c1b2126c3
3
+ metadata.gz: a9074831fe3487ecb134b3e16ac1467e06e758fa
4
+ data.tar.gz: 0ad21cd23a69f90c128a648ec575fd7c117cd68a
5
5
  SHA512:
6
- metadata.gz: 6f16477ad60c71d288d31e523182ab81fe8e5d3855864d815b87387e8b99f4d8b5d275b28d4f96efb87412f41b27da051f88031e806980e6f14f35ddd572c4ed
7
- data.tar.gz: 4952d6028a6b390d9c748627ee144933591fb3916ce2cb236a4aaaee80b2a7bf25426b2cc2f76b9572a414d5efa28e5626274d3b36b85c45affbbda30342e034
6
+ metadata.gz: 777f2579aa323dab448cf75cf2eed77f5ad6271fc15fb73cf65bbadee100b8bddffe89cb8ba8ca0a44e5ad0132d622949bbee00b34a1c34dc093b8c1d7ae6ee5
7
+ data.tar.gz: 9cf09fa462a839a78782304f4434f166e2d99e8f3f4254b44176e68ff0185563f1b62d9b8188d0d184b0dc6365f6b7887a9c8c151ba5b5d73ff4c6ebc84b7478
@@ -1,5 +1,13 @@
1
1
  class Specinfra::Command::Freebsd::Base::File < Specinfra::Command::Base::File
2
2
  class << self
3
+ def get_owner_user(file)
4
+ "stat -f%Su #{escape(file)}"
5
+ end
6
+
7
+ def get_owner_group(file)
8
+ "stat -f%Sg #{escape(file)}"
9
+ end
10
+
3
11
  def check_grouped(file, group)
4
12
  regexp = "^#{group}$"
5
13
  "stat -f%Sg #{escape(file)} | grep -- #{escape(regexp)}"
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ set :os, :family => 'freebsd'
4
+
5
+ describe get_command(:get_file_owner_user, '/tmp') do
6
+ it { should eq 'stat -f%Su /tmp' }
7
+ end
8
+
9
+ describe get_command(:get_file_owner_group, '/tmp') do
10
+ it { should eq 'stat -f%Sg /tmp' }
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
@@ -337,6 +337,7 @@ files:
337
337
  - spec/command/base/user_spec.rb
338
338
  - spec/command/debian/service_spec.rb
339
339
  - spec/command/factory_spec.rb
340
+ - spec/command/freebsd/file_spec.rb
340
341
  - spec/command/linux/interface_spec.rb
341
342
  - spec/command/linux/inventory_spec.rb
342
343
  - spec/command/linux/ip6tables_spec.rb
@@ -386,6 +387,7 @@ test_files:
386
387
  - spec/command/base/user_spec.rb
387
388
  - spec/command/debian/service_spec.rb
388
389
  - spec/command/factory_spec.rb
390
+ - spec/command/freebsd/file_spec.rb
389
391
  - spec/command/linux/interface_spec.rb
390
392
  - spec/command/linux/inventory_spec.rb
391
393
  - spec/command/linux/ip6tables_spec.rb