Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

Commit

Permalink
Adding missing documentation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
idabmat committed Jul 13, 2018
1 parent 02c256d commit 080de3f
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .yardopts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--no-private --markup markdown lib/**/*.rb - README.md LICENSE.txt CODE_OF_CONDUCT.md
--no-private lib/**/*.rb - README.md LICENSE.txt CODE_OF_CONDUCT.md
3 changes: 1 addition & 2 deletions lib/zenaton.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require 'zenaton/version'

# :nodoc:
# Top level namespace for the Zenaton ruby library
module Zenaton
# Your code goes here...
end
45 changes: 25 additions & 20 deletions lib/zenaton/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,40 @@ module Zenaton
class Client
include Singleton

ZENATON_API_URL = 'https://zenaton.com/api/v1'
ZENATON_WORKER_URL = 'http://localhost'
DEFAULT_WORKER_PORT = 4001
WORKER_API_VERSION = 'v_newton'
ZENATON_API_URL = 'https://zenaton.com/api/v1' # Zenaton api url
ZENATON_WORKER_URL = 'http://localhost' # Default worker url
DEFAULT_WORKER_PORT = 4001 # Default worker port
WORKER_API_VERSION = 'v_newton' # Default worker api version

MAX_ID_SIZE = 256
MAX_ID_SIZE = 256 # Limit on length of custom ids

APP_ENV = 'app_env'
APP_ID = 'app_id'
API_TOKEN = 'api_token'
APP_ENV = 'app_env' # Parameter name for the application environment
APP_ID = 'app_id' # Parameter name for the application ID
API_TOKEN = 'api_token' # Parameter name for the API token

ATTR_ID = 'custom_id'
ATTR_NAME = 'name'
ATTR_CANONICAL = 'canonical_name'
ATTR_DATA = 'data'
ATTR_PROG = 'programming_language'
ATTR_MODE = 'mode'
ATTR_ID = 'custom_id' # Parameter name for custom ids
ATTR_NAME = 'name' # Parameter name for workflow names
ATTR_CANONICAL = 'canonical_name' # Parameter name for version name
ATTR_DATA = 'data' # Parameter name for json payload
ATTR_PROG = 'programming_language' # Parameter name for the language
ATTR_MODE = 'mode' # Parameter name for the worker update mode

PROG = 'Ruby'
PROG = 'Ruby' # The current programming language

EVENT_INPUT = 'event_input'
EVENT_NAME = 'event_name'
EVENT_INPUT = 'event_input' # Parameter name for event data
EVENT_NAME = 'event_name' # Parameter name for event name

WORKFLOW_KILL = 'kill'
WORKFLOW_PAUSE = 'pause'
WORKFLOW_RUN = 'run'
WORKFLOW_KILL = 'kill' # Worker update mode to stop a worker
WORKFLOW_PAUSE = 'pause' # Worker udpate mode to pause a worker
WORKFLOW_RUN = 'run' # Worker update mode to resume a worker

attr_writer :app_id, :api_token, :app_env

# Class method that sets the three tokens needed to interact with the API
# @param app_id [String] the ID of your Zenaton application
# @param api_token [String] your Zenaton account API token
# @param app_env [String] the environment (dev, staging, prod) to run under
# @return [Zenaton::Client] the instance of the client.
def self.init(app_id, api_token, app_env)
instance.tap do |client|
client.app_id = app_id
Expand Down
4 changes: 2 additions & 2 deletions lib/zenaton/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class Error < StandardError; end
# Exception raised when communication with workers failed
class InternalError < Error; end

# :nodoc:
# Exception raise when clien code is invalid
class ExternalError < Error; end

# :nodoc:
# Exception raised when wrong argument type is provided
class InvalidArgumentError < ExternalError; end

# :nodoc:
Expand Down
1 change: 1 addition & 0 deletions lib/zenaton/interfaces/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'zenaton/exceptions'

module Zenaton
# Abstract classes used as interfaces
module Interfaces
# @abstract Do not subclass job directly, use either Tasks or Workflows
class Job
Expand Down
1 change: 1 addition & 0 deletions lib/zenaton/services/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require 'zenaton/exceptions'

module Zenaton
# Collection of utility classes for the Zenaton library
module Services
# Wrapper class around HTTParty that:
# - handles http calls
Expand Down
1 change: 1 addition & 0 deletions lib/zenaton/traits/zenatonable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'zenaton/engine'

module Zenaton
# Reusable modules from the Zenaton library
module Traits
# Module to be included in tasks and workflows
module Zenatonable
Expand Down
1 change: 1 addition & 0 deletions lib/zenaton/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

module Zenaton
# This gem's current version
VERSION = '0.1.0'
end
1 change: 1 addition & 0 deletions lib/zenaton/workflows/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require 'zenaton/traits/zenatonable'

module Zenaton
# Module for the workflow manager and the versioned workflows
module Workflows
# @abstract Subclass and override {#versions} to create your own versionned
# workflows
Expand Down

0 comments on commit 080de3f

Please sign in to comment.