module GithubRunDeck::Util
> Utility Methods¶ ↑
Public Instance Methods
parse_json(file = nil, symbolize = true)
click to toggle source
serialize(response)
click to toggle source
serialize_csv(csv)
click to toggle source
# File lib/github-rundeck/util.rb, line 50 def serialize_csv(csv) # => Serialize a CSV String into an Array return unless csv && csv.is_a?(String) csv.split(',') end
serialize_revisions(branches, tags)
click to toggle source
# File lib/github-rundeck/util.rb, line 56 def serialize_revisions(branches, tags) # => Serialize Branches/Tags into JSON Array # => Branches = String, Tags = Key/Value branches = branches.map(&:name).sort_by(&:downcase) tags = tags.map(&:name).sort_by(&:downcase).reverse.map { |tag| { name: "Tag: #{tag}", value: tag } } JSON.pretty_generate(branches + tags) end