Class: Origen::CodeGenerators::Timever

Inherits:
Base
  • Object
show all
Defined in:
lib/origen/code_generators/timever.rb

Instance Method Summary collapse

Methods inherited from Base

banner, inherited, name, namespace

Methods included from Actions

#add_config, #add_source, #comment_config, #config, #environment, #gem, #gem_group, #generate, #git, #initialize, #lib, #rake, #rakefile, #readme

Instance Method Details

#create_version_fileObject


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/origen/code_generators/timever.rb', line 8

def create_version_file
  if config[:change]
    @version = config[:change]
  else
    @version = Origen.app.version
    unless @version.timestamp?
      if @version.production?
        @version = VersionString.production_timestamp
      else
        @version = VersionString.development_timestamp
      end
    end
  end
  template 'templates/code_generators/version_time.rb', File.join(Origen.root, 'config', 'version.rb'), force: true
end

31
32
33
34
# File 'lib/origen/code_generators/timever.rb', line 31

def print_version
  puts
  puts "You're new app version is: #{Origen.app.version(refresh: true)}"
end

#set_configurationObject


24
25
26
27
28
29
# File 'lib/origen/code_generators/timever.rb', line 24

def set_configuration
  if Origen.app.config.semantically_version
    comment_config :semantically_version
    add_config :semantically_version, false
  end
end