lib/instapusher/job_submission.rb in instapusher-0.1.5 vs lib/instapusher/job_submission.rb in instapusher-0.1.6
- old
+ new
@@ -50,10 +50,19 @@
elsif options[:staging]
"instapusher.net"
else
ENV['INSTAPUSHER_HOST'] || DEFAULT_HOSTNAME
end
- "http://#{hostname}/api/v1/jobs.json"
+ if use_ssl?
+ "https://#{hostname}/api/v1/jobs.json"
+ else
+ "http://#{hostname}/api/v1/jobs.json"
+ end
end
end
+
+ def use_ssl?
+ !(ENV['INSTAPUSHER_HOST'] || options[:local])
+ end
+
end
end