Socket
Book a DemoInstallSign in
Socket

postwave-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postwave-client

0.0.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

Postwave Ruby Client 🌊

A Ruby client for displaying Postwave blogs.

Installation

gem install postwave-client

Usage

Create a Postwave Client

postwave_client = Postwave::Client.new("path/to/config/postwave.yaml")

If you'd like to preload all the posts:

postwave_client = Postwave::Client.new("path/to/config/postwave.yaml", preload: true)

Get a Single Post

Pass in the stub (the filename without '.md') for the post.

post = postwave_client.post("my-great-post")

# <Postwave::Post title="My Great Post", date=<Time ...>, tags=["tag1"], body="bla bla bla..">

puts post.title
# "My Great Post"

Get a Collection of Posts

This will give you a list of posts for displaying on a page.

You can also filter by tags and specify offsets and limits (useful for pagination).

posts = postwave_client.posts

# [<Postwave::Post ...>, <Postwave::Post ...>, ...]

tagged_posts = postwave_client.posts(tag: "lizards")

page2_posts = postwave_client.posts(offset: 10, limit: 10)

Posts will be in reverse chronological order.

Get an Index of Posts

This will give you a quick list of post summaries containing the title, date, and stub, useful for building an archive page or quick index of posts.

You can also specify offsets and limits (useful for pagination).

index = postwave_client(index)

# [<Postwave::PostStub title="My Great Post", date=<Time ...>, stub="my-great-post">, <Postwave::PostStub ...>, ...]

puts index.first.stub
# my-great-post

page2_index = postwave_client.index(offset: 10, limit: 10)

Index will be in reverse chronological order.

Get Tags Used In the Blog

tags = postwave_client.tags

# ["tag1", "tag2", "another-tag"]

Get Details For A Tag

tag = postwave_clinet.tag("tag1")

# <Postwave::Tag tile="tag1", count=1, post_slugs=["my-great-post"]>

Want To Know More About Postwave?

Check out the Postwave repo.

Development

Run the Tests!

rake test

FAQs

Package last updated on 12 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.