You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 11, 2020. It is now read-only.
* Add guard file
* file rename and removed ks structs
* rename to transfer spec
* Rename file item to file, and remove duplicate tests
* replaced ks structs with attr_accesors
* Added descriptions per tests
* Added board feature and made methods private
* disabled remote items
* Removed ks structs
* added classes for handling boards
* Added specs for remote board
* Removed items, and renamed web_items to links
* rename items to links
* Cleanup of if case
* add upload_file and get_board method
* Handle future links uploads, remove not used parts and update put_io method with use of classes
* Class attributes instea of hashes
* take default arguments
* Added request board method
* raise errors with the file name and remove true return
* Transform items from remote board to classes
* Set keyword arguments for classes and make them accessible with attr_reader
* Do one full test of all methods for boards
* Bump version
* skip transfer Tests for now
* Type + spacing
* single quotes
* Skip transfer tests for now
* add items to remote boards
* Added board builder spec
* add helper methods for transfers
* Adding transfer functionality
* wip
* edited upload_file to also handle transfer files
* Send empty hash instead of string for get requests
* rubocop
* complete_file accepts boards and transfers and transfers work now
* Rescue when no block is given
* change method name
* Remove unsupported method
* changed variable into let
* Check for items on future board
* Tests for future transfers
* refactor of the transfer builder tests
* Added tests for wetransfer_client class
* bumped wetransfer_style style
* Refactor nested meta-hash away.
Shortened some tests while in the process
* Consitency
* Implement guard (#34)
* Added guard and rubocop to project
* added guard description to readme
* remove pry calls
* fixed conflicts
* Extracted boards and transfers from the client
* return remote board or add files to board
* Version to module
* change to module class wetransfer
* Removed transfer/board depended methods
* removed all the object related methods into the object classes
* Removed private methods from client and placed them into the right classes, still some refactoring could be done.
* these gems needs to be added
* Restructuring the code
* removed gualrdfile from gitignore
* Moved transfers and boards into WT_client folder en renaming
* Integration tests for boards (#35)
* let’s pass down the whole object instead of the id
* Before doing the request, make sure we have a auth token.
* added feature tests
* Pass down the board object
* remove module from spec describe
* moved constant more upward
* added part size constant
* Change to fixnum for old ruby support (2.1)
* change Test for Integer to support older rubies(2.1)
* Remove specific target ruby version form rubocop rules
* make size output integer
* Test for kind integer
* no need for class
* Add rubocop to guard
* run guard inside group to halt if test fail
* wip Add upload and create method for boards (#38)
* Create a transfer and upload files with one method
* add a duplicate file checker
* Removed code smell and naming things/items
* Spec our generic status code check
* Use non-deprecated Rubies
* Resolve multiple minor issues
* Mark parts of our boards API experimental
An open source Ruby SDK for the WeTransfer Public API
3
+
The Ruby SDK that makes interacting with WeTransfer's Public API a breeze
4
+
5
+
This gem can be used to create transfers (as seen on WeTransfer.com) and boards (as seen in our [iOS app](https://itunes.apple.com/app/apple-store/id765359021?pt=10422800&ct=wetransfer-developer-portal&mt=8) and [Android app](https://play.google.com/store/apps/details?id=com.wetransfer.app.live&referrer=utm_source%3Dwetransfer%26utm_medium%3Ddeveloper-portal) ) alike.
4
6
5
7
For your API key and additional info please visit our [developer portal](https://developers.wetransfer.com).
6
8
@@ -9,12 +11,13 @@ For your API key and additional info please visit our [developer portal](https:/
You'll need to retrieve an API key from [our developer portal](https://developers.wetransfer.com).
40
41
41
-
Be sure to not commit this key to Github! If you do though, no worries, you can always revoke & create a new key from within the portal.
42
+
Be sure to not commit this key to Github! If you do though, you can always revoke it and create a new key from within the portal.
42
43
43
-
For configuring and storing secrets - like this API key - there are a variety of solutions. The smoothest here is creating a .env file:
44
+
For configuring and storing secrets - like this API key - there are a variety of solutions. The smoothest here is creating a `.env` file, and use a gem like [dotenv](https://github.com/bkeepers/dotenv).
44
45
45
46
Now that you've got a wonderful WeTransfer API key, create a .env file in your project folder:
46
47
47
-
$ touch .env
48
+
touch .env
49
+
50
+
You don't want the contents of this file to leave your system. Ever.
51
+
52
+
If the `.env` file is new, make sure to add it to your `.gitignore`, using the following command:
53
+
54
+
echo .env >> .gitignore
48
55
49
-
Check your `.gitignore`file and make sure it has `.env` listed!
56
+
Open the file in your text editor and add this line:
50
57
51
-
Now, open the file in your text editor and add this line:
58
+
WT_API_KEY=<your api key>
52
59
53
-
`WT_API_KEY=<your api key>`(without the <> brackets!)
60
+
Make sure to replace `<your api key>`by your actual api key. Don't include the pointy brackets!
54
61
55
-
Great! Now you can go to your project file and create the client:
62
+
Great! Now you can go to your project file and use the client.
63
+
64
+
## Transfers
65
+
66
+
A transfer is a collection of files that can be created once, and downloaded until it expires. Once a transfer is ready for sharing, it is closed for modifications.
# To get a link to your transfer, call `url` on your transfer object:
85
+
transfer.url => "https://we.tl/t-123234="
75
86
```
76
87
77
-
The upload will be performed at the end of the block.
88
+
The upload will be performed at the end of the block. Depending on your file sizes and network connection speed, this might take some time.
89
+
90
+
What are you waiting for? Open that link in your browser! Chop chop.
91
+
92
+
## Boards
93
+
94
+
A board is a collection of files and links, but it is open for modifications. Like your portfolio: While working, you can make adjustments to it. A board is a fantastic place for showcasing your work in progress.
95
+
96
+
Boards need a WeTransfer Client to be present, just like transfers.
items.add_web_url(url:'http://wepresent.wetransfer.com', title:'Time well spent')
114
+
end
115
+
116
+
puts board.url # => "https://we.tl/b-923478"
117
+
```
118
+
119
+
You've just created a board. It is visible on the internet, to share it with anyone.
78
120
79
121
## Development
122
+
80
123
You'll need to retrieve an API key from [our developer portal](https://developers.wetransfer.com), and as described above, store it in a local `.env` file. As always, do not commit this file to github! :)
81
124
82
125
After forking and cloning down the repo, run `bundle install` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
83
126
84
-
```
85
-
$ git clone <your fork>
86
-
$ cd wetransfer_ruby_sdk
87
-
$ bundle install
88
-
```
127
+
git clone <your fork> ./wetransfer_ruby_sdk
128
+
cd wetransfer_ruby_sdk
129
+
bundle install
89
130
90
131
To install this gem onto your local machine, run `bundle exec rake install`.
91
132
92
133
To execute to ruby specs, run:
93
134
94
-
```
95
-
$ bundle exec rspec
96
-
```
135
+
bundle exec rspec
97
136
98
137
Please note that we use rubocop to lint this gem -- be sure to run it prior to submitting a PR for maximum mergeability.
99
138
100
-
$ bundle exec rubocop
139
+
bundle exec rubocop
140
+
141
+
If any violations can be handled by rubocop, you can run auto-fix and it'll handle them for you, though do run the tests again and make sure it hasn't done something... unexpected.
142
+
143
+
bundle exec rubocop -a
101
144
102
-
If any violations can be handled by rubocop, you can run auto-fix and it'll handle them for you, though do run the tests again and make sure it hasn't done something ... unexpected.
145
+
For more convenience you also can run Guard, this checks all the tests and runs rubocop every time you save your files.
103
146
104
-
$ bundle exec rubocop -a
147
+
bundle exec guard
105
148
106
149
Hooray!
107
150
@@ -115,4 +158,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
115
158
116
159
## Code of Conduct
117
160
118
-
Everyone interacting in the WeTransfer Ruby SDK project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/WeTransfer/wetransfer_ruby_sdk/blob/master/.github/CODE_OF_CONDUCT.md).
161
+
Everyone interacting in the WeTransfer Ruby SDK project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/WeTransfer/wetransfer_ruby_sdk/blob/master/.github/CODE_OF_CONDUCT.md).
0 commit comments