class RBT::Cookbooks::CreateSnapcraftFile
Constants
- NAMESPACE
#¶ ↑
NAMESPACE
¶ ↑#¶ ↑
Public Class Methods
[](i = '')
click to toggle source
Public Instance Methods
add( i = '', add_newline = true )
click to toggle source
add_apps()
click to toggle source
add_confinement( use_this_confinement = 'strict' )
click to toggle source
#¶ ↑
add_confinement
¶ ↑
Can be either 'devmode' or 'strict'.
Unconfined applications, specified with 'devmode', can only be released to the hidden “edge” channel.
#¶ ↑
# File lib/rbt/utility_scripts/create_snapcraft_file.rb, line 199 def add_confinement( use_this_confinement = 'strict' ) add('confinement: '+use_this_confinement) end
add_grade( use_this_grade = 'stable' )
click to toggle source
add_name()
click to toggle source
add_newline()
click to toggle source
add_parts()
click to toggle source
#¶ ↑
add_parts
(parts tag)¶ ↑
This method denotes the necessary parts (components) of our program at hand.
#¶ ↑
# File lib/rbt/utility_scripts/create_snapcraft_file.rb, line 273 def add_parts heredoc_variable = <<-EOF parts: #{name_of_this_individual_program?}: # See 'snapcraft plugins' for more information. plugin: #{plugin_type?} source: #{remote_url?} EOF add(heredoc_variable) end
add_program_description()
click to toggle source
#¶ ↑
add_program_description
(desc tag)¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/create_snapcraft_file.rb, line 315 def add_program_description description_to_use = "description: |#{N}".dup _ = @dataset.description? _.split(N).each {|line| description_to_use << ' '+line+N } add(description_to_use.strip.chomp) end
add_program_licence()
click to toggle source
add_program_summary()
click to toggle source
add_program_version()
click to toggle source
binaries?()
click to toggle source
generate_the_snapcraft_file( into = into? )
click to toggle source
#¶ ↑
generate_the_snapcraft_file
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/create_snapcraft_file.rb, line 344 def generate_the_snapcraft_file( into = into? ) what = what? remove_file(into) if File.exist? into opnn; e "Now saving the content into the file `#{sfile(into)}`." write_what_into(what, into) end
into?()
click to toggle source
licence?()
click to toggle source
name_of_this_individual_program?()
click to toggle source
notify_the_user_that_we_will_create_a_new_snapcraft_file_next( _ = programs? )
click to toggle source
#¶ ↑
notify_the_user_that_we_will_create_a_new_snapcraft_file_next
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/create_snapcraft_file.rb, line 327 def notify_the_user_that_we_will_create_a_new_snapcraft_file_next( _ = programs? ) result = 'Creating a snapcraft file next for the program'.dup if _.size > 1 result << 's' end if _.is_a? Array _ = _.join(', ').strip end result << " called #{royalblue(_)}." opnn; e result end
plugin_type?()
click to toggle source
program_name?()
click to toggle source
#¶ ↑
program_name?¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/create_snapcraft_file.rb, line 140 def program_name? @program_name end
Also aliased as: programs?
program_version?()
click to toggle source
remote_url?()
click to toggle source
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/utility_scripts/create_snapcraft_file.rb, line 55 def reset super() @namespace = NAMESPACE # ======================================================================= # # The following instance variable, a String, is the one that is used # to store all content that will be written into the snapcraft yaml # file. It will be used to store the file in the current directory. # ======================================================================= # @snapcraft_file_content = ''.dup # ======================================================================= # # Denote into which file we will store that content. # ======================================================================= # @store_into_this_file = 'snapcraft.yaml' end
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/create_snapcraft_file.rb, line 356 def run programs?.each {|this_program| reset try_to_find_corresponding_program(this_program) # <- Must come first as it sets the @dataset variable. set_name_of_this_individual_program(this_program) set_store_into_this_file( this_program+'-'+program_version?+'-snapcraft' ) notify_the_user_that_we_will_create_a_new_snapcraft_file_next( this_program ) add_name add_program_version add_program_summary add_program_licence add_program_description add_grade add_confinement add_newline add_apps add_parts generate_the_snapcraft_file } end
set_name_of_this_individual_program(i)
click to toggle source
set_program_name(i = '')
click to toggle source
#¶ ↑
set_program_name
¶ ↑
Denote onto which program we will work on.
#¶ ↑
# File lib/rbt/utility_scripts/create_snapcraft_file.rb, line 84 def set_program_name(i = '') if i.nil? opnn; e 'Please provide a valid name for a program to this class.' exit end i = [i].flatten.compact if i.first.is_a?(String) and i.first.include?(',') i = i.map {|entry| if entry.include? ',' entry = entry.split(',') end entry }.flatten.compact end @program_name = i end
set_store_into_this_file(i)
click to toggle source
short_desc?()
click to toggle source
short_name?()
click to toggle source
try_to_find_corresponding_program( program_name = program_name? )
click to toggle source
#¶ ↑
try_to_find_corresponding_program
¶ ↑
This method attempts to find a corresponding entry from the individual yaml files.
#¶ ↑
# File lib/rbt/utility_scripts/create_snapcraft_file.rb, line 150 def try_to_find_corresponding_program( program_name = program_name? ) @dataset = RBT::Cookbooks::Cookbook.new(program_name) { :bypass_menu_check } end