Class: Tooling::Task

Inherits:
Rake::TaskLib
  • Object
show all
Extended by:
Forwardable
Includes:
Rake::DSL
Defined in:
lib/tasks/tooling.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ext_task, *args, **opts) {|_self| ... } ⇒ Task

Returns a new instance of Task.

Yields:

  • (_self)

Yield Parameters:

  • _self (Tooling::Task)

    the object that the method was called on



113
114
115
116
117
118
119
120
121
122
123
# File 'lib/tasks/tooling.rb', line 113

def initialize(ext_task, *args, **opts)
  @ext_task = ext_task
  @_name = args.shift || ext_task.name
  @namespace = opts.fetch(:namespace, :tooling)
  @namespaced = opts.fetch(:namespaced, !@namespace.nil?)
  yield self if block_given?

  Tooling.tasks << self

  define(args)
end

Instance Attribute Details

#ext_taskObject

Returns the value of attribute ext_task.



111
112
113
# File 'lib/tasks/tooling.rb', line 111

def ext_task
  @ext_task
end

Instance Method Details

#build_dirObject



136
137
138
# File 'lib/tasks/tooling.rb', line 136

def build_dir
  platform_tmp_dir.join(RUBY_VERSION.to_s)
end

#cc_json_task_nameObject



140
141
142
# File 'lib/tasks/tooling.rb', line 140

def cc_json_task_name
  task_name :pre_compile_commands
end

#nameObject



125
126
127
# File 'lib/tasks/tooling.rb', line 125

def name
  @_name ||= extname.dup
end

#platform_tmp_dirObject



132
133
134
# File 'lib/tasks/tooling.rb', line 132

def platform_tmp_dir
  Pathname.new(File.join(ext_task.tmp_dir, ext_task.platform, ext_task.name))
end