git-feats 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md ADDED
@@ -0,0 +1,8 @@
1
+ ## 0.0.2 (2012-12-6)
2
+
3
+ * fix API to "handle" request failures
4
+ * fix bug causing multi-argument commands to fail
5
+
6
+ ## 0.0.1 (2012-12-6)
7
+
8
+ * initial public (alpha) release
data/lib/git-feats/api.rb CHANGED
@@ -6,27 +6,33 @@ module GitFeats
6
6
 
7
7
  extend self
8
8
 
9
- URL = 'http://localhost:3000'
9
+ URL = 'http://gitfeats.com'
10
10
 
11
11
  def upload_feats
12
12
  # Post json to git-feats
13
- conn.post do |req|
14
- req.url '/api/post_feats'
15
- req.headers['Content-Type'] = 'application/json'
16
- req.body = upload_feats_body.to_json
13
+ begin
14
+ conn.post do |req|
15
+ req.url '/api/post_feats'
16
+ req.headers['Content-Type'] = 'application/json'
17
+ req.body = upload_feats_body.to_json
18
+ end
19
+ rescue
17
20
  end
18
21
  end
19
22
 
20
23
  private
21
24
 
22
- # Return the faraday connection or load a new one
25
+ # Return the faraday connection or create one
23
26
  def conn
24
27
  @conn ||= new_connection
25
28
  end
26
29
 
27
30
  def new_connection
28
31
  # Create git-feats connection
29
- Faraday.new(:url => URL)
32
+ Faraday.new(:url => URL) do |faraday|
33
+ faraday.request :url_encoded
34
+ faraday.adapter Faraday.default_adapter
35
+ end
30
36
  end
31
37
 
32
38
  # Construct the body for the upload feats post
@@ -11,8 +11,8 @@ module GitFeats
11
11
  end
12
12
 
13
13
  # Run shortcut
14
- def self.run(args)
15
- Runner.new(args).run
14
+ def self.run(*args)
15
+ new(*args).run
16
16
  end
17
17
 
18
18
  # Execute git command
@@ -1,3 +1,3 @@
1
1
  module GitFeats
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-feats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -73,6 +73,7 @@ extra_rdoc_files: []
73
73
  files:
74
74
  - .travis.yml
75
75
  - Gemfile
76
+ - HISTORY.md
76
77
  - LICENSE.txt
77
78
  - README.md
78
79
  - Rakefile