Class: Lolcommits::Uploldz
- Defined in:
- lib/lolcommits/plugins/uploldz.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
Attributes inherited from Plugin
#default, #name, #options, #runner
Instance Method Summary collapse
-
#initialize(runner) ⇒ Uploldz
constructor
A new instance of Uploldz.
- #run ⇒ Object
Methods inherited from Plugin
#configuration, #execute, #is_enabled?, #plugdebug
Constructor Details
#initialize(runner) ⇒ Uploldz
Returns a new instance of Uploldz.
7 8 9 10 11 12 13 |
# File 'lib/lolcommits/plugins/uploldz.rb', line 7 def initialize(runner) super self.name = 'uploldz' self.default = false self..concat(['endpoint']) end |
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint.
5 6 7 |
# File 'lib/lolcommits/plugins/uploldz.rb', line 5 def endpoint @endpoint end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/lolcommits/plugins/uploldz.rb', line 15 def run repo = self.runner.repo.to_s if configuration['endpoint'].empty? puts "Endpoint URL is empty, please run lolcommits --config to add one." elsif repo.empty? puts "Repo is empty, skipping upload" else plugdebug "Calling " + configuration['endpoint'] + " with repo " + repo RestClient.post(configuration['endpoint'], :file => File.new(self.runner.main_image), :repo => repo) end end |