-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,941 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# Ignore Ruby logs | ||
.ruby-version | ||
.idea | ||
|
||
# Ignore MacOS logs | ||
.DS_Store | ||
|
||
# Ignore versioning file | ||
# Ignore versioning files | ||
Gemfile.lock | ||
.ruby-version | ||
|
||
# Ignore tests coverage folder | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
module Crowdin | ||
module ApiResources | ||
module Dictionaries | ||
def list_dictionaries(query = {}, project_id = config.project_id) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
self, | ||
:get, | ||
"/projects/#{project_id}/dictionaries", | ||
query | ||
) | ||
|
||
request.perform | ||
end | ||
|
||
def edit_dictionary(language_id = nil, query = {}, project_id = config.project_id) | ||
language_id || raise_parameter_is_required_error(:language_id) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
self, | ||
:patch, | ||
"/projects/#{project_id}/dictionaries/#{language_id}", | ||
query | ||
) | ||
|
||
request.perform | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# frozen_string_literal: true | ||
|
||
module Crowdin | ||
module ApiResources | ||
module Distributions | ||
def list_distributions(query = {}, project_id = config.project_id) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
self, | ||
:get, | ||
"/projects/#{project_id}/distributions", | ||
query | ||
) | ||
|
||
request.perform | ||
end | ||
|
||
def add_distribution(query = {}, project_id = config.project_id) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
self, | ||
:post, | ||
"/projects/#{project_id}/distributions", | ||
query | ||
) | ||
|
||
request.perform | ||
end | ||
|
||
def get_distribution(hash = nil, project_id = config.project_id) | ||
hash || raise_parameter_is_required_error(:hash) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
self, | ||
:get, | ||
"/projects/#{project_id}/distributions/#{hash}" | ||
) | ||
|
||
request.perform | ||
end | ||
|
||
def delete_distribution(hash = nil, project_id = config.project_id) | ||
hash || raise_parameter_is_required_error(:hash) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
self, | ||
:delete, | ||
"/projects/#{project_id}/distributions/#{hash}" | ||
) | ||
|
||
request.perform | ||
end | ||
|
||
def edit_distribution(hash = nil, query = {}, project_id = config.project_id) | ||
hash || raise_parameter_is_required_error(:hash) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
self, | ||
:patch, | ||
"/projects/#{project_id}/distributions/#{hash}", | ||
query | ||
) | ||
|
||
request.perform | ||
end | ||
|
||
def get_destribution_release(hash = nil, project_id = config.project_id) | ||
hash || raise_parameter_is_required_error(:hash) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
self, | ||
:get, | ||
"/projects/#{project_id}/distributions/#{hash}/release" | ||
) | ||
|
||
request.perform | ||
end | ||
|
||
def release_distribution(hash = nil, project_id = config.project_id) | ||
hash || raise_parameter_is_required_error(:hash) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
self, | ||
:post, | ||
"/projects/#{project_id}/distributions/#{hash}/release" | ||
) | ||
|
||
request.perform | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.