cryx-rest-client 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/restclient/logging.rb +16 -0
- data/rest-client.gemspec +3 -2
- metadata +2 -1
@@ -0,0 +1,16 @@
|
|
1
|
+
module RestClient
|
2
|
+
module Logging
|
3
|
+
# Why not directly use a Logger instance ? It deals with STDOUT, STDERR, and writing to a file...
|
4
|
+
def display_log(msg)
|
5
|
+
return unless log_to = RestClient.log
|
6
|
+
|
7
|
+
if log_to == 'stdout'
|
8
|
+
STDOUT.puts msg
|
9
|
+
elsif log_to == 'stderr'
|
10
|
+
STDERR.puts msg
|
11
|
+
else
|
12
|
+
File.open(log_to, 'a') { |f| f.puts msg }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/rest-client.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "rest-client"
|
3
|
-
s.version = "0.9.
|
3
|
+
s.version = "0.9.3"
|
4
4
|
s.summary = "Simple REST client for Ruby, inspired by microframework syntax for specifying actions."
|
5
5
|
s.description = "A simple REST client for Ruby, inspired by the Sinatra microframework style of specifying actions: get, put, post, delete."
|
6
6
|
s.author = "Adam Wiggins"
|
@@ -10,7 +10,8 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.has_rdoc = true
|
11
11
|
s.platform = Gem::Platform::RUBY
|
12
12
|
s.files = %w(Rakefile README.rdoc rest-client.gemspec
|
13
|
-
lib/rest_client.rb lib/restclient.rb
|
13
|
+
lib/rest_client.rb lib/restclient.rb
|
14
|
+
lib/restclient/logging.rb
|
14
15
|
lib/restclient/request.rb lib/restclient/response.rb
|
15
16
|
lib/restclient/exceptions.rb lib/restclient/resource.rb
|
16
17
|
spec/base.rb spec/request_spec.rb spec/response_spec.rb
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryx-rest-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Wiggins
|
@@ -27,6 +27,7 @@ files:
|
|
27
27
|
- rest-client.gemspec
|
28
28
|
- lib/rest_client.rb
|
29
29
|
- lib/restclient.rb
|
30
|
+
- lib/restclient/logging.rb
|
30
31
|
- lib/restclient/request.rb
|
31
32
|
- lib/restclient/response.rb
|
32
33
|
- lib/restclient/exceptions.rb
|