Sha256: 24d402303073c28da078c79fb124eff9c2da8edf8183b307d52ef17659b2a42f

Contents?: true

Size: 1.13 KB

Versions: 9

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake

<% desc = group['desc'] || "#{group['name'].gsub(".", "_").camelize} methods." %>
<% if desc.include?("'")  %>
desc "<%= desc %>"
<% else %>
desc '<%= desc %>'
<% end %>
command '<%= group['name'].gsub(".", "_") %>' do |g|
<% names.sort.each_with_index do |(name, data), index| %>
<% if index > 0 %>

<% end %>
  <% short_desc = data["desc"].split("\n").first %>
  <% short_desc += ' (undocumented)' if data['undocumented'] %>
  <% if short_desc.include?("'")  %>
  g.desc "<%= short_desc %>"
  <% else %>
  g.desc '<%= short_desc %>'
  <% end %>
  g.long_desc %( <%= data["desc"].split("\n").join(" ") %> )
  g.command '<%= name %>' do |c|
  <% data["args"].each do |arg_name, arg_v| %>
    <% if arg_v["desc"].include?("'") %>
    c.flag '<%= arg_name %>', desc: "<%= arg_v["desc"].gsub('"', '\'') %>"
    <% else %>
    c.flag '<%= arg_name %>', desc: '<%= arg_v["desc"] %>'
    <% end %>
  <% end %>
    c.action do |_global_options, options, _args|
      puts JSON.dump($client.<%=group['name'].gsub(".", "_") %>_<%= name %>(options))
    end
  end
<% end %>
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
slack-ruby-client-2.0.0 lib/slack/web/api/templates/command.erb
slack-ruby-client-1.1.0 lib/slack/web/api/templates/command.erb
slack-ruby-client-1.0.0 lib/slack/web/api/templates/command.erb
slack-ruby-client-0.17.0 lib/slack/web/api/templates/command.erb
slack-ruby-client-0.16.0 lib/slack/web/api/templates/command.erb
slack-ruby-client-0.15.1 lib/slack/web/api/templates/command.erb
slack-ruby-client-0.15.0 lib/slack/web/api/templates/command.erb
slack-ruby-client-0.14.6 lib/slack/web/api/templates/command.erb
slack-ruby-client-0.14.5 lib/slack/web/api/templates/command.erb