rapidapi 0.1.2 → 0.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: 1ce57a28128fe74a9719ed9c6b25952ab8ea6ea2
4
- data.tar.gz: 2b3235bae870282e102046d24596fd72e24829d0
3
+ metadata.gz: 214c98728a2f37f58a03decc93c79b10c1ee5933
4
+ data.tar.gz: f43cfc7ba927e17911ba7e3a56fd7bfb1eb8839d
5
5
  SHA512:
6
- metadata.gz: 66ce83fe19adf4e8397a4b99f04d2236ca35ddbd8add5c65419bceebacda932a3add7181d4c91e6a1265fd0d7d5a7894a0988fbf9d88be75c967776f68a2607b
7
- data.tar.gz: 8079069621d353646a7aabdeed66ff07b20e59febec1018c5ad877d94c47458cf8253e465728ee97893f302ac19340e31dd2beb1530e7516ae124d933c7c2da2
6
+ metadata.gz: 43ef83d129276e7705f91c63c546206f94065958ab940c140b6696e252b21d896b6e0a30ec82187bd00129f4c26ee721b7c3b2e02c8d38af4263214b00b3e9de
7
+ data.tar.gz: 76024835e99f38a72a35edaf5ecaf626abecd95b7e96f59060ba63516aba723189087c0a557f814649f8290282af188a71cdd11ec83bc7a6097e5a232da73a85
data/README.md CHANGED
@@ -5,47 +5,39 @@
5
5
  ## Overview
6
6
  RapidAPI is the world's first opensource API marketplace. It allows developers to discover and connect to the world's top APIs more easily and manage multiple API connections in one place.
7
7
 
8
- ## iOS SDK
9
- * In case you're using [CocoaPods](https://cocoapods.org), add the following line to your `Podfile`:
8
+ ## Ruby SDK
9
+ * In case you're using gemfile:
10
10
 
11
11
  ```ruby
12
- pod "RapidAPISDK", "~> 0.1"
12
+ gem 'rapidapi', '~> 0.1.2'
13
13
  ```
14
14
 
15
- * Otherwise, you can add RapidAPISDK manually to your Xcode project.
16
- 1. Go to the [releases tab](https://github.com/RapidSoftwareSolutions/rapidapi-ios-sdk/releases).
17
- 2. Download the latest release zip.
18
- 3. Unzip the file and drag the *RapidConnectSDK.framework* directory to the "Frameworks" folder in your project.
15
+ * Otherwise, you can install the gem manually using:
16
+
17
+ ```ruby
18
+ gem install rapidapi
19
+ ```
19
20
 
20
21
  ## Initialization
21
22
  Import RapidAPISDK by putting the following code in your header file
22
23
 
23
- ```objective-c
24
- #import <RapidConnectSDK/RapidConnectSDK.h>
24
+ ```ruby
25
+ require 'rapidapisdk'
25
26
  ```
26
27
 
27
28
  Now initialize it using:
28
29
 
29
- ```objective-c
30
- RapidConnect *rapid = [[RapidConnect alloc] initWithProjectName:@"PROJECT_NAME" andToken:@"TOKEN"];
30
+ ```ruby
31
+ RapidAPI.config(
32
+ project: 'PROJECT_NAME',
33
+ token: 'TOKEN'
34
+ )
31
35
  ```
32
36
  ## Usage
33
37
  To use any block in the marketplace, just copy it's code snippet and paste it in your code. For example, the following is the snippet for the **Delivery.sendSMS** block:
34
38
 
35
- ```objective-c
36
- [rapid callPackage:@"Delivery" block:@"sendSMS"
37
- withParameters:[NSDictionary dictionaryWithObjectsAndKeys:
38
- @"Hello from RapidAPI!",@"message",
39
- @"4158496404", @"number",
40
- nil]
41
- success:^(NSDictionary *responseDict) {
42
-
43
- // response handling here ...
44
- NSLog(@"%@",responseDict);
45
-
46
- } failure:^(NSError *error) {
47
- // error handling here ...
48
- NSLog(@"%@",[error localizedDescription]);
39
+ ```ruby
40
+ response = RapidAPI.call('MicrosoftEmotionAPI', 'getEmotionRecognition', { 'param1': 'xxxxx', 'param2': 'xxxx' })
49
41
  ```
50
42
 
51
43
 
@@ -57,35 +49,15 @@ Whenever a block in RapidAPI requires a file, you can either pass a URL to the f
57
49
  #### URL
58
50
  The following code will call the block MicrosoftComputerVision.analyzeImage with a URL of an image:
59
51
 
60
- ```objective-c
61
- [rapid callPackage:@"MicrosoftComputerVision" block:@"analyzeImage"
62
- withParameters:[NSDictionary dictionaryWithObjectsAndKeys:
63
- @"XXXXXXXXXXXXXXXXXXX",@"subscriptionKey",
64
- @"http://example.com/file.jpg", @"image",
65
- nil]
66
- success:^(NSDictionary *responseDict) {
67
- NSLog(@"%@",responseDict);
68
- } failure:^(NSError *error) {
69
- // error handling here ...
70
- NSLog(@"%@",[error localizedDescription]);
52
+ ```ruby
53
+ response = RapidAPI.call('MicrosoftEmotionAPI', 'getEmotionRecognition', { 'param1': 'xxxxx', 'image': 'http://image.url/' })
71
54
  ```
72
55
 
73
56
  #### Post File
74
57
  If the file is locally stored, you can read it using `NSFileManager` and pass the read stream to the block, like the following:
75
58
 
76
- ```objective-c
77
- NSData *data = [[NSFileManager defaultManager] contentsAtPath:@"path/to/the/file.jpg"];
78
-
79
- [rapid callPackage:@"MicrosoftComputerVision" block:@"analyzeImage"
80
- withParameters:[NSDictionary dictionaryWithObjectsAndKeys:
81
- @"XXXXXXXXXXXXXXXXXXX",@"subscriptionKey",
82
- data, @"image",
83
- nil]
84
- success:^(NSDictionary *responseDict) {
85
- NSLog(@"%@",responseDict);
86
- } failure:^(NSError *error) {
87
- // error handling here ...
88
- NSLog(@"%@",[error localizedDescription]);
59
+ ```ruby
60
+ response = RapidAPI.call('MicrosoftEmotionAPI', 'getEmotionRecognition', { 'subscriptionKey': 'xxxxxxx', 'image': UploadIO.new(File.new("Happy-man.jpg"), "image/jpg", "Happy-man.jpg") })
89
61
  ```
90
62
 
91
63
  ##Issues:
@@ -96,4 +68,4 @@ As this is a pre-release version of the SDK, you may expirience bugs. Please rep
96
68
 
97
69
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
98
70
 
99
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
71
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,3 +1,3 @@
1
1
  module RapidAPI
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ['lib']
23
23
 
24
- spec.add_development_dependency 'bundler', '~> 1.13'
25
- spec.add_development_dependency 'rake', '~> 10.0'
26
- spec.add_development_dependency 'rspec', '~> 3.0'
27
- spec.add_development_dependency 'byebug', '~> 9.0', '>= 9.0.6'
28
- spec.add_development_dependency 'multipart-post', '~> 2.0'
24
+ spec.add_dependency 'bundler', '~> 1.13'
25
+ spec.add_dependency 'rake', '~> 10.0'
26
+ spec.add_dependency 'rspec', '~> 3.0'
27
+ spec.add_dependency 'byebug', '~> 9.0', '>= 9.0.6'
28
+ spec.add_dependency 'multipart-post', '~> 2.0'
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rapidapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Bukati
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-06 00:00:00.000000000 Z
11
+ date: 2017-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.13'
20
- type: :development
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
@@ -31,7 +31,7 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
- type: :development
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
@@ -45,7 +45,7 @@ dependencies:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.0'
48
- type: :development
48
+ type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
@@ -62,7 +62,7 @@ dependencies:
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
64
  version: 9.0.6
65
- type: :development
65
+ type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
@@ -79,7 +79,7 @@ dependencies:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
81
  version: '2.0'
82
- type: :development
82
+ type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements: