hotchoc 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +558 -0
- data/CHANGELOG.md +17 -0
- data/README.md +7 -11
- data/Rakefile +8 -0
- data/hotchoc.gemspec +8 -7
- data/lib/hotchoc/api.rb +4 -28
- data/lib/hotchoc/errors.rb +1 -1
- data/lib/hotchoc/fetcher.rb +1 -1
- data/lib/hotchoc/presenters/album.rb +65 -0
- data/lib/hotchoc/presenters/base.rb +26 -0
- data/lib/hotchoc/presenters/blocks/base.rb +31 -0
- data/lib/hotchoc/presenters/blocks/image.rb +23 -0
- data/lib/hotchoc/presenters/blocks/text.rb +23 -0
- data/lib/hotchoc/presenters/file.rb +62 -0
- data/lib/hotchoc/presenters/page.rb +69 -0
- data/lib/hotchoc/presenters/post.rb +53 -0
- data/lib/hotchoc/presenters/thumbnail.rb +37 -0
- data/lib/hotchoc/presenters/topic.rb +33 -0
- data/lib/hotchoc/version.rb +1 -1
- data/lib/hotchoc.rb +12 -1
- data/spec/hotchoc/api_spec.rb +8 -48
- data/spec/support/matchers.rb +5 -0
- data/spec/support/responses/albums.json +538 -221
- data/spec/support/responses/pages.json +19 -25
- data/spec/support/responses/posts.json +58 -34
- data/spec/support/responses/topics.json +111 -6
- data/spec/support/stubs.rb +4 -16
- metadata +42 -23
- data/spec/support/responses/album.json +0 -165
- data/spec/support/responses/page.json +0 -33
- data/spec/support/responses/post.json +0 -29
- data/spec/support/responses/topic.json +0 -9
@@ -1,165 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"album": {
|
3
|
-
"blocks": [
|
4
|
-
{
|
5
|
-
"content": {
|
6
|
-
"image": {
|
7
|
-
"content_type": "image/jpeg",
|
8
|
-
"created_at": "2014-07-26T12:43:35Z",
|
9
|
-
"exif": {},
|
10
|
-
"height": 683,
|
11
|
-
"id": "53d3a2776c6f72785d050000",
|
12
|
-
"name": "moon.jpg",
|
13
|
-
"parent_id": "53d3a2266c6f72785d020000",
|
14
|
-
"size": 83852,
|
15
|
-
"state": "finished",
|
16
|
-
"thumbnails": {
|
17
|
-
"original": [
|
18
|
-
{
|
19
|
-
"height": 133,
|
20
|
-
"name": "200.jpg",
|
21
|
-
"size": 7974,
|
22
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=200",
|
23
|
-
"width": 200
|
24
|
-
},
|
25
|
-
{
|
26
|
-
"height": 267,
|
27
|
-
"name": "400.jpg",
|
28
|
-
"size": 17634,
|
29
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=400",
|
30
|
-
"width": 400
|
31
|
-
},
|
32
|
-
{
|
33
|
-
"height": 534,
|
34
|
-
"name": "800.jpg",
|
35
|
-
"size": 51121,
|
36
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=800",
|
37
|
-
"width": 800
|
38
|
-
},
|
39
|
-
{
|
40
|
-
"height": 667,
|
41
|
-
"name": "1000.jpg",
|
42
|
-
"size": 74685,
|
43
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=1000",
|
44
|
-
"width": 1000
|
45
|
-
}
|
46
|
-
],
|
47
|
-
"square": [
|
48
|
-
{
|
49
|
-
"height": 200,
|
50
|
-
"name": "200_square.jpg",
|
51
|
-
"size": 11980,
|
52
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=200\\u0026s=1",
|
53
|
-
"width": 200
|
54
|
-
},
|
55
|
-
{
|
56
|
-
"height": 400,
|
57
|
-
"name": "400_square.jpg",
|
58
|
-
"size": 31091,
|
59
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=400\\u0026s=1",
|
60
|
-
"width": 400
|
61
|
-
},
|
62
|
-
{
|
63
|
-
"height": 683,
|
64
|
-
"name": "683_square.jpg",
|
65
|
-
"size": 78596,
|
66
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=683\\u0026s=1",
|
67
|
-
"width": 683
|
68
|
-
}
|
69
|
-
]
|
70
|
-
},
|
71
|
-
"updated_at": "2014-07-26T12:43:58Z",
|
72
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg",
|
73
|
-
"width": 1024
|
74
|
-
},
|
75
|
-
"title": null
|
76
|
-
},
|
77
|
-
"created_at": "2014-07-26T12:43:31Z",
|
78
|
-
"id": "53d3a2736c6f72785d040000",
|
79
|
-
"position": 1,
|
80
|
-
"type": "image",
|
81
|
-
"updated_at": "2014-07-26T12:43:35Z"
|
82
|
-
}
|
83
|
-
],
|
84
|
-
"cover": {
|
85
|
-
"content_type": "image/jpeg",
|
86
|
-
"created_at": "2014-07-26T12:43:35Z",
|
87
|
-
"exif": {},
|
88
|
-
"height": 683,
|
89
|
-
"id": "53d3a2776c6f72785d050000",
|
90
|
-
"name": "moon.jpg",
|
91
|
-
"parent_id": "53d3a2266c6f72785d020000",
|
92
|
-
"size": 83852,
|
93
|
-
"state": "finished",
|
94
|
-
"thumbnails": {
|
95
|
-
"original": [
|
96
|
-
{
|
97
|
-
"height": 133,
|
98
|
-
"name": "200.jpg",
|
99
|
-
"size": 7974,
|
100
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=200",
|
101
|
-
"width": 200
|
102
|
-
},
|
103
|
-
{
|
104
|
-
"height": 267,
|
105
|
-
"name": "400.jpg",
|
106
|
-
"size": 17634,
|
107
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=400",
|
108
|
-
"width": 400
|
109
|
-
},
|
110
|
-
{
|
111
|
-
"height": 534,
|
112
|
-
"name": "800.jpg",
|
113
|
-
"size": 51121,
|
114
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=800",
|
115
|
-
"width": 800
|
116
|
-
},
|
117
|
-
{
|
118
|
-
"height": 667,
|
119
|
-
"name": "1000.jpg",
|
120
|
-
"size": 74685,
|
121
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=1000",
|
122
|
-
"width": 1000
|
123
|
-
}
|
124
|
-
],
|
125
|
-
"square": [
|
126
|
-
{
|
127
|
-
"height": 200,
|
128
|
-
"name": "200_square.jpg",
|
129
|
-
"size": 11980,
|
130
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=200\\u0026s=1",
|
131
|
-
"width": 200
|
132
|
-
},
|
133
|
-
{
|
134
|
-
"height": 400,
|
135
|
-
"name": "400_square.jpg",
|
136
|
-
"size": 31091,
|
137
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=400\\u0026s=1",
|
138
|
-
"width": 400
|
139
|
-
},
|
140
|
-
{
|
141
|
-
"height": 683,
|
142
|
-
"name": "683_square.jpg",
|
143
|
-
"size": 78596,
|
144
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg?w=683\\u0026s=1",
|
145
|
-
"width": 683
|
146
|
-
}
|
147
|
-
]
|
148
|
-
},
|
149
|
-
"updated_at": "2014-07-26T12:43:58Z",
|
150
|
-
"url": "https://www.hotchoc.dev/files/albums/new-album/moon.jpg",
|
151
|
-
"width": 1024
|
152
|
-
},
|
153
|
-
"created_at": "2014-07-26T12:42:14Z",
|
154
|
-
"description": "",
|
155
|
-
"hidden": false,
|
156
|
-
"id": "53d3a2266c6f72785d010000",
|
157
|
-
"identifier": "new-album",
|
158
|
-
"publish_date": "2014-07-26T12:44:09Z",
|
159
|
-
"status": "published",
|
160
|
-
"subtitle": "A subtitle",
|
161
|
-
"title": "New album",
|
162
|
-
"topics": [],
|
163
|
-
"updated_at": "2014-07-26T12:44:09Z"
|
164
|
-
}
|
165
|
-
}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"page": {
|
3
|
-
"blocks": [
|
4
|
-
{
|
5
|
-
"content": {
|
6
|
-
"html": "\\u003cp\\u003eTest\\u003c/p\\u003e\\n",
|
7
|
-
"markdown": "Test"
|
8
|
-
},
|
9
|
-
"created_at": "2014-07-26T13:03:13Z",
|
10
|
-
"id": "53d3a7116c6f727871050000",
|
11
|
-
"position": 1,
|
12
|
-
"type": "text",
|
13
|
-
"updated_at": "2014-07-26T13:03:18Z"
|
14
|
-
}
|
15
|
-
],
|
16
|
-
"created_at": "2014-07-26T13:02:38Z",
|
17
|
-
"excerpt": "",
|
18
|
-
"featured_image": null,
|
19
|
-
"hidden": false,
|
20
|
-
"id": "53d3a6ee6c6f72785d260000",
|
21
|
-
"identifier": "new-page",
|
22
|
-
"level": 1,
|
23
|
-
"parent_id": "53d0dca56c6f7253e6010000",
|
24
|
-
"path": "/new-page",
|
25
|
-
"position": 0,
|
26
|
-
"publish_date": "2014-07-26T13:02:43Z",
|
27
|
-
"status": "published",
|
28
|
-
"subtitle": "",
|
29
|
-
"title": "Page 1",
|
30
|
-
"topics": [],
|
31
|
-
"updated_at": "2014-07-26T13:03:20Z"
|
32
|
-
}
|
33
|
-
}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"post": {
|
3
|
-
"blocks": [
|
4
|
-
{
|
5
|
-
"content": {
|
6
|
-
"html": "\\u003cp\\u003eTest\\u003c/p\\u003e\\n",
|
7
|
-
"markdown": "Test"
|
8
|
-
},
|
9
|
-
"created_at": "2014-07-26T13:04:35Z",
|
10
|
-
"id": "53d3a7636c6f72785d2b0000",
|
11
|
-
"position": 1,
|
12
|
-
"type": "text",
|
13
|
-
"updated_at": "2014-07-26T13:05:08Z"
|
14
|
-
}
|
15
|
-
],
|
16
|
-
"created_at": "2014-07-26T13:04:25Z",
|
17
|
-
"excerpt": "",
|
18
|
-
"featured_image": null,
|
19
|
-
"hidden": false,
|
20
|
-
"id": "53d3a7596c6f72785d290000",
|
21
|
-
"identifier": "new-post",
|
22
|
-
"publish_date": "2014-07-26T13:04:35Z",
|
23
|
-
"status": "published",
|
24
|
-
"subtitle": "",
|
25
|
-
"title": "Post 1",
|
26
|
-
"topics": [],
|
27
|
-
"updated_at": "2014-07-26T13:05:09Z"
|
28
|
-
}
|
29
|
-
}
|