class Themebox::Client

Public Class Methods

new(token) click to toggle source
# File lib/themebox/client.rb, line 2
def initialize(token)
        @token = token
end

Public Instance Methods

delete_file(path) click to toggle source
# File lib/themebox/client.rb, line 15
def delete_file(path)
        puts "Deleting #{path}"
        RestClient.delete resource_path(path)
end
resource_path(path) click to toggle source
# File lib/themebox/client.rb, line 20
def resource_path(path)
        "http://tablefillr.dev/themes/#{path.sub(/\.liquid$/, '')}"
end
upload_file(path, file) click to toggle source
# File lib/themebox/client.rb, line 6
def upload_file(path, file)
        upload_path = "http://tablefillr.dev/themes/#{path.sub(/\.liquid$/, '')}"

        puts "Uploading #{path}"
        RestClient.put resource_path(path), :content => file, 
                                                                                :token => @token,
                                                                                :content_type => "application/x-www-form-urlencoded"
end