99designs-tasks 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/99designs-tasks.gemspec +30 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +37 -0
  9. data/Rakefile +7 -0
  10. data/lib/99designs/errors/api_error.rb +4 -0
  11. data/lib/99designs/errors/authentication_error.rb +4 -0
  12. data/lib/99designs/errors/base_error.rb +15 -0
  13. data/lib/99designs/errors/invalid_state_error.rb +4 -0
  14. data/lib/99designs/errors/not_found_error.rb +4 -0
  15. data/lib/99designs/errors/payment_error.rb +4 -0
  16. data/lib/99designs/errors/validation_error.rb +7 -0
  17. data/lib/99designs/tasks/api_client.rb +133 -0
  18. data/lib/99designs/tasks/version.rb +5 -0
  19. data/lib/99designs/tasks.rb +10 -0
  20. data/spec/api_client_spec.rb +144 -0
  21. data/spec/cassettes/approve_delivery.yml +45 -0
  22. data/spec/cassettes/attach_files.yml +91 -0
  23. data/spec/cassettes/create_task.yml +60 -0
  24. data/spec/cassettes/create_task_blank_body.yml +47 -0
  25. data/spec/cassettes/create_task_invalid_apikey.yml +48 -0
  26. data/spec/cassettes/create_task_no_credits.yml +46 -0
  27. data/spec/cassettes/delete_attachment.yml +127 -0
  28. data/spec/cassettes/get_task.yml +45 -0
  29. data/spec/cassettes/post_comment.yml +45 -0
  30. data/spec/cassettes/request_revision.yml +45 -0
  31. data/spec/cassettes/request_revision_approve_delivery.yml +46 -0
  32. data/spec/cassettes/server_having_problems.yml +121 -0
  33. data/spec/cassettes/task_not_found.yml +46 -0
  34. data/spec/cassettes/update_task.yml +87 -0
  35. data/spec/spec_helper.rb +91 -0
  36. data/spec/support/sample.txt +1 -0
  37. data/spec/support/vcr.rb +10 -0
  38. metadata +210 -0
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://xyzzy:@api.99designs.com.dockervm:49881/tasks/v1/tasks/fakeade6a144db4cdf680d89251bd7e2594c10b6
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ response:
17
+ status:
18
+ code: 404
19
+ message: Not Found
20
+ headers:
21
+ Server:
22
+ - nginx/1.4.6 (Ubuntu)
23
+ Content-Type:
24
+ - application/json
25
+ Transfer-Encoding:
26
+ - chunked
27
+ Connection:
28
+ - keep-alive
29
+ Vary:
30
+ - Accept-Encoding
31
+ Cache-Control:
32
+ - no-cache
33
+ Date:
34
+ - Tue, 26 May 2015 01:34:31 GMT
35
+ Access-Control-Allow-Methods:
36
+ - OPTIONS, GET, PUT, POST, DELETE
37
+ Access-Control-Allow-Headers:
38
+ - Authorization
39
+ X-Debug-Token:
40
+ - 22a9b8
41
+ body:
42
+ encoding: UTF-8
43
+ string: "{\"message\":\"Not found\"}"
44
+ http_version:
45
+ recorded_at: Tue, 26 May 2015 01:34:31 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,87 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://xyzzy:@api.99designs.com.dockervm:49881/tasks/v1/tasks/84cc6f1d34d60f14d42389a0ae92740a
6
+ body:
7
+ encoding: UTF-8
8
+ string: body=updated
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 204
21
+ message: No Content
22
+ headers:
23
+ Server:
24
+ - nginx/1.4.6 (Ubuntu)
25
+ Content-Type:
26
+ - application/json
27
+ Connection:
28
+ - keep-alive
29
+ Cache-Control:
30
+ - no-cache
31
+ - no-transform
32
+ Date:
33
+ - Tue, 26 May 2015 01:18:43 GMT
34
+ Access-Control-Allow-Methods:
35
+ - OPTIONS, GET, PUT, POST, DELETE
36
+ Access-Control-Allow-Headers:
37
+ - Authorization
38
+ X-Debug-Token:
39
+ - 8ea311
40
+ body:
41
+ encoding: UTF-8
42
+ string: ''
43
+ http_version:
44
+ recorded_at: Tue, 26 May 2015 01:18:43 GMT
45
+ - request:
46
+ method: get
47
+ uri: http://xyzzy:@api.99designs.com.dockervm:49881/tasks/v1/tasks/84cc6f1d34d60f14d42389a0ae92740a
48
+ body:
49
+ encoding: US-ASCII
50
+ string: ''
51
+ headers:
52
+ User-Agent:
53
+ - Faraday v0.9.1
54
+ Accept-Encoding:
55
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
56
+ Accept:
57
+ - "*/*"
58
+ response:
59
+ status:
60
+ code: 200
61
+ message: OK
62
+ headers:
63
+ Server:
64
+ - nginx/1.4.6 (Ubuntu)
65
+ Content-Type:
66
+ - application/vnd.99designs.task+json; profile=http://api.99designs.com.dockervm:49881/tasks/v1/schema#/Task
67
+ Transfer-Encoding:
68
+ - chunked
69
+ Connection:
70
+ - keep-alive
71
+ Cache-Control:
72
+ - no-cache
73
+ - no-transform
74
+ Date:
75
+ - Tue, 26 May 2015 01:18:43 GMT
76
+ Access-Control-Allow-Methods:
77
+ - OPTIONS, GET, PUT, POST, DELETE
78
+ Access-Control-Allow-Headers:
79
+ - Authorization
80
+ X-Debug-Token:
81
+ - fdd507
82
+ body:
83
+ encoding: UTF-8
84
+ string: "{\"id\":\"84cc6f1d34d60f14d42389a0ae92740a\",\"state\":{\"code\":\"available\",\"text\":\"Available\"},\"body\":\"updated\",\"attachments\":[{\"id\":193,\"filename\":\"money.svg\",\"filesize\":19039,\"filetype\":\"image\\/svg+xml\",\"source\":\"https:\\/\\/d15rdjgfy8kdl5.cloudfront.net\\/tasks\\/128\\/attachments\\/779318b249ffe555976bda74dc200cbb553ae4a0\\/0\\/money.svg\",\"thumbnail\":null,\"links\":[{\"rel\":\"delete_attachment\",\"href\":\"http:\\/\\/api.99designs.com.dockervm:49881\\/tasks\\/v1\\/tasks\\/84cc6f1d34d60f14d42389a0ae92740a\\/attachments\\/193\",\"method\":\"POST\"}]},{\"id\":194,\"filename\":\"sample.txt\",\"filesize\":12,\"filetype\":\"text\\/plain\",\"source\":\"https:\\/\\/d15rdjgfy8kdl5.cloudfront.net\\/tasks\\/128\\/attachments\\/236e2740391c4302e157e804bbde597949b48543\\/0\\/sample.txt\",\"thumbnail\":null,\"links\":[{\"rel\":\"delete_attachment\",\"href\":\"http:\\/\\/api.99designs.com.dockervm:49881\\/tasks\\/v1\\/tasks\\/84cc6f1d34d60f14d42389a0ae92740a\\/attachments\\/194\",\"method\":\"POST\"}]}],\"currentdesigner\":null,\"timeline\":[],\"links\":[{\"rel\":\"update_task\",\"href\":\"http:\\/\\/api.99designs.com.dockervm:49881\\/tasks\\/v1\\/tasks\\/84cc6f1d34d60f14d42389a0ae92740a\",\"method\":\"PUT\"},{\"rel\":\"attach_files\",\"href\":\"http:\\/\\/api.99designs.com.dockervm:49881\\/tasks\\/v1\\/tasks\\/84cc6f1d34d60f14d42389a0ae92740a\\/attachments\",\"method\":\"POST\"},{\"rel\":\"post_comment\",\"href\":\"http:\\/\\/api.99designs.com.dockervm:49881\\/tasks\\/v1\\/tasks\\/84cc6f1d34d60f14d42389a0ae92740a\\/comment\",\"method\":\"POST\"},{\"rel\":\"self\",\"href\":\"http:\\/\\/api.99designs.com.dockervm:49881\\/tasks\\/v1\\/tasks\\/84cc6f1d34d60f14d42389a0ae92740a\",\"method\":\"GET\"}]}"
85
+ http_version:
86
+ recorded_at: Tue, 26 May 2015 01:18:43 GMT
87
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,91 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # The `.rspec` file also contains a few flags that are not defaults but that
16
+ # users commonly want.
17
+ #
18
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # The settings below are suggested to provide a good initial experience
44
+ # with RSpec, but feel free to customize to your heart's content.
45
+ =begin
46
+ # These two settings work together to allow you to limit a spec run
47
+ # to individual examples or groups you care about by tagging them with
48
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
49
+ # get run.
50
+ config.filter_run :focus
51
+ config.run_all_when_everything_filtered = true
52
+
53
+ # Limits the available syntax to the non-monkey patched syntax that is
54
+ # recommended. For more details, see:
55
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
56
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
57
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
58
+ config.disable_monkey_patching!
59
+
60
+ # This setting enables warnings. It's recommended, but in some cases may
61
+ # be too noisy due to issues in dependencies.
62
+ config.warnings = true
63
+
64
+ # Many RSpec users commonly either run the entire suite or an individual
65
+ # file, and it's useful to allow more verbose output when running an
66
+ # individual spec file.
67
+ if config.files_to_run.one?
68
+ # Use the documentation formatter for detailed output,
69
+ # unless a formatter has already been configured
70
+ # (e.g. via a command-line flag).
71
+ config.default_formatter = 'doc'
72
+ end
73
+
74
+ # Print the 10 slowest examples and example groups at the
75
+ # end of the spec run, to help surface which specs are running
76
+ # particularly slow.
77
+ config.profile_examples = 10
78
+
79
+ # Run specs in random order to surface order dependencies. If you find an
80
+ # order dependency and want to debug it, you can fix the order by providing
81
+ # the seed, which is printed after each run.
82
+ # --seed 1234
83
+ config.order = :random
84
+
85
+ # Seed global randomization in this process using the `--seed` CLI option.
86
+ # Setting this allows you to use `--seed` to deterministically reproduce
87
+ # test failures related to randomization by passing the same `--seed` value
88
+ # as the one that triggered the failure.
89
+ Kernel.srand config.seed
90
+ =end
91
+ end
@@ -0,0 +1 @@
1
+ hello world
@@ -0,0 +1,10 @@
1
+ require "vcr"
2
+ require "webmock"
3
+
4
+ VCR.configure do |c|
5
+ # The directory where your cassettes will be saved
6
+ c.cassette_library_dir = 'spec/cassettes'
7
+
8
+ # Your HTTP request service. You can also use fakeweb, webmock, and more
9
+ c.hook_into :webmock
10
+ end
metadata ADDED
@@ -0,0 +1,210 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: 99designs-tasks
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Dennis Hotson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.8'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday_middleware
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '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'
41
+ - !ruby/object:Gem::Dependency
42
+ name: mime-types
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.6'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.6'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: vcr
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: webmock
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: 99designs Tasks API client
126
+ email:
127
+ - dennis@99designs.com
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - ".gitignore"
133
+ - ".rspec"
134
+ - ".travis.yml"
135
+ - 99designs-tasks.gemspec
136
+ - Gemfile
137
+ - LICENSE.txt
138
+ - README.md
139
+ - Rakefile
140
+ - lib/99designs/errors/api_error.rb
141
+ - lib/99designs/errors/authentication_error.rb
142
+ - lib/99designs/errors/base_error.rb
143
+ - lib/99designs/errors/invalid_state_error.rb
144
+ - lib/99designs/errors/not_found_error.rb
145
+ - lib/99designs/errors/payment_error.rb
146
+ - lib/99designs/errors/validation_error.rb
147
+ - lib/99designs/tasks.rb
148
+ - lib/99designs/tasks/api_client.rb
149
+ - lib/99designs/tasks/version.rb
150
+ - spec/api_client_spec.rb
151
+ - spec/cassettes/approve_delivery.yml
152
+ - spec/cassettes/attach_files.yml
153
+ - spec/cassettes/create_task.yml
154
+ - spec/cassettes/create_task_blank_body.yml
155
+ - spec/cassettes/create_task_invalid_apikey.yml
156
+ - spec/cassettes/create_task_no_credits.yml
157
+ - spec/cassettes/delete_attachment.yml
158
+ - spec/cassettes/get_task.yml
159
+ - spec/cassettes/post_comment.yml
160
+ - spec/cassettes/request_revision.yml
161
+ - spec/cassettes/request_revision_approve_delivery.yml
162
+ - spec/cassettes/server_having_problems.yml
163
+ - spec/cassettes/task_not_found.yml
164
+ - spec/cassettes/update_task.yml
165
+ - spec/spec_helper.rb
166
+ - spec/support/sample.txt
167
+ - spec/support/vcr.rb
168
+ homepage: https://github.com/99designs/tasks-api-ruby
169
+ licenses:
170
+ - MIT
171
+ metadata: {}
172
+ post_install_message:
173
+ rdoc_options: []
174
+ require_paths:
175
+ - lib
176
+ required_ruby_version: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ required_rubygems_version: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ version: '0'
186
+ requirements: []
187
+ rubyforge_project:
188
+ rubygems_version: 2.2.0
189
+ signing_key:
190
+ specification_version: 4
191
+ summary: 99designs Tasks API client
192
+ test_files:
193
+ - spec/api_client_spec.rb
194
+ - spec/cassettes/approve_delivery.yml
195
+ - spec/cassettes/attach_files.yml
196
+ - spec/cassettes/create_task.yml
197
+ - spec/cassettes/create_task_blank_body.yml
198
+ - spec/cassettes/create_task_invalid_apikey.yml
199
+ - spec/cassettes/create_task_no_credits.yml
200
+ - spec/cassettes/delete_attachment.yml
201
+ - spec/cassettes/get_task.yml
202
+ - spec/cassettes/post_comment.yml
203
+ - spec/cassettes/request_revision.yml
204
+ - spec/cassettes/request_revision_approve_delivery.yml
205
+ - spec/cassettes/server_having_problems.yml
206
+ - spec/cassettes/task_not_found.yml
207
+ - spec/cassettes/update_task.yml
208
+ - spec/spec_helper.rb
209
+ - spec/support/sample.txt
210
+ - spec/support/vcr.rb