brick_ftp 1.0.0 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +10 -3
  3. data/.github/action/publish_gem/Dockerfile +14 -0
  4. data/.github/action/publish_gem/entrypoint.sh +18 -0
  5. data/.github/action/write_github_release/Dockerfile +14 -0
  6. data/.github/action/write_github_release/entrypoint.sh +48 -0
  7. data/.github/main.workflow +14 -0
  8. data/CHANGELOG.md +77 -2
  9. data/README.md +6 -3
  10. data/brick_ftp.gemspec +1 -2
  11. data/lib/brick_ftp.rb +2 -1
  12. data/lib/brick_ftp/restful_api.rb +11 -11
  13. data/lib/brick_ftp/restful_api/add_group_member.rb +2 -2
  14. data/lib/brick_ftp/restful_api/client.rb +4 -2
  15. data/lib/brick_ftp/restful_api/complete_upload.rb +2 -2
  16. data/lib/brick_ftp/restful_api/continue_upload.rb +2 -2
  17. data/lib/brick_ftp/restful_api/copy_folder.rb +1 -1
  18. data/lib/brick_ftp/restful_api/count_folder_contents.rb +3 -3
  19. data/lib/brick_ftp/restful_api/count_users.rb +1 -1
  20. data/lib/brick_ftp/restful_api/create_api_key.rb +2 -2
  21. data/lib/brick_ftp/restful_api/create_behavior.rb +2 -2
  22. data/lib/brick_ftp/restful_api/create_bundle.rb +2 -2
  23. data/lib/brick_ftp/restful_api/create_folder.rb +1 -1
  24. data/lib/brick_ftp/restful_api/create_group.rb +2 -2
  25. data/lib/brick_ftp/restful_api/create_notification.rb +2 -2
  26. data/lib/brick_ftp/restful_api/create_permission.rb +2 -2
  27. data/lib/brick_ftp/restful_api/create_public_key.rb +2 -2
  28. data/lib/brick_ftp/restful_api/create_user.rb +2 -2
  29. data/lib/brick_ftp/restful_api/create_user_in_group.rb +2 -2
  30. data/lib/brick_ftp/restful_api/delete_api_key.rb +1 -1
  31. data/lib/brick_ftp/restful_api/delete_behavior.rb +1 -1
  32. data/lib/brick_ftp/restful_api/delete_bundle.rb +1 -1
  33. data/lib/brick_ftp/restful_api/delete_folder.rb +5 -7
  34. data/lib/brick_ftp/restful_api/delete_group.rb +1 -1
  35. data/lib/brick_ftp/restful_api/delete_notification.rb +1 -1
  36. data/lib/brick_ftp/restful_api/delete_permission.rb +1 -1
  37. data/lib/brick_ftp/restful_api/delete_public_key.rb +1 -1
  38. data/lib/brick_ftp/restful_api/delete_user.rb +1 -1
  39. data/lib/brick_ftp/restful_api/download_file.rb +2 -2
  40. data/lib/brick_ftp/restful_api/get_api_key.rb +2 -2
  41. data/lib/brick_ftp/restful_api/get_behavior.rb +2 -2
  42. data/lib/brick_ftp/restful_api/get_bundle.rb +2 -2
  43. data/lib/brick_ftp/restful_api/get_bundle_zip.rb +2 -2
  44. data/lib/brick_ftp/restful_api/get_file_in_bundle.rb +2 -2
  45. data/lib/brick_ftp/restful_api/get_folder_size.rb +1 -1
  46. data/lib/brick_ftp/restful_api/get_group.rb +2 -2
  47. data/lib/brick_ftp/restful_api/get_public_key.rb +2 -2
  48. data/lib/brick_ftp/restful_api/get_site_usage.rb +1 -1
  49. data/lib/brick_ftp/restful_api/get_user.rb +2 -2
  50. data/lib/brick_ftp/restful_api/list_api_keys.rb +2 -2
  51. data/lib/brick_ftp/restful_api/list_behaviors.rb +2 -2
  52. data/lib/brick_ftp/restful_api/list_bundle_contents.rb +2 -2
  53. data/lib/brick_ftp/restful_api/list_bundles.rb +2 -2
  54. data/lib/brick_ftp/restful_api/list_folder_behaviors.rb +2 -2
  55. data/lib/brick_ftp/restful_api/list_folders.rb +2 -2
  56. data/lib/brick_ftp/restful_api/list_groups.rb +2 -2
  57. data/lib/brick_ftp/restful_api/list_notifications.rb +2 -2
  58. data/lib/brick_ftp/restful_api/list_permissions.rb +2 -2
  59. data/lib/brick_ftp/restful_api/list_public_keys.rb +2 -2
  60. data/lib/brick_ftp/restful_api/list_users.rb +2 -2
  61. data/lib/brick_ftp/restful_api/move_folder.rb +1 -1
  62. data/lib/brick_ftp/restful_api/remove_group_member.rb +1 -1
  63. data/lib/brick_ftp/restful_api/retrieve_file_history.rb +1 -1
  64. data/lib/brick_ftp/restful_api/retrieve_folder_history.rb +1 -1
  65. data/lib/brick_ftp/restful_api/retrieve_history.rb +1 -1
  66. data/lib/brick_ftp/restful_api/retrieve_login_history.rb +1 -1
  67. data/lib/brick_ftp/restful_api/retrieve_site_history.rb +1 -1
  68. data/lib/brick_ftp/restful_api/retrieve_user_history.rb +1 -1
  69. data/lib/brick_ftp/restful_api/search_user.rb +2 -2
  70. data/lib/brick_ftp/restful_api/start_upload.rb +2 -2
  71. data/lib/brick_ftp/restful_api/unlock_user.rb +2 -2
  72. data/lib/brick_ftp/restful_api/update_behavior.rb +2 -2
  73. data/lib/brick_ftp/restful_api/update_group.rb +2 -2
  74. data/lib/brick_ftp/restful_api/update_group_member.rb +2 -2
  75. data/lib/brick_ftp/restful_api/update_user.rb +2 -2
  76. data/lib/brick_ftp/restful_api/upload_file.rb +4 -4
  77. data/lib/brick_ftp/types/behavior.rb +4 -2
  78. data/lib/brick_ftp/types/bundle.rb +4 -2
  79. data/lib/brick_ftp/types/bundle_content.rb +4 -2
  80. data/lib/brick_ftp/types/bundle_zip.rb +4 -2
  81. data/lib/brick_ftp/types/file.rb +4 -2
  82. data/lib/brick_ftp/types/file_in_bundle.rb +4 -2
  83. data/lib/brick_ftp/types/folder_contents_count.rb +5 -3
  84. data/lib/brick_ftp/types/group.rb +4 -2
  85. data/lib/brick_ftp/types/group_membership.rb +4 -2
  86. data/lib/brick_ftp/types/history.rb +4 -2
  87. data/lib/brick_ftp/types/ignore_undefined_attributes.rb +11 -0
  88. data/lib/brick_ftp/types/notification.rb +4 -2
  89. data/lib/brick_ftp/types/permission.rb +4 -2
  90. data/lib/brick_ftp/types/site_usage.rb +3 -1
  91. data/lib/brick_ftp/types/upload.rb +4 -2
  92. data/lib/brick_ftp/types/user.rb +4 -2
  93. data/lib/brick_ftp/types/user_api_key.rb +4 -2
  94. data/lib/brick_ftp/types/user_public_key.rb +4 -2
  95. data/lib/brick_ftp/version.rb +1 -1
  96. metadata +14 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 776279ef2f09b842d7a59865c84df4f22ea890eda837d16d4aae614fe8e5e247
4
- data.tar.gz: 39033de2755ac6b275ef08c2803c223af2d226b2366645c1964e4e49d5289d6e
3
+ metadata.gz: f89f5228f66c2b5a9b36d711b39ed799d41eb2257106a3306d15f87baff57859
4
+ data.tar.gz: e3e76df6a6829230a55168dd76e82d659967a232d5a19f8cde26ee0686ce3607
5
5
  SHA512:
6
- metadata.gz: 3e404fb4fde9f08d3f7cd1f1ee52b15337d53c8026d15116fb011dad26f63455edfc58aa6e1d89eb9e1b844cc179f042985200bc47e884d0b8c575f108350773
7
- data.tar.gz: d60af19f6f3ac2c547ba09248a89fa63ba70bdc1af017808fcf510e8da5c6d5e9a58a1b328ed1b605cb76dc23296425e05ff67bc78716e2c06281b7968ed32d3
6
+ metadata.gz: a796baec9ec77b321d2856b59efcd7a45ccb665ae23df4cd4d82d1814894de43d4d4502000824ddc2eae00f89440fdaad0a7d7a300e99d0fe8c4930b968a7f30
7
+ data.tar.gz: 1eccf58c09d2ed1dd3c96ebb3ebf3bbae8675b9d5bf076f11793e96746fa7c03fd34e5413e098007a4ec27953755b7cf06780b4d033ad5896a2914b01347df0b
@@ -18,9 +18,6 @@ jobs:
18
18
  - run:
19
19
  name: RSpec
20
20
  command: rspec
21
- - store_artifacts:
22
- path: coverage
23
- destination: coverage
24
21
  ruby-2.3:
25
22
  <<: *build
26
23
  docker:
@@ -33,6 +30,14 @@ jobs:
33
30
  <<: *build
34
31
  docker:
35
32
  - image: circleci/ruby:2.5
33
+ ruby-2.6:
34
+ <<: *build
35
+ docker:
36
+ - image: circleci/ruby:2.6
37
+ ruby-2.7:
38
+ <<: *build
39
+ docker:
40
+ - image: circleci/ruby:2.7
36
41
 
37
42
  workflows:
38
43
  version: 2
@@ -41,3 +46,5 @@ workflows:
41
46
  - ruby-2.3
42
47
  - ruby-2.4
43
48
  - ruby-2.5
49
+ - ruby-2.6
50
+ - ruby-2.7
@@ -0,0 +1,14 @@
1
+ FROM ruby:alpine
2
+ LABEL "com.github.actions.name"="Publish Gem"
3
+ LABEL "com.github.actions.description"="Publish gem to rubygems.org"
4
+ LABEL "com.github.actions.icon"="truck"
5
+ LABEL "com.github.actions.color"="green"
6
+ LABEL "repository"="https://github.com/koshigoe/brick_ftp"
7
+ LABEL "homepage"="https://github.com/koshigoe/brick_ftp"
8
+ LABEL "maintainer"="koshigoe <koshigoeb@gmail.com>"
9
+
10
+ RUN apk update -q \
11
+ && apk add -q --no-cache curl jq git
12
+
13
+ ADD entrypoint.sh /entrypoint.sh
14
+ ENTRYPOINT ["/entrypoint.sh"]
@@ -0,0 +1,18 @@
1
+ #!/bin/ash -eu
2
+
3
+ action=$(jq -r '.action' $GITHUB_EVENT_PATH)
4
+ if [ "$action" != "published" ]; then
5
+ exit 0
6
+ fi
7
+
8
+ cd $GITHUB_WORKSPACE
9
+
10
+ mkdir -p ~/.gem
11
+ cat <<EOF > ~/.gem/credentials
12
+ ---
13
+ :rubygems_api_key: $RUBYGEMS_TOKEN
14
+ EOF
15
+ chmod 0600 ~/.gem/credentials
16
+
17
+ gem build *.gemspec
18
+ gem push *.gem
@@ -0,0 +1,14 @@
1
+ FROM alpine:3.8
2
+ LABEL "com.github.actions.name"="Write GitHub Release"
3
+ LABEL "com.github.actions.description"="Write merged PRs into latest GitHub Release"
4
+ LABEL "com.github.actions.icon"="edit"
5
+ LABEL "com.github.actions.color"="blue"
6
+ LABEL "repository"="https://github.com/koshigoe/brick_ftp"
7
+ LABEL "homepage"="https://github.com/koshigoe/brick_ftp"
8
+ LABEL "maintainer"="koshigoe <koshigoeb@gmail.com>"
9
+
10
+ RUN apk update -q \
11
+ && apk add -q --no-cache curl jq
12
+
13
+ ADD entrypoint.sh /entrypoint.sh
14
+ ENTRYPOINT ["/entrypoint.sh"]
@@ -0,0 +1,48 @@
1
+ #!/bin/ash -eu
2
+
3
+ action=$(jq -r '.action' $GITHUB_EVENT_PATH)
4
+ if [ "$action" != "published" ]; then
5
+ exit 0
6
+ fi
7
+
8
+ # Get previous GitHub Release.
9
+ curl --fail -s \
10
+ -u $GITHUB_ACTOR:$GITHUB_TOKEN \
11
+ https://api.github.com/repos/$GITHUB_REPOSITORY/releases \
12
+ | jq -r '.[1]' \
13
+ > previous_release.json
14
+ previous_published_date=$(jq -r '.published_at' previous_release.json)
15
+
16
+ # Get latest published date.
17
+ latest_published_date=$(jq -r '.release.published_at' $GITHUB_EVENT_PATH)
18
+
19
+ # Get latest GitHub Release ID.
20
+ latest_release_id=$(jq -r '.release.id' $GITHUB_EVENT_PATH)
21
+
22
+ # Get merged PRs
23
+ merged_pr_list=$(
24
+ curl --fail -s \
25
+ -u $GITHUB_ACTOR:$GITHUB_TOKEN \
26
+ "https://api.github.com/search/issues?q=repo:${GITHUB_REPOSITORY}+is:pr+base:master+merged:${previous_published_date}..${latest_published_date}" \
27
+ | jq -r '.items[] | ["- #" + (.number | tostring) + " " + .title] | @tsv' \
28
+ | sort -k 3)
29
+
30
+ # Get comparable tags
31
+ previous_tag_name=$(jq -r '.tag_name' previous_release.json)
32
+ latest_tag_name=$(jq -r '.release.tag_name' $GITHUB_EVENT_PATH)
33
+
34
+ # Make release note.
35
+ release_note=$(cat <<EOF | sed ':a;N;$!ba;s/\n/\\n/g')
36
+ https://github.com/$GITHUB_REPOSITORY/compare/${previous_tag_name}...${latest_tag_name}
37
+
38
+ ### Merged
39
+
40
+ $merged_pr_list
41
+ EOF
42
+
43
+ # Update body of latest GitHub Release.
44
+ curl --fail -s \
45
+ -u $GITHUB_ACTOR:$GITHUB_TOKEN \
46
+ -X PATCH \
47
+ -d "{\"body\":\"${release_note}\"}" \
48
+ https://api.github.com/repos/$GITHUB_REPOSITORY/releases/$latest_release_id
@@ -0,0 +1,14 @@
1
+ workflow "Release" {
2
+ on = "release"
3
+ resolves = ["Write GitHub Release", "Publish Gem"]
4
+ }
5
+
6
+ action "Write GitHub Release" {
7
+ uses = "./.github/action/write_github_release"
8
+ secrets = ["GITHUB_TOKEN"]
9
+ }
10
+
11
+ action "Publish Gem" {
12
+ uses = "./.github/action/publish_gem"
13
+ secrets = ["GITHUB_TOKEN", "RUBYGEMS_TOKEN"]
14
+ }
@@ -1,19 +1,94 @@
1
1
  Changelog
2
2
  ====
3
3
 
4
+ The official Ruby SDK released by Files.com
4
5
 
5
- [unreleased](https://github.com/koshigoe/brick_ftp/compare/v1.0.0...master)
6
+ > SDKs in Ruby and PHP are available for download using the typical package manager for each language.
7
+ > https://developers.files.com/?ruby#introduction
8
+
9
+ Its usage like:
10
+
11
+ ```ruby
12
+ Files.api_key = 'YOUR_API_KEY'
13
+
14
+ # Alternatively, you can specify the API key on a per-request basis in the final parameter to any method or initializer.
15
+ Files::User.new(params, api_key: 'YOUR_API_KEY')
16
+ ```
17
+
18
+ I will archive this repository after found official SDK.
19
+
20
+
21
+ [v2.0.3](https://github.com/koshigoe/brick_ftp/compare/v2.0.2...v2.0.3)
22
+ ----
23
+
24
+ [Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v2.0.2...v2.0.3)
25
+
26
+ ### Enhancements:
27
+
28
+ ### Fixed Bugs:
29
+
30
+ - [#133](https://github.com/koshigoe/brick_ftp/pull/133) Fix to enable to delete folders recursively
31
+
32
+ ### Breaking Changes:
33
+
34
+
35
+ [v2.0.2](https://github.com/koshigoe/brick_ftp/compare/v2.0.1...v2.0.2)
6
36
  ----
7
37
 
8
- [Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v1.0.0...master)
38
+ [Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v2.0.1...v2.0.2)
9
39
 
10
40
  ### Enhancements:
11
41
 
42
+ - [#132](https://github.com/koshigoe/brick_ftp/pull/132) Suppress warnings in Ruby 2.7
43
+
12
44
  ### Fixed Bugs:
13
45
 
14
46
  ### Breaking Changes:
15
47
 
16
48
 
49
+ [v2.0.1](https://github.com/koshigoe/brick_ftp/compare/v2.0.0...v2.0.1)
50
+ ----
51
+
52
+ [Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v2.0.0...v2.0.1)
53
+
54
+ ### Enhancements:
55
+
56
+ ### Fixed Bugs:
57
+
58
+ - [#124](https://github.com/koshigoe/brick_ftp/pull/124) Handle response 204 No Content avoid to parse error.
59
+
60
+ ### Breaking Changes:
61
+
62
+
63
+ [v2.0.0](https://github.com/koshigoe/brick_ftp/compare/v1.0.1...v2.0.0)
64
+ ----
65
+
66
+ [Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v1.0.1...v2.0.0)
67
+
68
+ ### Enhancements:
69
+
70
+ - [#119](https://github.com/koshigoe/brick_ftp/pull/119) Change domain of API endpoint.
71
+ - _**Please check your SSL cert of new custom domain before update this gem.**_
72
+
73
+ ### Fixed Bugs:
74
+
75
+ ### Breaking Changes:
76
+
77
+
78
+ [v1.0.1](https://github.com/koshigoe/brick_ftp/compare/v1.0.0...v1.0.1)
79
+ ----
80
+
81
+ [Full Changelog](https://github.com/koshigoe/brick_ftp/compare/v1.0.0...v1.0.1)
82
+
83
+ ### Enhancements:
84
+
85
+ ### Fixed Bugs:
86
+
87
+ - [#117](https://github.com/koshigoe/brick_ftp/pull/117) Ignore undefined attributes.
88
+
89
+ ### Breaking Changes:
90
+
91
+
17
92
  [v1.0.0](https://github.com/koshigoe/brick_ftp/compare/v0.8.2...v1.0.0)
18
93
  ----
19
94
 
data/README.md CHANGED
@@ -1,11 +1,14 @@
1
1
  [![CircleCI](https://circleci.com/gh/koshigoe/brick_ftp/tree/master.svg?style=svg)](https://circleci.com/gh/koshigoe/brick_ftp/tree/master)
2
- [![codecov](https://codecov.io/gh/koshigoe/brick_ftp/branch/master/graph/badge.svg)](https://codecov.io/gh/koshigoe/brick_ftp)
2
+ [![Maintainability](https://api.codeclimate.com/v1/badges/b996c388d3d32b7ec953/maintainability)](https://codeclimate.com/github/koshigoe/brick_ftp/maintainability)
3
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/b996c388d3d32b7ec953/test_coverage)](https://codeclimate.com/github/koshigoe/brick_ftp/test_coverage)
3
4
 
4
5
 
5
- BrickFTP
6
+ Files.com (BrickFTP)
6
7
  ====
7
8
 
8
- This is a [BrickFTP](https://brickftp.com/)'s _unofficial_ [RESTful API](https://developers.brickftp.com/) Client.
9
+ This is a [File.com (BrickFTP)](https://files.com/)'s _unofficial_ [RESTful API](https://developers.files.com/) Client.
10
+
11
+ **I recommend official SDK: [Files-com/files-sdk-ruby](https://github.com/Files-com/files-sdk-ruby)**
9
12
 
10
13
 
11
14
  Installation
@@ -22,8 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.required_ruby_version = '>= 2.3.0'
24
24
 
25
- spec.add_development_dependency 'bundler', '~> 1.16'
26
- spec.add_development_dependency 'codecov', '~> 0.1.10'
25
+ spec.add_development_dependency 'bundler', '>= 1.16'
27
26
  spec.add_development_dependency 'pry', '~> 0.11'
28
27
  spec.add_development_dependency 'rake', '~> 12.0'
29
28
  spec.add_development_dependency 'redcarpet', '~> 3.4'
@@ -6,10 +6,11 @@ require 'brick_ftp/core_ext'
6
6
  require 'brick_ftp/utils'
7
7
  require 'brick_ftp/utils/chunk_io'
8
8
  require 'brick_ftp/types'
9
+ require 'brick_ftp/types/ignore_undefined_attributes'
9
10
  require 'brick_ftp/restful_api'
10
11
 
11
12
  module BrickFTP
12
- # https://brickftp.com/redundancy/
13
+ # https://files.com/redundancy/
13
14
  IP_ADDRESSES = %w[
14
15
  54.193.69.72
15
16
  54.193.69.200
@@ -5,7 +5,7 @@ module BrickFTP
5
5
  autoload :Client, 'brick_ftp/restful_api/client'
6
6
  autoload :Command, 'brick_ftp/restful_api/command'
7
7
  autoload :GetSiteUsage, 'brick_ftp/restful_api/get_site_usage'
8
- # ref. https://developers.brickftp.com/#users
8
+ # ref. https://developers.files.com/#users
9
9
  autoload :ListUsers, 'brick_ftp/restful_api/list_users'
10
10
  autoload :CountUsers, 'brick_ftp/restful_api/count_users'
11
11
  autoload :SearchUser, 'brick_ftp/restful_api/search_user'
@@ -14,17 +14,17 @@ module BrickFTP
14
14
  autoload :UpdateUser, 'brick_ftp/restful_api/update_user'
15
15
  autoload :DeleteUser, 'brick_ftp/restful_api/delete_user'
16
16
  autoload :UnlockUser, 'brick_ftp/restful_api/unlock_user'
17
- # ref. https://developers.brickftp.com/#user-api-keys
17
+ # ref. https://developers.files.com/#user-api-keys
18
18
  autoload :ListAPIKeys, 'brick_ftp/restful_api/list_api_keys'
19
19
  autoload :GetAPIKey, 'brick_ftp/restful_api/get_api_key'
20
20
  autoload :CreateAPIKey, 'brick_ftp/restful_api/create_api_key'
21
21
  autoload :DeleteAPIKey, 'brick_ftp/restful_api/delete_api_key'
22
- # ref. https://developers.brickftp.com/#user-public-keys
22
+ # ref. https://developers.files.com/#user-public-keys
23
23
  autoload :ListPublicKeys, 'brick_ftp/restful_api/list_public_keys'
24
24
  autoload :GetPublicKey, 'brick_ftp/restful_api/get_public_key'
25
25
  autoload :CreatePublicKey, 'brick_ftp/restful_api/create_public_key'
26
26
  autoload :DeletePublicKey, 'brick_ftp/restful_api/delete_public_key'
27
- # ref. https://developers.brickftp.com/#groups
27
+ # ref. https://developers.files.com/#groups
28
28
  autoload :ListGroups, 'brick_ftp/restful_api/list_groups'
29
29
  autoload :GetGroup, 'brick_ftp/restful_api/get_group'
30
30
  autoload :CreateGroup, 'brick_ftp/restful_api/create_group'
@@ -34,22 +34,22 @@ module BrickFTP
34
34
  autoload :AddGroupMember, 'brick_ftp/restful_api/add_group_member'
35
35
  autoload :UpdateGroupMember, 'brick_ftp/restful_api/update_group_member'
36
36
  autoload :RemoveGroupMember, 'brick_ftp/restful_api/remove_group_member'
37
- # ref. https://developers.brickftp.com/#permissions
37
+ # ref. https://developers.files.com/#permissions
38
38
  autoload :ListPermissions, 'brick_ftp/restful_api/list_permissions'
39
39
  autoload :CreatePermission, 'brick_ftp/restful_api/create_permission'
40
40
  autoload :DeletePermission, 'brick_ftp/restful_api/delete_permission'
41
- # ref. https://developers.brickftp.com/#notifications
41
+ # ref. https://developers.files.com/#notifications
42
42
  autoload :ListNotifications, 'brick_ftp/restful_api/list_notifications'
43
43
  autoload :CreateNotification, 'brick_ftp/restful_api/create_notification'
44
44
  autoload :DeleteNotification, 'brick_ftp/restful_api/delete_notification'
45
- # ref. https://developers.brickftp.com/#history
45
+ # ref. https://developers.files.com/#history
46
46
  autoload :RetrieveHistory, 'brick_ftp/restful_api/retrieve_history'
47
47
  autoload :RetrieveSiteHistory, 'brick_ftp/restful_api/retrieve_site_history'
48
48
  autoload :RetrieveLoginHistory, 'brick_ftp/restful_api/retrieve_login_history'
49
49
  autoload :RetrieveUserHistory, 'brick_ftp/restful_api/retrieve_user_history'
50
50
  autoload :RetrieveFolderHistory, 'brick_ftp/restful_api/retrieve_folder_history'
51
51
  autoload :RetrieveFileHistory, 'brick_ftp/restful_api/retrieve_file_history'
52
- # ref. https://developers.brickftp.com/#bundles
52
+ # ref. https://developers.files.com/#bundles
53
53
  autoload :ListBundles, 'brick_ftp/restful_api/list_bundles'
54
54
  autoload :GetBundle, 'brick_ftp/restful_api/get_bundle'
55
55
  autoload :CreateBundle, 'brick_ftp/restful_api/create_bundle'
@@ -57,14 +57,14 @@ module BrickFTP
57
57
  autoload :ListBundleContents, 'brick_ftp/restful_api/list_bundle_contents'
58
58
  autoload :GetFileInBundle, 'brick_ftp/restful_api/get_file_in_bundle'
59
59
  autoload :GetBundleZip, 'brick_ftp/restful_api/get_bundle_zip'
60
- # ref. https://developers.brickftp.com/#behaviors
60
+ # ref. https://developers.files.com/#behaviors
61
61
  autoload :ListBehaviors, 'brick_ftp/restful_api/list_behaviors'
62
62
  autoload :ListFolderBehaviors, 'brick_ftp/restful_api/list_folder_behaviors'
63
63
  autoload :GetBehavior, 'brick_ftp/restful_api/get_behavior'
64
64
  autoload :CreateBehavior, 'brick_ftp/restful_api/create_behavior'
65
65
  autoload :UpdateBehavior, 'brick_ftp/restful_api/update_behavior'
66
66
  autoload :DeleteBehavior, 'brick_ftp/restful_api/delete_behavior'
67
- # ref. https://developers.brickftp.com/#file-and-folder-operations
67
+ # ref. https://developers.files.com/#file-and-folder-operations
68
68
  autoload :ListFolders, 'brick_ftp/restful_api/list_folders'
69
69
  autoload :CreateFolder, 'brick_ftp/restful_api/create_folder'
70
70
  autoload :CountFolderContents, 'brick_ftp/restful_api/count_folder_contents'
@@ -73,7 +73,7 @@ module BrickFTP
73
73
  autoload :MoveFolder, 'brick_ftp/restful_api/move_folder'
74
74
  autoload :CopyFolder, 'brick_ftp/restful_api/copy_folder'
75
75
  autoload :DeleteFolder, 'brick_ftp/restful_api/delete_folder'
76
- # ref. https://developers.brickftp.com/#file-uploading
76
+ # ref. https://developers.files.com/#file-uploading
77
77
  autoload :StartUpload, 'brick_ftp/restful_api/start_upload'
78
78
  autoload :ContinueUpload, 'brick_ftp/restful_api/continue_upload'
79
79
  autoload :CompleteUpload, 'brick_ftp/restful_api/complete_upload'
@@ -4,7 +4,7 @@ module BrickFTP
4
4
  module RESTfulAPI
5
5
  # Add a member
6
6
  #
7
- # @see https://developers.brickftp.com/#add-a-member Add a member
7
+ # @see https://developers.files.com/#add-a-member Add a member
8
8
  #
9
9
  # ### Params
10
10
  #
@@ -37,7 +37,7 @@ module BrickFTP
37
37
  def call(group_id, user_id, params)
38
38
  res = client.put("/api/rest/v1/groups/#{group_id}/memberships/#{user_id}.json", membership: params.to_h.compact)
39
39
 
40
- BrickFTP::Types::GroupMembership.new(res.symbolize_keys)
40
+ BrickFTP::Types::GroupMembership.new(**res.symbolize_keys)
41
41
  end
42
42
  end
43
43
  end
@@ -13,7 +13,7 @@ module BrickFTP
13
13
  READ_TIMEOUT = 60
14
14
  USER_AGENT = 'BrickFTP Client/1.0 (https://github.com/koshigoe/brick_ftp)'
15
15
 
16
- # ref. https://developers.brickftp.com/#errors
16
+ # ref. https://developers.files.com/#errors
17
17
  ErrorResponse = Struct.new(
18
18
  'RESTfulAPIErrorResponse',
19
19
  :error,
@@ -39,7 +39,7 @@ module BrickFTP
39
39
  # @param [String] api_key
40
40
  #
41
41
  def initialize(subdomain, api_key)
42
- @http = Net::HTTP.new("#{subdomain}.brickftp.com", 443)
42
+ @http = Net::HTTP.new("#{subdomain}.files.com", 443)
43
43
  @http.use_ssl = true
44
44
  @http.open_timeout = OPEN_TIMEOUT
45
45
  @http.read_timeout = READ_TIMEOUT
@@ -153,6 +153,8 @@ module BrickFTP
153
153
 
154
154
  def handle_response(response)
155
155
  case response
156
+ when Net::HTTPNoContent
157
+ nil
156
158
  when Net::HTTPSuccess
157
159
  parse_success_response(response)
158
160
  else
@@ -6,7 +6,7 @@ module BrickFTP
6
6
  module RESTfulAPI
7
7
  # Completing an upload
8
8
  #
9
- # @see https://developers.brickftp.com/#completing-an-upload Completing an upload
9
+ # @see https://developers.files.com/#completing-an-upload Completing an upload
10
10
  #
11
11
  # ### Params
12
12
  #
@@ -39,7 +39,7 @@ module BrickFTP
39
39
  def call(path, params)
40
40
  res = client.post("/api/rest/v1/files/#{ERB::Util.url_encode(path)}", params.to_h.compact.merge(action: 'end'))
41
41
 
42
- BrickFTP::Types::File.new(res.symbolize_keys)
42
+ BrickFTP::Types::File.new(**res.symbolize_keys)
43
43
  end
44
44
  end
45
45
  end
@@ -6,7 +6,7 @@ module BrickFTP
6
6
  module RESTfulAPI
7
7
  # Requesting additional upload URLs
8
8
  #
9
- # @see https://developers.brickftp.com/#requesting-additional-upload-urls Requesting additional upload URLs
9
+ # @see https://developers.files.com/#requesting-additional-upload-urls Requesting additional upload URLs
10
10
  #
11
11
  # ### Params
12
12
  #
@@ -43,7 +43,7 @@ module BrickFTP
43
43
  def call(path, params)
44
44
  res = client.post("/api/rest/v1/files/#{ERB::Util.url_encode(path)}", params.to_h.compact.merge(action: 'put'))
45
45
 
46
- BrickFTP::Types::Upload.new(res.symbolize_keys)
46
+ BrickFTP::Types::Upload.new(**res.symbolize_keys)
47
47
  end
48
48
  end
49
49
  end