class Object
Constants
- WEBSITE_COMMANDS
Commands that need to have a website and a designer object
Public Instance Methods
print_availability_result(result, opts)
click to toggle source
Print result of links availability check eather to STDOUT or in a table format
# File bin/syclink, line 536 def print_availability_result(result, opts) if opts[:table] allowed_cols = %w{ url response } cols = opts[:columns].delete(' ').downcase.split(',') & allowed_cols cols = allowed_cols if cols.empty? SycLink::Formatter.table_of_array(result, cols, opts) else result.each { |r| puts r.join(';') } end end
print_links(links, columns, opts = {})
click to toggle source
Print links in table format
# File bin/syclink, line 527 def print_links(links, columns, opts = {}) allowed_cols = %w{ url name description tag } cols = columns.delete(' ').downcase.split(',') & allowed_cols cols = allowed_cols if cols.empty? SycLink::Formatter.table(links, cols, opts) end
set_default_website(current, default)
click to toggle source
If current website and default website are different ask whether current website should be set as default website
# File bin/syclink, line 514 def set_default_website(current, default) if (current != default) print "Want to make '#{current}' the default (y/n)? " if STDIN.gets.chomp =~ /y/i puts; puts "Making '#{current}' the default website" File.open(@syclink_file, 'w') do |f| YAML.dump({ default_website: current }, f) end end end end