clarinet 0.5.1

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.
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Clarinet
4
+ VERSION = '0.5.1'
5
+ end
@@ -0,0 +1,12 @@
1
+ describe Clarinet::App do
2
+ describe '#initialize' do
3
+ it 'returns App instance with correct attr_accessors' do
4
+ app = Clarinet::App.new 'fake_api_key'
5
+
6
+ expect(app.client).to be_instance_of(Clarinet::Client)
7
+ expect(app.concepts).to be_instance_of(Clarinet::Concepts)
8
+ expect(app.models).to be_instance_of(Clarinet::Models)
9
+ expect(app.inputs).to be_instance_of(Clarinet::Inputs)
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ HTTP/1.1 200 OK
2
+ Access-Control-Allow-Headers: Content-Type,Accept,X-Requested-With,Content-Type,Accept-Encoding,X-CSRF-Token,Authorization,X-Clarifai-Application-Id,X-Clarifai-REST-API-Key,X-Clarifai-Session-Token,X-Clarifai-Client,X-Clarifai-Site
3
+ Access-Control-Allow-Methods: GET,HEAD,POST,PUT,PATCH,OPTIONS,DELETE
4
+ Access-Control-Allow-Origin: *
5
+ Content-Type: application/json; charset=UTF-8
6
+ Date: Mon, 21 Aug 2017 07:38:27 GMT
7
+ Server: nginx
8
+ Content-Length: 2244
9
+ Connection: keep-alive
10
+
11
+ {"status":{"code":10000,"description":"Ok"},"outputs":[{"id":"ecca089166024202a3ab26f0bf36860b","status":{"code":10000,"description":"Ok"},"created_at":"2017-08-21T07:38:27.521988261Z","model":{"id":"aaa03c23b3724a16a56b629203edc62c","name":"general-v1.3","created_at":"2016-03-09T17:11:39.608845Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"concept","type_ext":"concept"},"model_version":{"id":"aa9ca48295b37401f8af92ad1af0d91d","created_at":"2016-07-13T01:19:12.147644Z","status":{"code":21100,"description":"Model trained successfully"}},"display_name":"General"},"input":{"id":"b8b5075a1ff64e7fa088174e8378185a","data":{"image":{"url":"https://samples.clarifai.com/metro-north.jpg"}}},"data":{"concepts":[{"id":"ai_HLmqFqBf","name":"train","value":0.9987074,"app_id":"main"},{"id":"ai_fvlBqXZR","name":"railway","value":0.9971303,"app_id":"main"},{"id":"ai_Xxjc3MhT","name":"transportation system","value":0.99544376,"app_id":"main"},{"id":"ai_RRXLczch","name":"locomotive","value":0.9914662,"app_id":"main"},{"id":"ai_6kTjGfF6","name":"station","value":0.9910724,"app_id":"main"},{"id":"ai_VRmbGVWh","name":"travel","value":0.98730266,"app_id":"main"},{"id":"ai_SHNDcmJ3","name":"subway system","value":0.97979987,"app_id":"main"},{"id":"ai_jlb9q33b","name":"commuter","value":0.9676262,"app_id":"main"},{"id":"ai_tr0MBp64","name":"traffic","value":0.9670719,"app_id":"main"},{"id":"ai_46lGZ4Gm","name":"railroad track","value":0.96478844,"app_id":"main"},{"id":"ai_l4WckcJN","name":"blur","value":0.9640489,"app_id":"main"},{"id":"ai_CpFBRWzD","name":"urban","value":0.95840275,"app_id":"main"},{"id":"ai_786Zr311","name":"no person","value":0.95792294,"app_id":"main"},{"id":"ai_2gkfMDsM","name":"platform","value":0.95782685,"app_id":"main"},{"id":"ai_6lhccv44","name":"business","value":0.9567626,"app_id":"main"},{"id":"ai_971KsJkn","name":"track","value":0.9446391,"app_id":"main"},{"id":"ai_WBQfVV0p","name":"city","value":0.9392204,"app_id":"main"},{"id":"ai_dSCKh8xv","name":"fast","value":0.9365082,"app_id":"main"},{"id":"ai_TZ3C79C6","name":"road","value":0.9306637,"app_id":"main"},{"id":"ai_VSVscs9k","name":"terminal","value":0.91909647,"app_id":"main"}]}}]}
@@ -0,0 +1,11 @@
1
+ HTTP/1.1 200 OK
2
+ Access-Control-Allow-Headers: Content-Type,Accept,X-Requested-With,Content-Type,Accept-Encoding,X-CSRF-Token,Authorization,X-Clarifai-Application-Id,X-Clarifai-REST-API-Key,X-Clarifai-Session-Token,X-Clarifai-Client,X-Clarifai-Site
3
+ Access-Control-Allow-Methods: GET,HEAD,POST,PUT,PATCH,OPTIONS,DELETE
4
+ Access-Control-Allow-Origin: *
5
+ Content-Type: application/json; charset=UTF-8
6
+ Date: Mon, 21 Aug 2017 06:41:24 GMT
7
+ Server: nginx
8
+ Content-Length: 520
9
+ Connection: keep-alive
10
+
11
+ {"status":{"code":10000,"description":"Ok"},"model":{"id":"aaa03c23b3724a16a56b629203edc62c","name":"general-v1.3","created_at":"2016-03-09T17:11:39.608845Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"concept","type_ext":"concept"},"model_version":{"id":"aa9ca48295b37401f8af92ad1af0d91d","created_at":"2016-07-13T01:19:12.147644Z","status":{"code":21100,"description":"Model trained successfully"},"active_concept_count":9171},"display_name":"General"}}
@@ -0,0 +1,11 @@
1
+ HTTP/1.1 200 OK
2
+ Access-Control-Allow-Headers: Content-Type,Accept,X-Requested-With,Content-Type,Accept-Encoding,X-CSRF-Token,Authorization,X-Clarifai-Application-Id,X-Clarifai-REST-API-Key,X-Clarifai-Session-Token,X-Clarifai-Client,X-Clarifai-Site
3
+ Access-Control-Allow-Methods: GET,HEAD,POST,PUT,PATCH,OPTIONS,DELETE
4
+ Access-Control-Allow-Origin: *
5
+ Content-Type: application/json; charset=UTF-8
6
+ Date: Fri, 18 Aug 2017 13:41:24 GMT
7
+ Server: nginx
8
+ Content-Length: 6903
9
+ Connection: keep-alive
10
+
11
+ {"status":{"code":10000,"description":"Ok"},"models":[{"id":"d16f390eb32cad478c7ae150069bd2c6","name":"moderation","created_at":"2017-05-16T19:20:38.733764Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"concept","type_ext":"concept"},"model_version":{"id":"b42ac907ac93483484483a0040a386be","created_at":"2017-05-16T19:20:38.733764Z","status":{"code":21100,"description":"Model trained successfully"},"active_concept_count":5},"display_name":"Moderation"},{"id":"c443119bf2ed4da98487520d01a0b1e3","name":"logo","created_at":"2017-03-06T22:57:00.707216Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"concept","type_ext":"detection"},"model_version":{"id":"ef1b7237d28b415f910ca343a9145e99","created_at":"2017-03-06T22:57:05.625525Z","status":{"code":21100,"description":"Model trained successfully"},"active_concept_count":561},"display_name":"Logo"},{"id":"c2cf7cecd8a6427da375b9f35fcd2381","name":"focus","created_at":"2017-03-06T22:57:00.660603Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"blur","type_ext":"focus"},"model_version":{"id":"fefeafd0c9224bce9274f06dad43553e","created_at":"2017-03-06T22:57:00.684652Z","status":{"code":21100,"description":"Model trained successfully"}},"display_name":"Focus"},{"id":"c0c0ac362b03416da06ab3fa36fb58e3","name":"demographics","created_at":"2016-12-23T06:08:44.271674Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"facedetect","type_ext":"facedetect"},"model_version":{"id":"f783f0807c52474c8c6ad20c8cf45fc0","created_at":"2016-12-23T06:08:44.271674Z","status":{"code":21100,"description":"Model trained successfully"}},"display_name":"Demographics"},{"id":"e0be3b9d6a454f0493ac3a30784001ff","name":"apparel","created_at":"2016-12-20T22:43:29.831402Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"concept","type_ext":"concept"},"model_version":{"id":"dc2cd6d9bff5425a80bfe0c4105583c1","created_at":"2016-12-20T22:43:29.831402Z","status":{"code":21100,"description":"Model trained successfully"},"active_concept_count":112},"display_name":"Apparel"},{"id":"d02b4508df58432fbb84e800597b8959","name":"face-v1.3","created_at":"2016-10-25T19:30:38.541073Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"embed","type_ext":"embed"},"model_version":{"id":"ec1740642c83478392e7b8735c43c630","created_at":"2016-10-25T19:30:38.541073Z","status":{"code":21100,"description":"Model trained successfully"}},"display_name":"Face Embedding"},{"id":"e466caa0619f444ab97497640cefc4dc","name":"celeb-v1.3","created_at":"2016-10-25T19:30:38.541073Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"concept","type_ext":"concept"},"model_version":{"id":"bdb0537982ae4e0da563ed836ccfa065","created_at":"2016-10-25T19:30:38.541073Z","status":{"code":21100,"description":"Model trained successfully"},"active_concept_count":10554},"display_name":"Celebrity"},{"id":"a403429f2ddf4b49b307e318f00e528b","name":"face-v1.3","created_at":"2016-10-25T19:30:38.541073Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"facedetect","type_ext":"facedetect"},"model_version":{"id":"c67b5872d8b44df4be55f2b3de3ebcbb","created_at":"2016-10-25T19:30:38.541073Z","status":{"code":21100,"description":"Model trained successfully"}},"display_name":"Face Detection"},{"id":"c386b7a870114f4a87477c0824499348","name":"weddings-v1.0","created_at":"2016-09-22T19:14:51.993209Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"concept","type_ext":"concept"},"model_version":{"id":"b91bcf877c464a38a25a742694da7535","created_at":"2016-09-22T19:14:51.993209Z","status":{"code":21100,"description":"Model trained successfully"},"active_concept_count":445},"display_name":"Wedding"},{"id":"eee28c313d69466f836ab83287a54ed9","name":"travel-v1.0","created_at":"2016-09-17T22:18:59.955626Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"concept","type_ext":"concept"},"model_version":{"id":"d2ffbf9730fd41fea79063270847be82","created_at":"2016-09-17T22:18:59.955626Z","status":{"code":21100,"description":"Model trained successfully"},"active_concept_count":77},"display_name":"Travel"},{"id":"e9576d86d2004ed1a38ba0cf39ecb4b1","name":"nsfw-v1.0","created_at":"2016-09-17T22:18:59.955626Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"concept","type_ext":"concept"},"model_version":{"id":"a6b3a307361c4a00a465e962f721fc58","created_at":"2016-09-17T22:18:59.955626Z","status":{"code":21100,"description":"Model trained successfully"},"active_concept_count":2},"display_name":"NSFW"},{"id":"bd367be194cf45149e75f01d59f77ba7","name":"food-items-v1.0","created_at":"2016-09-17T22:18:59.955626Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"concept","type_ext":"concept"},"model_version":{"id":"dfebc169854e429086aceb8368662641","created_at":"2016-09-17T22:18:59.955626Z","status":{"code":21100,"description":"Model trained successfully"},"active_concept_count":979},"display_name":"Food"},{"id":"bbb5f41425b8468d9b7a554ff10f8581","name":"general-v1.3","created_at":"2016-06-17T22:01:04.144732Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"embed","type_ext":"embed"},"model_version":{"id":"bb7ac05c86be42d38b67bc473d333e07","created_at":"2016-07-13T01:19:12.147644Z","status":{"code":21100,"description":"Model trained successfully"}},"display_name":"General Embedding"},{"id":"eeed0b6733a644cea07cf4c60f87ebb7","name":"color","created_at":"2016-05-11T18:05:45.924367Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"color","type_ext":"color"},"model_version":{"id":"dd9458324b4b45c2be1a7ba84d27cd04","created_at":"2016-07-13T01:19:12.147644Z","status":{"code":21100,"description":"Model trained successfully"},"active_concept_count":140},"display_name":"Color"},{"id":"aaa03c23b3724a16a56b629203edc62c","name":"general-v1.3","created_at":"2016-03-09T17:11:39.608845Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"concept","type_ext":"concept"},"model_version":{"id":"aa9ca48295b37401f8af92ad1af0d91d","created_at":"2016-07-13T01:19:12.147644Z","status":{"code":21100,"description":"Model trained successfully"},"active_concept_count":9171},"display_name":"General"}]}
@@ -0,0 +1,11 @@
1
+ HTTP/1.1 200 OK
2
+ Access-Control-Allow-Headers: Content-Type,Accept,X-Requested-With,Content-Type,Accept-Encoding,X-CSRF-Token,Authorization,X-Clarifai-Application-Id,X-Clarifai-REST-API-Key,X-Clarifai-Session-Token,X-Clarifai-Client,X-Clarifai-Site
3
+ Access-Control-Allow-Methods: GET,HEAD,POST,PUT,PATCH,OPTIONS,DELETE
4
+ Access-Control-Allow-Origin: *
5
+ Content-Type: application/json; charset=UTF-8
6
+ Date: Fri, 18 Aug 2017 11:33:26 GMT
7
+ Server: nginx
8
+ Content-Length: 523
9
+ Connection: keep-alive
10
+
11
+ {"status":{"code":10000,"description":"Ok"},"models":[{"id":"aaa03c23b3724a16a56b629203edc62c","name":"general-v1.3","created_at":"2016-03-09T17:11:39.608845Z","app_id":"main","output_info":{"message":"Show output_info with: GET /models/{model_id}/output_info","type":"concept","type_ext":"concept"},"model_version":{"id":"aa9ca48295b37401f8af92ad1af0d91d","created_at":"2016-07-13T01:19:12.147644Z","status":{"code":21100,"description":"Model trained successfully"},"active_concept_count":9171},"display_name":"General"}]}
@@ -0,0 +1,57 @@
1
+ describe Clarinet::Model do
2
+
3
+ before :each do
4
+ app = Clarinet::App.new 'fake_api_key'
5
+ @model = app.models.init_model Clarinet::Model::GENERAL
6
+ end
7
+
8
+ describe '#predict' do
9
+ it 'should call /outputs endpoint with correct payload given single url' do
10
+ req_stub = stub_request(:post, "https://api.clarifai.com/v2/models/#{Clarinet::Model::GENERAL}/outputs")
11
+ .with(body: {
12
+ inputs: [
13
+ {
14
+ data: {
15
+ image: {
16
+ url: 'https://samples.clarifai.com/metro-north.jpg'
17
+ }
18
+ }
19
+ }
20
+ ]
21
+ })
22
+ .to_return(fixture_file('model-predict-default'))
23
+
24
+ @model.predict 'https://samples.clarifai.com/metro-north.jpg'
25
+
26
+ expect(req_stub).to have_been_requested
27
+ end
28
+
29
+ it 'should call API endpoint with correct payload given multiple urls' do
30
+ req_stub = stub_request(:post, "https://api.clarifai.com/v2/models/#{Clarinet::Model::GENERAL}/outputs")
31
+ .with(body: {
32
+ inputs: [
33
+ {
34
+ data: {
35
+ image: {
36
+ url: 'https://samples.clarifai.com/metro-north.jpg'
37
+ }
38
+ }
39
+ },
40
+ {
41
+ data: {
42
+ image: {
43
+ url: 'https://samples.clarifai.com/metro-north-2.jpg'
44
+ }
45
+ }
46
+ }
47
+ ]
48
+ })
49
+ .to_return(fixture_file('model-predict-default'))
50
+
51
+ @model.predict ['https://samples.clarifai.com/metro-north.jpg', 'https://samples.clarifai.com/metro-north-2.jpg']
52
+
53
+ expect(req_stub).to have_been_requested
54
+ end
55
+ end
56
+
57
+ end
@@ -0,0 +1,106 @@
1
+ describe Clarinet::Models do
2
+
3
+ before :each do
4
+ app = Clarinet::App.new 'fake_api_key'
5
+ @models = app.models
6
+ end
7
+
8
+ describe '#init_model' do
9
+ it 'should return a model instance given model id' do
10
+ model = @models.init_model Clarinet::Model::GENERAL
11
+ expect(model).to be_instance_of(Clarinet::Model)
12
+ expect(model.id).to eq(Clarinet::Model::GENERAL)
13
+
14
+ model = @models.init_model id: Clarinet::Model::GENERAL
15
+ expect(model).to be_instance_of(Clarinet::Model)
16
+ expect(model.id).to eq(Clarinet::Model::GENERAL)
17
+ end
18
+
19
+ it 'should call #search if given name' do
20
+ model_data = { name: 'general-v1.3' }
21
+
22
+ stub_request(:post, 'https://api.clarifai.com/v2/models/searches')
23
+ .to_return(fixture_file('search-general-concept'))
24
+
25
+ search_results = @models.search 'general-v1.3', nil
26
+ @models.expects(:search).with('general-v1.3', nil).returns(search_results)
27
+
28
+ @models.init_model model_data
29
+ end
30
+ end
31
+
32
+ describe '#search' do
33
+ it 'should call search API and return Clarinet::Models instance' do
34
+ model_name = 'general-v1.3'
35
+ model_type = 'concept'
36
+
37
+ req_stub = stub_request(:post, 'https://api.clarifai.com/v2/models/searches')
38
+ .with(body: { model_query: { name: model_name, type: model_type } })
39
+ .to_return(fixture_file('search-general-concept'))
40
+
41
+ result = @models.search model_name, model_type
42
+
43
+ expect(req_stub).to have_been_requested
44
+ end
45
+
46
+ it 'should return correct Clarinet::Models instance' do
47
+ model_name = 'general-v1.3'
48
+ model_type = 'concept'
49
+
50
+ stub_request(:post, 'https://api.clarifai.com/v2/models/searches')
51
+ .with(body: { model_query: { name: model_name, type: model_type } })
52
+ .to_return(fixture_file('search-general-concept'))
53
+
54
+ result = @models.search model_name, model_type
55
+
56
+ expect(result).to be_instance_of(Clarinet::Models)
57
+ expect(result.size).to eq(1)
58
+ end
59
+ end
60
+
61
+ describe '#list' do
62
+ it 'should return Clarinet::Models with all models' do
63
+ req_stub = stub_request(:get, 'https://api.clarifai.com/v2/models')
64
+ .with(query: { page: 1, per_page: 20 })
65
+ .to_return(fixture_file('models-list'))
66
+
67
+ result = @models.list
68
+
69
+ expect(req_stub).to have_been_requested
70
+
71
+ expect(result).to be_instance_of(Clarinet::Models)
72
+ expect(result.size).to eq(15)
73
+ end
74
+
75
+ it 'should use pagination options in the API call' do
76
+ req_stub = stub_request(:get, 'https://api.clarifai.com/v2/models')
77
+ .with(query: { page: 2, per_page: 33 })
78
+ .to_return(fixture_file('models-list'))
79
+
80
+ @models.list page: 2, per_page: 33
81
+
82
+ expect(req_stub).to have_been_requested
83
+ end
84
+ end
85
+
86
+ describe '#get' do
87
+ it 'should call correct API endpoint and return Clarinet::Model instance' do
88
+ req_stub = stub_request(:get, "https://api.clarifai.com/v2/models/#{Clarinet::Model::GENERAL}")
89
+ .to_return(fixture_file('models-get'))
90
+
91
+ result = @models.get Clarinet::Model::GENERAL
92
+
93
+ expect(req_stub).to have_been_requested
94
+ expect(result).to be_instance_of(Clarinet::Model)
95
+ end
96
+ end
97
+
98
+ describe '#predict' do
99
+ it 'should call #predict on Clarinet::Model instance' do
100
+ Clarinet::Model.any_instance.expects(:predict).with('fake_image_url')
101
+
102
+ @models.predict Clarinet::Model::GENERAL, 'fake_image_url'
103
+ end
104
+ end
105
+
106
+ end
@@ -0,0 +1,109 @@
1
+ require 'simplecov'
2
+ SimpleCov.start
3
+
4
+ require 'clarinet'
5
+
6
+ require 'webmock/rspec'
7
+
8
+ # This file was generated by the `rspec --init` command. Conventionally, all
9
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
10
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
11
+ # this file to always be loaded, without a need to explicitly require it in any
12
+ # files.
13
+ #
14
+ # Given that it is always loaded, you are encouraged to keep this file as
15
+ # light-weight as possible. Requiring heavyweight dependencies from this file
16
+ # will add to the boot time of your test suite on EVERY test run, even for an
17
+ # individual file that may not need all of that loaded. Instead, consider making
18
+ # a separate helper file that requires the additional dependencies and performs
19
+ # the additional setup, and require it from the spec files that actually need
20
+ # it.
21
+ #
22
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
23
+ RSpec.configure do |config|
24
+ config.filter_run focus: true
25
+ config.run_all_when_everything_filtered = true
26
+
27
+ # rspec-expectations config goes here. You can use an alternate
28
+ # assertion/expectation library such as wrong or the stdlib/minitest
29
+ # assertions if you prefer.
30
+ config.expect_with :rspec do |expectations|
31
+ # This option will default to `true` in RSpec 4. It makes the `description`
32
+ # and `failure_message` of custom matchers include text for helper methods
33
+ # defined using `chain`, e.g.:
34
+ # be_bigger_than(2).and_smaller_than(4).description
35
+ # # => "be bigger than 2 and smaller than 4"
36
+ # ...rather than:
37
+ # # => "be bigger than 2"
38
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
39
+ end
40
+
41
+ # rspec-mocks config goes here. You can use an alternate test double
42
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
43
+ config.mock_with :mocha
44
+
45
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
46
+ # have no way to turn it off -- the option exists only for backwards
47
+ # compatibility in RSpec 3). It causes shared context metadata to be
48
+ # inherited by the metadata hash of host groups and examples, rather than
49
+ # triggering implicit auto-inclusion in groups with matching metadata.
50
+ config.shared_context_metadata_behavior = :apply_to_host_groups
51
+
52
+ # Run specs in random order to surface order dependencies. If you find an
53
+ # order dependency and want to debug it, you can fix the order by providing
54
+ # the seed, which is printed after each run.
55
+ # --seed 1234
56
+ config.order = :random
57
+
58
+ # The settings below are suggested to provide a good initial experience
59
+ # with RSpec, but feel free to customize to your heart's content.
60
+ =begin
61
+ # This allows you to limit a spec run to individual examples or groups
62
+ # you care about by tagging them with `:focus` metadata. When nothing
63
+ # is tagged with `:focus`, all examples get run. RSpec also provides
64
+ # aliases for `it`, `describe`, and `context` that include `:focus`
65
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
66
+ config.filter_run_when_matching :focus
67
+
68
+ # Allows RSpec to persist some state between runs in order to support
69
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
70
+ # you configure your source control system to ignore this file.
71
+ config.example_status_persistence_file_path = "spec/examples.txt"
72
+
73
+ # Limits the available syntax to the non-monkey patched syntax that is
74
+ # recommended. For more details, see:
75
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
76
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
77
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
78
+ config.disable_monkey_patching!
79
+
80
+ # This setting enables warnings. It's recommended, but in some cases may
81
+ # be too noisy due to issues in dependencies.
82
+ config.warnings = true
83
+
84
+ # Many RSpec users commonly either run the entire suite or an individual
85
+ # file, and it's useful to allow more verbose output when running an
86
+ # individual spec file.
87
+ if config.files_to_run.one?
88
+ # Use the documentation formatter for detailed output,
89
+ # unless a formatter has already been configured
90
+ # (e.g. via a command-line flag).
91
+ config.default_formatter = "doc"
92
+ end
93
+
94
+ # Print the 10 slowest examples and example groups at the
95
+ # end of the spec run, to help surface which specs are running
96
+ # particularly slow.
97
+ config.profile_examples = 10
98
+
99
+ # Seed global randomization in this process using the `--seed` CLI option.
100
+ # Setting this allows you to use `--seed` to deterministically reproduce
101
+ # test failures related to randomization by passing the same `--seed` value
102
+ # as the one that triggered the failure.
103
+ Kernel.srand config.seed
104
+ =end
105
+ end
106
+
107
+ def fixture_file(name)
108
+ File.new("#{File.dirname(__FILE__)}/fixtures/#{name}.txt")
109
+ end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: clarinet
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.1
5
+ platform: ruby
6
+ authors:
7
+ - Jaakko Rinta-Filppula
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-02-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.14'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: addressable
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.5'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.5'
41
+ description: Simple client to interface with the Clarifai API v2
42
+ email: jaakko.rf@gmail.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - ".gitignore"
48
+ - ".rspec"
49
+ - ".rubocop.yml"
50
+ - ".travis.yml"
51
+ - Gemfile
52
+ - LICENSE
53
+ - README.md
54
+ - Rakefile
55
+ - clarinet.gemspec
56
+ - lib/clarinet.rb
57
+ - lib/clarinet/app.rb
58
+ - lib/clarinet/client.rb
59
+ - lib/clarinet/concept.rb
60
+ - lib/clarinet/concepts.rb
61
+ - lib/clarinet/error/error.rb
62
+ - lib/clarinet/input.rb
63
+ - lib/clarinet/inputs.rb
64
+ - lib/clarinet/model.rb
65
+ - lib/clarinet/models.rb
66
+ - lib/clarinet/status.rb
67
+ - lib/clarinet/utils.rb
68
+ - lib/clarinet/version.rb
69
+ - spec/app_spec.rb
70
+ - spec/fixtures/model-predict-default.txt
71
+ - spec/fixtures/models-get.txt
72
+ - spec/fixtures/models-list.txt
73
+ - spec/fixtures/search-general-concept.txt
74
+ - spec/model_spec.rb
75
+ - spec/models_spec.rb
76
+ - spec/spec_helper.rb
77
+ homepage: https://github.com/tophattom/clarinet
78
+ licenses:
79
+ - ISC
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 2.6.13
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: Clarifai API client
101
+ test_files: []