hotchoc 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,51 +4,45 @@
4
4
  "blocks": [
5
5
  {
6
6
  "content": {
7
- "html": "\\u003cp\\u003eTest\\u003c/p\\u003e\\n",
8
- "markdown": "Test"
7
+ "html": "<p>Test <em>test</em> test</p>\n",
8
+ "markdown": "Test _test_ test"
9
9
  },
10
- "created_at": "2014-07-26T13:03:13Z",
11
- "id": "53d3a7116c6f727871050000",
12
- "position": 1,
10
+ "created_at": "2015-05-04T09:26:59Z",
11
+ "id": "07072e07-0afd-44b2-ae02-94161632f218",
12
+ "position": 0,
13
13
  "type": "text",
14
- "updated_at": "2014-07-26T13:03:18Z"
14
+ "updated_at": "2015-05-04T09:27:11Z"
15
15
  }
16
16
  ],
17
- "created_at": "2014-07-26T13:02:38Z",
18
- "excerpt": "",
19
- "featured_image": null,
20
- "hidden": false,
21
- "id": "53d3a6ee6c6f72785d260000",
22
- "identifier": "new-page",
17
+ "created_at": "2015-05-04T09:26:47Z",
18
+ "id": "730524b0-b68e-486f-8199-31c582ce7e99",
19
+ "identifier": "test-page-1",
23
20
  "level": 1,
24
- "parent_id": "53d0dca56c6f7253e6010000",
25
- "path": "/new-page",
21
+ "parent_id": "2fba7834-b083-4dc5-9c50-a488c42dcded",
22
+ "path": "/test-page-1",
26
23
  "position": 0,
27
- "publish_date": "2014-07-26T13:02:43Z",
24
+ "publish_date": "2015-05-04T09:26:47Z",
28
25
  "status": "published",
29
- "subtitle": "",
30
- "title": "Page 1",
26
+ "subtitle": "Test subtitle 1",
27
+ "title": "Test page 1",
31
28
  "topics": [],
32
- "updated_at": "2014-07-26T13:03:20Z"
29
+ "updated_at": "2015-05-04T09:27:22Z"
33
30
  },
34
31
  {
35
32
  "blocks": [],
36
- "created_at": "2014-07-24T10:15:01Z",
37
- "excerpt": null,
38
- "featured_image": null,
39
- "hidden": false,
40
- "id": "53d0dca56c6f7253e6010000",
33
+ "created_at": "2015-05-04T08:08:26Z",
34
+ "id": "2fba7834-b083-4dc5-9c50-a488c42dcded",
41
35
  "identifier": "home",
42
36
  "level": 0,
43
37
  "parent_id": null,
44
38
  "path": "/",
45
39
  "position": 0,
46
- "publish_date": "2014-07-24T10:15:01Z",
40
+ "publish_date": "2015-05-04T08:08:26Z",
47
41
  "status": "published",
48
42
  "subtitle": null,
49
43
  "title": "Home",
50
44
  "topics": [],
51
- "updated_at": "2014-07-24T10:15:01Z"
45
+ "updated_at": "2015-05-04T08:08:26Z"
52
46
  }
53
47
  ]
54
48
  }
@@ -4,55 +4,79 @@
4
4
  "blocks": [
5
5
  {
6
6
  "content": {
7
- "html": "\\u003cp\\u003eTest\\u003c/p\\u003e\\n",
8
- "markdown": "Test"
7
+ "html": "<p>Test test <em>test</em></p>\n",
8
+ "markdown": "Test test _test_"
9
9
  },
10
- "created_at": "2014-07-26T13:04:35Z",
11
- "id": "53d3a7636c6f72785d2b0000",
12
- "position": 1,
10
+ "created_at": "2015-05-04T09:28:39Z",
11
+ "id": "72b6bee3-c4ba-4fcb-afe2-434ae1e0c8c9",
12
+ "position": 0,
13
13
  "type": "text",
14
- "updated_at": "2014-07-26T13:05:08Z"
14
+ "updated_at": "2015-05-04T09:28:47Z"
15
15
  }
16
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",
17
+ "created_at": "2015-05-04T09:28:26Z",
18
+ "id": "5388f1e6-ad20-4baa-8720-63c3fb50273a",
19
+ "identifier": "test-post-2",
20
+ "publish_date": "2015-05-04T09:28:26Z",
24
21
  "status": "published",
25
- "subtitle": "",
26
- "title": "Post 1",
27
- "topics": [],
28
- "updated_at": "2014-07-26T13:05:09Z"
22
+ "subtitle": "Test subtitle 2",
23
+ "title": "Test post 2",
24
+ "topics": [
25
+ {
26
+ "created_at": "2015-05-04T08:08:27Z",
27
+ "id": "37e30b6f-9f51-414e-8c76-bbdda12f11a7",
28
+ "identifier": "victoria",
29
+ "name": "Victoria",
30
+ "updated_at": "2015-05-04T09:28:55Z"
31
+ },
32
+ {
33
+ "created_at": "2015-05-04T08:08:27Z",
34
+ "id": "30479282-7b1f-40b8-befb-d7e86ca0021f",
35
+ "identifier": "melbourne",
36
+ "name": "Melbourne",
37
+ "updated_at": "2015-05-04T09:28:53Z"
38
+ }
39
+ ],
40
+ "updated_at": "2015-05-04T09:28:57Z"
29
41
  },
30
42
  {
31
43
  "blocks": [
32
44
  {
33
45
  "content": {
34
- "html": "\\u003cp\\u003eTest\\u003c/p\\u003e\\n",
35
- "markdown": "Test"
46
+ "html": "<p>Test test <strong>test</strong></p>\n",
47
+ "markdown": "Test test **test**"
36
48
  },
37
- "created_at": "2014-07-26T13:05:28Z",
38
- "id": "53d3a7986c6f72785d2e0000",
39
- "position": 1,
49
+ "created_at": "2015-05-04T09:27:46Z",
50
+ "id": "a53d6576-3e7d-4b48-9b99-245c34748922",
51
+ "position": 0,
40
52
  "type": "text",
41
- "updated_at": "2014-07-26T13:05:32Z"
53
+ "updated_at": "2015-05-04T09:27:56Z"
42
54
  }
43
55
  ],
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",
56
+ "created_at": "2015-05-04T09:27:31Z",
57
+ "id": "316c76ac-0fb7-4eee-9291-f48857068f68",
58
+ "identifier": "test-post-1",
59
+ "publish_date": "2015-05-04T09:27:31Z",
51
60
  "status": "published",
52
- "subtitle": "",
53
- "title": "Post 2",
54
- "topics": [],
55
- "updated_at": "2014-07-26T13:05:35Z"
61
+ "subtitle": "Test subtitle 1",
62
+ "title": "Test post 1",
63
+ "topics": [
64
+ {
65
+ "created_at": "2015-05-04T08:08:27Z",
66
+ "id": "a1753785-ba93-4846-8bce-9c2af6813317",
67
+ "identifier": "bushwalking",
68
+ "name": "Bushwalking",
69
+ "updated_at": "2015-05-04T09:28:07Z"
70
+ },
71
+ {
72
+ "created_at": "2015-05-04T08:08:27Z",
73
+ "id": "ac5ce271-a199-44c2-89e9-3f57515fbbb6",
74
+ "identifier": "hobart",
75
+ "name": "Hobart",
76
+ "updated_at": "2015-05-04T09:28:09Z"
77
+ }
78
+ ],
79
+ "updated_at": "2015-05-04T09:28:20Z"
56
80
  }
57
81
  ]
58
82
  }
@@ -1,18 +1,123 @@
1
1
  {
2
2
  "topics": [
3
3
  {
4
- "created_at": "2014-07-24T10:15:01Z",
5
- "id": "53d0dca56c6f7253e6060000",
4
+ "created_at": "2015-05-04T08:08:27Z",
5
+ "id": "4b3e5569-7bef-445d-9f11-92cdceeda222",
6
6
  "identifier": "australia",
7
7
  "name": "Australia",
8
- "updated_at": "2014-07-24T10:15:01Z"
8
+ "updated_at": "2015-05-04T08:08:27Z"
9
9
  },
10
10
  {
11
- "created_at": "2014-07-24T10:15:01Z",
12
- "id": "53d0dca56c6f7253e60c0000",
11
+ "created_at": "2015-05-04T08:08:27Z",
12
+ "id": "a1753785-ba93-4846-8bce-9c2af6813317",
13
13
  "identifier": "bushwalking",
14
14
  "name": "Bushwalking",
15
- "updated_at": "2014-07-24T10:15:01Z"
15
+ "updated_at": "2015-05-04T09:28:07Z"
16
+ },
17
+ {
18
+ "created_at": "2015-05-04T08:08:27Z",
19
+ "id": "86f6e524-932f-4ddf-a1f9-a6d0132394ef",
20
+ "identifier": "darwin",
21
+ "name": "Darwin",
22
+ "updated_at": "2015-05-04T08:08:27Z"
23
+ },
24
+ {
25
+ "created_at": "2015-05-04T08:08:27Z",
26
+ "id": "3002a596-252f-4397-aeda-f93b631de857",
27
+ "identifier": "ducati",
28
+ "name": "Ducati",
29
+ "updated_at": "2015-05-04T09:22:39Z"
30
+ },
31
+ {
32
+ "created_at": "2015-05-04T08:08:27Z",
33
+ "id": "bb20d36a-9f3a-47be-9b49-af1d95240e96",
34
+ "identifier": "hiking",
35
+ "name": "Hiking",
36
+ "updated_at": "2015-05-04T08:08:27Z"
37
+ },
38
+ {
39
+ "created_at": "2015-05-04T08:08:27Z",
40
+ "id": "ac5ce271-a199-44c2-89e9-3f57515fbbb6",
41
+ "identifier": "hobart",
42
+ "name": "Hobart",
43
+ "updated_at": "2015-05-04T09:28:09Z"
44
+ },
45
+ {
46
+ "created_at": "2015-05-04T08:08:27Z",
47
+ "id": "bd0edb81-95b7-4ab7-9a11-ea04e79cd468",
48
+ "identifier": "launceston",
49
+ "name": "Launceston",
50
+ "updated_at": "2015-05-04T08:08:27Z"
51
+ },
52
+ {
53
+ "created_at": "2015-05-04T08:08:27Z",
54
+ "id": "30479282-7b1f-40b8-befb-d7e86ca0021f",
55
+ "identifier": "melbourne",
56
+ "name": "Melbourne",
57
+ "updated_at": "2015-05-04T09:28:53Z"
58
+ },
59
+ {
60
+ "created_at": "2015-05-04T08:08:27Z",
61
+ "id": "741201ee-b9d0-4b10-b9ae-64b5aba838f9",
62
+ "identifier": "new-south-wales",
63
+ "name": "New South Wales",
64
+ "updated_at": "2015-05-04T08:08:27Z"
65
+ },
66
+ {
67
+ "created_at": "2015-05-04T08:08:27Z",
68
+ "id": "5e56277d-cb2d-441d-8827-dca97cf3d67b",
69
+ "identifier": "northern-territory",
70
+ "name": "Northern Territory",
71
+ "updated_at": "2015-05-04T08:08:27Z"
72
+ },
73
+ {
74
+ "created_at": "2015-05-04T08:08:27Z",
75
+ "id": "0b0f7c89-252d-4dfa-9c45-99295adfc976",
76
+ "identifier": "numbulwar",
77
+ "name": "Numbulwar",
78
+ "updated_at": "2015-05-04T08:08:27Z"
79
+ },
80
+ {
81
+ "created_at": "2015-05-04T08:08:27Z",
82
+ "id": "6e6d7cb5-429f-48b6-93ac-301825e2c595",
83
+ "identifier": "overland-track",
84
+ "name": "Overland Track",
85
+ "updated_at": "2015-05-04T08:08:27Z"
86
+ },
87
+ {
88
+ "created_at": "2015-05-04T08:08:27Z",
89
+ "id": "2189e20c-f651-48c5-bd3f-f7b497081643",
90
+ "identifier": "south-australia",
91
+ "name": "South Australia",
92
+ "updated_at": "2015-05-04T08:08:27Z"
93
+ },
94
+ {
95
+ "created_at": "2015-05-04T08:08:27Z",
96
+ "id": "8acd8555-1e9c-4f12-add9-728904c655be",
97
+ "identifier": "south-coast-track",
98
+ "name": "South Coast Track",
99
+ "updated_at": "2015-05-04T08:08:27Z"
100
+ },
101
+ {
102
+ "created_at": "2015-05-04T08:08:27Z",
103
+ "id": "99d1e3ad-d1b1-4ff9-9f31-3f7295c1308f",
104
+ "identifier": "sydney",
105
+ "name": "Sydney",
106
+ "updated_at": "2015-05-04T08:08:27Z"
107
+ },
108
+ {
109
+ "created_at": "2015-05-04T08:08:27Z",
110
+ "id": "c149c800-c75d-4638-9baa-35a5abe4fc60",
111
+ "identifier": "tasmania",
112
+ "name": "Tasmania",
113
+ "updated_at": "2015-05-04T08:08:27Z"
114
+ },
115
+ {
116
+ "created_at": "2015-05-04T08:08:27Z",
117
+ "id": "37e30b6f-9f51-414e-8c76-bbdda12f11a7",
118
+ "identifier": "victoria",
119
+ "name": "Victoria",
120
+ "updated_at": "2015-05-04T09:28:55Z"
16
121
  }
17
122
  ]
18
123
  }
@@ -1,28 +1,16 @@
1
1
  RSpec.configure do |config|
2
2
  config.before(:each) do
3
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/)
4
+ stub_request(:get, /.*\.hotchoc\.(io|dev|test)\/api\/albums\/?(\?.*)?\z/)
8
5
  .to_return(status: 200, body: File.read(response_stub('albums')))
9
6
 
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/)
7
+ stub_request(:get, /.*\.hotchoc\.(io|dev|test)\/api\/pages\/?(\?.*)?\z/)
14
8
  .to_return(status: 200, body: File.read(response_stub('pages')))
15
9
 
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/)
10
+ stub_request(:get, /.*\.hotchoc\.(io|dev|test)\/api\/posts\/?(\?.*)?\z/)
20
11
  .to_return(status: 200, body: File.read(response_stub('posts')))
21
12
 
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/)
13
+ stub_request(:get, /.*\.hotchoc\.(io|dev|test)\/api\/topics\/?(\?.*)?\z/)
26
14
  .to_return(status: 200, body: File.read(response_stub('topics')))
27
15
 
28
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotchoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.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-07-27 00:00:00.000000000 Z
11
+ date: 2015-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -16,71 +16,85 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.6.9
19
+ version: 0.7.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.6.9
26
+ version: 0.7.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.5'
33
+ version: '1.7'
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
- version: '1.5'
40
+ version: '1.7'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.3'
47
+ version: '10.4'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.3'
54
+ version: '10.4'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.0'
61
+ version: '3.2'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.0'
68
+ version: '3.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.24.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.24.1
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: webmock
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: '1.18'
89
+ version: '1.20'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
- version: '1.18'
83
- description: Official Ruby wrapper for the Hotchoc API.
96
+ version: '1.20'
97
+ description: Ruby wrapper for the Hotchoc API.
84
98
  email:
85
99
  - matthias.siegel@gmail.com
86
100
  executables: []
@@ -89,6 +103,7 @@ extra_rdoc_files: []
89
103
  files:
90
104
  - ".gitignore"
91
105
  - ".rspec"
106
+ - ".rubocop.yml"
92
107
  - CHANGELOG.md
93
108
  - Gemfile
94
109
  - LICENSE.md
@@ -101,6 +116,16 @@ files:
101
116
  - lib/hotchoc/configuration.rb
102
117
  - lib/hotchoc/errors.rb
103
118
  - lib/hotchoc/fetcher.rb
119
+ - lib/hotchoc/presenters/album.rb
120
+ - lib/hotchoc/presenters/base.rb
121
+ - lib/hotchoc/presenters/blocks/base.rb
122
+ - lib/hotchoc/presenters/blocks/image.rb
123
+ - lib/hotchoc/presenters/blocks/text.rb
124
+ - lib/hotchoc/presenters/file.rb
125
+ - lib/hotchoc/presenters/page.rb
126
+ - lib/hotchoc/presenters/post.rb
127
+ - lib/hotchoc/presenters/thumbnail.rb
128
+ - lib/hotchoc/presenters/topic.rb
104
129
  - lib/hotchoc/version.rb
105
130
  - spec/hotchoc/api_spec.rb
106
131
  - spec/hotchoc/client_spec.rb
@@ -108,13 +133,10 @@ files:
108
133
  - spec/hotchoc/main_spec.rb
109
134
  - spec/spec_helper.rb
110
135
  - spec/support/helpers.rb
111
- - spec/support/responses/album.json
136
+ - spec/support/matchers.rb
112
137
  - spec/support/responses/albums.json
113
- - spec/support/responses/page.json
114
138
  - spec/support/responses/pages.json
115
- - spec/support/responses/post.json
116
139
  - spec/support/responses/posts.json
117
- - spec/support/responses/topic.json
118
140
  - spec/support/responses/topics.json
119
141
  - spec/support/stubs.rb
120
142
  homepage: https://github.com/choc/hotchoc-ruby
@@ -137,10 +159,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
159
  version: '0'
138
160
  requirements: []
139
161
  rubyforge_project:
140
- rubygems_version: 2.2.2
162
+ rubygems_version: 2.4.5
141
163
  signing_key:
142
164
  specification_version: 4
143
- summary: Official Ruby wrapper for the Hotchoc API.
165
+ summary: Ruby wrapper for the Hotchoc API.
144
166
  test_files:
145
167
  - spec/hotchoc/api_spec.rb
146
168
  - spec/hotchoc/client_spec.rb
@@ -148,12 +170,9 @@ test_files:
148
170
  - spec/hotchoc/main_spec.rb
149
171
  - spec/spec_helper.rb
150
172
  - spec/support/helpers.rb
151
- - spec/support/responses/album.json
173
+ - spec/support/matchers.rb
152
174
  - spec/support/responses/albums.json
153
- - spec/support/responses/page.json
154
175
  - spec/support/responses/pages.json
155
- - spec/support/responses/post.json
156
176
  - spec/support/responses/posts.json
157
- - spec/support/responses/topic.json
158
177
  - spec/support/responses/topics.json
159
178
  - spec/support/stubs.rb