pact_broker 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@ Do this to generate your change history
2
2
 
3
3
  $ git log --date=relative --pretty=format:' * %h - %s (%an, %ad)' 'package/pact-broker-0.0.PRODVERSION'..'package/pact-broker-0.0.NEWVERSION'
4
4
 
5
+ #### 0.0.8 (2013-11-18)
6
+
7
+ * 6022baa - Changed name to title in list pacticipants response (Beth, 7 hours ago)
8
+ * 13fde52 - Moving resources module under the Api module. (Beth, 8 hours ago)
9
+ * f52c572 - Added HAL index (Beth, 8 hours ago)
10
+
5
11
  #### 0.0.7 (2013-11-15)
6
12
 
7
13
  * 7984d86 - Added title to each item in the pacts/latest links array (Beth, 83 seconds ago)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pact_broker (0.0.7)
4
+ pact_broker (0.0.8)
5
5
  httparty
6
6
  json
7
7
  roar
data/config.ru CHANGED
@@ -1,7 +1,7 @@
1
1
  require File.dirname(__FILE__) + '/config/boot'
2
2
  require 'pact_broker/db'
3
3
  require 'pact_broker/api'
4
- require 'pact_broker/resources/pact'
4
+ require 'pact_broker/api/resources/pact'
5
5
 
6
6
 
7
7
  use Rack::Static, root: 'public', urls: ['/favicon.ico']
@@ -1,8 +1,9 @@
1
- require 'pact_broker/resources/pact'
2
- require 'pact_broker/resources/latest_pact'
3
- require 'pact_broker/resources/latest_pacts'
4
- require 'pact_broker/resources/pacticipant'
5
- require 'pact_broker/resources/pacticipants'
1
+ require 'pact_broker/api/resources/pact'
2
+ require 'pact_broker/api/resources/latest_pact'
3
+ require 'pact_broker/api/resources/latest_pacts'
4
+ require 'pact_broker/api/resources/pacticipant'
5
+ require 'pact_broker/api/resources/pacticipants'
6
+ require 'pact_broker/api/resources/index'
6
7
 
7
8
  require 'webmachine/adapters/rack'
8
9
 
@@ -12,11 +13,12 @@ module PactBroker
12
13
  pact_api = Webmachine::Application.new do |app|
13
14
  app.routes do
14
15
  add(['trace', '*'], Webmachine::Trace::TraceResource) unless ENV['RACK_ENV'] == 'production'
15
- add ['pact', 'provider', :provider_name, 'consumer', :consumer_name, 'version', :consumer_version_number], Resources::Pact
16
- add ['pact', 'provider', :provider_name, 'consumer', :consumer_name, 'latest'], Resources::LatestPact
17
- add ['pacts', 'latest'], Resources::LatestPacts
18
- add ['pacticipants'], Resources::Pacticipants
19
- add ['pacticipants', :name], Resources::Pacticipant
16
+ add ['pact', 'provider', :provider_name, 'consumer', :consumer_name, 'version', :consumer_version_number], Api::Resources::Pact
17
+ add ['pact', 'provider', :provider_name, 'consumer', :consumer_name, 'latest'], Api::Resources::LatestPact
18
+ add ['pacts', 'latest'], Api::Resources::LatestPacts
19
+ add ['pacticipants'], Api::Resources::Pacticipants
20
+ add ['pacticipants', :name], Api::Resources::Pacticipant
21
+ add [], Api::Resources::Index
20
22
  end
21
23
  end
22
24
 
@@ -41,7 +41,7 @@ module PactBroker
41
41
  end
42
42
 
43
43
  links :pacticipants do
44
- represented.collect{ | pacticipant | {:href => pacticipant_url(pacticipant), :name => pacticipant.name } }
44
+ represented.collect{ | pacticipant | {:href => pacticipant_url(pacticipant), :title => pacticipant.name } }
45
45
  end
46
46
 
47
47
  end
@@ -2,7 +2,7 @@ require 'webmachine'
2
2
  require 'pact_broker/services'
3
3
  require 'pact_broker/api/decorators'
4
4
 
5
- module PactBroker
5
+ module PactBroker::Api
6
6
 
7
7
  module Resources
8
8
 
@@ -28,7 +28,7 @@ module PactBroker
28
28
  end
29
29
 
30
30
  def handle_exception e
31
- PactBroker::Resources::ErrorHandler.handle_exception(e, response)
31
+ PactBroker::Api::Resources::ErrorHandler.handle_exception(e, response)
32
32
  end
33
33
  end
34
34
  end
@@ -0,0 +1,49 @@
1
+ require 'pact_broker/api/resources/base_resource'
2
+ require 'json'
3
+
4
+ module PactBroker::Api
5
+
6
+ module Resources
7
+
8
+ class Index < BaseResource
9
+
10
+ def content_types_provided
11
+ [["application/hal+json", :to_json]]
12
+ end
13
+
14
+ def allowed_methods
15
+ ["GET"]
16
+ end
17
+
18
+ def to_json
19
+ {
20
+ _links: {
21
+ 'index' => [
22
+ {
23
+ href: request.uri.to_s,
24
+ title: 'The index page',
25
+ templated: false
26
+ }
27
+ ],
28
+ 'latest-pacts' => [
29
+ {
30
+ href: request.uri.to_s + 'pacts/latest',
31
+ title: 'Retrieve latest pacts',
32
+ templated: false
33
+ }
34
+ ],
35
+ 'pacticpants' => [
36
+ {
37
+ href: request.uri.to_s + 'pacticipants',
38
+ title: 'Retrieve pacticipants',
39
+ templated: false
40
+ }
41
+ ]
42
+ }
43
+ }.to_json
44
+ end
45
+
46
+ end
47
+ end
48
+
49
+ end
@@ -1,6 +1,6 @@
1
- require 'pact_broker/resources/base_resource'
1
+ require 'pact_broker/api/resources/base_resource'
2
2
 
3
- module PactBroker
3
+ module PactBroker::Api
4
4
 
5
5
  module Resources
6
6
 
@@ -1,6 +1,6 @@
1
- require 'pact_broker/resources/base_resource'
1
+ require 'pact_broker/api/resources/base_resource'
2
2
 
3
- module PactBroker
3
+ module PactBroker::Api
4
4
 
5
5
  module Resources
6
6
 
@@ -1,7 +1,7 @@
1
1
  require 'cgi'
2
- require 'pact_broker/resources/base_resource'
2
+ require 'pact_broker/api/resources/base_resource'
3
3
 
4
- module PactBroker
4
+ module PactBroker::Api
5
5
 
6
6
  module Resources
7
7
 
@@ -1,4 +1,4 @@
1
- require 'pact_broker/resources/base_resource'
1
+ require 'pact_broker/api/resources/base_resource'
2
2
 
3
3
  module Webmachine
4
4
  class Request
@@ -8,7 +8,7 @@ module Webmachine
8
8
  end
9
9
  end
10
10
 
11
- module PactBroker
11
+ module PactBroker::Api
12
12
 
13
13
  module Resources
14
14
 
@@ -1,6 +1,6 @@
1
- require 'pact_broker/resources/base_resource'
1
+ require 'pact_broker/api/resources/base_resource'
2
2
 
3
- module PactBroker
3
+ module PactBroker::Api
4
4
 
5
5
  module Resources
6
6
 
@@ -1,3 +1,3 @@
1
1
  module PactBroker
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
@@ -6,7 +6,7 @@ require 'pact_broker/api'
6
6
  require 'uri'
7
7
  require_relative 'provider_states_for_pact_broker_client'
8
8
 
9
- require 'pact_broker/resources/pact'
9
+ require 'pact_broker/api/resources/pact'
10
10
 
11
11
  Pact.configure do | config |
12
12
  config.logger.level = Logger::DEBUG
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact_broker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-11-15 00:00:00.000000000 Z
14
+ date: 2013-11-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: httparty
@@ -307,6 +307,13 @@ files:
307
307
  - lib/pact_broker/api/decorators/pacticipant_decorator.rb
308
308
  - lib/pact_broker/api/decorators/representable_pact.rb
309
309
  - lib/pact_broker/api/decorators/version_decorator.rb
310
+ - lib/pact_broker/api/resources/base_resource.rb
311
+ - lib/pact_broker/api/resources/index.rb
312
+ - lib/pact_broker/api/resources/latest_pact.rb
313
+ - lib/pact_broker/api/resources/latest_pacts.rb
314
+ - lib/pact_broker/api/resources/pact.rb
315
+ - lib/pact_broker/api/resources/pacticipant.rb
316
+ - lib/pact_broker/api/resources/pacticipants.rb
310
317
  - lib/pact_broker/db.rb
311
318
  - lib/pact_broker/logging.rb
312
319
  - lib/pact_broker/models.rb
@@ -319,12 +326,6 @@ files:
319
326
  - lib/pact_broker/repositories/pact_repository.rb
320
327
  - lib/pact_broker/repositories/pacticipant_repository.rb
321
328
  - lib/pact_broker/repositories/version_repository.rb
322
- - lib/pact_broker/resources/base_resource.rb
323
- - lib/pact_broker/resources/latest_pact.rb
324
- - lib/pact_broker/resources/latest_pacts.rb
325
- - lib/pact_broker/resources/pact.rb
326
- - lib/pact_broker/resources/pacticipant.rb
327
- - lib/pact_broker/resources/pacticipants.rb
328
329
  - lib/pact_broker/services.rb
329
330
  - lib/pact_broker/services/pact_service.rb
330
331
  - lib/pact_broker/services/pacticipant_service.rb
@@ -360,7 +361,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
360
361
  version: '0'
361
362
  segments:
362
363
  - 0
363
- hash: -1534852976496336612
364
+ hash: -3477467796967438675
364
365
  required_rubygems_version: !ruby/object:Gem::Requirement
365
366
  none: false
366
367
  requirements:
@@ -369,7 +370,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
369
370
  version: '0'
370
371
  segments:
371
372
  - 0
372
- hash: -1534852976496336612
373
+ hash: -3477467796967438675
373
374
  requirements: []
374
375
  rubyforge_project:
375
376
  rubygems_version: 1.8.23