vx-service_connector 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 924c2cbe702273405ca23547b8f7a580320365a0
4
- data.tar.gz: 9eca10454e35becb88234bf75fcd067d0d4ee4fd
3
+ metadata.gz: c0f6d19ca3d8cac3a290c0c0993478152f71d96b
4
+ data.tar.gz: b4f44fedfa0e3d637e502a29eb4becb360cfa2ec
5
5
  SHA512:
6
- metadata.gz: b7a44df4c8d01c007b1fcd330f3028d66f6f7f9ece0af202d2d52786b7a27a23c2bae2224ad66ae579163b4f0caac28869b11d54cd119aac103a1ebf59f9282e
7
- data.tar.gz: 56a55d731c912715a1a5d3388a46e16c70174043f41c38687f2694924a6433b2ff50a463c5f4c049287b2b5ff83d21b73f524faa81295e9c14351dbd18c76959
6
+ metadata.gz: 0afd16981e0b359a74b43f0328050a79234d400f4e7d043a40a243445d22c4ccd15d5b711165248dfd81132636abfa3de928bf06dbd30c17c219a310410d4e95
7
+ data.tar.gz: c73960f77c79688f9a849c07e721169c14b28ef674f806164ec80e3e44479c262898237c75e4605c60665cd49c516fb431bef953c8735732240e24d1badd171b
data/Gemfile CHANGED
@@ -2,7 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in vx-service_connector.gemspec
4
4
  gemspec
5
-
6
- group :development do
7
- gem 'httplog'
8
- end
@@ -1,13 +1,14 @@
1
+
1
2
  require File.expand_path("../service_connector/version", __FILE__)
2
3
  require File.expand_path("../service_connector/error", __FILE__)
3
4
 
4
5
  module Vx
5
6
  module ServiceConnector
6
7
 
7
- autoload :Base, File.expand_path("../service_connector/base", __FILE__)
8
- autoload :Github, File.expand_path("../service_connector/github", __FILE__)
9
- autoload :GitlabV5, File.expand_path("../service_connector/gitlab_v5", __FILE__)
10
- autoload :Model, File.expand_path("../service_connector/model", __FILE__)
8
+ autoload :Base, File.expand_path("../service_connector/base", __FILE__)
9
+ autoload :Github, File.expand_path("../service_connector/github", __FILE__)
10
+ autoload :GitlabV5, File.expand_path("../service_connector/gitlab_v5", __FILE__)
11
+ autoload :Model, File.expand_path("../service_connector/model", __FILE__)
11
12
 
12
13
  extend self
13
14
 
@@ -24,3 +25,5 @@ module Vx
24
25
 
25
26
  end
26
27
  end
28
+
29
+ require File.expand_path("../service_connector/instrumentation", __FILE__)
@@ -1,12 +1,7 @@
1
1
  module Vx
2
2
  module ServiceConnector
3
3
  class Github
4
- class Repos
5
- attr_reader :session
6
-
7
- def initialize(session)
8
- @session = session
9
- end
4
+ Repos = Struct.new(:session) do
10
5
 
11
6
  def to_a
12
7
  @repos ||= (user_repositories + organization_repositories)
@@ -0,0 +1,13 @@
1
+ require 'active_support/notifications'
2
+ require 'faraday'
3
+ require 'octokit/default'
4
+
5
+
6
+ Octokit::Default::MIDDLEWARE.insert 0, Faraday::Request::Instrumentation
7
+
8
+ builder = Faraday::RackBuilder.new
9
+ builder.insert 0, Faraday::Request::Instrumentation
10
+
11
+ Faraday.default_connection_options = {
12
+ builder: builder
13
+ }
@@ -1,5 +1,5 @@
1
1
  module Vx
2
2
  module ServiceConnector
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
@@ -12,3 +12,14 @@ Dir[File.expand_path("../..", __FILE__) + "/spec/support/**/*.rb"].each {|f| req
12
12
  RSpec.configure do |config|
13
13
  config.include ReadFixtureSpecSupport
14
14
  end
15
+
16
+ ActiveSupport::Notifications.subscribe "request.faraday" do |name, started, finished, _, payload|
17
+ env = {
18
+ method: payload[:method],
19
+ url: payload[:url].to_s,
20
+ status: payload[:status],
21
+ response_headers: payload[:response_headers].map{|k,v| "#{k}: #{v}" }.join("\n"),
22
+ request_headers: payload[:request_headers].map{|k,v| "#{k}: #{v}" }.join("\n")
23
+ }
24
+ pp env
25
+ end
@@ -18,7 +18,9 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency 'octokit', '2.2.0'
21
+ spec.add_runtime_dependency 'octokit', '2.2.0'
22
+ spec.add_runtime_dependency 'faraday', '~> 0.9.0'
23
+ spec.add_runtime_dependency 'activesupport', '~> 4.0'
22
24
 
23
25
  spec.add_development_dependency "bundler", "~> 1.3"
24
26
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vx-service_connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-30 00:00:00.000000000 Z
11
+ date: 2014-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -24,6 +24,34 @@ dependencies:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.2.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.9.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 0.9.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: activesupport
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '4.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '4.0'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: bundler
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -112,6 +140,7 @@ files:
112
140
  - lib/vx/service_connector/gitlab_v5/payload.rb
113
141
  - lib/vx/service_connector/gitlab_v5/repos.rb
114
142
  - lib/vx/service_connector/gitlab_v5/session.rb
143
+ - lib/vx/service_connector/instrumentation.rb
115
144
  - lib/vx/service_connector/model.rb
116
145
  - lib/vx/service_connector/version.rb
117
146
  - spec/fixtures/github/add_deploy_key.json