Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

sevenwire/sambal

This branch is 1 commit ahead of, 34 commits behind johnae/sambal:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Nick Delja
Sep 10, 2018
8f7e5a1 · Sep 10, 2018
Sep 10, 2018
Jan 3, 2018
Apr 18, 2012
Dec 16, 2015
Apr 18, 2012
Mar 22, 2016
Apr 18, 2012
Sep 7, 2017
Dec 16, 2015
Dec 16, 2015

Repository files navigation

Circle CI

Sambal

Sambal is a ruby samba client

Quite a bit of code was borrowed from https://github.com/reivilo/rsmbclient - Thanks!

Installation

Add this line to your application's Gemfile:

gem 'sambal'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sambal

Requirements

A working installation of samba, specifically the "smbclient" command line utility. See http://www.samba.org for more information. On a mac this can be installed through homebrew https://github.com/mxcl/homebrew, like this:

brew install samba

On the Mac it can probably also be installed both through Fink and MacPorts.

On Linux (Ubuntu) it's as easy as:

apt-get install smbclient

It should be available in a similar way on all major Linux distributions.

Usage

client = Sambal::Client.new(domain: 'WORKGROUP', host: '127.0.0.1', share: '', user: 'guest', password: '--no-pass', port: 445)
client.ls # returns hash of files
client.put("local_file.txt","remote_file.txt") # uploads file to server
client.exists?("remote_file.txt") # checks if file is on server
client.put_content("My content here", "remote_file") # uploads content to a file on server
client.get("remote_file.txt", "local_file.txt") # downloads file from server
client.del("remote_file.txt") # deletes files from server
client.exists?("some_directory") # checks if directory is on server
client.cd("some_directory") # changes directory on server
client.close # closes connection

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Packages

No packages published

Languages

  • Ruby 66.0%
  • HTML 34.0%