mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-06 17:28:50 +01:00
More code style fixes
This commit is contained in:
parent
465419f46a
commit
d4c9041ccd
61 changed files with 406 additions and 422 deletions
|
|
@ -2,16 +2,16 @@ require 'net/https'
|
|||
require File.expand_path(File.dirname(__FILE__) + '/tracks_xml_builder')
|
||||
|
||||
module TracksCli
|
||||
|
||||
class TracksAPI
|
||||
def initialize(options)
|
||||
@options = options
|
||||
@options = options
|
||||
end
|
||||
|
||||
def get_http(uri)
|
||||
http = Net::HTTP.new(uri.host, uri.port)
|
||||
|
||||
if uri.scheme == "https" # enable SSL/TLS
|
||||
# Enable SSL/TLS
|
||||
if uri.scheme == "https"
|
||||
http.use_ssl = true
|
||||
http.ca_path = "/etc/ssl/certs/" # Debian based path
|
||||
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
||||
|
|
@ -57,7 +57,5 @@ module TracksCli
|
|||
def get_context(context_id)
|
||||
get(context_uri_for(context_id))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
require 'active_support/time_with_zone'
|
||||
|
||||
module TracksCli
|
||||
|
||||
class TracksXmlBuilder
|
||||
|
||||
def xml_for_description(description)
|
||||
"<description>#{description}</description>"
|
||||
end
|
||||
|
|
@ -23,8 +21,8 @@ module TracksCli
|
|||
def xml_for_taglist(taglist)
|
||||
unless taglist.nil?
|
||||
tags = taglist.split(",")
|
||||
if tags.length() > 0
|
||||
tags = tags.collect { |tag| "<tag><name>#{tag.strip}</name></tag>" unless tag.strip.empty?}.join('')
|
||||
if tags.length > 0
|
||||
tags = tags.collect { |tag| "<tag><name>#{tag.strip}</name></tag>" unless tag.strip.empty? }.join('')
|
||||
return "<tags>#{tags}</tags>"
|
||||
end
|
||||
else
|
||||
|
|
@ -61,6 +59,5 @@ module TracksCli
|
|||
def build_project_xml(project)
|
||||
"<project><name>#{project[:description]}</name><default-context-id>#{project[:default_context_id]}</default-context-id></project>"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue