diesel-api-dsl 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/Rakefile +5 -0
- data/diesel.gemspec +4 -0
- data/lib/diesel.rb +13 -5
- data/lib/diesel/api_base.rb +27 -0
- data/lib/diesel/api_builder.rb +98 -34
- data/lib/diesel/api_error.rb +3 -0
- data/lib/diesel/api_group.rb +27 -0
- data/lib/diesel/data_model.rb +24 -0
- data/lib/diesel/endpoint.rb +15 -33
- data/lib/diesel/middleware/auth/api_key.rb +27 -0
- data/lib/diesel/middleware/debug.rb +20 -0
- data/lib/diesel/middleware/set_body_parameter.rb +11 -0
- data/lib/diesel/middleware/set_header.rb +15 -0
- data/lib/diesel/middleware/set_parameter_base.rb +33 -0
- data/lib/diesel/middleware/set_path_parameter.rb +17 -0
- data/lib/diesel/middleware/set_query_parameter.rb +13 -0
- data/lib/diesel/middleware_builder.rb +15 -0
- data/lib/diesel/middleware_stack.rb +21 -0
- data/lib/diesel/request_context.rb +40 -15
- data/lib/diesel/swagger/data_type_field.rb +25 -0
- data/lib/diesel/swagger/definition.rb +12 -0
- data/lib/diesel/swagger/external_docs.rb +10 -0
- data/lib/diesel/swagger/info.rb +14 -0
- data/lib/diesel/swagger/node.rb +140 -0
- data/lib/diesel/swagger/operation.rb +22 -0
- data/lib/diesel/swagger/parameter.rb +32 -0
- data/lib/diesel/swagger/parser.rb +70 -0
- data/lib/diesel/swagger/path.rb +27 -0
- data/lib/diesel/swagger/property.rb +8 -0
- data/lib/diesel/swagger/security_definition.rb +15 -0
- data/lib/diesel/swagger/specification.rb +30 -0
- data/lib/diesel/utils/inflections.rb +46 -0
- data/lib/diesel/version.rb +1 -1
- data/spec/diesel/api_builder_spec.rb +14 -0
- data/spec/diesel/swagger/parser_spec.rb +80 -0
- data/spec/diesel_spec.rb +43 -0
- data/spec/files/honeybadger.json +80 -0
- data/spec/files/pivotal_tracker.json +94 -0
- data/spec/fixtures/vcr_cassettes/honeybadger.yml +98 -0
- data/spec/fixtures/vcr_cassettes/pivotal_tracker_create_story.yml +61 -0
- data/spec/spec_helper.rb +10 -0
- metadata +110 -25
- data/apis/pivotal_tracker.rb +0 -55
- data/examples/create_pivotal_task.rb +0 -13
- data/lib/diesel/action/http.rb +0 -92
- data/lib/diesel/api.rb +0 -33
- data/lib/diesel/auth/api_key.rb +0 -39
- data/lib/diesel/auth/base.rb +0 -8
- data/lib/diesel/auth/oauth2.rb +0 -13
- data/lib/diesel/authenticator.rb +0 -35
- data/lib/diesel/complex_type_builder.rb +0 -24
- data/lib/diesel/container_builder.rb +0 -6
- data/lib/diesel/dsl.rb +0 -239
- data/lib/diesel/model_builder.rb +0 -9
- data/lib/diesel/profile.rb +0 -112
@@ -0,0 +1,98 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.honeybadger.io/v1/projects/3167/faults?auth_token=afaketoken
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: OK
|
16
|
+
headers:
|
17
|
+
Server:
|
18
|
+
- nginx
|
19
|
+
Date:
|
20
|
+
- Sun, 04 Jan 2015 05:41:06 GMT
|
21
|
+
Content-Type:
|
22
|
+
- application/json; charset=utf-8
|
23
|
+
Transfer-Encoding:
|
24
|
+
- chunked
|
25
|
+
Connection:
|
26
|
+
- keep-alive
|
27
|
+
Vary:
|
28
|
+
- Accept-Encoding
|
29
|
+
Status:
|
30
|
+
- 200 OK
|
31
|
+
Strict-Transport-Security:
|
32
|
+
- max-age=31536000
|
33
|
+
X-Frame-Options:
|
34
|
+
- SAMEORIGIN
|
35
|
+
X-Xss-Protection:
|
36
|
+
- 1; mode=block
|
37
|
+
X-Content-Type-Options:
|
38
|
+
- nosniff
|
39
|
+
Set-Cookie:
|
40
|
+
- _honeybadger_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFVEkiJTM4ZDllNDdiMDY3Njk4NmZkMDcwYzhjNjQ2OWMwMzIzBjsAVA%3D%3D--124cf4e6729ee5f15da2588ec9283da5e170c2b4;
|
41
|
+
path=/; secure; HttpOnly
|
42
|
+
X-Request-Id:
|
43
|
+
- cbc296dc-05aa-4d76-a372-eb9a1e94239a
|
44
|
+
X-Runtime:
|
45
|
+
- '2.092752'
|
46
|
+
body:
|
47
|
+
encoding: UTF-8
|
48
|
+
string: '{"results":[{"project_id":3167,"klass":"HoneybadgerTestingException","component":"application","action":"verify","environment":"development","resolved":true,"ignored":false,"created_at":"2013-10-02T14:23:21.116Z","comments_count":1,"message":"Testing
|
49
|
+
honeybadger via \"rake honeybadger:test\". If you can see this, it works.","notices_count":1,"last_notice_at":"2013-10-02T14:23:21.101Z","tags":[],"id":1563097,"assignee":null},{"project_id":3167,"klass":"NoMethodError","component":"portal","action":"show","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-02T19:54:43.127Z","comments_count":0,"message":"undefined
|
50
|
+
method `deals'' for nil:NilClass","notices_count":34,"last_notice_at":"2013-10-07T13:54:49.614Z","tags":[],"id":1569973,"assignee":null},{"project_id":3167,"klass":"NoMethodError","component":"admin/deals","action":"index","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-03T20:56:00.529Z","comments_count":0,"message":"undefined
|
51
|
+
method `name'' for nil:NilClass","notices_count":2,"last_notice_at":"2014-06-05T20:26:05.385Z","tags":[],"id":1590813,"assignee":null},{"project_id":3167,"klass":"Foursquare2::APIError","component":"admin/deals","action":"show","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-04T20:07:40.087Z","comments_count":0,"message":"other:
|
52
|
+
Must provide parameter venueId (400)","notices_count":50,"last_notice_at":"2014-11-18T19:00:35.983Z","tags":[],"id":1608448,"assignee":null},{"project_id":3167,"klass":"MultiJson::DecodeError","component":"admin/deals","action":"show","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-04T20:08:43.640Z","comments_count":0,"message":"757:
|
53
|
+
unexpected token at ''\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003c!DOCTYPE
|
54
|
+
html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"\u003e\n\u003chtml\u003e\n \u003chead\u003e\n \u003ctitle\u003e503
|
55
|
+
No healthy backends\u003c/title\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n \u003ch1\u003eError
|
56
|
+
503 No healthy backends\u003c/h1\u003e\n \u003cp\u003eNo healthy backends\u003c/p\u003e\n \u003ch3\u003eGuru
|
57
|
+
Meditation:\u003c/h3\u003e\n \u003cp\u003eXID: 2595686802\u003c/p\u003e\n \u003chr\u003e\n \u003cp\u003eVarnish
|
58
|
+
cache server\u003c/p\u003e\n \u003c/body\u003e\n\u003c/html\u003e\n''","notices_count":2,"last_notice_at":"2013-10-04T20:08:44.290Z","tags":[],"id":1608469,"assignee":null},{"project_id":3167,"klass":"NameError","component":null,"action":null,"environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-06T15:10:39.295Z","comments_count":0,"message":"uninitialized
|
59
|
+
constant Jobs::CheckForUngeocodedDeals","notices_count":1,"last_notice_at":"2013-10-06T15:10:39.282Z","tags":[],"id":1628541,"assignee":null},{"project_id":3167,"klass":"NoMethodError","component":null,"action":null,"environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-07T10:30:21.831Z","comments_count":0,"message":"undefined
|
60
|
+
method `perform'' for Jobs::CheckForUngeocodedDeals:Class","notices_count":1,"last_notice_at":"2013-10-07T10:30:21.820Z","tags":[],"id":1637349,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/deals","action":"index","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-07T14:02:01.586Z","comments_count":0,"message":"Mysql2::Error:
|
61
|
+
Lost connection to MySQL server during query: SELECT `locations`.* FROM `locations` WHERE
|
62
|
+
`locations`.`id` = 3596 LIMIT 1","notices_count":4,"last_notice_at":"2013-11-26T14:29:56.279Z","tags":[],"id":1639607,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/reservations","action":"geo","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-07T19:37:50.792Z","comments_count":0,"message":"Mysql2::Error:
|
63
|
+
Lost connection to MySQL server during query: SELECT `cities`.* FROM `cities` WHERE
|
64
|
+
`cities`.`id` = 1 LIMIT 1","notices_count":32,"last_notice_at":"2014-04-15T19:28:38.959Z","tags":[],"id":1645856,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/reservations","action":"geo","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-07T20:28:39.553Z","comments_count":0,"message":"Mysql2::Error:
|
65
|
+
Lost connection to MySQL server during query: SELECT `users`.* FROM `users` WHERE
|
66
|
+
`users`.`id` = 370064 LIMIT 1","notices_count":36,"last_notice_at":"2014-04-15T19:26:51.343Z","tags":[],"id":1646919,"assignee":null},{"project_id":3167,"klass":"NoMethodError","component":"admin/daily_content","action":"show_email","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-08T21:39:49.184Z","comments_count":0,"message":"undefined
|
67
|
+
method `name'' for nil:NilClass","notices_count":1,"last_notice_at":"2013-10-08T21:39:49.165Z","tags":[],"id":1668099,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"portal","action":"show","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-11T12:46:45.533Z","comments_count":0,"message":"NoMethodError:
|
68
|
+
undefined method `fields'' for nil:NilClass: SELECT `ratings`.* FROM `ratings` WHERE
|
69
|
+
`ratings`.`location_id` = 3038 AND (ratings.comments IS NOT NULL AND LENGTH(ratings.comments)
|
70
|
+
\u003e 4) ORDER BY ratings.created_at DESC LIMIT 5","notices_count":7,"last_notice_at":"2014-05-05T14:27:59.503Z","tags":[],"id":1713397,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/locations","action":"index","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-11T20:42:51.804Z","comments_count":0,"message":"Mysql2::Error:
|
71
|
+
Lost connection to MySQL server during query: SELECT `cities`.* FROM `cities` WHERE
|
72
|
+
`cities`.`id` = 1 LIMIT 1","notices_count":5,"last_notice_at":"2014-05-06T16:08:05.787Z","tags":[],"id":1720931,"assignee":null},{"project_id":3167,"klass":"NoMethodError","component":"portal","action":"show","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-11T21:13:22.149Z","comments_count":0,"message":"undefined
|
73
|
+
method `deal_extension'' for nil:NilClass","notices_count":2,"last_notice_at":"2013-10-11T21:13:28.380Z","tags":[],"id":1721320,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/deals","action":"show","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-16T14:40:09.434Z","comments_count":0,"message":"Mysql2::Error:
|
74
|
+
Lost connection to MySQL server during query: SELECT COUNT(*) FROM `claims` WHERE
|
75
|
+
`claims`.`deal_id` = 1808 AND `claims`.`type` = ''EmailClaim'' AND (error
|
76
|
+
= ''false'' OR error IS NULL)","notices_count":1,"last_notice_at":"2013-10-16T14:40:09.400Z","tags":[],"id":1819734,"assignee":null},{"project_id":3167,"klass":"NoMethodError","component":"admin/articles","action":"new","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-18T20:50:02.451Z","comments_count":0,"message":"undefined
|
77
|
+
method `[]'' for nil:NilClass","notices_count":1,"last_notice_at":"2013-10-18T20:50:02.378Z","tags":[],"id":1875098,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/locations","action":"index","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-23T17:48:22.037Z","comments_count":0,"message":"Mysql2::Error:
|
78
|
+
Lost connection to MySQL server during query: SELECT `locations`.* FROM `locations` WHERE
|
79
|
+
`locations`.`id` = 2916 LIMIT 1","notices_count":3,"last_notice_at":"2013-12-13T16:09:42.419Z","tags":[],"id":1947856,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/daily_content","action":"edit","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-24T19:26:27.647Z","comments_count":0,"message":"Mysql2::Error:
|
80
|
+
MySQL server has gone away: SELECT COUNT(*) FROM `daily_content` WHERE `daily_content`.`page_type`
|
81
|
+
= ''Shoppe National Email''","notices_count":6,"last_notice_at":"2014-05-15T14:54:52.126Z","tags":[],"id":1966829,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/daily_content","action":"content_options","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-24T20:41:17.983Z","comments_count":0,"message":"Mysql2::Error:
|
82
|
+
Lost connection to MySQL server during query: SELECT `shoppe_products`.*
|
83
|
+
FROM `shoppe_products` WHERE (deleted_at IS NULL AND (available_on IS NOT
|
84
|
+
NULL AND CAST(available_on AS DATE) \u003c= ''2013-12-05'') AND (available_until
|
85
|
+
IS NULL OR CAST(available_until AS DATE) \u003e= ''2013-12-05'')) AND (shoppe_artist_id
|
86
|
+
IS NOT NULL) AND (name LIKE ''%%'') ORDER BY available_on DESC LIMIT 100","notices_count":2,"last_notice_at":"2013-12-04T14:26:59.451Z","tags":[],"id":1968249,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/daily_content","action":"edit","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-26T02:11:13.946Z","comments_count":0,"message":"Mysql2::Error:
|
87
|
+
Lost connection to MySQL server during query: SELECT `cities`.* FROM `cities`","notices_count":1,"last_notice_at":"2013-10-26T02:11:13.905Z","tags":[],"id":1986521,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/deals","action":"index","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-26T02:11:17.186Z","comments_count":0,"message":"Mysql2::Error:
|
88
|
+
Lost connection to MySQL server during query: SELECT `cities`.* FROM `cities` WHERE
|
89
|
+
`cities`.`id` = 13 LIMIT 1","notices_count":2,"last_notice_at":"2014-01-31T21:51:13.248Z","tags":[],"id":1986531,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/daily_content","action":"content_options","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-28T16:15:54.380Z","comments_count":0,"message":"Mysql2::Error:
|
90
|
+
MySQL server has gone away: SHOW TABLES","notices_count":3,"last_notice_at":"2014-05-27T16:52:17.111Z","tags":[],"id":2018760,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/daily_content","action":"content_options","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-28T16:15:54.431Z","comments_count":0,"message":"Mysql2::Error:
|
91
|
+
Lost connection to MySQL server during query: SELECT `cities`.* FROM `cities` WHERE
|
92
|
+
`cities`.`id` IN (5, 9, 11, 1, 6, 12, 14, 4, 2, 10, 17, 19, 7, 3, 8)","notices_count":1,"last_notice_at":"2013-10-28T16:15:54.317Z","tags":[],"id":2018761,"assignee":null},{"project_id":3167,"klass":"ActiveRecord::StatementInvalid","component":"admin/deals","action":"index","environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-29T20:17:08.404Z","comments_count":0,"message":"NoMethodError:
|
93
|
+
undefined method `fields'' for nil:NilClass: SELECT COUNT(*) FROM `deals` WHERE
|
94
|
+
`deals`.`privileges_count` = 0 AND `deals`.`visible` = 0","notices_count":6,"last_notice_at":"2014-04-29T18:41:53.327Z","tags":[],"id":2040164,"assignee":null},{"project_id":3167,"klass":"ArgumentError","component":null,"action":null,"environment":"production","resolved":true,"ignored":false,"created_at":"2013-10-29T22:06:52.826Z","comments_count":0,"message":"invalid
|
95
|
+
%-encoding (Vincent%2C%20we%20are%20excited%20to%20re-feature%20Vinny%u2019s%20New%20York%20Pizza%20%26%20Italian%20Grill%20for%20a%203%20month%20run.%20%0A%0APlease%20review%20the%20reservation%20form%20for%20accuracy.%20Once%20done%2C%20sign%20electronically%20with%20your%20mouse%20and%20click%20%27submit%27.%20%0A%0AWe%20will%20launch%20your%20new%20feature%20on%20Sunday%2C%20August%2010th.%20%0A%0AThanks%21)","notices_count":8,"last_notice_at":"2014-07-28T21:39:56.859Z","tags":[],"id":2042146,"assignee":null}],"total_count":158,"current_page":1,"num_pages":7}'
|
96
|
+
http_version:
|
97
|
+
recorded_at: Sun, 04 Jan 2015 05:41:06 GMT
|
98
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,61 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://www.pivotaltracker.com/services/v5/projects/1053124/stories
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"name":"Testing Pivotal API","story_type":"chore"}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
X-Trackertoken:
|
13
|
+
- afaketoken
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
Transfer-Encoding:
|
22
|
+
- chunked
|
23
|
+
Status:
|
24
|
+
- 200 OK
|
25
|
+
X-Tracker-Project-Version:
|
26
|
+
- '17'
|
27
|
+
X-Ua-Compatible:
|
28
|
+
- IE=Edge,chrome=1
|
29
|
+
Etag:
|
30
|
+
- '"3153849c2aa6910b84051fb3f95aa916"'
|
31
|
+
Cache-Control:
|
32
|
+
- max-age=0, private, must-revalidate
|
33
|
+
X-Request-Id:
|
34
|
+
- f000300655795ace684e5ce0287aa024
|
35
|
+
X-Runtime:
|
36
|
+
- '0.209003'
|
37
|
+
Date:
|
38
|
+
- Sun, 04 Jan 2015 03:27:51 GMT
|
39
|
+
X-Rack-Cache:
|
40
|
+
- invalidate, pass
|
41
|
+
X-Powered-By:
|
42
|
+
- Phusion Passenger 4.0.41
|
43
|
+
Server:
|
44
|
+
- nginx/1.6.0 + Phusion Passenger 4.0.41
|
45
|
+
Access-Control-Allow-Origin:
|
46
|
+
- "*"
|
47
|
+
Access-Control-Allow-Credentials:
|
48
|
+
- 'false'
|
49
|
+
Access-Control-Allow-Methods:
|
50
|
+
- GET, POST, PUT, DELETE, OPTIONS
|
51
|
+
Access-Control-Allow-Headers:
|
52
|
+
- X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is
|
53
|
+
X-Tracker-Client-Pinger-Interval:
|
54
|
+
- '8'
|
55
|
+
body:
|
56
|
+
encoding: UTF-8
|
57
|
+
string: '{"kind":"story","id":85381528,"project_id":1053124,"name":"Testing
|
58
|
+
Pivotal API","story_type":"chore","current_state":"unscheduled","requested_by_id":371381,"owner_ids":[],"labels":[],"created_at":"2015-01-04T03:27:51Z","updated_at":"2015-01-04T03:27:51Z","url":"https://www.pivotaltracker.com/story/show/85381528"}'
|
59
|
+
http_version:
|
60
|
+
recorded_at: Sun, 04 Jan 2015 03:27:52 GMT
|
61
|
+
recorded_with: VCR 2.9.3
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,57 +1,113 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diesel-api-dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Calvin Yu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.1'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.0.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.0.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: vcr
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.9.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.9.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.20.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.20.0
|
41
83
|
- !ruby/object:Gem::Dependency
|
42
84
|
name: httparty
|
43
85
|
requirement: !ruby/object:Gem::Requirement
|
44
86
|
requirements:
|
45
|
-
- - ~>
|
87
|
+
- - "~>"
|
46
88
|
- !ruby/object:Gem::Version
|
47
89
|
version: '0.12'
|
48
90
|
type: :runtime
|
49
91
|
prerelease: false
|
50
92
|
version_requirements: !ruby/object:Gem::Requirement
|
51
93
|
requirements:
|
52
|
-
- - ~>
|
94
|
+
- - "~>"
|
53
95
|
- !ruby/object:Gem::Version
|
54
96
|
version: '0.12'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: multi_json
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.10.1
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.10.1
|
55
111
|
description: Create API Clients From an DSL
|
56
112
|
email:
|
57
113
|
- me@sourcebender.com
|
@@ -59,32 +115,53 @@ executables: []
|
|
59
115
|
extensions: []
|
60
116
|
extra_rdoc_files: []
|
61
117
|
files:
|
62
|
-
- .gitignore
|
118
|
+
- ".gitignore"
|
63
119
|
- Gemfile
|
64
120
|
- LICENSE
|
65
121
|
- README.md
|
66
122
|
- Rakefile
|
67
|
-
- apis/pivotal_tracker.rb
|
68
123
|
- apis/slack.rb
|
69
124
|
- diesel.gemspec
|
70
|
-
- examples/create_pivotal_task.rb
|
71
125
|
- examples/post_slack_message.rb
|
72
126
|
- lib/diesel.rb
|
73
|
-
- lib/diesel/
|
74
|
-
- lib/diesel/api.rb
|
127
|
+
- lib/diesel/api_base.rb
|
75
128
|
- lib/diesel/api_builder.rb
|
76
|
-
- lib/diesel/
|
77
|
-
- lib/diesel/
|
78
|
-
- lib/diesel/
|
79
|
-
- lib/diesel/authenticator.rb
|
80
|
-
- lib/diesel/complex_type_builder.rb
|
81
|
-
- lib/diesel/container_builder.rb
|
82
|
-
- lib/diesel/dsl.rb
|
129
|
+
- lib/diesel/api_error.rb
|
130
|
+
- lib/diesel/api_group.rb
|
131
|
+
- lib/diesel/data_model.rb
|
83
132
|
- lib/diesel/endpoint.rb
|
84
|
-
- lib/diesel/
|
85
|
-
- lib/diesel/
|
133
|
+
- lib/diesel/middleware/auth/api_key.rb
|
134
|
+
- lib/diesel/middleware/debug.rb
|
135
|
+
- lib/diesel/middleware/set_body_parameter.rb
|
136
|
+
- lib/diesel/middleware/set_header.rb
|
137
|
+
- lib/diesel/middleware/set_parameter_base.rb
|
138
|
+
- lib/diesel/middleware/set_path_parameter.rb
|
139
|
+
- lib/diesel/middleware/set_query_parameter.rb
|
140
|
+
- lib/diesel/middleware_builder.rb
|
141
|
+
- lib/diesel/middleware_stack.rb
|
86
142
|
- lib/diesel/request_context.rb
|
143
|
+
- lib/diesel/swagger/data_type_field.rb
|
144
|
+
- lib/diesel/swagger/definition.rb
|
145
|
+
- lib/diesel/swagger/external_docs.rb
|
146
|
+
- lib/diesel/swagger/info.rb
|
147
|
+
- lib/diesel/swagger/node.rb
|
148
|
+
- lib/diesel/swagger/operation.rb
|
149
|
+
- lib/diesel/swagger/parameter.rb
|
150
|
+
- lib/diesel/swagger/parser.rb
|
151
|
+
- lib/diesel/swagger/path.rb
|
152
|
+
- lib/diesel/swagger/property.rb
|
153
|
+
- lib/diesel/swagger/security_definition.rb
|
154
|
+
- lib/diesel/swagger/specification.rb
|
155
|
+
- lib/diesel/utils/inflections.rb
|
87
156
|
- lib/diesel/version.rb
|
157
|
+
- spec/diesel/api_builder_spec.rb
|
158
|
+
- spec/diesel/swagger/parser_spec.rb
|
159
|
+
- spec/diesel_spec.rb
|
160
|
+
- spec/files/honeybadger.json
|
161
|
+
- spec/files/pivotal_tracker.json
|
162
|
+
- spec/fixtures/vcr_cassettes/honeybadger.yml
|
163
|
+
- spec/fixtures/vcr_cassettes/pivotal_tracker_create_story.yml
|
164
|
+
- spec/spec_helper.rb
|
88
165
|
homepage: http://github.com/cyu/diesel
|
89
166
|
licenses:
|
90
167
|
- MIT
|
@@ -95,12 +172,12 @@ require_paths:
|
|
95
172
|
- lib
|
96
173
|
required_ruby_version: !ruby/object:Gem::Requirement
|
97
174
|
requirements:
|
98
|
-
- -
|
175
|
+
- - ">="
|
99
176
|
- !ruby/object:Gem::Version
|
100
177
|
version: '0'
|
101
178
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
179
|
requirements:
|
103
|
-
- -
|
180
|
+
- - ">="
|
104
181
|
- !ruby/object:Gem::Version
|
105
182
|
version: '0'
|
106
183
|
requirements: []
|
@@ -109,4 +186,12 @@ rubygems_version: 2.2.2
|
|
109
186
|
signing_key:
|
110
187
|
specification_version: 4
|
111
188
|
summary: Create API Clients From an DSL
|
112
|
-
test_files:
|
189
|
+
test_files:
|
190
|
+
- spec/diesel/api_builder_spec.rb
|
191
|
+
- spec/diesel/swagger/parser_spec.rb
|
192
|
+
- spec/diesel_spec.rb
|
193
|
+
- spec/files/honeybadger.json
|
194
|
+
- spec/files/pivotal_tracker.json
|
195
|
+
- spec/fixtures/vcr_cassettes/honeybadger.yml
|
196
|
+
- spec/fixtures/vcr_cassettes/pivotal_tracker_create_story.yml
|
197
|
+
- spec/spec_helper.rb
|
data/apis/pivotal_tracker.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
apis do
|
2
|
-
description "PivotalTracker API v5"
|
3
|
-
api_version "5"
|
4
|
-
base_path "https://www.pivotaltracker.com/services/v5"
|
5
|
-
|
6
|
-
api_key "X-TrackerToken" do
|
7
|
-
nickname :api_token
|
8
|
-
pass_as :header
|
9
|
-
end
|
10
|
-
|
11
|
-
header "Content-Type" => "application/json"
|
12
|
-
|
13
|
-
resource "projects/{project_id}/stories" do
|
14
|
-
description "Operations on stories"
|
15
|
-
|
16
|
-
operation :create_story do
|
17
|
-
reference_url "https://www.pivotaltracker.com/help/api/rest/v5#projects_project_id_stories_post"
|
18
|
-
method :post
|
19
|
-
|
20
|
-
parameter "project_id" do
|
21
|
-
param_type :path
|
22
|
-
required
|
23
|
-
end
|
24
|
-
|
25
|
-
body "story" do
|
26
|
-
data_type "NewStory"
|
27
|
-
required
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
complex_type "NewStory" do
|
33
|
-
required :name
|
34
|
-
property :cl_numbers
|
35
|
-
property :current_state do
|
36
|
-
enum :accepted, :delivered, :finished, :started, :rejected, :unstarted, :unscheduled
|
37
|
-
end
|
38
|
-
property :external_id
|
39
|
-
property :deadline
|
40
|
-
property :description
|
41
|
-
property :estimate
|
42
|
-
property :integration_id
|
43
|
-
property :planned_iteration_number
|
44
|
-
property :requested_by_id
|
45
|
-
property :accepted_at
|
46
|
-
property :before_id
|
47
|
-
property :created_at
|
48
|
-
property :after_id
|
49
|
-
property :name
|
50
|
-
property :story_type do
|
51
|
-
enum :feature, :bug, :chore, :release
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'diesel'
|
2
|
-
require 'logger'
|
3
|
-
PivotalTracker = Diesel.load_api 'apis/pivotal_tracker'
|
4
|
-
api = PivotalTracker.new
|
5
|
-
api.logger = Logger.new(STDOUT)
|
6
|
-
api.logger.level = Logger::DEBUG
|
7
|
-
api.api_token = YOUR_API_TOKEN
|
8
|
-
p api.create_story(
|
9
|
-
project_id: YOUR_PROJECT_ID,
|
10
|
-
story: {
|
11
|
-
name: 'Testing Pivotal API',
|
12
|
-
:story_type => :chore
|
13
|
-
})
|