xing-backend 0.0.20 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06adc2c9335e9abd04144b3b77aa30b10ca66494
4
- data.tar.gz: dab2b68d69fe03e1e510ccc4d3ae490f93065991
3
+ metadata.gz: 83263b2da2ccaa9937f54b89d89db2614d0720b1
4
+ data.tar.gz: e60e38b8a1c57730d90c66076840a85d1712af31
5
5
  SHA512:
6
- metadata.gz: db70e839274e8e2cd5f49583ec2435d6aef0fe25b10f3f7c4e5902922228d884a8dab7b11ed2cc7879718119234fc3e9ae60a546c29d51ed4e70a64baddc7559
7
- data.tar.gz: 6e2e327f99f3fb411c0733d571d4cf5a3635c067b2eddf06eb40ada56643f7783947f34e66bc43ba912c041adf990df2f0d5ccc03bac0e8b13be1f5dd8b4df1a
6
+ metadata.gz: b07bbb1e14d280327e461466e61ac3893b1f98ca5d16484448bcdc780fb24bc800011d85ec4d24e13f51842dd8d9c5239ef01af518025edc63e984dd660c070a
7
+ data.tar.gz: a495405c436e09f94fdd54be11643e52db8badaef0be96842337cef069400adedb216f1142857039d258a6b5dd9f79320afec077fe95535b23fbd5af9fc0e4b8
data/lib/xing/engine.rb CHANGED
@@ -8,6 +8,7 @@ module Xing
8
8
  end
9
9
 
10
10
  config.autoload_paths += Dir[File.join(__FILE__, '../controllers/**/')]
11
+ config.autoload_paths += Dir[File.join(__FILE__, '../../lib')]
11
12
 
12
13
  config.generators do |g|
13
14
  g.test_framework :rspec
@@ -16,6 +16,10 @@ module Xing::Serializers
16
16
  object.current_page
17
17
  end
18
18
 
19
+ def self_link
20
+ page_link(page: page_num)
21
+ end
22
+
19
23
  def next_link
20
24
  page_link({page: page_num + 1}) unless page_num == total_pages
21
25
  end
@@ -0,0 +1,47 @@
1
+ module Xing::Services
2
+ class LogJson
3
+ APPJSON_RE = %r{^application/json}.freeze
4
+
5
+ def log_string(string)
6
+ obj = JSON.parse(string)
7
+ pretty_str = JSON.pretty_unparse(obj)
8
+ Rails.logger.debug(type_string + ": " + pretty_str)
9
+ end
10
+ end
11
+
12
+ class LogJsonRequests < LogJson
13
+ def initialize(app)
14
+ @app = app
15
+ end
16
+
17
+ def call(env)
18
+ if defined?(Rails) and env["CONTENT_TYPE"] =~ APPJSON_RE
19
+ log_string(env["rack.input"].read)
20
+ env["rack.input"].rewind
21
+ end
22
+ @app.call(env)
23
+ end
24
+
25
+ def type_string
26
+ "Request"
27
+ end
28
+ end
29
+
30
+ class LogJsonResponses < LogJson
31
+ def initialize(app)
32
+ @app = app
33
+ end
34
+
35
+ def call(env)
36
+ @app.call(env).tap do |status, headers, response|
37
+ if defined?(Rails) and headers["Content-Type"] =~ APPJSON_RE
38
+ log_string(response.body)
39
+ end
40
+ end
41
+ end
42
+
43
+ def type_string
44
+ "Response"
45
+ end
46
+ end
47
+ end
data/lib/xing/services.rb CHANGED
@@ -6,3 +6,4 @@ end
6
6
  require 'xing/services/json_tree_lister'
7
7
  require 'xing/services/error_converter'
8
8
  require 'xing/services/locator'
9
+ require 'xing/services/log_json_responses'
@@ -141,3 +141,13 @@ ETHON: started MULTI
141
141
  ETHON: performed MULTI
142
142
  ETHON: started MULTI
143
143
  ETHON: performed MULTI
144
+ ETHON: Libcurl initialized
145
+ ETHON: started MULTI
146
+ ETHON: performed MULTI
147
+ ETHON: started MULTI
148
+ ETHON: performed MULTI
149
+ ETHON: Libcurl initialized
150
+ ETHON: started MULTI
151
+ ETHON: performed MULTI
152
+ ETHON: started MULTI
153
+ ETHON: performed MULTI
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xing-backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Dorn
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-01-06 00:00:00.000000000 Z
14
+ date: 2016-01-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -250,6 +250,7 @@ files:
250
250
  - lib/xing/services/error_converter.rb
251
251
  - lib/xing/services/json_tree_lister.rb
252
252
  - lib/xing/services/locator.rb
253
+ - lib/xing/services/log_json_responses.rb
253
254
  - lib/xing/services/paged_wrapper.rb
254
255
  - lib/xing/snapshot.rb
255
256
  - lib/xing/snapshot/domain_helpers.rb
@@ -344,7 +345,7 @@ rdoc_options:
344
345
  - "--main"
345
346
  - doc/README
346
347
  - "--title"
347
- - xing-backend-0.0.20 Documentation
348
+ - xing-backend-0.0.21 Documentation
348
349
  require_paths:
349
350
  - lib/
350
351
  required_ruby_version: !ruby/object:Gem::Requirement