wordsmith-ruby-sdk 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -2
- data/README.md +18 -3
- data/bin/console +1 -1
- data/lib/wordsmith/project.rb +4 -11
- data/lib/wordsmith/template.rb +2 -2
- data/lib/wordsmith/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9cf22832b7f45e15804321820a3d0ee122a246c
|
4
|
+
data.tar.gz: 2f25df4737785656198385d76a1ef750f9dd8693
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43b6f9e096c609d3f216357872aaacc7a63992ab4e8430cb483bbdaa5d8e087272a2bda84568c5a445a22af143ee2269011bb244fa6f64b67e6fde5ec3e6062d
|
7
|
+
data.tar.gz: 358649643caa4c4b15c6f88a5b7cdc4ac2096474179df23d672f38e43026ebf430caa41dff9ab4565ea1d8f1902a282acc10f74f48b35d8de81ecea1d3f45404
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
|
3
3
|
|
4
|
-
## [Unreleased](https://github.com/automatedinsightsinc/wordsmith-ruby-sdk/compare/v1.0.
|
4
|
+
## [Unreleased](https://github.com/automatedinsightsinc/wordsmith-ruby-sdk/compare/v1.0.3...HEAD)
|
5
5
|
|
6
|
-
## [1.0.
|
6
|
+
## [1.0.3](https://github.com/automatedinsightsinc/wordsmith-ruby-sdk/compare/v1.0.2...v1.0.3)
|
7
|
+
##### Changed
|
8
|
+
- Updated for API v1.1
|
9
|
+
- Fix to handle additional fields returned by the API.
|
10
|
+
|
11
|
+
## [1.0.2](https://github.com/AutomatedInsightsInc/wordsmith-ruby-sdk/tree/v1.0.2) - 2016-04-27
|
7
12
|
##### Added
|
8
13
|
- Codeclimate test coverage reporter with dotenv for codeclimate token.
|
9
14
|
- Required ruby version in gemspec.
|
data/README.md
CHANGED
@@ -1,8 +1,23 @@
|
|
1
|
-
[](https://codeclimate.com/github/AutomatedInsightsInc/wordsmith-ruby-sdk)
|
3
|
+
[](https://codeclimate.com/github/AutomatedInsightsInc/wordsmith-ruby-sdk/coverage)
|
5
|
+
[](https://codeclimate.com/github/AutomatedInsightsInc/wordsmith-ruby-sdk)
|
4
7
|
|
5
8
|
# Wordsmith SDK for Ruby
|
9
|
+
## Intro to Wordsmith
|
10
|
+
|
11
|
+
[Wordsmith](http://wordsmith.automatedinsights.com) makes it easy to generate thousands of stories, reports, and articles
|
12
|
+
in the time it takes to write just one. Wordsmith is a natural language
|
13
|
+
generation tool that enables users to turn data into text using dynamic
|
14
|
+
templates. The platform is easy to learn, and powerful enough to make each piece
|
15
|
+
of content totally unique.
|
16
|
+
|
17
|
+
The Wordsmith API allows developers to generate new content using the Templates
|
18
|
+
created in the Wordsmith web app by users at your company. Developers can use
|
19
|
+
the API to send new data which will trigger the generation of new text content.
|
20
|
+
You have complete control over when you generate and use the content.
|
6
21
|
|
7
22
|
## Installation
|
8
23
|
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require "bundler/setup"
|
4
|
-
|
4
|
+
require_relative "../lib/wordsmith-ruby-sdk"
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
data/lib/wordsmith/project.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Wordsmith::Project
|
2
|
-
attr_reader :name, :slug, :templates
|
2
|
+
attr_reader :name, :slug, :schema, :templates
|
3
3
|
|
4
4
|
def self.all
|
5
5
|
projects_attributes = Wordsmith.client.get 'projects'
|
@@ -11,20 +11,13 @@ class Wordsmith::Project
|
|
11
11
|
project or fail %Q(Project not found with slug: "#{slug}")
|
12
12
|
end
|
13
13
|
|
14
|
-
def schema
|
15
|
-
@_schema ||=
|
16
|
-
begin
|
17
|
-
body = Wordsmith.client.get "projects/#{slug}"
|
18
|
-
body[:schema]
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
14
|
private
|
23
15
|
|
24
|
-
def initialize(name: nil, slug: nil, templates: nil)
|
25
|
-
raise "Missing required
|
16
|
+
def initialize(name: nil, slug: nil, schema: nil, templates: nil, **attributes)
|
17
|
+
raise "Missing required keyword arguments" unless [name, slug, templates].all?
|
26
18
|
@name = name
|
27
19
|
@slug = slug
|
20
|
+
@schema = schema
|
28
21
|
@templates = Wordsmith::TemplateCollection.new(
|
29
22
|
templates.map {|t| Wordsmith::Template.new project: self, **t})
|
30
23
|
end
|
data/lib/wordsmith/template.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
class Wordsmith::Template
|
2
2
|
attr_reader :name, :slug, :project
|
3
3
|
|
4
|
-
def initialize(name: nil, slug: nil, project: nil)
|
5
|
-
raise "Missing required
|
4
|
+
def initialize(name: nil, slug: nil, project: nil, **attributes)
|
5
|
+
raise "Missing required keyword arguments" unless [name, slug, project].all?
|
6
6
|
@name = name
|
7
7
|
@slug = slug
|
8
8
|
@project = project
|
data/lib/wordsmith/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wordsmith-ruby-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Tillery
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|