Class: GithubRunDeck
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- GithubRunDeck
- Defined in:
- lib/github-rundeck.rb
Overview
> GitHub RunDeck
Constant Summary collapse
- VERSION =
'0.1.2'.freeze
Class Attribute Summary collapse
-
.cache_timeout ⇒ Object
Returns the value of attribute cache_timeout.
-
.config_file ⇒ Object
Returns the value of attribute config_file.
-
.github_oauth_token ⇒ Object
Returns the value of attribute github_oauth_token.
Instance Method Summary collapse
-
#ghclient ⇒ Object
> Definitions <=#.
- #serialize(response) ⇒ Object
- #serialize_revisions(branches, tags) ⇒ Object
Class Attribute Details
.cache_timeout ⇒ Object
Returns the value of attribute cache_timeout.
18 19 20 |
# File 'lib/github-rundeck.rb', line 18 def cache_timeout @cache_timeout end |
.config_file ⇒ Object
Returns the value of attribute config_file.
17 18 19 |
# File 'lib/github-rundeck.rb', line 17 def config_file @config_file end |
.github_oauth_token ⇒ Object
Returns the value of attribute github_oauth_token.
19 20 21 |
# File 'lib/github-rundeck.rb', line 19 def github_oauth_token @github_oauth_token end |
Instance Method Details
#ghclient ⇒ Object
> Definitions <=#
33 34 35 36 |
# File 'lib/github-rundeck.rb', line 33 def ghclient # => Instantiate a new GitHub Client Github::Client.new end |
#serialize(response) ⇒ Object
38 39 40 41 |
# File 'lib/github-rundeck.rb', line 38 def serialize(response) # => Serialize Object into JSON Array JSON.pretty_generate(response.map(&:name).sort_by(&:downcase)) end |
#serialize_revisions(branches, tags) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/github-rundeck.rb', line 43 def serialize_revisions(branches, ) # => Serialize Branches/Tags into JSON Array # => Branches = String, Tags = Key/Value branches = branches.map(&:name).sort_by(&:downcase) = .map(&:name).sort_by(&:downcase).reverse.map { |tag| { name: "Tag: #{tag}", value: tag } } JSON.pretty_generate(branches + ) end |