sambal 0.2.1 → 0.2.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
  SHA256:
3
- metadata.gz: fd8dcc698177728a2089a8ef9bf157d4e1e0d11e59083399b5b0fceecf9b0331
4
- data.tar.gz: 8ff8321bc0480bc5fe4422c697dceceb0a2743e0a4ac6e35cfc4ef4dab739ee4
3
+ metadata.gz: 0a50e0a519bdbc0ab8cccb0116250c2b073e5e305a906d9f46fac5012dc11814
4
+ data.tar.gz: 71ac3f8493eae53b548a0e58a207e38034615af0f0d915956d50ab338b5bc16e
5
5
  SHA512:
6
- metadata.gz: 313f5d0d5ae699228ba5874cc69f72debe1ae7364643e2040d19aa98ae81e874017be52978c576e67478a7bb63ce27170db00f3801dc262b9620778a367f22f1
7
- data.tar.gz: 040f2c1e8d7bf126feeda45bdf28c6aeba75778f9491afd5d2999e1b15953540e74239ad0d1ca92518ba51ccff030df3ec84175a172609800f6e7a9671f5bb61
6
+ metadata.gz: 5e14f217b9d83deceae6bd11a17d94ce17ca59800850031a0d57d416fe5f1f1431a0de3b8c9d9e8a3f4b4695f9d4e16b15fa2e2cbb808cf16ba409ad60dc67d3
7
+ data.tar.gz: ba2eb773c39c1dccfd4b71dbe2b184f453b17cf02690124d010d30d18d3456e4976a7d33f5b11bacda7c192882d1336b686f859ca0147a736ac0a9ff8191ede4
data/.envrc ADDED
@@ -0,0 +1 @@
1
+ use_nix
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/groovy
2
+
3
+ def hasCmd(cmd) { "command -v ${cmd} >/dev/null 2>&1" }
4
+
5
+ def shell(cmd) {
6
+ def nixInitPath = '$HOME/.nix-profile/etc/profile.d/nix.sh'
7
+ sh """
8
+ if ! ${hasCmd('nix-shell')}; then
9
+ if [ -e ${nixInitPath} ]; then
10
+ . ${nixInitPath}
11
+ else
12
+ curl https://nixos.org/nix/install | sh
13
+ . ${nixInitPath}
14
+ fi
15
+ fi
16
+ ${cmd}
17
+ """
18
+ }
19
+
20
+ def nixShell(cmd) { shell """ nix-shell --run "${cmd}" """ }
21
+
22
+ node('linux') {
23
+ stage("Prerequisites") { shell """ nix-env -iA nixpkgs.git """ }
24
+
25
+ stage("Checkout") { checkout scm }
26
+
27
+ stage("Setup") { nixShell '''
28
+ bundle install
29
+ mkdir -p /tmp/sambal-temp-path
30
+ '''
31
+ }
32
+
33
+ stage("Test") { nixShell "SAMBAL_TEMP_PATH=/tmp/sambal-temp-path bundle exec rspec" }
34
+ }
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Circle CI](https://circleci.com/gh/johnae/sambal.svg?style=svg)](https://circleci.com/gh/johnae/sambal)
1
+ [![Build Status](https://ci.insane.se/buildStatus/icon?job=sambal/master)](https://ci.insane.se/job/sambal/job/master/)
2
2
 
3
3
  # Sambal
4
4
 
@@ -27,14 +27,15 @@ On a mac this can be installed through homebrew https://github.com/mxcl/homebrew
27
27
 
28
28
  brew install samba
29
29
 
30
- On the Mac it can probably also be installed both through Fink and MacPorts.
31
-
32
30
  On Linux (Ubuntu) it's as easy as:
33
31
 
34
32
  apt-get install smbclient
35
33
 
36
34
  It should be available in a similar way on all major Linux distributions.
37
35
 
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).
38
+
38
39
  ## Usage
39
40
 
40
41
  client = Sambal::Client.new(domain: 'WORKGROUP', host: '127.0.0.1', share: '', user: 'guest', password: '--no-pass', port: 445)
@@ -0,0 +1,6 @@
1
+ with import <nixpkgs> {};
2
+
3
+ stdenv.mkDerivation {
4
+ name = "sambal";
5
+ buildInputs = [ ruby rake samba ];
6
+ }
@@ -252,7 +252,7 @@ module Sambal
252
252
  end
253
253
 
254
254
  def ask(cmd)
255
- @input.printf("#{cmd}\n")
255
+ @input.print("#{cmd}\n")
256
256
  response = @output.expect(/^smb:.*\\>/,@timeout)[0] rescue nil
257
257
  if response.nil?
258
258
  $stderr.puts "Failed to do #{cmd}"
@@ -39,7 +39,7 @@ module Sambal
39
39
  @erb_path = "#{File.expand_path(File.dirname(__FILE__))}/smb.conf.erb"
40
40
  @host = "127.0.0.1" ## will always just be localhost
41
41
  @root_path = File.expand_path(File.dirname(File.dirname(File.dirname(__FILE__))))
42
- @tmp_path = "#{root_path}/spec_tmp"
42
+ @tmp_path = ENV.key?('SAMBAL_TEMP_PATH') ? ENV['SAMBAL_TEMP_PATH'] : "#{root_path}/spec_tmp"
43
43
  @share_path = "#{tmp_path}/share"
44
44
  @share_name = share_name
45
45
  @config_path = "#{tmp_path}/smb.conf"
@@ -71,11 +71,11 @@ module Sambal
71
71
  def start
72
72
  if RUBY_PLATFORM=="java"
73
73
  @smb_server_pid = Thread.new do
74
- `smbd -S -F -s #{@config_path} -p #{@port} --option="lockdir"=#{@lock_path} --option="pid directory"=#{@pid_dir} --option="private directory"=#{@private_dir} --option="cache directory"=#{@cache_dir} --option="state directory"=#{@state_dir} > #{@log_path}/smb.log`
74
+ `smbd -S -F -s #{@config_path} -p #{@port} --option="lockdir"=#{@lock_path} --option="pid directory"=#{@pid_dir} --option="private directory"=#{@private_dir} --option="cache directory"=#{@cache_dir} --option="state directory"=#{@state_dir} < /dev/null > #{@log_path}/smb.log`
75
75
  end
76
76
  else
77
77
  @smb_server_pid = fork do
78
- `smbd -S -F -s #{@config_path} -p #{@port} --option="lockdir"=#{@lock_path} --option="pid directory"=#{@pid_dir} --option="private directory"=#{@private_dir} --option="cache directory"=#{@cache_dir} --option="state directory"=#{@state_dir} > #{@log_path}/smb.log`
78
+ exec "smbd -S -F -s #{@config_path} -p #{@port} --option=\"lockdir\"=#{@lock_path} --option=\"pid directory\"=#{@pid_dir} --option=\"private directory\"=#{@private_dir} --option=\"cache directory\"=#{@cache_dir} --option=\"state directory\"=#{@state_dir} < /dev/null > #{@log_path}/smb.log"
79
79
  end
80
80
  end
81
81
  sleep 2 ## takes a short time to start up
@@ -1,5 +1,5 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  module Sambal
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
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.1
4
+ version: 0.2.2
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: 2018-08-12 00:00:00.000000000 Z
11
+ date: 2018-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -31,13 +31,15 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
+ - ".envrc"
34
35
  - ".gitignore"
35
36
  - Gemfile
37
+ - Jenkinsfile
36
38
  - LICENSE
37
39
  - README.md
38
40
  - Rakefile
39
41
  - Spookfile
40
- - circle.yml
42
+ - default.nix
41
43
  - lib/sambal.rb
42
44
  - lib/sambal/client.rb
43
45
  - lib/sambal/response.rb
@@ -66,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
68
  version: '0'
67
69
  requirements: []
68
70
  rubyforge_project:
69
- rubygems_version: 2.7.6
71
+ rubygems_version: 2.7.7
70
72
  signing_key:
71
73
  specification_version: 4
72
74
  summary: Ruby Samba Client
data/circle.yml DELETED
@@ -1,4 +0,0 @@
1
- dependencies:
2
- pre:
3
- - sudo apt-get update -qq
4
- - sudo apt-get install -y smbclient samba