Module: Rubyists::Linear

Includes:
SemanticLogger::Loggable
Defined in:
lib/linear.rb,
lib/linear/api.rb,
lib/linear/cli.rb,
lib/linear/cli.rb,
lib/linear/fragments.rb,
lib/linear/cli/caller.rb,
lib/linear/exceptions.rb,
lib/linear/cli/version.rb,
lib/linear/cli/watcher.rb,
lib/linear/models/team.rb,
lib/linear/models/user.rb,
lib/linear/cli/what_for.rb,
lib/linear/models/issue.rb,
lib/linear/models/label.rb,
lib/linear/commands/team.rb,
lib/linear/commands/issue.rb,
lib/linear/models/comment.rb,
lib/linear/models/project.rb,
lib/linear/commands/whoami.rb,
lib/linear/cli/sub_commands.rb,
lib/linear/commands/console.rb,
lib/linear/commands/version.rb,
lib/linear/commands/issue/pr.rb,
lib/linear/models/base_model.rb,
lib/linear/cli/common_options.rb,
lib/linear/commands/team/list.rb,
lib/linear/commands/issue/list.rb,
lib/linear/commands/issue/take.rb,
lib/linear/commands/issue/create.rb,
lib/linear/commands/issue/update.rb,
lib/linear/models/workflow_state.rb,
lib/linear/commands/issue/develop.rb,
lib/linear/models/issue/class_methods.rb,
lib/linear/models/base_model/method_magic.rb,
lib/linear/models/base_model/class_methods.rb

Overview

Namespace for Linear

Defined Under Namespace

Modules: CLI, Fragments Classes: BaseModel, Comment, GraphApi, Issue, Label, Project, Team, User, WorkflowState

Constant Summary collapse

ROOT =

rubocop:disable Layout/SpaceAroundOperators

(Pathname(__FILE__)/'../..').expand_path
LIBROOT =
ROOT/:lib/:linear
MODEL_ROOT =
ROOT/:lib/:linear/:models
SPEC_ROOT =
ROOT/:spec
FEATURE_ROOT =
ROOT/:features
DEBUG_LEVELS =
%i[warn info debug trace].freeze
Api =

Acts as a singleton for a GraphApi instance

Rubyists::Linear::GraphApi.new
SmellsBad =
Class.new(StandardError)
NotFoundError =
Class.new(StandardError)
NoKeyError =
Class.new(StandardError)
VERSION =
'0.9.20'

Class Method Summary collapse

Class Method Details

.L(*libraries) ⇒ Object

rubocop:disable Naming/MethodName



35
36
37
# File 'lib/linear.rb', line 35

def self.L(*libraries) # rubocop:disable Naming/MethodName
  Array(libraries).each { |library| require LIBROOT/library }
end

.M(*models) ⇒ Object

rubocop:disable Naming/MethodName



40
41
42
# File 'lib/linear.rb', line 40

def self.M(*models) # rubocop:disable Naming/MethodName
  Array(models).each { |model| require MODEL_ROOT/model }
end

.tmpdirObject



31
32
33
# File 'lib/linear.rb', line 31

def self.tmpdir
  @tmpdir || raise('tmpdir not set')
end

.tmpdir=(other) ⇒ Object



27
28
29
# File 'lib/linear.rb', line 27

def self.tmpdir=(other)
  @tmpdir = other.is_a?(Pathname) ? other : Pathname(other)
end

.verbosityObject

rubocop:enable Layout/SpaceAroundOperators



45
46
47
# File 'lib/linear.rb', line 45

def self.verbosity
  @verbosity ||= 0
end

.verbosity=(debug) ⇒ Object



49
50
51
52
53
54
55
56
57
# File 'lib/linear.rb', line 49

def self.verbosity=(debug)
  return verbosity unless debug

  logger.warn 'Debug level should be between 0 and 3' unless debug.between?(0, 3)
  @verbosity = debug
  level = @verbosity > (DEBUG_LEVELS.size - 1) ? :trace : DEBUG_LEVELS[@verbosity]
  SemanticLogger.default_level = level
  @verbosity
end