Simple connection to https://www.pcloud.com
- Ruby 2.x
- Rails >= 4.0
Add into Gemfile add:
gem 'pcloud', git: 'https://github.com/icotanchev/pcloud'
Then bundle install to install it
rails generate pcloud
which will generate config/pcloud.yml file to set auth_type, user name and password or OAuth token
auth_type: plain/oauth
username: YOUR_USERNAME
password: YOUR_PASSWORD
access_token: YOUR_OAUTH_TOEKB
Pcloud.upload(source_file_name, source_file_path, destination_folder_id)
Pcloud.list_folder(destination_folder_id)
Pcloud.create_folder(destination_folder_id, folder_name)
Pcloud.delete_folder(destination_folder_id)
Pcloud.delete_file(destination_file_id)
Pcloud.get_file_link(destination_file_id)
Pcloud.download_file(file_url, destination_path)
Pcloud.download_file_by_id(file_id, destination_path)
Config is released under the MIT License.