smb-client 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/README.md +4 -1
- data/lib/smb/client/client.rb +8 -4
- data/lib/smb/client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74e4c55cf1373694b5add4df963fdd2724e4530f
|
4
|
+
data.tar.gz: 261879d622d0e1f3e07d7e61f010dcf21d22e81e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 237d79a37f9ec4ae6ea87a7bd4c35c2928937139b8543695e1e22373819df74e10c019415bf5ea03ae5bda77aaf05bc886e44b267b484df57dd627e57136554c
|
7
|
+
data.tar.gz: 242f5cfffd62044a694f516e17c1aa72bf2fbd6ef5a95f28a414e0d5f31fbbc42123fb1f38f76be2317ecb25d399c55576cb018fefad4205f3d697b0b6a18b74
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -27,11 +27,14 @@ Or install it yourself as:
|
|
27
27
|
### Setup
|
28
28
|
|
29
29
|
```ruby
|
30
|
+
require 'smb/client'
|
31
|
+
|
30
32
|
options = {
|
31
33
|
host: 'Your host',
|
32
34
|
user: 'username',
|
33
35
|
share: 'share',
|
34
36
|
password: 'password',
|
37
|
+
workgroup: 'WORKGROUP',
|
35
38
|
version: 2
|
36
39
|
}
|
37
40
|
@smb_client = SMB::Client.new options
|
@@ -74,7 +77,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
74
77
|
|
75
78
|
## Contributing
|
76
79
|
|
77
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
80
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/NetcomKassel/smb-client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
78
81
|
|
79
82
|
## License
|
80
83
|
|
data/lib/smb/client/client.rb
CHANGED
@@ -37,9 +37,11 @@ module SMB
|
|
37
37
|
@first_message = true
|
38
38
|
|
39
39
|
@connection_established = false
|
40
|
+
@shutdown_in_progress = false
|
40
41
|
end
|
41
42
|
|
42
43
|
def close
|
44
|
+
@shutdown_in_progress = true
|
43
45
|
Process.kill('QUIT', @pid) == 1
|
44
46
|
end
|
45
47
|
|
@@ -89,10 +91,12 @@ module SMB
|
|
89
91
|
end
|
90
92
|
end
|
91
93
|
rescue Errno::EIO => e
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
94
|
+
unless @shutdown_in_progress
|
95
|
+
if @connection_established
|
96
|
+
raise StandardError, "Unexpected error: [#{e.message}]"
|
97
|
+
else
|
98
|
+
raise Client::ConnectionError, 'Cannot connect to SMB server'
|
99
|
+
end
|
96
100
|
end
|
97
101
|
end
|
98
102
|
end
|
data/lib/smb/client/version.rb
CHANGED