Sha256: 846a7099fc8b75199366138ac9c5d4c375e3131b45602c5d5cb5dd44ed985701

Contents?: true

Size: 1.74 KB

Versions: 2

Compression:

Stored size: 1.74 KB

Contents

# Rmega

Ruby library for the Mega.co.nz API.  
Tested using ruby 1.9.3+ (OpenSSL 0.9.8r+)

<div style="background-color: #000000; border-radius: 8px">
  <img src="https://eu.static.mega.co.nz/images/mega/logo.png" />
</div>



## Usage

```ruby
storage = Rmega.login 'your_email', 'your_password'

# Fetch all the nodes (files, folders, ecc.)
nodes = storage.nodes

# Find all nodes which name match a regexp
nodes = storage.nodes_by_name /my.document/i

# Download a file
my_node.download '~/Download' # The name of the node is used
my_node.download '~/Download/mydocument_42.zip' # Specify a new name

# Download a file using a given url
storage.download 'https://mega.co.nz/#!cER0GYbD!ZCHruEzLghAcEZuD44Dp0k--6m5duA08Xl4a_bUZYMI', '~/Download'

# Upload a file (to the root node)
storage.upload '~/Downloads/my_file.zip'

# Upload a file to a specific folder
storage.upload '~/Downloads/my_file.zip', folder_node

# Trash a node
my_node.trash

# Gets the public url (the sharable one) of a file
my_node.public_url

# See the attributes of a node
my_node.attributes

# Find all nodes of certain type
# types are: file, dir, root, inbox, trash
files   = storage.nodes_by_type :file
folders = storage.nodes_by_type :dir

```


## Installation

Add this line to your application's Gemfile:

    gem 'rmega'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rmega


## 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


## Copyright

This work is the result of a reverse engineering of the Mega's Javascript code.

Copyright (c) 2013 Daniele Molteni  
MIT License

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rmega-0.0.3 README.md
rmega-0.0.2 README.md