Sha256: 57c840a306450c72fdaef717dc3a76ebe2b3f64661df9ab7018d4915c5ba1b5a

Contents?: true

Size: 1014 Bytes

Versions: 7

Compression:

Stored size: 1014 Bytes

Contents

# This file was auto-generated by lib/slack/web/api/tasks/generate.rake

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

<% end %>
  <% short_desc = data["desc"].split("\n").first %>
  <% 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"] %>"
    <% else %>
    c.flag '<%= arg_name %>', desc: '<%= arg_v["desc"] %>'
    <% end %>
  <% end %>
    c.action do |_global_options, options, _args|
      puts JSON.dump($client.<%=group['name'] %>_<%= name %>(options))
    end
  end
<% end %>
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
slack-ruby-client-bhe-0.5.5 lib/slack/web/api/templates/command.erb
slack-ruby-client-bhe-0.5.4 lib/slack/web/api/templates/command.erb
slack-ruby-client-0.5.4 lib/slack/web/api/templates/command.erb
slack-ruby-client-0.5.3 lib/slack/web/api/templates/command.erb
slack-ruby-client-0.5.2 lib/slack/web/api/templates/command.erb
slack-ruby-client-0.5.1 lib/slack/web/api/templates/command.erb
slack-ruby-client-0.5.0 lib/slack/web/api/templates/command.erb