Module: Kinokero

Defined in:
lib/kinokero/proxy.rb,
lib/kinokero.rb,
lib/kinokero/log.rb,
lib/kinokero/device.rb,
lib/kinokero/jingle.rb,
lib/kinokero/printer.rb,
lib/kinokero/version.rb,
lib/kinokero/cloudprint.rb

Overview

######################################################################### #########################################################################

Defined Under Namespace

Modules: Device Classes: Cloudprint, Jingle, Log, Printer, PrinteridNotFound, Proxy

Constant Summary collapse

CRLF =
'\r\n'
MIMETYPE_JSON =

mimetype for how to encode CDD files

'application/json'
MIMETYPE_PROTOBUF =
'application/protobuf'
MIMETYPE_GENERAL =
'application/octet-stream'
MIMETYPE_CDD =
MIMETYPE_GENERAL
MIMETYPE_PPD =

mimetype for how to encode PPD files

'application/vnd.cups.ppd'
POLLING_SECS =

number of secs to sleep before polling again

30
TRUNCATE_LOG =

number of characters before truncate response logs

1000
FOLLOWUP_HOST =

authentication function constants

'www.google.com/cloudprint'
FOLLOWUP_URI =
'select%2Fgaiaauth'
GAIA_HOST =
'www.google.com'
LOGIN_URI =
'/accounts/ServiceLoginAuth'
LOGIN_URL =
'https://www.google.com/accounts/ClientLogin'
AUTHORIZATION_SCOPE =

GCP documentation constants

"https://www.googleapis.com/auth/cloudprint"
CLIENT_REDIRECT_URI =
"urn:ietf:wg:oauth:2.0:oob"
AUTHORIZATION_REDIRECT_URI =
'oob'
OAUTH2_TOKEN_ENDPOINT =
"https://accounts.google.com/o/oauth2/token"
MIMETYPE_OAUTH =
"application/x-pkcs12"
GCP_URL =

The GCP URL path is composed of URL + SERVICE + ACTION below three are used when testing locally

GCP_URL = 'http://0.0.0.0:3000'
GCP_SERVICE = '/'
GCP_REGISTER = ''
'https://www.google.com/'
GCP_SERVICE =
'cloudprint'
XMPP_SERVER =

jingle constants required

"talk.google.com"
NS_GOOGLE_PUSH =
"google:push"
GCP_CHANNEL =
"cloudprint.google.com"
MY_PROXY_ID =

MY_PROXY_ID is a unique name for this running of the GCP connector client formed with gem name + machine-node name (expected to be unique) TODO: make sure machine nodename is unique

"kinokero::"+`uname -n`.chop
SSL_CERT_PATH =

SSL certificates path for this machine NOTE: move this out before finalizing gem

"/usr/lib/ssl/certs"
CUPS_TESTPAGE_FILE =

CUPS system default testpage file

"/usr/share/cups/data/default-testpage.pdf"
PRINTER_POLL_CYCLE =

printer device status polling cycle (float secs to sleep)

15
VERSION =
"0.0.5"
@@my_proxy_id =

class Proxy required

MY_PROXY_ID
@@proxy_client_id =

unique name for this running of the GCP connector client

ENV["GCP_PROXY_CLIENT_ID"] || 'missing'
@@proxy_client_secret =
ENV["GCP_PROXY_CLIENT_SECRET"] || 'missing'
@@proxy_serial_nbr =
ENV["GCP_PROXY_SERIAL_NBR"] || 'missing'
@@verbose =

for any class-level decisions

false
@@mimetype_oauth =

class Cloudprint required

MIMETYPE_OAUTH
@@mimetype_ppd =

how to encoade oauth files

MIMETYPE_PPD
@@mimetype_cdd =

how to encode PPD files

MIMETYPE_CDD
@@polling_secs =

how to encode CDD files

POLLING_SECS
@@truncate_log =

secs to sleep before register polling again

TRUNCATE_LOG
@@followup_host =

number of characters to truncate response logs

FOLLOWUP_HOST
@@followup_uri =
FOLLOWUP_URI
@@gaia_host =
GAIA_HOST
@@login_uri =
LOGIN_URI
@@login_url =
LOGIN_URL
@@gcp_url =
GCP_URL
@@gcp_service =
GCP_SERVICE
@@ssl_ca_path =

SSL certificates path for this machine

SSL_CERT_PATH
@@authorization_scope =
AUTHORIZATION_SCOPE
@@authorization_redirect_uri =
AUTHORIZATION_REDIRECT_URI
@@oauth2_token_endpoint =
OAUTH2_TOKEN_ENDPOINT
@@xmpp_server =

class Jingle required

XMPP_SERVER
@@ns_google_push =
NS_GOOGLE_PUSH
@@gcp_channel =
GCP_CHANNEL
@@cups_testpage_file =

cups testpage file path

CUPS_TESTPAGE_FILE
@@printer_poll_cycle =

printer device/cups related

PRINTER_POLL_CYCLE

Class Method Summary collapse

Class Method Details

.setup {|_self| ... } ⇒ Object

Default way to setup kinokero configuration

Yields:

  • (_self)

Yield Parameters:

  • _self (Kinokero)

    the object that the method was called on


165
166
167
# File 'lib/kinokero.rb', line 165

def self.setup
  yield self
end