wormholio 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +15 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +33 -0
- data/Rakefile +2 -0
- data/lib/wormholio/ftp.rb +50 -0
- data/lib/wormholio/version.rb +3 -0
- data/lib/wormholio.rb +34 -0
- data/wormholio.gemspec +27 -0
- metadata +140 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
N2Q0NWViYzFiOTlmNmY5NzJkZTU4NWIwYTM2YTVlNTNiZTI2MjFiZQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NDRlMTRlOTcyYmM3YjBkZWVmZDEyYzVlMTA4NzVjMDM0NDJlZDhiZA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NDA4M2FhNWQwZGEzM2M4N2RiNGI4Njk4NzYyMDRhOGU1YzE1MGUzODA4NzVi
|
10
|
+
NWU0MTU0ZDEyN2EyMTliMzk0NmFiZGI5ZmQ3ZTAyM2JjYzU0NzQwNjBjNDEw
|
11
|
+
OGI0NzdiMGNkZWFhMDkzMWY1ODM2ZjBjNDFkN2YwNTAwZGIzYTU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MWZjOWEwOTk5NmI1MjkzOWVmNzNlN2NiZDNmODc3ZDk5NDc2OGUzYTg2MGQ1
|
14
|
+
YThlNDVjMzAyNTkwYzNjMjg4ZTI1YzFmZmFkYjdjYmUzNmQwZmY4MDFmNDc0
|
15
|
+
NTk5MTYxYjgzNzZmZWI2N2QzMWQzNzE4ZWM5OWUzYjdmZWE5ZDg=
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Christopher Reynolds
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Wormholio
|
2
|
+
|
3
|
+
This gem was created to be a one-stop-shop for all file transfer methods that anyone would need to use in their ruby application.
|
4
|
+
The current methods I found available were cryptric, and the documentation available for these methods offered no help.
|
5
|
+
After creating blog posts on the methods I needed to support ([S3](http://skplunkerin.com/s3-with-ruby-on-rails/) && [FTP, FTPS, SFTP & SCP](http://skplunkerin.com/ftp-ftps-sftp-scp-ruby-on-rails/)), my buddies then recommended converting these classes into a single gem... and so I did.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'wormholio'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install wormholio
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Contributing
|
28
|
+
|
29
|
+
1. Fork it ( https://github.com/skplunkerin/wormholio/fork )
|
30
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
31
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
32
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
33
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require "net/ftp"
|
2
|
+
|
3
|
+
class Ftp
|
4
|
+
|
5
|
+
def self.upload(creds,file,options={})
|
6
|
+
p 'FTP UPLOAD'
|
7
|
+
connect(creds,options)
|
8
|
+
@wormholio_ftp.chdir("#{creds['dir_path']}")
|
9
|
+
@wormholio_ftp.putbinaryfile(file)
|
10
|
+
close_connection()
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.download(creds,local_path,filename,options={})
|
14
|
+
p 'FTP DOWNLOAD'
|
15
|
+
connect(creds,options)
|
16
|
+
@wormholio_ftp.chdir("#{creds['dir_path']}")
|
17
|
+
@wormholio_ftp.getbinaryfile(filename,"#{local_path}#{filename}")
|
18
|
+
close_connection()
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
def self.connect(creds, options)
|
23
|
+
p 'ESTABLISH FTP CONNECTION'
|
24
|
+
host = creds["host"] # Host to connect too
|
25
|
+
port = (creds["port"]) ? creds["port"] : 21 # Default to port 21 unless port is given
|
26
|
+
username = creds["username"] # Username to connect with
|
27
|
+
password = creds["password"] # Password for username
|
28
|
+
|
29
|
+
@wormholio_ftp = Net::FTP.new
|
30
|
+
|
31
|
+
if options["debug"]
|
32
|
+
p 'Debug Mode'
|
33
|
+
p options["debug"]
|
34
|
+
@wormholio_ftp.debug_mode = options["debug"] # Debug mode
|
35
|
+
end
|
36
|
+
if options["passive"]
|
37
|
+
p 'Passive'
|
38
|
+
p options["passive"]
|
39
|
+
@wormholio_ftp.passive = options["passive"] # Passive connection
|
40
|
+
end
|
41
|
+
@wormholio_ftp.connect(host,port)
|
42
|
+
@wormholio_ftp.login(username, password)
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.close_connection
|
46
|
+
p 'CLOSE FTP CONNECTION'
|
47
|
+
@wormholio_ftp.close
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
data/lib/wormholio.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require "wormholio/version"
|
2
|
+
require "wormholio/ftp"
|
3
|
+
|
4
|
+
module Wormholio
|
5
|
+
|
6
|
+
module FTP
|
7
|
+
|
8
|
+
def self.upload(credentials,file,options={})
|
9
|
+
Ftp.upload(credentials,file,options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.download(credendtials,local_path,filename,options={})
|
13
|
+
Ftp.download(credentials,file,options)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
module FTPS
|
19
|
+
# TODO
|
20
|
+
end
|
21
|
+
|
22
|
+
module SFTP
|
23
|
+
# TODO
|
24
|
+
end
|
25
|
+
|
26
|
+
module SCP
|
27
|
+
# TODO
|
28
|
+
end
|
29
|
+
|
30
|
+
module S3
|
31
|
+
# TODO
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
data/wormholio.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'wormholio/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "wormholio"
|
8
|
+
spec.version = Wormholio::VERSION
|
9
|
+
spec.authors = ["Christopher Reynolds"]
|
10
|
+
spec.email = ["reynolds87chris@gmail.com"]
|
11
|
+
spec.summary = %q{Currently under development... Will have support for FTP, FTPS, SFTP, SCP and S3.}
|
12
|
+
spec.description = %q{If you want one gem that can utilize all file transfer methods, use Wormholio. Currently supported transfer method: FTP; soon to be supported: FTPS, SFTP, SCP & S3.}
|
13
|
+
spec.homepage = "https://github.com/skplunkerin/wormholio"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "double-bag-ftps", "~> 0.1"
|
24
|
+
spec.add_development_dependency "net-sftp", "~> 2.1"
|
25
|
+
spec.add_development_dependency "net-scp", "~> 1.2"
|
26
|
+
spec.add_development_dependency "s3", "~> 0.3"
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wormholio
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Christopher Reynolds
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: double-bag-ftps
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: net-sftp
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: net-scp
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.2'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.2'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: s3
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.3'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.3'
|
97
|
+
description: ! 'If you want one gem that can utilize all file transfer methods, use
|
98
|
+
Wormholio. Currently supported transfer method: FTP; soon to be supported: FTPS,
|
99
|
+
SFTP, SCP & S3.'
|
100
|
+
email:
|
101
|
+
- reynolds87chris@gmail.com
|
102
|
+
executables: []
|
103
|
+
extensions: []
|
104
|
+
extra_rdoc_files: []
|
105
|
+
files:
|
106
|
+
- .gitignore
|
107
|
+
- Gemfile
|
108
|
+
- LICENSE.txt
|
109
|
+
- README.md
|
110
|
+
- Rakefile
|
111
|
+
- lib/wormholio.rb
|
112
|
+
- lib/wormholio/ftp.rb
|
113
|
+
- lib/wormholio/version.rb
|
114
|
+
- wormholio.gemspec
|
115
|
+
homepage: https://github.com/skplunkerin/wormholio
|
116
|
+
licenses:
|
117
|
+
- MIT
|
118
|
+
metadata: {}
|
119
|
+
post_install_message:
|
120
|
+
rdoc_options: []
|
121
|
+
require_paths:
|
122
|
+
- lib
|
123
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - ! '>='
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ! '>='
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
requirements: []
|
134
|
+
rubyforge_project:
|
135
|
+
rubygems_version: 2.4.4
|
136
|
+
signing_key:
|
137
|
+
specification_version: 4
|
138
|
+
summary: Currently under development... Will have support for FTP, FTPS, SFTP, SCP
|
139
|
+
and S3.
|
140
|
+
test_files: []
|