hotchoc 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 +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +38 -8
- data/hotchoc.gemspec +5 -2
- data/lib/hotchoc/api.rb +45 -0
- data/lib/hotchoc/client.rb +16 -5
- data/lib/hotchoc/configuration.rb +6 -11
- data/lib/hotchoc/errors.rb +12 -0
- data/lib/hotchoc/fetcher.rb +35 -0
- data/lib/hotchoc/version.rb +1 -1
- data/lib/hotchoc.rb +3 -0
- data/spec/hotchoc/api_spec.rb +103 -0
- data/spec/hotchoc/client_spec.rb +16 -48
- data/spec/hotchoc/configuration_spec.rb +1 -13
- data/spec/hotchoc/main_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -1
- data/spec/support/helpers.rb +3 -0
- data/spec/support/responses/album.json +165 -0
- data/spec/support/responses/albums.json +344 -0
- data/spec/support/responses/page.json +33 -0
- data/spec/support/responses/pages.json +54 -0
- data/spec/support/responses/post.json +29 -0
- data/spec/support/responses/posts.json +58 -0
- data/spec/support/responses/topic.json +9 -0
- data/spec/support/responses/topics.json +18 -0
- data/spec/support/stubs.rb +29 -0
- metadata +64 -10
@@ -0,0 +1,58 @@
|
|
1
|
+
{
|
2
|
+
"posts": [
|
3
|
+
{
|
4
|
+
"blocks": [
|
5
|
+
{
|
6
|
+
"content": {
|
7
|
+
"html": "\\u003cp\\u003eTest\\u003c/p\\u003e\\n",
|
8
|
+
"markdown": "Test"
|
9
|
+
},
|
10
|
+
"created_at": "2014-07-26T13:04:35Z",
|
11
|
+
"id": "53d3a7636c6f72785d2b0000",
|
12
|
+
"position": 1,
|
13
|
+
"type": "text",
|
14
|
+
"updated_at": "2014-07-26T13:05:08Z"
|
15
|
+
}
|
16
|
+
],
|
17
|
+
"created_at": "2014-07-26T13:04:25Z",
|
18
|
+
"excerpt": "",
|
19
|
+
"featured_image": null,
|
20
|
+
"hidden": false,
|
21
|
+
"id": "53d3a7596c6f72785d290000",
|
22
|
+
"identifier": "new-post",
|
23
|
+
"publish_date": "2014-07-26T13:04:35Z",
|
24
|
+
"status": "published",
|
25
|
+
"subtitle": "",
|
26
|
+
"title": "Post 1",
|
27
|
+
"topics": [],
|
28
|
+
"updated_at": "2014-07-26T13:05:09Z"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"blocks": [
|
32
|
+
{
|
33
|
+
"content": {
|
34
|
+
"html": "\\u003cp\\u003eTest\\u003c/p\\u003e\\n",
|
35
|
+
"markdown": "Test"
|
36
|
+
},
|
37
|
+
"created_at": "2014-07-26T13:05:28Z",
|
38
|
+
"id": "53d3a7986c6f72785d2e0000",
|
39
|
+
"position": 1,
|
40
|
+
"type": "text",
|
41
|
+
"updated_at": "2014-07-26T13:05:32Z"
|
42
|
+
}
|
43
|
+
],
|
44
|
+
"created_at": "2014-07-26T13:05:21Z",
|
45
|
+
"excerpt": "",
|
46
|
+
"featured_image": null,
|
47
|
+
"hidden": false,
|
48
|
+
"id": "53d3a7916c6f72785d2c0000",
|
49
|
+
"identifier": "new-post-1",
|
50
|
+
"publish_date": "2014-07-26T13:05:28Z",
|
51
|
+
"status": "published",
|
52
|
+
"subtitle": "",
|
53
|
+
"title": "Post 2",
|
54
|
+
"topics": [],
|
55
|
+
"updated_at": "2014-07-26T13:05:35Z"
|
56
|
+
}
|
57
|
+
]
|
58
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"topics": [
|
3
|
+
{
|
4
|
+
"created_at": "2014-07-24T10:15:01Z",
|
5
|
+
"id": "53d0dca56c6f7253e6060000",
|
6
|
+
"identifier": "australia",
|
7
|
+
"name": "Australia",
|
8
|
+
"updated_at": "2014-07-24T10:15:01Z"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"created_at": "2014-07-24T10:15:01Z",
|
12
|
+
"id": "53d0dca56c6f7253e60c0000",
|
13
|
+
"identifier": "bushwalking",
|
14
|
+
"name": "Bushwalking",
|
15
|
+
"updated_at": "2014-07-24T10:15:01Z"
|
16
|
+
}
|
17
|
+
]
|
18
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
RSpec.configure do |config|
|
2
|
+
config.before(:each) do
|
3
|
+
|
4
|
+
stub_request(:get, /.*\.hotchoc\.(io|dev|test){1}\/api\/albums\/([a-z0-9])+(\?.*)?\z/)
|
5
|
+
.to_return(status: 200, body: File.read(response_stub('album')))
|
6
|
+
|
7
|
+
stub_request(:get, /.*\.hotchoc\.(io|dev|test){1}\/api\/albums\/?(\?.*)?\z/)
|
8
|
+
.to_return(status: 200, body: File.read(response_stub('albums')))
|
9
|
+
|
10
|
+
stub_request(:get, /.*\.hotchoc\.(io|dev|test){1}\/api\/pages\/([a-z0-9])+(\?.*)?\z/)
|
11
|
+
.to_return(status: 200, body: File.read(response_stub('page')))
|
12
|
+
|
13
|
+
stub_request(:get, /.*\.hotchoc\.(io|dev|test){1}\/api\/pages\/?(\?.*)?\z/)
|
14
|
+
.to_return(status: 200, body: File.read(response_stub('pages')))
|
15
|
+
|
16
|
+
stub_request(:get, /.*\.hotchoc\.(io|dev|test){1}\/api\/posts\/([a-z0-9])+(\?.*)?\z/)
|
17
|
+
.to_return(status: 200, body: File.read(response_stub('post')))
|
18
|
+
|
19
|
+
stub_request(:get, /.*\.hotchoc\.(io|dev|test){1}\/api\/posts\/?(\?.*)?\z/)
|
20
|
+
.to_return(status: 200, body: File.read(response_stub('posts')))
|
21
|
+
|
22
|
+
stub_request(:get, /.*\.hotchoc\.(io|dev|test){1}\/api\/topics\/([a-z0-9])+(\?.*)?\z/)
|
23
|
+
.to_return(status: 200, body: File.read(response_stub('topic')))
|
24
|
+
|
25
|
+
stub_request(:get, /.*\.hotchoc\.(io|dev|test){1}\/api\/topics\/?(\?.*)?\z/)
|
26
|
+
.to_return(status: 200, body: File.read(response_stub('topics')))
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotchoc
|
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
|
- Matthias Siegel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: typhoeus
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.6.9
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.6.9
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -28,30 +42,44 @@ dependencies:
|
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- - "
|
45
|
+
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
47
|
+
version: '10.3'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- - "
|
52
|
+
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
54
|
+
version: '10.3'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rspec
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - "
|
59
|
+
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
61
|
+
version: '3.0'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - "
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.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.18'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
53
81
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
82
|
+
version: '1.18'
|
55
83
|
description: Official Ruby wrapper for the Hotchoc API.
|
56
84
|
email:
|
57
85
|
- matthias.siegel@gmail.com
|
@@ -61,19 +89,34 @@ extra_rdoc_files: []
|
|
61
89
|
files:
|
62
90
|
- ".gitignore"
|
63
91
|
- ".rspec"
|
92
|
+
- CHANGELOG.md
|
64
93
|
- Gemfile
|
65
94
|
- LICENSE.md
|
66
95
|
- README.md
|
67
96
|
- Rakefile
|
68
97
|
- hotchoc.gemspec
|
69
98
|
- lib/hotchoc.rb
|
99
|
+
- lib/hotchoc/api.rb
|
70
100
|
- lib/hotchoc/client.rb
|
71
101
|
- lib/hotchoc/configuration.rb
|
102
|
+
- lib/hotchoc/errors.rb
|
103
|
+
- lib/hotchoc/fetcher.rb
|
72
104
|
- lib/hotchoc/version.rb
|
105
|
+
- spec/hotchoc/api_spec.rb
|
73
106
|
- spec/hotchoc/client_spec.rb
|
74
107
|
- spec/hotchoc/configuration_spec.rb
|
75
108
|
- spec/hotchoc/main_spec.rb
|
76
109
|
- spec/spec_helper.rb
|
110
|
+
- spec/support/helpers.rb
|
111
|
+
- spec/support/responses/album.json
|
112
|
+
- spec/support/responses/albums.json
|
113
|
+
- spec/support/responses/page.json
|
114
|
+
- spec/support/responses/pages.json
|
115
|
+
- spec/support/responses/post.json
|
116
|
+
- spec/support/responses/posts.json
|
117
|
+
- spec/support/responses/topic.json
|
118
|
+
- spec/support/responses/topics.json
|
119
|
+
- spec/support/stubs.rb
|
77
120
|
homepage: https://github.com/choc/hotchoc-ruby
|
78
121
|
licenses:
|
79
122
|
- MIT
|
@@ -99,7 +142,18 @@ signing_key:
|
|
99
142
|
specification_version: 4
|
100
143
|
summary: Official Ruby wrapper for the Hotchoc API.
|
101
144
|
test_files:
|
145
|
+
- spec/hotchoc/api_spec.rb
|
102
146
|
- spec/hotchoc/client_spec.rb
|
103
147
|
- spec/hotchoc/configuration_spec.rb
|
104
148
|
- spec/hotchoc/main_spec.rb
|
105
149
|
- spec/spec_helper.rb
|
150
|
+
- spec/support/helpers.rb
|
151
|
+
- spec/support/responses/album.json
|
152
|
+
- spec/support/responses/albums.json
|
153
|
+
- spec/support/responses/page.json
|
154
|
+
- spec/support/responses/pages.json
|
155
|
+
- spec/support/responses/post.json
|
156
|
+
- spec/support/responses/posts.json
|
157
|
+
- spec/support/responses/topic.json
|
158
|
+
- spec/support/responses/topics.json
|
159
|
+
- spec/support/stubs.rb
|