ruby-libstorj 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8de9d6c135ae3b5e58a34ce91f1ac731bc2e887a
4
- data.tar.gz: f581db0c00bfcbbec33081df8034bcb17c8d7e18
3
+ metadata.gz: be875e27acd221845d705984e330a4c2a347e770
4
+ data.tar.gz: f756fb923dbb524c284f599912b9b8565d8f5eba
5
5
  SHA512:
6
- metadata.gz: d7d9eef9134284db52495f95e1fbf73f7827380e180e6da2ffff75ae8ff6db1a204f3f3e646670ca7c664c74613dbd2e3e028ef945abf531a940c670fd842f29
7
- data.tar.gz: 0a58c196a68386fc3ca0fc8bf3caf0156f38d2526c374a551b4a7eb194121f733e22943fbf06e171cfd2283195e6cbb2f0581cbdf4b3ea8b76a7c47dbafbc1b1
6
+ metadata.gz: b98b1270ed1d934d49dc874669db279098fef16f6ddbded3f3eaac7fbfb4934b8ce1e417406e63027597a0629c7b01aaa21b37b3fe290d6852afc9384ed2a8d7
7
+ data.tar.gz: a97463b8af6037225bde317c45b7091847b5cb9066539902d39330ee4a6cfd2735d3faaf78d236ac2afaa2815aadfd172da227e342bbf0b62eb1cf7cf680e338
@@ -0,0 +1,48 @@
1
+ FROM storjlabs/storj-integration:swig-python-libstorj
2
+
3
+ RUN apt update -yqq
4
+ RUN apt install -yqq ruby-dev rubygems-integration
5
+
6
+ # copy scripts and source
7
+ RUN mkdir -p /storj/ruby-libstorj
8
+ COPY Gemfile Gemfile.lock ruby-libstorj.gemspec Rakefile Guardfile /storj/ruby-libstorj/
9
+ COPY ./dockerfiles/setup-user /storj/ruby-libstorj/setup-user
10
+ COPY ./lib /storj/ruby-libstorj/lib
11
+ COPY ./spec /storj/ruby-libstorj/spec
12
+ COPY ./ext /storj/ruby-libstorj/ext
13
+
14
+ # modify file permissions
15
+ RUN chmod 655 /storj/ruby-libstorj/setup-user/*.{js,sh}
16
+ WORKDIR /storj/ruby-libstorj/setup-user
17
+
18
+ # setup env variables
19
+ ARG STORJ_EMAIL='username@example.com'
20
+ ARG STORJ_PASS='password'
21
+ ARG STORJ_KEYPASS=''
22
+ ARG STORJ_MNEMONIC='abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about'
23
+ ARG STORJ_BRIDGE='http://127.0.0.1:6382'
24
+ ARG LIBSTORJ_INCLUDE='/storj/ruby-libstorj/ext/libstorj/src'
25
+ ENV STORJ_EMAIL=$STORJ_EMAIL
26
+ ENV STORJ_KEYPASS=$STORJ_KEYPASS
27
+ ENV STORJ_PASS=$STORJ_PASS
28
+ ENV STORJ_MNEMONIC=$STORJ_MNEMONIC
29
+ ENV STORJ_BRIDGE=$STORJ_BRIDGE
30
+ ENV LIBSTORJ_INCLUDE=$LIBSTORJ_INCLUDE
31
+
32
+ # remove STORJ_BRIDGE export in .bashrc
33
+ RUN sed -i '/export STORJ_BRIDGE.*/d' /root/.bashrc
34
+
35
+ RUN ./setup_user.sh
36
+
37
+ # useful if you want to interact with mongo from
38
+ # a "linked" container (e.g. python_libstorj)
39
+ # or from your host (if using just docker - don't forget `-p`)
40
+ EXPOSE 27017
41
+
42
+ WORKDIR /storj/ruby-libstorj
43
+ RUN gem install bundler
44
+ RUN bundle install
45
+ #RUN bundle exec rake install[no-test]
46
+
47
+ CMD /bin/bash
48
+ #CMD ["bundle", "exec", "rake"]
data/Gemfile CHANGED
@@ -1,10 +1,10 @@
1
1
  source 'https://rubygems.org' do
2
- gem 'rake'
3
2
  gem 'ffi' # Ruby FFI lib
4
3
  gem 'libuv' # libuv FFI bindings for ruby (https://github.com/cotag/libuv)
5
4
  ### libuv documentation -- http://docs.libuv.org/en/v1.x/
6
5
 
7
6
  group :test do
7
+ gem 'rake'
8
8
  gem 'rspec'
9
9
  gem 'rspec-wait'
10
10
  gem 'simplecov'
@@ -14,6 +14,7 @@ source 'https://rubygems.org' do
14
14
  group :development do
15
15
  gem 'pry' # debugging tools / REPL
16
16
  gem 'pry-byebug' # moar debugging tools
17
+ gem 'rake'
17
18
  gem 'rake-compiler'
18
19
  gem 'guard'
19
20
  gem 'guard-rake'
@@ -1,7 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-libstorj (1.0.0)
4
+ ruby-libstorj (1.0.1)
5
+ ffi (~> 1.9)
6
+ libuv (~> 3.2)
5
7
 
6
8
  GEM
7
9
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,9 +1,14 @@
1
- ruby-libstorj: Ruby bindings for libstorj
1
+ ruby-libstorj
2
2
  ===
3
+ [![Storj.io](https://storj.io/img/storj-badge.svg)](https://storj.io)
3
4
  [![Gem Version](https://badge.fury.io/rb/ruby-libstorj.svg)](https://badge.fury.io/rb/ruby-libstorj)
4
5
 
6
+ Ruby library for encrypted file transfer on the Storj network via bindings to [libstorj](https://github.com/Storj/libstorj).
7
+
5
8
  ## Using ruby-libstorj
6
9
 
10
+ ### First, install [`libstorj`](https://github.com/storj/libstorj)
11
+
7
12
  ### Install gem:
8
13
  + using bundler:
9
14
  ```
@@ -25,13 +30,29 @@ ruby-libstorj: Ruby bindings for libstorj
25
30
  ```
26
31
  (see [installing for development](#wip) if you have issues with `rake install`)
27
32
 
28
-
33
+ ### Usage:
34
+ Until more thorough documentation is available, please see the tests:
35
+ + [`LibStorj`](./spec/ruby-libstorj/libstorj_spec.rb) _[(source)](./lib/ruby-libstorj/libstorj.rb)_
36
+ - `LibStorj::Ext::Storj::Mixins` _[(source)](./lib/ruby-libstorj/mixins/storj.rb)_
37
+ - `.util_timestamp`
38
+ - `.util_datetime`
39
+ - `.mnemonic_check`
40
+ - `.mnemonic_generate`
41
+ + [`LibStorj::Env`](./spec/ruby-libstorj/env_spec.rb) _[(source)](./lib/ruby-libstorj/env.rb)_
42
+ - `#get_info`
43
+ - `#get_buckets`
44
+ - `#create_bucket`
45
+ - `#delete_bucket`
46
+ - `#store_file`
47
+ - `#resolve_file`
48
+ - `#list_files`
49
+ - `#delete_file`
29
50
 
30
51
  ## Developing ruby-libstorj
31
52
 
32
53
  This project primarily uses the ruby [`ffi`](https://rubygems.org/gems/ffi) (foreign function interface) gem api to bind to C/C++ libraries and plain old ruby for logic.
33
54
 
34
- If the ffi api becomes insufficient the ruby gem [`rice`](https://rubygems.org/gems/rice) has proven extremely useful for doing rub things in C/C++.
55
+ If the ffi api becomes insufficient the ruby gem [`rice`](https://rubygems.org/gems/rice) has proven extremely useful for doing ruby things in C/C++.
35
56
  Otherwise, you're going to want to read up on [ruby's C API](https://silverhammermba.github.io/emberb/c/)
36
57
 
37
58
  This project strives to conform to the ruby and rubygems standards and conventions. See [rubygems.org guide on "Make Your Own Gem"](http://guides.rubygems.org/make-your-own-gem/) for more.
@@ -4,7 +4,7 @@
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = 'ruby-libstorj'
7
- gem.version = '1.0.0' #LibStorj::VERSION
7
+ gem.version = '1.0.1' #LibStorj::VERSION
8
8
  gem.license = 'AGPL-3.0'
9
9
  gem.authors = ['Bryan White']
10
10
  gem.email = ['bryanchriswhite@gmail.com', 'bryan@storj.io']
@@ -19,10 +19,11 @@ Gem::Specification.new do |gem|
19
19
  gem.required_ruby_version = '>= 2.0.0'
20
20
  gem.require_paths = ['lib']
21
21
 
22
- # TODO: is this necessary?
23
- # gem.add_runtime_dependency '<gem name>', '~> <version>'
24
- #
25
- # gem.add_development_dependency '<gem name', '~> <version>'
22
+ gem.add_runtime_dependency 'ffi', '~> 1.9'
23
+ gem.add_runtime_dependency 'libuv', '~> 3.2'
24
+
25
+ gem.add_development_dependency 'rake', '~> 12.0'
26
+ gem.add_development_dependency 'rake-compiler', '~> 1.0'
26
27
 
27
28
  gem.files = `git ls-files`.split("\n").reject {|f| f =~ /^test/}
28
29
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-libstorj
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan White
@@ -9,7 +9,63 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2018-03-20 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ffi
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.9'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: libuv
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '12.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '12.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake-compiler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.0'
13
69
  description: Ruby bindings to the libstorj C Storj API library
14
70
  email:
15
71
  - bryanchriswhite@gmail.com
@@ -22,6 +78,7 @@ files:
22
78
  - ".gitignore"
23
79
  - ".gitmodules"
24
80
  - ".rspec"
81
+ - Dockerfile
25
82
  - Gemfile
26
83
  - Gemfile.lock
27
84
  - Guardfile