sambal 0.0.7 → 0.0.8

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.
@@ -1,5 +1,5 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  module Sambal
4
- VERSION = "0.0.7"
4
+ VERSION = "0.0.8"
5
5
  end
data/lib/sambal.rb CHANGED
@@ -89,8 +89,8 @@ module Sambal
89
89
  end
90
90
  end
91
91
 
92
- def ls
93
- parse_files(ask("ls"))
92
+ def ls(wildcard = '')
93
+ parse_files(ask("ls #{wildcard}"))
94
94
  end
95
95
 
96
96
  def cd(dir)
@@ -53,6 +53,14 @@ describe Sambal::Client do
53
53
  'testfile.txt'
54
54
  end
55
55
 
56
+ let(:testfile2) do
57
+ 'testfile.tx'
58
+ end
59
+
60
+ let(:testfile3) do
61
+ 'testfil.txt'
62
+ end
63
+
56
64
  let(:testfile_sub) do
57
65
  'testfile_sub.txt'
58
66
  end
@@ -61,8 +69,25 @@ describe Sambal::Client do
61
69
  "#{sub_directory_path}/#{testfile_sub}"
62
70
  end
63
71
 
64
- it "should list files on an smb server" do
65
- @sambal_client.ls.should have_key(testfile)
72
+ describe 'ls' do
73
+ before(:all) do
74
+ FileUtils.cp "#{test_server.share_path}/#{testfile}", "#{test_server.share_path}/#{testfile2}"
75
+ FileUtils.cp "#{test_server.share_path}/#{testfile}", "#{test_server.share_path}/#{testfile3}"
76
+ end
77
+
78
+ it "should list files on an smb server" do
79
+ result = @sambal_client.ls
80
+ result.should have_key(testfile)
81
+ result.should have_key(testfile2)
82
+ result.should have_key(testfile3)
83
+ end
84
+
85
+ it "should list files using a wildcard on an smb server" do
86
+ result = @sambal_client.ls '*.txt'
87
+ result.should have_key(testfile)
88
+ result.should_not have_key(testfile2)
89
+ result.should have_key(testfile3)
90
+ end
66
91
  end
67
92
 
68
93
  it "should get files from an smb server" do
@@ -137,4 +162,4 @@ describe Sambal::Client do
137
162
  result.should_not be_successful
138
163
  end
139
164
 
140
- end
165
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sambal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-14 00:00:00.000000000 Z
12
+ date: 2012-08-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70291248058060 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,12 @@ dependencies:
21
21
  version: 2.6.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70291248058060
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 2.6.0
25
30
  description: Ruby Samba Client using the cmdline smbclient
26
31
  email:
27
32
  - john@insane.se
@@ -61,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
66
  version: '0'
62
67
  requirements: []
63
68
  rubyforge_project:
64
- rubygems_version: 1.8.11
69
+ rubygems_version: 1.8.23
65
70
  signing_key:
66
71
  specification_version: 3
67
72
  summary: Ruby Samba Client