sambal 0.2.3 → 0.2.4

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
  SHA256:
3
- metadata.gz: 9fc6edc1f7ee1557e9bb47fa9af736415cfa7c43fbe9a0869a81cc63f738d7ab
4
- data.tar.gz: 7664aaf2c58023cbe3f7e5eb3d486a6340ce650def28ca32a311024611bdece5
3
+ metadata.gz: 6c823f0d8de2bf8123f6eca3b6b30b5886a73e525319abe6293c84e326d57751
4
+ data.tar.gz: 5b37db63b852ee0ee9ae04b0ff2cd547a5e002ae7ce46b4bff0c93643a2f099e
5
5
  SHA512:
6
- metadata.gz: '0901a04a4fe2f864ac3e457cae9d0a238fcde13213745644d49127b2565d32830f4b90b768c864fec1381bd8665152fd651c8a5a7016c70877f8b7eef81bec8e'
7
- data.tar.gz: fa767044e4110eb4ccfbe921c28b9c7668819ad019ca3e6b8cde385f6e5c6ab0aced3f3b74ceb5c919ceaaf46ca9f38bda6a1f8f8a5bbe2cbf13b5dba017b9ca
6
+ metadata.gz: 3d980269e1dbe721c4cd6915e2999dc0e7c86827798302400a35ce2c4ff9bf8e95c59465eb30113fb34e4c150f468334175d9a90ed2eaf370dc65fc0540f9717
7
+ data.tar.gz: b8d926be2d6e28c2429625e2a576994e459968d096b50cf4af822c3a0e31db11ee1129d236f6e271e8473a1378fba4c8083368a976d9348425e7da108ed41c74
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://ci.insane.se/buildStatus/icon?job=sambal/master)](https://ci.insane.se/job/sambal/job/master/)
1
+ ![Test status](https://github.com/johnae/sambal/actions/workflows/ci.yaml/badge.svg)
2
2
 
3
3
  # Sambal
4
4
 
@@ -34,7 +34,11 @@ On Linux (Ubuntu) it's as easy as:
34
34
  It should be available in a similar way on all major Linux distributions.
35
35
 
36
36
  If you happen to be running [NixOS](https://nixos.org/) or at least the [Nix package manager](https://nixos.org/nix/download.html) you could just
37
- use the `default.nix` file in this repo. That should also set you up for running the tests (which require samba).
37
+ use the `flake.nix` file in this repo. That should also set you up for running the tests (which require samba). Something like this:
38
+
39
+ nix develop
40
+ bundle install
41
+ bundle exec rspec
38
42
 
39
43
  ## Usage
40
44
 
data/lib/sambal/client.rb CHANGED
@@ -44,7 +44,7 @@ module Sambal
44
44
 
45
45
  @output, @input, @pid = PTY.spawn(command[0], *command[1..-1])
46
46
 
47
- res = @output.expect(/(.*\n)?smb:.*\\>/, @timeout)[0] rescue nil
47
+ res = @output.expect(/smb:.*\\>/, @timeout)[0] rescue nil
48
48
  @connected = case res
49
49
  when nil
50
50
  false
@@ -116,7 +116,7 @@ module Sambal
116
116
  begin
117
117
  file_context(filename) do |file|
118
118
  response = ask_wrapped 'get', [file, output]
119
- if response =~ /^getting\sfile.*$/
119
+ if response =~ /getting\sfile.*$/
120
120
  Response.new(response, true)
121
121
  else
122
122
  Response.new(response, false)
@@ -140,7 +140,7 @@ module Sambal
140
140
 
141
141
  def put(file, destination)
142
142
  response = ask_wrapped 'put', [file, destination]
143
- if response =~ /^putting\sfile.*$/
143
+ if response =~ /putting\sfile.*$/
144
144
  Response.new(response, true)
145
145
  else
146
146
  Response.new(response, false)
@@ -155,7 +155,7 @@ module Sambal
155
155
  f << content
156
156
  end
157
157
  response = ask_wrapped 'put', [t.path, destination]
158
- if response =~ /^putting\sfile.*$/
158
+ if response =~ /putting\sfile.*$/
159
159
  Response.new(response, true)
160
160
  else
161
161
  Response.new(response, false)
@@ -191,7 +191,7 @@ module Sambal
191
191
  cd '..'
192
192
  response = ask_wrapped 'rmdir', dir
193
193
  next_line = response.split("\n")[1]
194
- if next_line =~ /^smb:.*\\>/
194
+ if next_line =~ /smb:.*\\>/
195
195
  Response.new(response, true)
196
196
  else
197
197
  Response.new(response, false)
@@ -206,7 +206,7 @@ module Sambal
206
206
  file_context(filename) do |file|
207
207
  response = ask_wrapped 'del', file
208
208
  next_line = response.split("\n")[1]
209
- if next_line =~ /^smb:.*\\>/
209
+ if next_line =~ /smb:.*\\>/
210
210
  Response.new(response, true)
211
211
  #elsif next_line =~ /^NT_STATUS_NO_SUCH_FILE.*$/
212
212
  # Response.new(response, false)
@@ -255,7 +255,7 @@ module Sambal
255
255
  def ask(cmd)
256
256
  @input.print("#{cmd}\n")
257
257
  response = begin
258
- @output.expect(/^smb:.*\\>/,@timeout)[0]
258
+ @output.expect(/smb:.*\\>/,@timeout)[0]
259
259
  rescue => e
260
260
  $stderr.puts e
261
261
  nil
@@ -1,5 +1,5 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  module Sambal
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sambal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Axel Eriksson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-26 00:00:00.000000000 Z
11
+ date: 2022-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec