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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d489e8655ff9018f56d700f3d6803b7a766d6ba
4
- data.tar.gz: 96c3637e93fa96babcf3794bef4708597ac07407
3
+ metadata.gz: f9cf22832b7f45e15804321820a3d0ee122a246c
4
+ data.tar.gz: 2f25df4737785656198385d76a1ef750f9dd8693
5
5
  SHA512:
6
- metadata.gz: 235c0f2b2a6543153780d6a90107426fe8cba33cc22661a928edafe0c0e2f815bd008907e044eda7d97bf024f2cc5883b761e2f07ca4042b9b34a8aaabc60cae
7
- data.tar.gz: ccf057c48a4e32b1c5fa690f0b563f16782f131e86bfcf2b049fc1cd3309590e178b9922f43c2d7d05cb7685218cd5971ecdf761674b96e058642c4d701673ca
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.1...HEAD)
4
+ ## [Unreleased](https://github.com/automatedinsightsinc/wordsmith-ruby-sdk/compare/v1.0.3...HEAD)
5
5
 
6
- ## [1.0.2](https://github.com/AutomatedInsightsInc/wordsmith-ruby-sdk/tree/v1.0.1) - 2016-04-27
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
- [![Code Climate](https://codeclimate.com/repos/5720c4b8e7b46b37e1002bfe/badges/3c997ae42848b5faf8ad/gpa.svg)](https://codeclimate.com/repos/5720c4b8e7b46b37e1002bfe/feed)
2
- [![Test Coverage](https://codeclimate.com/repos/5720c4b8e7b46b37e1002bfe/badges/3c997ae42848b5faf8ad/coverage.svg)](https://codeclimate.com/repos/5720c4b8e7b46b37e1002bfe/coverage)
3
- [![Issue Count](https://codeclimate.com/repos/5720c4b8e7b46b37e1002bfe/badges/3c997ae42848b5faf8ad/issue_count.svg)](https://codeclimate.com/repos/5720c4b8e7b46b37e1002bfe/feed)
1
+ [![Code
2
+ Climate](https://codeclimate.com/github/AutomatedInsightsInc/wordsmith-ruby-sdk/badges/gpa.svg)](https://codeclimate.com/github/AutomatedInsightsInc/wordsmith-ruby-sdk)
3
+ [![Test
4
+ Coverage](https://codeclimate.com/github/AutomatedInsightsInc/wordsmith-ruby-sdk/badges/coverage.svg)](https://codeclimate.com/github/AutomatedInsightsInc/wordsmith-ruby-sdk/coverage)
5
+ [![Issue
6
+ Count](https://codeclimate.com/github/AutomatedInsightsInc/wordsmith-ruby-sdk/badges/issue_count.svg)](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
- require "wordsmith/sdk"
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.
@@ -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 kword arguments" unless [name, slug, templates].all?
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
@@ -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 kword arguments" unless [name, slug, project].all?
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
@@ -1,3 +1,3 @@
1
1
  module Wordsmith
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
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.2
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-04-27 00:00:00.000000000 Z
11
+ date: 2016-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler