playtypus 0.0.1 → 0.0.2

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +119 -2
  3. data/playtypus.gemspec +3 -3
  4. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9aec06b1f7368bf6ff41307b3233f48fe739a017
4
- data.tar.gz: 228631e1ae380172ee68b4723ecbeccca4360a7b
3
+ metadata.gz: 8b957f6ab26d1f24f1b54a1ee3db13cde2159652
4
+ data.tar.gz: 674cd348adab63b2fe6b5d76134eaf9faee0d6ca
5
5
  SHA512:
6
- metadata.gz: cea6432424ebb439fb7a9d17df48b5b8c65200fa49e62c96c33fb4ad2b462dfdd5527ffe875c9b437882fb0180a9f218db4a033ed34d5624a8b7da9d800df6da
7
- data.tar.gz: 3bf11b8b37fa84ed25d97aefe8cbb0b62effed5072ec398e66678d1b7911ad24f4101433a02e21526a3b4ad5cbf7434ab33f19be20fba1f88511099f6aa3c83c
6
+ metadata.gz: 9781ccfb4d40a64bd6ce5888f663e639da47d68c179a7c9b1e225e1a4ab24a50f34f97b8d81ff0794dd1fac13a5cd6b90728f6d0e5e2aea80e1c79ca2f7b49cc
7
+ data.tar.gz: bd5c8b6c9e882e3ff8a321b4f678473b5461026e55a7d3d01563e3d873e4ba9b629d052e9eeaa389182ec70fd3aa9043d9bbc21a621c5501bd5cf7694cfa470b
data/README.md CHANGED
@@ -1,2 +1,119 @@
1
- # playtypus
2
- The Playtypus is an eventmachine-based command line utility that plays HTTP calls
1
+ [![Build Status](https://travis-ci.org/rackspaceautomationco/playtypus.svg?branch=master)](https://travis-ci.org/rackspaceautomationco/playtypus) [![Coverage Status](https://coveralls.io/repos/rackspaceautomationco/playtypus/badge.svg?branch=master)](https://coveralls.io/r/rackspaceautomationco/playtypus?branch=master) [![Gem Version](https://badge.fury.io/rb/playtypus.svg)](http://badge.fury.io/rb/playtypus)
2
+
3
+ -/- /_ _
4
+ _/__/ (__(/_
5
+
6
+ _
7
+ ,_ // __, -/- ,_ ,
8
+ _/_)__(/_(_/(__(_/__/__(_/__/_)__(_/__/_)_
9
+ / _/_ _/_ /
10
+ / (/ (/ /
11
+
12
+
13
+ _.-^~~^^^`~-,_,,~''''''```~,''``~'``~,
14
+ ______,' -o :. _ . ; ,'`, `.
15
+ ( -\.._,.;;'._ ,( } _`_-_,, `, `,
16
+ ``~~~~~~' ((/'((((____/~~~~~~'(,(,___> `~'
17
+
18
+ ## About
19
+
20
+ The Playtypus is an eventmachine-based command line utility that plays HTTP calls. A JSON input file (or files) tells The Playtypus what uri, method, headers, and body to send to a host, as well as the precise time to send each call. Optional response logging will write all details of HTTP responses to disk by call sequence.
21
+
22
+ ## Usage
23
+
24
+ 1. Install The Playtypus gem
25
+
26
+ `$ gem install playtypus`
27
+
28
+ 2. Define a series of HTTP calls in a JSON file
29
+
30
+ ```json
31
+ [
32
+ {
33
+ "timestamp" : "1970-01-01T00:00:00.0000000000Z",
34
+ "path" : "/v1/users",
35
+ "verb" : "POST",
36
+ "headers" : {
37
+ "Content-Type" : "application/json",
38
+ "X-AUTH-TOKEN" : "123456789"
39
+ },
40
+ "body" : {
41
+ "user" : {
42
+ "name" : "the playtypus",
43
+ "domicile" : "github"
44
+ }
45
+ }
46
+ },
47
+ {
48
+ "timestamp" : "1970-01-01T00:00:01.0000000000Z",
49
+ "path" : "/v1/users/1",
50
+ "verb" : "GET",
51
+ "headers" : {
52
+ "Content-Type" : "application/xml"
53
+ }
54
+ }
55
+ ]
56
+ ```
57
+
58
+ 3. Tell The Playtpus to play
59
+
60
+ `$ playtypus play --host=http://localhost:8081 --call-log=log.json --response-log=responses/ --preserve-times`
61
+
62
+ ## Command line arguments
63
+
64
+ This section describes required and optional arguments The Playtypus understands.
65
+
66
+ ### help
67
+
68
+ Describes available commands or one specific command
69
+
70
+ ### --host, -h
71
+
72
+ (Required) The HTTP protocol to use, as well as the host address to use in playback:
73
+
74
+ `--host=https://169.0.0.1:443/`
75
+
76
+ ### --call-log, -c
77
+
78
+ (Required) A file or directory containing a JSON array of calls to play:
79
+
80
+ `--call-log=calls/`
81
+
82
+ ### --response-log, -r
83
+
84
+ (Optional) A destination directory for response logs stored in sequence by call:
85
+
86
+ `--response-log=responses/`
87
+
88
+ ### --preserve-times, --no-preserve-times
89
+
90
+ (Default=false) Specifies whether timestamps should be used in playback:
91
+
92
+ `--preserve-times`
93
+
94
+ ## Call logs
95
+
96
+ Call logs specify arrays of JSON instructing The Playtypus what, as well as when, to play HTTP calls. Five properties are used:
97
+
98
+ 1. timestamp - a string in ISO 8601 format. The initial timestamp matters not--the relative distance between each timestamp defines the distance between two calls.
99
+
100
+ 2. path - a relative path to be appended to the global --host address
101
+
102
+ 3. verb - GET, PUT, POST, DELETE, et cetera
103
+
104
+ 4. headers - a dictionary of headers to send
105
+
106
+ 5. body - a payload in dictionary or string format
107
+
108
+ ## Contributing
109
+
110
+ 1. Fork/clone The Playtypus repo
111
+ 2. Make sure tests pass by running `rake` at the root of the project
112
+ 3. Add tests for your change. Make your change, and make sure that tests pass by running `rake` again
113
+ 4. Commit to your fork using a good commit message
114
+ 5. Push and submit a pull request
115
+
116
+ ## License
117
+
118
+ Distributed under the [MIT-LICENSE](/MIT-LICENSE)
119
+
data/playtypus.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'playtypus'
5
- s.version = '0.0.1'
5
+ s.version = '0.0.2'
6
6
  s.date = '2015-04-09'
7
7
  s.required_ruby_version = '>= 1.9.3'
8
8
  s.licenses = ['MIT']
@@ -23,6 +23,6 @@ Gem::Specification.new do |s|
23
23
  s.add_dependency 'coveralls', '~> 0.7.11', '>= 0.7.11'
24
24
  s.add_dependency 'pry', '~> 0.10.1', '>= 0.10.1'
25
25
  s.add_dependency 'httparty', '~> 0.11.0', '>= 0.11.0'
26
- s.add_dependency 'eventmachine', '~> 1.0.3', '>= 1.0.3'
26
+ s.add_dependency 'eventmachine', '~> 1.0.3', '< 1.0.4'
27
27
  s.add_dependency 'mocha', '~> 0.14.0', '>= 0.14.0'
28
- end
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playtypus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rackspace
@@ -157,9 +157,9 @@ dependencies:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
159
  version: 1.0.3
160
- - - ">="
160
+ - - "<"
161
161
  - !ruby/object:Gem::Version
162
- version: 1.0.3
162
+ version: 1.0.4
163
163
  type: :runtime
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
@@ -167,9 +167,9 @@ dependencies:
167
167
  - - "~>"
168
168
  - !ruby/object:Gem::Version
169
169
  version: 1.0.3
170
- - - ">="
170
+ - - "<"
171
171
  - !ruby/object:Gem::Version
172
- version: 1.0.3
172
+ version: 1.0.4
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: mocha
175
175
  requirement: !ruby/object:Gem::Requirement