Class: Release::Notes::System

Inherits:
Object
  • Object
show all
Includes:
Configurable
Defined in:
lib/release/notes/system.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**opts) ⇒ Object

Release::Notes::System initializer

Parameters:

  • **opts


16
17
18
19
20
21
22
23
# File 'lib/release/notes/system.rb', line 16

def initialize(**opts)
  @opts = opts

  return unless opts.delete(:log_all) == true

  opts[:label] = config_all_labels
  opts[:invert_grep] = " --invert-grep"
end

Instance Attribute Details

#optsObject (readonly)

Returns the value of attribute opts.



7
8
9
# File 'lib/release/notes/system.rb', line 7

def opts
  @opts
end

Class Method Details

.all_tagsString

Call Git.read_all_tags method

Returns:

  • (String)

    shell output of running Git.read_all_tags



49
50
51
# File 'lib/release/notes/system.rb', line 49

def all_tags
  `#{Git.read_all_tags}`
end

.first_commitString

Call Git.first_commit method

Returns:

  • (String)

    shell output of running Git.first_commit



40
41
42
# File 'lib/release/notes/system.rb', line 40

def first_commit
  `#{Git.first_commit}`
end

.last_tagString

Call Git.last_tag method

Returns:

  • (String)

    shell output of running Git.last_tag



58
59
60
# File 'lib/release/notes/system.rb', line 58

def last_tag
  `#{Git.last_tag}`
end

.tag_date(tag: nil) ⇒ String

Call Git.tag_date method

Parameters:

  • tag (String) (defaults to: nil)
    • a tag that you want to get the date created for

Returns:

  • (String)

    shell output of running Git.tag_date



69
70
71
# File 'lib/release/notes/system.rb', line 69

def tag_date(tag: nil)
  `#{Git.tag_date(tag || last_tag)}`
end

Instance Method Details

#logString

Call Git.log method with configurable options

Returns:

  • (String)

    shell output of running Git.log



30
31
32
# File 'lib/release/notes/system.rb', line 30

def log
  `#{Git.log(opts)}`
end