Class: Ra10ke::Duplicates::Verification::Module

Inherits:
Struct
  • Object
show all
Defined in:
lib/ra10ke/duplicates.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsObject

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



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

def args
  @args
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



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

def name
  @name
end

#namespaceObject

Returns the value of attribute namespace

Returns:

  • (Object)

    the current value of namespace



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

def namespace
  @namespace
end

Instance Method Details

#forge?Boolean

Returns:

  • (Boolean)


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

def forge?
  !git?
end

#git?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/ra10ke/duplicates.rb', line 36

def git?
  args.key? :git
end

#to_sObject



48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/ra10ke/duplicates.rb', line 48

def to_s
  str = "#{[namespace, name].compact.join '/'}"

  if git?
    ref = args[:ref] || args[:tag] || args[:branch]
    ref_type = (args[:ref] && 'ref') || (args[:tag] && 'tag') || (args[:branch] && 'branch')
    str += " from git on the #{ref_type} #{ref} at #{args[:git]}"
  elsif args.key? :version
    str += " from the forge at version #{args[:version]}"
  end

  str
end

#typeObject



44
45
46
# File 'lib/ra10ke/duplicates.rb', line 44

def type
  git? ? 'git' : 'forge'
end