ghost_rb 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2950b93ddb836d175974d4c592411f479fffd479
4
+ data.tar.gz: 5f770516776da3f381c15649bd749c62b7e6549b
5
+ SHA512:
6
+ metadata.gz: 95d4b0c061dd1de4630de52d099fed5787a43b9b974515474966f44ee5fb6162723f24f6d5e9a112b37f855b2c7f2dbecc9d2d3bc187e0aa9f30081aa2d00b09
7
+ data.tar.gz: 4f674f52a9eb2584c0030fc3949fa2e63ce396e6753d21a96b5d9042d51183fc043da6ab163db56ec8ee838c848948b565b73be698ededade7a503887844aed2
data/.codeclimate.yml ADDED
@@ -0,0 +1,15 @@
1
+ engines:
2
+ rubocop:
3
+ enabled: true
4
+ ratings:
5
+ paths:
6
+ - lib/**
7
+ - "**.rb"
8
+ exclude_paths:
9
+ - "*.gemspec"
10
+ - "*.md"
11
+ - Rakefile
12
+ - Gemfile
13
+ - docs/**/*
14
+ - task/**/*
15
+ - coverage/**/*
data/.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
13
+
14
+ # VS Code files
15
+ .vscode
16
+
17
+ # Gem files
18
+ *.gem
19
+
20
+ # Jekyll
21
+ _site
22
+ .sass-cache
23
+ .jekyll-metadata
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,22 @@
1
+ AllCops:
2
+ Exclude:
3
+ - bin/**/*
4
+ - tasks/**/*
5
+ TargetRubyVersion: 2.4
6
+ Metrics/MethodLength:
7
+ Max: 30
8
+ CountComments: false
9
+ Metrics/AbcSize:
10
+ Exclude:
11
+ - spec/**/*
12
+ Max: 20
13
+ Metrics/CyclomaticComplexity:
14
+ Max: 10
15
+ Metrics/BlockLength:
16
+ Exclude:
17
+ - spec/**/*
18
+ Metrics/LineLength:
19
+ Exclude:
20
+ - spec/**/*
21
+ Style/FrozenStringLiteralComment:
22
+ EnforcedStyle: always
data/.travis.yml ADDED
@@ -0,0 +1,36 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.0
5
+ env:
6
+ global:
7
+ - CC_TEST_REPORTER_ID=a56fc1316eb9869f9ef69353912ad37abd138ff4a594b6290c9830718ae5cd81
8
+ before_install: gem install bundler -v 1.14.4
9
+ before_script:
10
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11
+ - chmod +x ./cc-test-reporter
12
+ - ./cc-test-reporter before-build
13
+ script:
14
+ - bundle exec rspec
15
+ after_script:
16
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
17
+ before_deploy:
18
+ - cat ./README.md >> ./docs/index.md
19
+ deploy:
20
+ - provider: pages
21
+ skip_cleanup: true
22
+ github_token: "$GITHUB_TOKEN"
23
+ local_dir: "./docs"
24
+ target_branch: gh-pages
25
+ on:
26
+ branch:
27
+ - develop
28
+ - master
29
+ - provider: rubygems
30
+ api_key:
31
+ secure: aZt6t60GH8ISKGw+AY/Pik1rgvYWJW0uc6Co35OlOBTNs3YitHbk5sMTq2wP0bs6qvJyPJDedAXU5F1ZEEuWz6m2wScD+Ld1hscwadNA7xcdQX6VWsJqR4biq4MkR5fLmQnTa+cDcG476J9+vL7qHJPNuiN+3jm2ODhvFlmtwtx/nXv1KgoYgpUVKBENuaVkL/7zGiFTs0nc4R32U7HGfzOGg7uXKK2JYsW5PN3KpeYVM3Df8qemVIhT6InBZvGovN1PfQ4oFV25VPLCLrQPY+qCJt54LvJQAhZVPYQaBowm1Pgg6tPA3dIHAaHI3iPKi1hOFQLoSci70OmQb7My38gWU0ARkq02eiR0uZrhkcYOuVqVU4quOGuEpagqDuWnXIz7LfnZAzfqers//TKFl/o2sLvOEfCSMZFiby6f9vk87SLyRCcsYtxYQfRBTanCgB2AlOKalSZ+WzQ4F8LvZJZbgxEoN9ul1MxHP1SeSwDlBHpXutxrX+EOfP8b/Bvi0nu8Xq2Y7HbPtfiVOXOM9aiUqWJDVaf+S5zhWd72IS54JUcCgIjeB8ryK9k1vSnfvm1VMOo7illN4MxfNNYMQk5zSeyhOLzTIQvFgALrJDGk4JtZjire0BFWUkrtEqoiD1ZuMIKWVLZbIBBMskl+bkf+VvwiubX6LibVAC4itlk=
32
+ gem: ghost_rb
33
+ on:
34
+ tags: true
35
+ repo: renehernandez/ghost_rb
36
+ branch: master
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ghost_rb.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 TODO: Write your name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # GhostRb [![Build Status](https://travis-ci.org/renehernandez/ghost_rb.svg)](https://travis-ci.org/renehernandez/ghost_rb) [![Code Climate](https://codeclimate.com/github/renehernandez/ghost_rb/badges/gpa.svg)](https://codeclimate.com/github/renehernandez/ghost_rb) [![Test Coverage](https://codeclimate.com/github/renehernandez/ghost_rb/badges/coverage.svg)](https://codeclimate.com/github/renehernandez/ghost_rb/coverage)
2
+
3
+ GhostRb is a simple REST API client to interact with a given Ghost blog. As of now, it supports Client Authentication, which means it can only query public data.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'ghost_rb'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install ghost_rb
20
+
21
+ ## Usage
22
+
23
+ #### Client
24
+
25
+ To create a new client:
26
+
27
+ ```ruby
28
+ client = GhostRb::Client.new('URL', 'CLIENT_ID'], 'CLIENT_SECRET')
29
+ ```
30
+
31
+ #### Posts
32
+
33
+ To get a list with all the blog posts, simply write:
34
+
35
+ ```ruby
36
+ status, posts = client.get_posts
37
+ ```
38
+
39
+ You can change the *limit* (defaults to all) of posts to return for the query and whether to include *author* and *tags* information.
40
+
41
+ #### Tags
42
+
43
+ To get a list with all the tags, write instead:
44
+
45
+ ```ruby
46
+ status, tags = client.get_tags
47
+ ```
48
+
49
+ You can change the *limit* (defaults to all) of tags to return for the query and whether to include *count.posts* information.
50
+
51
+
52
+ ## Development
53
+
54
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
55
+
56
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
57
+
58
+ ## Contributing
59
+
60
+ Bug reports and pull requests are welcome on GitHub at https://github.com/renehernandez/ghost_rb.
61
+
62
+
63
+ ## License
64
+
65
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
66
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "ghost_rb"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/httpclient ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby_executable_hooks
2
+ #
3
+ # This file was generated by RubyGems.
4
+ #
5
+ # The application 'httpclient' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'rubygems'
10
+
11
+ version = ">= 0.a"
12
+
13
+ if ARGV.first
14
+ str = ARGV.first
15
+ str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
16
+ if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
17
+ version = $1
18
+ ARGV.shift
19
+ end
20
+ end
21
+
22
+ load Gem.activate_bin_path('httpclient', 'httpclient', version)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/docs/404.html ADDED
@@ -0,0 +1,24 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <style type="text/css" media="screen">
6
+ .container {
7
+ margin: 10px auto;
8
+ max-width: 600px;
9
+ text-align: center;
10
+ }
11
+ h1 {
12
+ margin: 30px 0;
13
+ font-size: 4em;
14
+ line-height: 1;
15
+ letter-spacing: -1px;
16
+ }
17
+ </style>
18
+
19
+ <div class="container">
20
+ <h1>404</h1>
21
+
22
+ <p><strong>Page not found :(</strong></p>
23
+ <p>The requested page could not be found.</p>
24
+ </div>
data/docs/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ # If you want to use GitHub Pages, remove the "gem "jekyll"" above and
4
+ # uncomment the line below. To upgrade, run `bundle update github-pages`.
5
+ gem "github-pages", group: :jekyll_plugins
6
+
7
+ # If you have any plugins, put them here!
8
+ group :jekyll_plugins do
9
+ gem "jekyll-feed", "~> 0.6"
10
+ end
11
+
data/docs/Gemfile.lock ADDED
@@ -0,0 +1,219 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ activesupport (4.2.8)
5
+ i18n (~> 0.7)
6
+ minitest (~> 5.1)
7
+ thread_safe (~> 0.3, >= 0.3.4)
8
+ tzinfo (~> 1.1)
9
+ addressable (2.5.2)
10
+ public_suffix (>= 2.0.2, < 4.0)
11
+ coffee-script (2.4.1)
12
+ coffee-script-source
13
+ execjs
14
+ coffee-script-source (1.11.1)
15
+ colorator (1.1.0)
16
+ ethon (0.10.1)
17
+ ffi (>= 1.3.0)
18
+ execjs (2.7.0)
19
+ faraday (0.13.1)
20
+ multipart-post (>= 1.2, < 3)
21
+ ffi (1.9.18)
22
+ forwardable-extended (2.6.0)
23
+ gemoji (3.0.0)
24
+ github-pages (161)
25
+ activesupport (= 4.2.8)
26
+ github-pages-health-check (= 1.3.5)
27
+ jekyll (= 3.5.2)
28
+ jekyll-avatar (= 0.5.0)
29
+ jekyll-coffeescript (= 1.0.2)
30
+ jekyll-default-layout (= 0.1.4)
31
+ jekyll-feed (= 0.9.2)
32
+ jekyll-gist (= 1.4.1)
33
+ jekyll-github-metadata (= 2.9.3)
34
+ jekyll-mentions (= 1.2.0)
35
+ jekyll-optional-front-matter (= 0.2.0)
36
+ jekyll-paginate (= 1.1.0)
37
+ jekyll-readme-index (= 0.1.0)
38
+ jekyll-redirect-from (= 0.12.1)
39
+ jekyll-relative-links (= 0.4.1)
40
+ jekyll-sass-converter (= 1.5.0)
41
+ jekyll-seo-tag (= 2.3.0)
42
+ jekyll-sitemap (= 1.1.1)
43
+ jekyll-swiss (= 0.4.0)
44
+ jekyll-theme-architect (= 0.1.0)
45
+ jekyll-theme-cayman (= 0.1.0)
46
+ jekyll-theme-dinky (= 0.1.0)
47
+ jekyll-theme-hacker (= 0.1.0)
48
+ jekyll-theme-leap-day (= 0.1.0)
49
+ jekyll-theme-merlot (= 0.1.0)
50
+ jekyll-theme-midnight (= 0.1.0)
51
+ jekyll-theme-minimal (= 0.1.0)
52
+ jekyll-theme-modernist (= 0.1.0)
53
+ jekyll-theme-primer (= 0.5.2)
54
+ jekyll-theme-slate (= 0.1.0)
55
+ jekyll-theme-tactile (= 0.1.0)
56
+ jekyll-theme-time-machine (= 0.1.0)
57
+ jekyll-titles-from-headings (= 0.4.0)
58
+ jemoji (= 0.8.0)
59
+ kramdown (= 1.13.2)
60
+ liquid (= 4.0.0)
61
+ listen (= 3.0.6)
62
+ mercenary (~> 0.3)
63
+ minima (= 2.1.1)
64
+ rouge (= 1.11.1)
65
+ terminal-table (~> 1.4)
66
+ github-pages-health-check (1.3.5)
67
+ addressable (~> 2.3)
68
+ net-dns (~> 0.8)
69
+ octokit (~> 4.0)
70
+ public_suffix (~> 2.0)
71
+ typhoeus (~> 0.7)
72
+ html-pipeline (2.7.1)
73
+ activesupport (>= 2)
74
+ nokogiri (>= 1.4)
75
+ i18n (0.8.6)
76
+ jekyll (3.5.2)
77
+ addressable (~> 2.4)
78
+ colorator (~> 1.0)
79
+ jekyll-sass-converter (~> 1.0)
80
+ jekyll-watch (~> 1.1)
81
+ kramdown (~> 1.3)
82
+ liquid (~> 4.0)
83
+ mercenary (~> 0.3.3)
84
+ pathutil (~> 0.9)
85
+ rouge (~> 1.7)
86
+ safe_yaml (~> 1.0)
87
+ jekyll-avatar (0.5.0)
88
+ jekyll (~> 3.0)
89
+ jekyll-coffeescript (1.0.2)
90
+ coffee-script (~> 2.2)
91
+ coffee-script-source (~> 1.11.1)
92
+ jekyll-default-layout (0.1.4)
93
+ jekyll (~> 3.0)
94
+ jekyll-feed (0.9.2)
95
+ jekyll (~> 3.3)
96
+ jekyll-gist (1.4.1)
97
+ octokit (~> 4.2)
98
+ jekyll-github-metadata (2.9.3)
99
+ jekyll (~> 3.1)
100
+ octokit (~> 4.0, != 4.4.0)
101
+ jekyll-mentions (1.2.0)
102
+ activesupport (~> 4.0)
103
+ html-pipeline (~> 2.3)
104
+ jekyll (~> 3.0)
105
+ jekyll-optional-front-matter (0.2.0)
106
+ jekyll (~> 3.0)
107
+ jekyll-paginate (1.1.0)
108
+ jekyll-readme-index (0.1.0)
109
+ jekyll (~> 3.0)
110
+ jekyll-redirect-from (0.12.1)
111
+ jekyll (~> 3.3)
112
+ jekyll-relative-links (0.4.1)
113
+ jekyll (~> 3.3)
114
+ jekyll-sass-converter (1.5.0)
115
+ sass (~> 3.4)
116
+ jekyll-seo-tag (2.3.0)
117
+ jekyll (~> 3.3)
118
+ jekyll-sitemap (1.1.1)
119
+ jekyll (~> 3.3)
120
+ jekyll-swiss (0.4.0)
121
+ jekyll-theme-architect (0.1.0)
122
+ jekyll (~> 3.5)
123
+ jekyll-seo-tag (~> 2.0)
124
+ jekyll-theme-cayman (0.1.0)
125
+ jekyll (~> 3.5)
126
+ jekyll-seo-tag (~> 2.0)
127
+ jekyll-theme-dinky (0.1.0)
128
+ jekyll (~> 3.5)
129
+ jekyll-seo-tag (~> 2.0)
130
+ jekyll-theme-hacker (0.1.0)
131
+ jekyll (~> 3.5)
132
+ jekyll-seo-tag (~> 2.0)
133
+ jekyll-theme-leap-day (0.1.0)
134
+ jekyll (~> 3.5)
135
+ jekyll-seo-tag (~> 2.0)
136
+ jekyll-theme-merlot (0.1.0)
137
+ jekyll (~> 3.5)
138
+ jekyll-seo-tag (~> 2.0)
139
+ jekyll-theme-midnight (0.1.0)
140
+ jekyll (~> 3.5)
141
+ jekyll-seo-tag (~> 2.0)
142
+ jekyll-theme-minimal (0.1.0)
143
+ jekyll (~> 3.5)
144
+ jekyll-seo-tag (~> 2.0)
145
+ jekyll-theme-modernist (0.1.0)
146
+ jekyll (~> 3.5)
147
+ jekyll-seo-tag (~> 2.0)
148
+ jekyll-theme-primer (0.5.2)
149
+ jekyll (~> 3.5)
150
+ jekyll-github-metadata (~> 2.9)
151
+ jekyll-seo-tag (~> 2.2)
152
+ jekyll-theme-slate (0.1.0)
153
+ jekyll (~> 3.5)
154
+ jekyll-seo-tag (~> 2.0)
155
+ jekyll-theme-tactile (0.1.0)
156
+ jekyll (~> 3.5)
157
+ jekyll-seo-tag (~> 2.0)
158
+ jekyll-theme-time-machine (0.1.0)
159
+ jekyll (~> 3.5)
160
+ jekyll-seo-tag (~> 2.0)
161
+ jekyll-titles-from-headings (0.4.0)
162
+ jekyll (~> 3.3)
163
+ jekyll-watch (1.5.0)
164
+ listen (~> 3.0, < 3.1)
165
+ jemoji (0.8.0)
166
+ activesupport (~> 4.0)
167
+ gemoji (~> 3.0)
168
+ html-pipeline (~> 2.2)
169
+ jekyll (>= 3.0)
170
+ kramdown (1.13.2)
171
+ liquid (4.0.0)
172
+ listen (3.0.6)
173
+ rb-fsevent (>= 0.9.3)
174
+ rb-inotify (>= 0.9.7)
175
+ mercenary (0.3.6)
176
+ mini_portile2 (2.3.0)
177
+ minima (2.1.1)
178
+ jekyll (~> 3.3)
179
+ minitest (5.10.3)
180
+ multipart-post (2.0.0)
181
+ net-dns (0.8.0)
182
+ nokogiri (1.8.1)
183
+ mini_portile2 (~> 2.3.0)
184
+ octokit (4.7.0)
185
+ sawyer (~> 0.8.0, >= 0.5.3)
186
+ pathutil (0.14.0)
187
+ forwardable-extended (~> 2.6)
188
+ public_suffix (2.0.5)
189
+ rb-fsevent (0.10.2)
190
+ rb-inotify (0.9.10)
191
+ ffi (>= 0.5.0, < 2)
192
+ rouge (1.11.1)
193
+ safe_yaml (1.0.4)
194
+ sass (3.5.1)
195
+ sass-listen (~> 4.0.0)
196
+ sass-listen (4.0.0)
197
+ rb-fsevent (~> 0.9, >= 0.9.4)
198
+ rb-inotify (~> 0.9, >= 0.9.7)
199
+ sawyer (0.8.1)
200
+ addressable (>= 2.3.5, < 2.6)
201
+ faraday (~> 0.8, < 1.0)
202
+ terminal-table (1.8.0)
203
+ unicode-display_width (~> 1.1, >= 1.1.1)
204
+ thread_safe (0.3.6)
205
+ typhoeus (0.8.0)
206
+ ethon (>= 0.8.0)
207
+ tzinfo (1.2.3)
208
+ thread_safe (~> 0.1)
209
+ unicode-display_width (1.3.0)
210
+
211
+ PLATFORMS
212
+ ruby
213
+
214
+ DEPENDENCIES
215
+ github-pages
216
+ jekyll-feed (~> 0.6)
217
+
218
+ BUNDLED WITH
219
+ 1.14.6