Module: Kobot
- Defined in:
- lib/kobot.rb,
lib/kobot/config.rb,
lib/kobot/engine.rb,
lib/kobot/logger.rb,
lib/kobot/mailer.rb,
lib/kobot/option.rb,
lib/kobot/version.rb,
lib/kobot/selector.rb,
lib/kobot/exception.rb,
lib/kobot/credential.rb
Overview
Code adapted conveniently from webdrivers for consistency https://github.com/titusfortner/webdrivers/blob/master/lib/webdrivers/logger.rb
Defined Under Namespace
Classes: Config, Credential, Engine, KotClockInError, KotClockOutError, KotRecordError, Logger, Mailer, Option, Selector
Constant Summary collapse
- VERSION =
'2.1.0'
Class Method Summary collapse
-
.configure ⇒ Object
Parses command line options, configures Kobot, and finally ensures required credentials are loaded properly and ready to be in use.
- .logger ⇒ Object
- .run ⇒ Object
Class Method Details
.configure ⇒ Object
Parses command line options, configures Kobot, and finally ensures required credentials are loaded properly and ready to be in use.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/kobot.rb', line 29 def configure = Option.parse! Config.configure do |config| config.clock = [:clock].to_sym config.loglevel = [:loglevel]&.to_sym || :info config.dryrun = [:dryrun] config.force = [:force] config.skip = [:skip] || [] config.auto_skip = [:auto_skip] config.auto_skip_without = [:auto_skip_without] || '裁量労働' config.kot_url = 'https://s2.kingtime.jp/independent/recorder/personal/' config.kot_timezone_offset = '+09:00' config.kot_date_format = '%m/%d' config.gmail_notify_enabled = [:notify] config.gmail_notify_to = [:to] config.gmail_notify_subject = "[#{Module.nesting.last}] Notification" config.gmail_smtp_address = 'smtp.gmail.com' config.gmail_smtp_port = 587 config.browser_headless = [:headless] config.browser_geolocation = [:geolocation] config.browser_wait_timeout = 10 config.credentials_file = File.join(Dir.home, ".#{File.basename(__FILE__, File.extname(__FILE__))}") end Credential.load! end |