Class: Vanagon::Component::DSL

Inherits:
Object
  • Object
show all
Defined in:
lib/vanagon/component/dsl.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, settings, platform) ⇒ Vanagon::Component::DSL

Constructor for the DSL object

Parameters:

  • name (String)

    name of the component

  • settings (Hash)

    settings to use in building the component

  • platform (Vanagon::Platform)

    platform to build the component for



15
16
17
18
# File 'lib/vanagon/component/dsl.rb', line 15

def initialize(name, settings, platform)
  @name = name
  @component = Vanagon::Component.new(@name, settings, platform)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object

All purpose getter. This object, which is passed to the component block, won’t have easy access to the attributes of the @component, so we make a getter for each attribute.

We only magically handle get_ methods, any other methods just get the standard method_missing treatment.



42
43
44
45
46
47
48
49
50
51
# File 'lib/vanagon/component/dsl.rb', line 42

def method_missing(method_name, *args)
  attribute_match = method_name.to_s.match(/get_(.*)/)
  if attribute_match
    attribute = attribute_match.captures.first
  else
    super
  end

  @component.send(attribute)
end

Instance Method Details

#_componentVanagon::Component

Accessor for the component.

Returns:



31
32
33
# File 'lib/vanagon/component/dsl.rb', line 31

def _component
  @component
end

#add_debian_activate_triggers(activate_name) ⇒ Object

Adds activate trigger name to be watched

Parameters:

  • activate_name (String)

    the activate trigger name



470
471
472
# File 'lib/vanagon/component/dsl.rb', line 470

def add_debian_activate_triggers(activate_name)
  @component.activate_triggers << OpenStruct.new(:activate_name => activate_name)
end

#add_debian_interest_triggers(pkg_state, scripts, interest_name) ⇒ Object

Adds interest trigger based on the specified packaging state and interest name.

Parameters:

  • pkg_state (String, Array)

    the package state during which the scripts should execute. Accepts either a single string (“install” or “upgrade”), or an Array of Strings ([“install”, “upgrade”]).

  • scripts (Array)

    the scripts to run for the interest trigger

  • interest_name (String)

    the name of the interest trigger



460
461
462
463
464
465
# File 'lib/vanagon/component/dsl.rb', line 460

def add_debian_interest_triggers(pkg_state, scripts, interest_name)
  pkg_state = Array(pkg_state)
  scripts = Array(scripts)
  check_pkg_state_array(pkg_state)
  @component.interest_triggers << OpenStruct.new(:pkg_state => pkg_state, :scripts => scripts, :interest_name => interest_name)
end

#add_postinstall_action(pkg_state, scripts) ⇒ Object

Adds action to run during the postinstall phase of packaging

Parameters:

  • pkg_state (Array)

    the state in which the scripts should execute. Can be one or multiple of ‘install’ and ‘upgrade’.

  • scripts (Array)

    the Bourne shell compatible scriptlet(s) to execute



479
480
481
482
483
484
# File 'lib/vanagon/component/dsl.rb', line 479

def add_postinstall_action(pkg_state, scripts)
  pkg_state = Array(pkg_state)
  scripts = Array(scripts)
  check_pkg_state_array(pkg_state)
  @component.postinstall_actions << OpenStruct.new(:pkg_state => pkg_state, :scripts => scripts)
end

#add_postremove_action(pkg_state, scripts) ⇒ Object

Adds action to run during the postremoval phase of packaging

Parameters:

  • pkg_state (Array)

    the state in which the scripts should execute. Can be one or multiple of ‘removal’ and ‘upgrade’.

  • scripts (Array)

    the Bourne shell compatible scriptlet(s) to execute



506
507
508
509
510
511
512
513
514
# File 'lib/vanagon/component/dsl.rb', line 506

def add_postremove_action(pkg_state, scripts)
  pkg_state = Array(pkg_state)
  scripts = Array(scripts)

  if pkg_state.empty? || !(pkg_state - ["upgrade", "removal"]).empty?
    raise Vanagon::Error, "#{pkg_state} should be an array containing one or more of ['removal', 'upgrade']"
  end
  @component.postremove_actions << OpenStruct.new(:pkg_state => pkg_state, :scripts => scripts)
end

#add_preinstall_action(pkg_state, scripts) ⇒ Object

Adds action to run during the preinstall phase of packaging

Parameters:

  • pkg_state (String, Array)

    the package state during which the scripts should execute. Accepts either a single string (“install” or “upgrade”), or an Array of Strings ([“install”, “upgrade”]).

  • scripts (Array)

    the Bourne shell compatible scriptlet(s) to execute



434
435
436
437
438
439
# File 'lib/vanagon/component/dsl.rb', line 434

def add_preinstall_action(pkg_state, scripts)
  pkg_state = Array(pkg_state)
  scripts = Array(scripts)
  check_pkg_state_array(pkg_state)
  @component.preinstall_actions << OpenStruct.new(:pkg_state => pkg_state, :scripts => scripts)
end

#add_preremove_action(pkg_state, scripts) ⇒ Object

Adds action to run during the preremoval phase of packaging

Parameters:

  • pkg_state (Array)

    the state in which the scripts should execute. Can be one or multiple of ‘removal’ and ‘upgrade’.

  • scripts (Array)

    the Bourne shell compatible scriptlet(s) to execute



491
492
493
494
495
496
497
498
499
# File 'lib/vanagon/component/dsl.rb', line 491

def add_preremove_action(pkg_state, scripts)
  pkg_state = Array(pkg_state)
  scripts = Array(scripts)

  if pkg_state.empty? || !(pkg_state - ["upgrade", "removal"]).empty?
    raise Vanagon::Error, "#{pkg_state} should be an array containing one or more of ['removal', 'upgrade']"
  end
  @component.preremove_actions << OpenStruct.new(:pkg_state => pkg_state, :scripts => scripts)
end

#add_rpm_install_triggers(pkg_state, scripts, pkg) ⇒ Object

Adds trigger for scripts to be run on specified pkg_state.

Parameters:

  • pkg_state (String, Array)

    the package state during which the scripts should execute. Accepts either a single string (“install” or “upgrade”), or an Array of Strings ([“install”, “upgrade”]).

  • scripts (Array)

    the rpm pkg scriptlet(s) to execute

  • pkg (String)

    the package the trigger will be set in



447
448
449
450
451
452
# File 'lib/vanagon/component/dsl.rb', line 447

def add_rpm_install_triggers(pkg_state, scripts, pkg)
  pkg_state = Array(pkg_state)
  scripts = Array(scripts)
  check_pkg_state_array(pkg_state)
  @component.install_triggers << OpenStruct.new(:pkg_state => pkg_state, :scripts => scripts, :pkg => pkg)
end

#add_source(uri, **options) ⇒ Object

This will add a source to the project and put it in the workdir alongside the other sources

Parameters:

  • uri (String)

    uri of the source

  • options (Hash)

    optional keyword arguments used to instatiate a new source @option opts [String] :sum @option opts [String] :ref



371
372
373
# File 'lib/vanagon/component/dsl.rb', line 371

def add_source(uri, **options)
  @component.sources << OpenStruct.new(options.merge({ url: uri }))
end

#apply_patch(patch, destination: @component.dirname, strip: 1, fuzz: 0, after: 'unpack') ⇒ Object

Add a patch to the list of patches to apply to the component’s source after unpacking

Parameters:

  • patch (String)

    Path to the patch that should be applied

  • destination (String) (defaults to: @component.dirname)

    Path to the location where the patch should be applied

  • strip (String, Integer) (defaults to: 1)

    directory levels to skip in applying patch

  • fuzz (String, Integer) (defaults to: 0)

    levels of context miss to ignore in applying patch

  • after (String) (defaults to: 'unpack')

    the location in the makefile where the patch command should be run



92
93
94
# File 'lib/vanagon/component/dsl.rb', line 92

def apply_patch(patch, destination: @component.dirname, strip: 1, fuzz: 0, after: 'unpack')
  @component.patches << Vanagon::Patch.new(patch, strip, fuzz, after, destination)
end

#build(&block) ⇒ Object

Set or add to the build call for the component. The commands required to build the component before testing/installing it.

Parameters:

  • block (Proc)

    the command(s) required to build the component



67
68
69
# File 'lib/vanagon/component/dsl.rb', line 67

def build(&block)
  @component.build << yield
end

#build_dir(path) ⇒ Object

Set a build dir relative to the source directory.

The build dir will be created before the configure block runs and configure/build/install commands will be run in the build dir.

Examples:

pkg.build_dir "build"
pkg.source "my-cmake-project" # Will create the path "my-cmake-project/build"
pkg.configure { ["cmake .."] }
pkg.build { ["make -j 3"] }
pkg.install { ["make install"] }

Parameters:

  • path (String)

    The build directory to use for building the project



334
335
336
337
338
339
340
# File 'lib/vanagon/component/dsl.rb', line 334

def build_dir(path)
  if Pathname.new(path).relative?
    @component.build_dir = path
  else
    raise Vanagon::Error, "build_dir should be a relative path, but '#{path}' looks to be absolute."
  end
end

#build_requires(build_requirement) ⇒ Object

build_requires adds a requirements to the list of build time dependencies that will need to be fetched from an external source before this component can be built. build_requires can also be satisfied by other components in the same project.

Parameters:

  • build_requirement (String)

    a library or other component that is required to build the current component



123
124
125
# File 'lib/vanagon/component/dsl.rb', line 123

def build_requires(build_requirement)
  @component.build_requires << build_requirement
end

#check(&block) ⇒ Object

Set or add to the check call for the component. The commands required to test the component before installing it.

Parameters:

  • block (Proc)

    the command(s) required to test the component



74
75
76
# File 'lib/vanagon/component/dsl.rb', line 74

def check(&block)
  @component.check << yield
end

#check_pkg_state_array(pkg_state) ⇒ Object

Checks that the array of pkg_state is valid (install AND/OR upgrade). Returns vanagon error if invalid

Parameters:

  • pkg_state (Array)

    array of pkg_state input to test



423
424
425
426
427
# File 'lib/vanagon/component/dsl.rb', line 423

def check_pkg_state_array(pkg_state)
  if pkg_state.empty? || (pkg_state - ["install", "upgrade"]).any?
    raise Vanagon::Error, "#{pkg_state} should be an array containing one or more of ['install', 'upgrade']"
  end
end

#component(name, &block) {|_self, @component.settings, @component.platform| ... } ⇒ Object

Primary way of interacting with the DSL

Parameters:

  • name (String)

    name of the componennt

  • block (Proc)

    DSL definition of the component to call

Yields:

Yield Parameters:



24
25
26
# File 'lib/vanagon/component/dsl.rb', line 24

def component(name, &block)
  yield(self, @component.settings, @component.platform)
end

#configfile(file, mode: nil, owner: nil, group: nil) ⇒ Object

Marks a file as a configfile to ensure that it is not overwritten on upgrade if it has been modified

Parameters:

  • file (String)

    name of the configfile



248
249
250
251
252
253
254
255
256
257
# File 'lib/vanagon/component/dsl.rb', line 248

def configfile(file, mode: nil, owner: nil, group: nil)
  # I AM SO SORRY
  @component.delete_file file
  if @component.platform.name =~ /solaris-10|osx/
    @component.install << "mv '#{file}' '#{file}.pristine'"
    @component.add_file Vanagon::Common::Pathname.configfile("#{file}.pristine", mode: mode, owner: owner, group: group)
  else
    @component.add_file Vanagon::Common::Pathname.configfile(file, mode: mode, owner: owner, group: group)
  end
end

#configure(&block) ⇒ Object

Set or add to the configure call for the component. The commands required to configure the component before building it.

Parameters:

  • block (Proc)

    the command(s) required to configure the component



60
61
62
# File 'lib/vanagon/component/dsl.rb', line 60

def configure(&block)
  @component.configure << yield
end

#conflicts(pkgname, version = nil) ⇒ Object

Indicates that this component conflicts with another package, so both cannot be installed at the same time. Conflicts can be collected and used by the project and package.

Parameters:

  • pkgname (String)

    name of the package which conflicts with this component

  • version (String) (defaults to: nil)

    the version of the package that conflicts with this component



157
158
159
# File 'lib/vanagon/component/dsl.rb', line 157

def conflicts(pkgname, version = nil)
  @component.conflicts << OpenStruct.new(:pkgname => pkgname, :version => version)
end

#directory(dir, mode: nil, owner: nil, group: nil) ⇒ Object

Adds a directory to the list of directories provided by the project, to be included in any packages of the project

Parameters:

  • dir (String)

    directory to add to the project

  • mode (String) (defaults to: nil)

    octal mode to apply to the directory

  • owner (String) (defaults to: nil)

    owner of the directory

  • group (String) (defaults to: nil)

    group of the directory



381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/vanagon/component/dsl.rb', line 381

def directory(dir, mode: nil, owner: nil, group: nil) # rubocop:disable Metrics/AbcSize
  install_flags = ['-d']
  if @component.platform.is_windows?
    unless mode.nil? && owner.nil? && group.nil?
      warn "You're trying to set the mode, owner, or group for windows. I don't know how to do that, ignoring!"
    end
  else
    install_flags << "-m '#{mode}'" unless mode.nil?
  end
  @component.install << "#{@component.platform.install} #{install_flags.join(' ')} '#{dir}'"
  @component.directories << Vanagon::Common::Pathname.new(dir, mode: mode, owner: owner, group: group)
end

#dirname(path) ⇒ Object

Set a source dir

The build dir will be created when the source archive is unpacked. This should be used when the unpacked directory name does not match the source archive name.

Examples:

pkg.url "http://the-internet.com/a-silly-name-that-unpacks-into-not-this.tar.gz"
pkg.dirname "really-cool-directory"
pkg.configure { ["cmake .."] }
pkg.build { ["make -j 3"] }
pkg.install { ["make install"] }

Parameters:

  • path (String)

    The build directory to use for building the project



356
357
358
359
360
361
362
# File 'lib/vanagon/component/dsl.rb', line 356

def dirname(path)
  if Pathname.new(path).relative?
    @component.dirname = path
  else
    raise Vanagon::Error, "dirname should be a relative path, but '#{path}' looks to be absolute."
  end
end

#environment(*env) ⇒ Object

Adds a set of environment overrides to the environment for a component. This environment is included in the configure, build and install steps.

Parameters:

  • env (Hash)

    mapping of keys to values to add to the environment for the component

Raises:

  • (ArgumentError)


398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/vanagon/component/dsl.rb', line 398

def environment(*env) # rubocop:disable Metrics/AbcSize
  if env.size == 1 && env.first.is_a?(Hash)
    warn <<-WARNING.undent
      the component DSL method signature #environment({Key => Value}) is deprecated
      and will be removed by Vanagon 1.0.0.

      Please update your project configurations to use the form:
        #environment(key, value)
    WARNING
    return @component.environment.merge!(env.first)
  elsif env.size == 2
    return @component.environment[env.first] = env.last
  end
  raise ArgumentError, <<-WARNING.undent
    component DSL method #environment only accepts a single Hash (deprecated)
    or a key-value pair (preferred):
      environment({"KEY" => "value"})
      environment("KEY", "value")
  WARNING
end

#install(&block) ⇒ Object

Set or add to the install call for the component. The commands required to install the component.

Parameters:

  • block (Proc)

    the command(s) required to install the component



81
82
83
# File 'lib/vanagon/component/dsl.rb', line 81

def install(&block)
  @component.install << yield
end

#install_configfile(source, target, mode: '0644', owner: nil, group: nil) ⇒ Object

Shorthand to install a file and mark it as a configfile

Parameters:

  • source (String)

    path to the configfile to copy

  • target (String)

    path to the desired target of the configfile



263
264
265
266
# File 'lib/vanagon/component/dsl.rb', line 263

def install_configfile(source, target, mode: '0644', owner: nil, group: nil)
  install_file(source, target, mode: mode, owner: owner, group: group)
  configfile(target, mode: mode, owner: owner, group: group)
end

#install_file(source, target, mode: nil, owner: nil, group: nil) ⇒ Object

Copies a file from source to target during the install phase of the component

Parameters:

  • source (String)

    path to the file to copy

  • target (String)

    path to the desired target of the file

  • owner (String) (defaults to: nil)

    owner of the file

  • group (String) (defaults to: nil)

    group owner of the file



229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/vanagon/component/dsl.rb', line 229

def install_file(source, target, mode: nil, owner: nil, group: nil) # rubocop:disable Metrics/AbcSize
  @component.install << "#{@component.platform.install} -d '#{File.dirname(target)}'"
  @component.install << "#{@component.platform.copy} -p '#{source}' '#{target}'"

  if @component.platform.is_windows?
    unless mode.nil? && owner.nil? && group.nil?
      warn "You're trying to set the mode, owner, or group for windows. I don't know how to do that, ignoring!"
    end
  else
    mode ||= '0644'
    @component.install << "chmod #{mode} '#{target}'"
  end
  @component.add_file Vanagon::Common::Pathname.file(target, mode: mode, owner: owner, group: group)
end

#install_only(install_only) ⇒ Object



520
521
522
# File 'lib/vanagon/component/dsl.rb', line 520

def install_only(install_only)
  @component.install_only = install_only
end

#install_service(service_file, default_file = nil, service_name = @component.name, service_type: nil, link_target: nil) ⇒ Object

install_service adds the commands to install the various files on disk during the package build and registers the service with the project

Parameters:

  • service_file (String)

    path to the service file relative to the source

  • default_file (String) (defaults to: nil)

    path to the default file relative to the source

  • service_name (String) (defaults to: @component.name)

    name of the service

  • service_type (String) (defaults to: nil)

    type of the service (network, application, system, etc)

  • link_target (String) (defaults to: nil)

    executable service file should be linked to



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/vanagon/component/dsl.rb', line 169

def install_service(service_file, default_file = nil, service_name = @component.name, service_type: nil, link_target: nil) # rubocop:disable Metrics/AbcSize
  case @component.platform.servicetype
  when "sysv"
    target_service_file = File.join(@component.platform.servicedir, service_name)
    target_default_file = File.join(@component.platform.defaultdir, service_name)
    target_mode = '0755'
    default_mode = '0644'
  when "systemd"
    target_service_file = File.join(@component.platform.servicedir, "#{service_name}.service")
    target_default_file = File.join(@component.platform.defaultdir, service_name)
    target_mode = '0644'
    default_mode = '0644'
  when "launchd"
    target_service_file = File.join(@component.platform.servicedir, "#{service_name}.plist")
    target_mode = '0644'
    default_mode = '0644'
  when "smf"
    target_service_file = File.join(@component.platform.servicedir, service_type.to_s, "#{service_name}.xml")
    target_default_file = File.join(@component.platform.defaultdir, service_name)
    target_mode = '0644'
    default_mode = '0755'
  when "aix"
    @component.service = OpenStruct.new(:name => service_name, :service_command => File.read(service_file).chomp)
    # Return here because there is no file to install, just a string read in
    return
  when "windows"
    @component.service = OpenStruct.new(\
      :bindir_id => "#{service_name.gsub(/[^A-Za-z0-9]/, '').upcase}BINDIR", \
      :service_file => service_file, \
      :component_group_id => "#{service_name.gsub(/[^A-Za-z0-9]/, '')}Component"\
    )
    # return here as we are just collecting the name of the service file to put into the harvest filter list.
    return
  else
    fail "Don't know how to install the #{@component.platform.servicetype}. Please teach #install_service how to do this."
  end

  # Install the service and default files
  if link_target
    install_file(service_file, link_target, mode: target_mode)
    link link_target, target_service_file
  else
    install_file(service_file, target_service_file, mode: target_mode)
  end

  if default_file
    install_file(default_file, target_default_file, mode: default_mode)
    configfile target_default_file
  end

  # Register the service for use in packaging
  @component.service = OpenStruct.new(:name => service_name, :service_file => target_service_file, :type => service_type)
end

#license(license) ⇒ Object



516
517
518
# File 'lib/vanagon/component/dsl.rb', line 516

def license(license)
  @component.license = license
end

link will add a command to the install to create a symlink from source to target

Parameters:

  • source (String)

    path to the file to symlink

  • target (String)

    path to the desired symlink



272
273
274
275
276
277
278
279
# File 'lib/vanagon/component/dsl.rb', line 272

def link(source, target)
  @component.install << "#{@component.platform.install} -d '#{File.dirname(target)}'"
  # Use a bash conditional to only create the link if it doesn't already point to the correct source.
  # This allows rerunning the install step to be idempotent, rather than failing because the link
  # already exists.
  @component.install << "([[ '#{target}' -ef '#{source}' ]] || ln -s '#{source}' '#{target}')"
  @component.add_file Vanagon::Common::Pathname.file(target)
end

#load_from_json(file) ⇒ Object

Loads and parses json from a file. Will treat the keys in the json as methods to invoke on the component in question

Parameters:

  • file (String)

    Path to the json file

Raises:

  • (RuntimeError)

    exceptions are raised if there is no file, if it refers to methods that don’t exist, or if it does not contain a Hash



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/vanagon/component/dsl.rb', line 101

def load_from_json(file)
  if File.exists?(file)
    data = JSON.parse(File.read(file))
    raise "Hash required. Got '#{data.class}' when parsing '#{file}'" unless data.is_a?(Hash)
    data.each do |key, value|
      if self.respond_to?(key)
        self.send(key, value)
      else
        fail "Component does not have a '#{key}' method to invoke. Maybe your bespoke json has a typo?"
      end
    end
  else
    fail "Cannot load component data from '#{file}'. It does not exist."
  end
end

#mirror(url) ⇒ Object

Sets a mirror url for the source of this component

Parameters:

  • url (String)

    a mirror url to use as the source for this component. Can be called more than once to add multiple mirror URLs.



300
301
302
# File 'lib/vanagon/component/dsl.rb', line 300

def mirror(url)
  @component.mirrors << url
end

#provides(provide, version = nil) ⇒ Object

Indicates that this component provides a system level package. Provides can be collected and used by the project and package.

Parameters:

  • provide (String)

    a package that is provided with this component

  • version (String) (defaults to: nil)

    the version of the package that is provided with this component



147
148
149
# File 'lib/vanagon/component/dsl.rb', line 147

def provides(provide, version = nil)
  @component.provides << OpenStruct.new(:provide => provide, :version => version)
end

#ref(the_ref) ⇒ Object

Sets the ref of the source for use in a git source

Parameters:

  • the_ref (String)

    ref, sha, branch or tag to checkout for a git source



317
318
319
# File 'lib/vanagon/component/dsl.rb', line 317

def ref(the_ref)
  @component.options[:ref] = the_ref
end

#replaces(replacement, version = nil) ⇒ Object

Indicates that this component replaces a system level package. Replaces can be collected and used by the project and package.

Parameters:

  • replacement (String)

    a package that is replaced with this component

  • version (String) (defaults to: nil)

    the version of the package that is replaced



139
140
141
# File 'lib/vanagon/component/dsl.rb', line 139

def replaces(replacement, version = nil)
  @component.replaces << OpenStruct.new(:replacement => replacement, :version => version)
end

#requires(requirement) ⇒ Object

requires adds a requirement to the list of runtime requirements for the component

Parameters:

  • requirement (String)

    a package that is required at runtime for this component



131
132
133
# File 'lib/vanagon/component/dsl.rb', line 131

def requires(requirement)
  @component.requires << requirement
end

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/vanagon/component/dsl.rb', line 53

def respond_to_missing?(method_name, include_private = false)
  method_name.to_s.start_with?('get_') || super
end

#sum(value) ⇒ Object Also known as: md5sum, sha1sum, sha256sum, sha512sum



304
305
306
307
308
# File 'lib/vanagon/component/dsl.rb', line 304

def sum(value)
  type = __callee__.to_s.gsub(/sum$/, '')
  @component.options[:sum] = value
  @component.options[:sum_type] = type
end

#url(uri) ⇒ Object

Sets the canonical URL or URI for the upstream source of this component

Parameters:

  • uri (String, URI)

    a URL or URI describing a canonical location for a component’s source code or artifact



292
293
294
# File 'lib/vanagon/component/dsl.rb', line 292

def url(uri)
  @component.url = uri.to_s
end

#version(ver) ⇒ Object

Sets the version for the component

Parameters:

  • ver (String)

    version of the component



284
285
286
# File 'lib/vanagon/component/dsl.rb', line 284

def version(ver)
  @component.version = ver
end