files.com 1.1.186 → 1.1.187
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +72 -24
- data/_VERSION +1 -1
- data/lib/files.com/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33f2f11a2d2de88c9a6b4ea9567827e56c4d2314a59d6e4e89acc99a90ab8138
|
4
|
+
data.tar.gz: 034b20521c3925dc61ab04a46f29ea5f537928b40b52f1388028151c46d98a25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ca76d9dba94ae2067cadd2fd381139ada1484841c67d26cb66c457850c85a6b8483c0e7d235af6a947ad1f4b7c1c5dbbcbb77ad190684dda16ceec4c552189e
|
7
|
+
data.tar.gz: 172e3434d3e97b41e1ac8aa83b4dfa07127d2217fc00761bfcbb086206e361d63665da7f5d95ae0f76380b976e1345c7795f6a42c0789075594317b1bf88c86b
|
data/README.md
CHANGED
@@ -499,25 +499,7 @@ Files::FolderAdminPermissionRequiredError -> Files::NotAuthorizedError -> Files:
|
|
499
499
|
|`TrialLockedError`| `SiteConfigurationError` |
|
500
500
|
|`UserRequestsEnabledRequiredError`| `SiteConfigurationError` |
|
501
501
|
|
502
|
-
##
|
503
|
-
|
504
|
-
Files.com publishes a Files.com API server, which is useful for testing your use of the Files.com
|
505
|
-
SDKs and other direct integrations against the Files.com API in an integration test environment.
|
506
|
-
|
507
|
-
It is a Ruby app that operates as a minimal server for the purpose of testing basic network
|
508
|
-
operations and JSON encoding for your SDK or API client. It does not maintain state and it does not
|
509
|
-
deeply inspect your submissions for correctness.
|
510
|
-
|
511
|
-
Eventually we will add more features intended for integration testing, such as the ability to
|
512
|
-
intentionally provoke errors.
|
513
|
-
|
514
|
-
Download the server as a Docker image via [Docker Hub](https://hub.docker.com/r/filescom/files-mock-server).
|
515
|
-
|
516
|
-
The Source Code is also available on [GitHub](https://github.com/Files-com/files-mock-server).
|
517
|
-
|
518
|
-
A README is available on the GitHub link.
|
519
|
-
|
520
|
-
## File/Folder Operations
|
502
|
+
## Examples
|
521
503
|
|
522
504
|
The Files::File and Files::Dir models implement the standard Ruby API
|
523
505
|
for File and Dir, respectively. (Note that the Files.com SDK uses the
|
@@ -526,11 +508,15 @@ Files::Folder).
|
|
526
508
|
|
527
509
|
### Upload
|
528
510
|
|
511
|
+
#### Upload a File
|
512
|
+
|
529
513
|
```ruby
|
530
|
-
|
531
|
-
|
514
|
+
Files::File.upload_file("local.txt", "remote.txt")
|
515
|
+
```
|
516
|
+
|
517
|
+
#### Upload Raw File Data
|
532
518
|
|
533
|
-
|
519
|
+
```ruby
|
534
520
|
File.open("local.txt") do |local_file|
|
535
521
|
Files::File.open("remote.txt", "w") do |remote_file|
|
536
522
|
remote_file.write(local_file.read)
|
@@ -538,16 +524,78 @@ File.open("local.txt") do |local_file|
|
|
538
524
|
end
|
539
525
|
```
|
540
526
|
|
527
|
+
#### Create a Folder
|
528
|
+
|
529
|
+
```ruby
|
530
|
+
Files::Folder.create("path/to/folder/to/be/created",
|
531
|
+
mkdir_parents: true
|
532
|
+
)
|
533
|
+
```
|
534
|
+
|
541
535
|
### Download
|
542
536
|
|
537
|
+
#### Download a File
|
538
|
+
|
543
539
|
```ruby
|
544
|
-
Files::File.
|
540
|
+
Files::File.download_file("remote.txt", "local.txt")
|
545
541
|
```
|
546
542
|
|
547
543
|
### List
|
548
544
|
|
545
|
+
#### List Folder Contents
|
546
|
+
|
549
547
|
```ruby
|
550
|
-
Files::Folder.list_for("/").each do |file|
|
548
|
+
Files::Folder.list_for("remote/path/to/folder/").each do |file|
|
551
549
|
puts file.path
|
552
550
|
end
|
553
551
|
```
|
552
|
+
|
553
|
+
### Copy
|
554
|
+
|
555
|
+
The copy method works for both files and folders.
|
556
|
+
|
557
|
+
```ruby
|
558
|
+
file = Files::File.new("source/path")
|
559
|
+
file.copy(destination: "destination/path")
|
560
|
+
```
|
561
|
+
|
562
|
+
### Move
|
563
|
+
|
564
|
+
The move method works for both files and folders.
|
565
|
+
|
566
|
+
```ruby
|
567
|
+
file = Files::File.new("source/path")
|
568
|
+
file.move(destination: "destination/path")
|
569
|
+
```
|
570
|
+
|
571
|
+
### Delete
|
572
|
+
|
573
|
+
The delete method works for both files and folders.
|
574
|
+
|
575
|
+
```ruby
|
576
|
+
Files::File.delete("path/to/file/or/folder")
|
577
|
+
```
|
578
|
+
|
579
|
+
In case the folder is not empty, you can use the `recursive` argument:
|
580
|
+
|
581
|
+
```ruby
|
582
|
+
Files::File.delete("path/to/folder", recursive: true)
|
583
|
+
```
|
584
|
+
|
585
|
+
## Mock Server
|
586
|
+
|
587
|
+
Files.com publishes a Files.com API server, which is useful for testing your use of the Files.com
|
588
|
+
SDKs and other direct integrations against the Files.com API in an integration test environment.
|
589
|
+
|
590
|
+
It is a Ruby app that operates as a minimal server for the purpose of testing basic network
|
591
|
+
operations and JSON encoding for your SDK or API client. It does not maintain state and it does not
|
592
|
+
deeply inspect your submissions for correctness.
|
593
|
+
|
594
|
+
Eventually we will add more features intended for integration testing, such as the ability to
|
595
|
+
intentionally provoke errors.
|
596
|
+
|
597
|
+
Download the server as a Docker image via [Docker Hub](https://hub.docker.com/r/filescom/files-mock-server).
|
598
|
+
|
599
|
+
The Source Code is also available on [GitHub](https://github.com/Files-com/files-mock-server).
|
600
|
+
|
601
|
+
A README is available on the GitHub link.
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.187
|
data/lib/files.com/version.rb
CHANGED