luis 0.1.0 → 0.1.1beta

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/lib/luis/version.rb +1 -1
  4. data/lib/luis.rb +12 -4
  5. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6030d5eed1e23c08ede610bf535cc646547c9052
4
- data.tar.gz: 30c2f208a3e38c1dcecb58857178cbfd0a9df25a
3
+ metadata.gz: d1004f19909ba7c65cc8c17b8b9d098c1a16d9a5
4
+ data.tar.gz: 1ff18bf12bff8de28dc5cd1931d2edabdb7cad49
5
5
  SHA512:
6
- metadata.gz: ab9c0a510d98b53df9e10d9c5a8f7c7c910b6bb6dee220f73ff248ba1ea33c8bece29d988992767733d69054666144bc6bb4ba40623fd5b1a17cf87b18bbbf7a
7
- data.tar.gz: 0b3c4df3c5a59a6c327d0c81bef5769ec8d574c1f96304d68443d19aafec0c743beba8bce6cbf7ca228287d5dc92e1dfeddbb4744c05d683bd9a050f6360c245
6
+ metadata.gz: 2574198b9f8136f10d44ed2429096648250bf91e32461fc6d0e9877b59b3bc126405614643240d3c6c33670a34450f1f7c94eb2b8da5e54c5d55761e9387915f
7
+ data.tar.gz: 5d1631d943c5abf0a7c8af2fc72b77670b2c08cca829a4fa1cfbad034df58e4e884ebe7e34e9e36638ecd12521707cf5b0ab3608ad92e7837ff67c77f9989641
data/README.md CHANGED
@@ -24,6 +24,7 @@ Or install it yourself as:
24
24
  Luis.configure do |config|
25
25
  config.id = "<id>"
26
26
  config.subscription_key ="<key>"
27
+ config.preview_mod = true
27
28
  end
28
29
  ```
29
30
 
data/lib/luis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Luis
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1beta'.freeze
3
3
  end
data/lib/luis.rb CHANGED
@@ -12,9 +12,15 @@ module Luis
12
12
 
13
13
  include HTTParty
14
14
  class << self
15
- attr_accessor :id, :subscription_key
15
+ attr_accessor :id, :subscription_key, :is_preview_mod, :is_verbose
16
+ end
17
+ API_BASE_URI = 'https://api.projectoxford.ai/luis/v1/application'.freeze
18
+
19
+ def self.api_uri
20
+ uri = API_BASE_URI
21
+ uri += '/preview' if is_preview_mod
22
+ uri
16
23
  end
17
- API_URL = 'https://api.projectoxford.ai/luis/v1/application/preview'.freeze
18
24
 
19
25
  # Query method for the luis
20
26
  #
@@ -24,7 +30,7 @@ module Luis
24
30
  options = default_options
25
31
  options['q'] = query
26
32
  options['contextId'] = context_id if context_id
27
- response = get(API_URL, query: options)
33
+ response = get(api_uri, query: options)
28
34
  Result.new JSON.parse(response.body)
29
35
  end
30
36
 
@@ -39,6 +45,8 @@ module Luis
39
45
  end
40
46
 
41
47
  def self.default_options
42
- { 'id' => id, 'subscription-key' => subscription_key }
48
+ options = { 'id' => id, 'subscription-key' => subscription_key }
49
+ options['verbose'] = true if is_verbose
50
+ options
43
51
  end
44
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aboobacker MK
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-29 00:00:00.000000000 Z
11
+ date: 2016-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -110,9 +110,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  requirements:
113
- - - ">="
113
+ - - ">"
114
114
  - !ruby/object:Gem::Version
115
- version: '0'
115
+ version: 1.3.1
116
116
  requirements: []
117
117
  rubyforge_project:
118
118
  rubygems_version: 2.6.6