codebase_api 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 79d075117269e78c4fe0434b0a8f9791630e7efd
4
+ data.tar.gz: fc9b20a4da9dac391e74b3787372a307e3c3e78d
5
+ SHA512:
6
+ metadata.gz: 10bd0313a8d5f573d759efcec2e1ff00156dd2789f83bd214d92fc92a5e3992c2ec84866ab684876cf2bb969fc1f663df902f8e361ab178e7c3c0f15322a8c78
7
+ data.tar.gz: 558ae71bae29cdacfbbeaf8dfab65e24a656d1c33420688dad2cd665e795b03c4901fac27c4189fefc961894c7dccac5bad032cab25c9ace75baa2de26823276
@@ -44,7 +44,7 @@ module CodebaseApi
44
44
  elsif http_result.body == 'false'
45
45
  @output = false
46
46
  else
47
- http_result.body.present? ? @output = JSON.parse(http_result.body) : @output
47
+ !http_result.body.empty? ? @output = JSON.parse(http_result.body) : @output
48
48
  end
49
49
  @success = case http_result
50
50
  when Net::HTTPSuccess
@@ -54,8 +54,7 @@ module CodebaseApi
54
54
  when Net::HTTPForbidden, Net::HTTPUnauthorized
55
55
  raise CodebaseApi::Errors::AccessDenied, "Access Denied"
56
56
  when Net::HTTPNotFound
57
- json = JSON.parse(http_result.body)
58
- raise CodebaseApi::Errors::NotFound, json['error']
57
+ @output = false
59
58
  when Net::HTTPBadRequest, Net::HTTPUnauthorized, Net::HTTPMethodNotAllowed
60
59
  json = JSON.parse(http_result.body)
61
60
  raise CodebaseApi::Errors::AccessDenied, "Access Denied for '#{CodebaseApi.application}' #{json['error']}"
@@ -63,11 +62,6 @@ module CodebaseApi
63
62
  raise CodebaseApi::Errors::CommunicationError, http_result.body
64
63
  end
65
64
 
66
- # show detailed info about the request
67
- puts "[Codebase API] Sent: #{data}".yellow
68
- puts "[Codebase API] Requesting: #{[path].join('/')} on https://api3.codebasehq.com".yellow
69
- puts "[Codebase API] Response: #{http_result.body}".yellow
70
-
71
65
  self
72
66
  end
73
67
 
@@ -84,4 +78,4 @@ module CodebaseApi
84
78
  end
85
79
 
86
80
  end
87
- end
81
+ end
@@ -1,3 +1,3 @@
1
1
  module CodebaseApi
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codebase_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.1.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Dean Perry
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-04 00:00:00.000000000 Z
11
+ date: 2015-01-13 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: colorize
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  description: Ruby gem for accessing the Codebase API
@@ -34,7 +31,7 @@ executables: []
34
31
  extensions: []
35
32
  extra_rdoc_files: []
36
33
  files:
37
- - .gitignore
34
+ - ".gitignore"
38
35
  - Gemfile
39
36
  - LICENSE.txt
40
37
  - README.md
@@ -58,26 +55,25 @@ files:
58
55
  - lib/codebase_api/wiki.rb
59
56
  homepage: ''
60
57
  licenses: []
58
+ metadata: {}
61
59
  post_install_message:
62
60
  rdoc_options: []
63
61
  require_paths:
64
62
  - lib
65
63
  required_ruby_version: !ruby/object:Gem::Requirement
66
- none: false
67
64
  requirements:
68
- - - ! '>='
65
+ - - ">="
69
66
  - !ruby/object:Gem::Version
70
67
  version: '0'
71
68
  required_rubygems_version: !ruby/object:Gem::Requirement
72
- none: false
73
69
  requirements:
74
- - - ! '>='
70
+ - - ">="
75
71
  - !ruby/object:Gem::Version
76
72
  version: '0'
77
73
  requirements: []
78
74
  rubyforge_project:
79
- rubygems_version: 1.8.24
75
+ rubygems_version: 2.4.5
80
76
  signing_key:
81
- specification_version: 3
77
+ specification_version: 4
82
78
  summary: Codebase API Ruby Gem
83
79
  test_files: []