Class: Bruw::Commands::Decidim

Inherits:
Thor
  • Object
show all
Defined in:
lib/bruw/commands/decidim.rb

Instance Method Summary collapse

Instance Method Details

#curl(path) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/bruw/commands/decidim.rb', line 30

def curl(path)
  options[:path] = path
  options[:version] = find_version_for_curl options

  response = Bruw::Decidim.curl(options)

  if options[:save]
    path = strip_path(path)
    create_path(path)
    save_file(path, response.chop)

    puts "Curl finished, please see '#{path}'".colorize(:green)
  else
    puts response.chop
  end
rescue StandardError => e
  puts e.message.colorize(:red)
end

#versionObject



13
14
15
16
17
# File 'lib/bruw/commands/decidim.rb', line 13

def version
  puts "Current Decidim version is #{Bruw::Decidim.version&.colorize(:green)}"
rescue StandardError => e
  puts e.message.colorize(:red)
end