Module: GitFeats::API

Extended by:
API
Included in:
API
Defined in:
lib/git-feats/api.rb

Constant Summary collapse

URL =
'http://www.gitfeats.com'

Instance Method Summary collapse

Instance Method Details

#upload_featsObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/git-feats/api.rb', line 11

def upload_feats
  # Post json to git-feats
  begin
    puts "Updating feats on gitfeats.com..."
    # Attempt to update feats
    conn.post do |req|
      req.url '/api/post_feats'
      req.headers['Content-Type'] = 'application/json'
      req.body = upload_feats_body.to_json
    end
    puts
  rescue
    puts "Connection failed!\n\n"
  end
end