Class: Steep::Project::DSL::TargetDSL

Inherits:
Object
  • Object
show all
Includes:
LibraryOptions, WithPattern
Defined in:
lib/steep/project/dsl.rb

Instance Attribute Summary collapse

Attributes included from LibraryOptions

#collection_config_path, #core_root, #stdlib_root

Instance Method Summary collapse

Methods included from WithPattern

#check, #ignore, #ignore_signature, #ignored_signatures, #ignored_sources, #signature, #signature_pattern, #signatures, #source_pattern, #sources

Methods included from LibraryOptions

#collection_config, #disable_collection, #libraries, #library, #library_configured?, #repo_path, #repo_paths, #stdlib_path, #to_library_options

Constructor Details

#initialize(name, project:) ⇒ TargetDSL

Returns a new instance of TargetDSL.



124
125
126
127
128
129
130
131
132
133
# File 'lib/steep/project/dsl.rb', line 124

def initialize(name, project:)
  @name = name
  @core_root = nil
  @stdlib_root = nil
  @project = project
  @collection_config_path = collection_config_path
  @unreferenced = false
  @implicitly_returns_nil = false
  @groups = []
end

Instance Attribute Details

#groupsObject (readonly)

Returns the value of attribute groups.



121
122
123
# File 'lib/steep/project/dsl.rb', line 121

def groups
  @groups
end

#implicitly_returns_nilObject (readonly)

Returns the value of attribute implicitly_returns_nil.



122
123
124
# File 'lib/steep/project/dsl.rb', line 122

def implicitly_returns_nil
  @implicitly_returns_nil
end

#nameObject (readonly)

Returns the value of attribute name.



118
119
120
# File 'lib/steep/project/dsl.rb', line 118

def name
  @name
end

#projectObject (readonly)

Returns the value of attribute project.



119
120
121
# File 'lib/steep/project/dsl.rb', line 119

def project
  @project
end

#unreferencedObject (readonly)

Returns the value of attribute unreferenced.



120
121
122
# File 'lib/steep/project/dsl.rb', line 120

def unreferenced
  @unreferenced
end

Instance Method Details

#code_diagnostics_configObject



169
170
171
# File 'lib/steep/project/dsl.rb', line 169

def code_diagnostics_config
  @code_diagnostics_config ||= Diagnostic::Ruby.default.dup
end

#configure_code_diagnostics(hash = nil) {|code_diagnostics_config| ... } ⇒ Object



161
162
163
164
165
166
167
# File 'lib/steep/project/dsl.rb', line 161

def configure_code_diagnostics(hash = nil)
  if hash
    code_diagnostics_config.merge!(hash)
  end

  yield code_diagnostics_config if block_given?
end

#group(name, &block) ⇒ Object



173
174
175
176
177
178
179
180
181
182
# File 'lib/steep/project/dsl.rb', line 173

def group(name, &block)
  name = name.to_str.to_sym unless Symbol === name
  group = GroupDSL.new(name, self)

  Steep.logger.tagged "group=#{name}" do
    group.instance_exec(&block) if block
  end

  groups << group
end

#implicitly_returns_nil!(value = true) ⇒ Object



157
158
159
# File 'lib/steep/project/dsl.rb', line 157

def implicitly_returns_nil!(value = true)
  @implicitly_returns_nil = value
end

#initialize_copy(other) ⇒ Object



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/steep/project/dsl.rb', line 135

def initialize_copy(other)
  @name = other.name
  @libraries = other.libraries.dup
  @sources = other.sources.dup
  @signatures = other.signatures.dup
  @ignored_sources = other.ignored_sources.dup
  @ignored_signatures = other.ignored_signatures.dup
  @repo_paths = other.repo_paths.dup
  @core_root = other.core_root
  @stdlib_root = other.stdlib_root
  @code_diagnostics_config = other.code_diagnostics_config.dup
  @project = other.project
  @collection_config_path = other.collection_config_path
  @unreferenced = other.unreferenced
  @implicitly_returns_nil = other.implicitly_returns_nil
  @groups = other.groups.dup
end

#unreferenced!(value = true) ⇒ Object



153
154
155
# File 'lib/steep/project/dsl.rb', line 153

def unreferenced!(value = true)
  @unreferenced = value
end