RecastAI 3.1.2 → 3.1.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: 4bfc3e21c8570d8547ca70b7c0d8d47d2896e4f8
4
- data.tar.gz: d024ce01230a62e182cefaf49495226c2ae00f05
3
+ metadata.gz: 69556aaa19b85c4393839be03e8170989e03d61c
4
+ data.tar.gz: 83efaa654755c9ce778fd0d45053f0397bb7dade
5
5
  SHA512:
6
- metadata.gz: e73ebcae3fc16e8f34bb02656fa908f96b6f30374f429b68b571cab3873ee34af9dbfbdacff26a2c38db26a47e6956e8979861cd2d5a266a0cc045d37d98c0a6
7
- data.tar.gz: db01f55fa51277231e974650cde86aafdef5e320f9c71f2537c19d2aa880206509e55589912183ac2c52f3f5c53bc2119bd312cde253990194781e253505f6a1
6
+ metadata.gz: aa44fa0826046e31902e2baf5fe9b8c50eeeb774077a5aaa0ee78ed92aa89f82f439e3c538fa737166f8ca30ffc657ec006a28d45838e00cb1d253919e8b1f06
7
+ data.tar.gz: c8b7d198b0d1537ae68720558fc19fc217300dae0efd320ed3d35184c33ef2f19e119e653cac8f39c037c3cd78d9f5077eea8e0bf7a16baa0082b61e55ce5db1
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+
5
+ require_relative '../lib/recastai'
6
+
7
+ options = {}
8
+ OptionParser.new do |opts|
9
+ opts.banner = "Usage: recastcli -[-t]oken TOKEN <--text TEXT | --file FILE>"
10
+
11
+ opts.on('-t', '--token=TOKEN', String, "the request token to use for the call") do |t|
12
+ options[:token] = t
13
+ end
14
+
15
+ opts.on('--text=TEXT', String, 'the text to process') do |t|
16
+ options[:text] = t
17
+ end
18
+
19
+ opts.on('--file=FILE', String, 'the file to process') do |f|
20
+ options[:file] = f
21
+ end
22
+
23
+ opts.on("-h", "--help", "Prints this help") do
24
+ puts opts
25
+ exit
26
+ end
27
+ end.parse!
28
+
29
+ client = RecastAI::Client.new(options[:token])
30
+
31
+ if options[:text]
32
+ response = client.request.analyse_text(options[:text])
33
+ elsif options[:file]
34
+ response = client.request.analyse_file(options[:file])
35
+ else
36
+ raise OptionParser::MissingArgument.new('You need to give either --text or --file')
37
+ end
38
+
39
+ puts response.intent
@@ -5,8 +5,8 @@ module RecastAI
5
5
  # Versioning
6
6
  MAJOR = '3'.freeze
7
7
  MINOR = '1'.freeze
8
- MICRO = '2'.freeze
9
- VERSION = "#{MAJOR}.#{MINOR}.#{MICRO}".freeze
8
+ PATCH = '3'.freeze
9
+ VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}".freeze
10
10
 
11
11
  # Endpoints
12
12
  TRAIN_ENDPOINT = 'https://api.recast.ai/v2/'.freeze
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.authors = ['Paul Renvoisé']
18
18
  spec.email = 'paul.renvoise@recast.ai'
19
19
  spec.files = `git ls-files -z`.split("\x0").reject{ |f| f.match(%r{^(test|spec|features)/}) }
20
- spec.executables = ['text', 'file']
20
+ spec.executables = ['recastcli']
21
21
  spec.require_paths = ['lib']
22
22
  spec.required_ruby_version = '>= 2.2'
23
23
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RecastAI
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Renvoisé
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-07 00:00:00.000000000 Z
11
+ date: 2017-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -98,8 +98,7 @@ description: Recast.AI official SDK for Ruby. Allows you to make requests to you
98
98
  bots.
99
99
  email: paul.renvoise@recast.ai
100
100
  executables:
101
- - text
102
- - file
101
+ - recastcli
103
102
  extensions: []
104
103
  extra_rdoc_files: []
105
104
  files:
@@ -110,8 +109,7 @@ files:
110
109
  - Gemfile.lock
111
110
  - LICENSE
112
111
  - README.md
113
- - bin/file
114
- - bin/text
112
+ - bin/recastcli
115
113
  - lib/recastai.rb
116
114
  - lib/recastai/apis/connect/connect.rb
117
115
  - lib/recastai/apis/connect/message.rb
data/bin/file DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require_relative '../lib/recastai'
4
-
5
- raise 'You must provide a token for your sentence to be processed' unless ARGV.any? && !ARGV[0].nil?
6
- raise 'You must provide a voice file to be processed' unless ARGV.any? && !ARGV[1].nil?
7
-
8
- client = RecastAI::Client.new(ARGV[0])
9
- response = client.file_request(ARGV[1])
10
-
11
- ap JSON.parse(response.raw)
data/bin/text DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require_relative '../lib/recastai'
4
-
5
- raise 'You must provide a token for your sentence to be processed' unless ARGV.any? && !ARGV[0].nil?
6
- raise 'You must provide a sentence to be processed' unless ARGV.any? && !ARGV[1].nil?
7
-
8
- client = RecastAI::Client.new(ARGV[0])
9
- response = client.text_request(ARGV[1])
10
-
11
- ap JSON.parse(response.raw)