tdi 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/helper/file.rb +8 -8
  3. data/lib/tdi/version.rb +1 -1
  4. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70f04663c09353563a0c5cd077f9b09d8263fe31
4
- data.tar.gz: 20da663f76bea16c7bbe8a25f7fcd9859b31db6b
3
+ metadata.gz: 5f667efd818c32c1de975332ee09be3747289808
4
+ data.tar.gz: 0cf62be71c8cfec8340700096c3e6dd971973c17
5
5
  SHA512:
6
- metadata.gz: 8a67549a9492f1b4cb89e9977fb0be0de57e49005b66856f167c75d94e1dd9e8eead5fcb947b02a5cee6a8775195604a0b172a6f3ca3fd2ab4ff3a8491e2ee6c
7
- data.tar.gz: 59742f43975087d67b1d1f8ba156e3c11634c786847a6a5d6ca6a5622251f34f02aabdf297ace0442293ec3b4f3cafe1769f3e45e7870c1a4e3783dd700b829b
6
+ metadata.gz: cb7abf813d5c473abe06ca6ac4b180fc558bdaf2ff79c0132723b4593bca85acc69770a25b12ce29fee99fc23b73c274d1e88a75510b728a44f27d7cd793b06b
7
+ data.tar.gz: 35b2f359c3a5ad88ff0ed98c233bcc28f33a90f93b1cbed45716774ccb5f07978ed722cf9f0ee08e6b3d4aa1a2d102859a007b99b2081e108673508ff3524d69
data/helper/file.rb CHANGED
@@ -19,6 +19,10 @@
19
19
 
20
20
  require 'fileutils'
21
21
  require 'etc'
22
+ require 'sys/filesystem'
23
+ include Sys
24
+
25
+ REMOTE_FS_LIST = %w(cifs coda nfs nfs4 smbfs)
22
26
 
23
27
  class TDIPlan < TDI
24
28
  def file(role_name, plan_name, plan_content)
@@ -84,18 +88,14 @@ class TDIPlan < TDI
84
88
  end
85
89
 
86
90
  # Location.
87
- unless type.eql?('directory')
88
- df_path = File.dirname(path)
89
- else
90
- df_path = path
91
- end
92
- device = %x(df -P #{df_path} | tail -n 1 | awk '{print $1}')
91
+ mount_p = Filesystem.mount_point(path)
92
+ mount_t = Filesystem.mounts.select { |mount| mount.mount_point.eql?(mount_p) }.first.mount_type
93
93
 
94
94
  case location
95
95
  when 'local'
96
- @flag_success = false if device.include?(':')
96
+ @flag_success = false if REMOTE_FS_LIST.include?(mount_t)
97
97
  when 'nfs'
98
- @flag_success = false unless device.include?(':')
98
+ @flag_success = false unless mount_t.eql?('nfs')
99
99
  else
100
100
  puts "ERR: Invalid file plan format \"#{location}\". Location must be \"local\" or \"nfs\".".light_magenta
101
101
  exit 1
data/lib/tdi/version.rb CHANGED
@@ -18,5 +18,5 @@
18
18
  # along with TDI. If not, see <http://www.gnu.org/licenses/>.
19
19
 
20
20
  module Tdi
21
- VERSION = '0.2.2'
21
+ VERSION = '0.2.3'
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rogério Carvalho Schneider
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-10-27 00:00:00.000000000 Z
13
+ date: 2017-04-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -124,6 +124,20 @@ dependencies:
124
124
  - - ">="
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
+ - !ruby/object:Gem::Dependency
128
+ name: sys-filesystem
129
+ requirement: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
127
141
  description: |-
128
142
  Test Driven Infrastructure acceptance helpers for
129
143
  validating your deployed infrastructure and external dependencies.