aspose_barcode_cloud 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -15
- data/lib/aspose_barcode_cloud/version.rb +1 -1
- data/test/barcode_tests.rb +59 -59
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c49e9b255b976761ddedd8916fb7482ac877229d
|
4
|
+
data.tar.gz: 474f353749869a53a720ddb17c705f02adfc3449
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ba01d95317e0e34dde4732b604a552b9fed64eaf53b061221c6e42356d891c2b65d2d05203de3e18d054d70da2d7b8e4395123ebd997d157cce9e6ea59c5204
|
7
|
+
data.tar.gz: a64d23341f1a89ceb6b085714e0415fc192fe1652fe6c04cab9c79f8c0f299211fbb7c1f65a37f135855caeb19a14f6dfbc164ccb343dfd88a3903261d662fb1
|
data/README.md
CHANGED
@@ -1,42 +1,41 @@
|
|
1
|
-
# Aspose.
|
2
|
-
This SDK lets you use [Aspose Cloud
|
1
|
+
# Aspose.BarCode Cloud SDK For Ruby
|
2
|
+
This SDK lets you use [Aspose Cloud Barcode APIs](http://www.aspose.com/cloud/barcode-api.aspx) in your Ruby web apps.
|
3
3
|
|
4
4
|
## Installing
|
5
|
-
You can simply install Aspose
|
5
|
+
You can simply install Aspose Barcode Cloud SDK with gem:
|
6
6
|
|
7
|
-
`gem install
|
7
|
+
`gem install aspose_barcode_cloud`
|
8
8
|
|
9
9
|
## Usage
|
10
10
|
APIs of this SDK can be called as follows:
|
11
11
|
|
12
12
|
```ruby
|
13
|
-
require '
|
13
|
+
require 'aspose_barcode_cloud'
|
14
14
|
|
15
|
-
class
|
15
|
+
class BarcodeUsage
|
16
16
|
|
17
|
-
include
|
17
|
+
include AsposeBarcodeCloud
|
18
18
|
include AsposeStorageCloud
|
19
19
|
|
20
20
|
def initialize
|
21
21
|
#Get App key and App SID from https://cloud.aspose.com
|
22
22
|
AsposeApp.app_key_and_sid("APP_KEY", "APP_SID")
|
23
|
-
@
|
23
|
+
@barcode_api = BarcodeApi.new
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
27
|
-
#
|
28
|
-
|
29
|
-
|
30
|
-
response = @slides_api.put_slides_convert(File.open("data/" << file_name,"r") { |io| io.read }, {format: convert_to_format})
|
26
|
+
def get_barcode_generate
|
27
|
+
#Generate barcode.
|
28
|
+
opts = {text: "Dairy Products", type: "qr", format: "png"}
|
29
|
+
response = @barcode_api.get_barcode_generate(opts)
|
31
30
|
end
|
32
31
|
|
33
32
|
end
|
34
33
|
```
|
35
34
|
## Unit Tests
|
36
|
-
Aspose
|
35
|
+
Aspose Barcode SDK includes a suite of unit tests within the [test](https://github.com/asposebarcode/Aspose_BarCode_Cloud/blob/master/SDKs/Aspose.BarCode_Cloud_SDK_for_Ruby/test/barcode_tests.rb) subdirectory. These Unit Tests also serves as examples of how to use the Aspose Barcode SDK.
|
37
36
|
|
38
37
|
## Contact
|
39
38
|
Your feedback is very important to us. Please email us all your queries and feedback at marketplace@aspose.com.
|
40
39
|
|
41
40
|
## License
|
42
|
-
Aspose
|
41
|
+
Aspose Barcode SDK is available under the MIT license. See the [LICENSE](https://github.com/asposebarcode/Aspose_BarCode_Cloud/blob/master/SDKs/Aspose.BarCode_Cloud_SDK_for_Ruby/LICENSE) file for more info.
|
data/test/barcode_tests.rb
CHANGED
@@ -9,95 +9,95 @@ class BarcodeTests < Minitest::Test
|
|
9
9
|
include AsposeStorageCloud
|
10
10
|
|
11
11
|
def setup
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
#Get App key and App SID from https://cloud.aspose.com
|
13
|
+
AsposeApp.app_key_and_sid("", "")
|
14
|
+
@barcode_api = BarcodeApi.new
|
15
15
|
end
|
16
16
|
|
17
17
|
def teardown
|
18
18
|
end
|
19
19
|
|
20
20
|
def upload_file(file_name)
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
@storage_api = StorageApi.new
|
22
|
+
response = @storage_api.put_create(file_name, File.open("data/" << file_name,"r") { |io| io.read } )
|
23
|
+
assert(response, message="Failed to upload {file_name} file.")
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_get_barcode_generate
|
27
|
-
|
27
|
+
opts = {text: "Dairy Products", type: "qr", format: "png"}
|
28
28
|
|
29
|
-
|
30
|
-
|
29
|
+
response = @barcode_api.get_barcode_generate(opts)
|
30
|
+
assert(response, message="Failed to generate barcode")
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_post_generate_multiple
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
34
|
+
barcode_builders_list = BarcodeBuildersList.new
|
35
|
+
barcode_builders_list.x_step = 1
|
36
|
+
barcode_builders_list.y_step = 2
|
37
|
+
barcode_builder_1 = BarcodeBuilder.new
|
38
|
+
barcode_builder_1.type_of_barcode = "qr"
|
39
|
+
barcode_builder_1.text = "Aspose Your File Format APIs"
|
40
|
+
barcode_builder_2 = BarcodeBuilder.new
|
41
|
+
barcode_builder_2.type_of_barcode = "qr"
|
42
|
+
barcode_builder_2.text = "Aspose.Barcode for Cloud"
|
43
|
+
barcode_builders_list.barcode_builders = [barcode_builder_1, barcode_builder_2]
|
44
|
+
opts = {format: "png"}
|
45
|
+
|
46
|
+
response = @barcode_api.post_generate_multiple(barcode_builders_list, opts)
|
47
|
+
assert(response, message="Failed to generate multiple barcodes and return in response stream")
|
48
48
|
end
|
49
49
|
|
50
50
|
def test_post_barcode_recognize_from_urlor_content
|
51
|
-
|
51
|
+
opts = {type: "Code39Standard", url: "http://www.barcoding.com/images/Barcodes/code93.gif"}
|
52
52
|
|
53
|
-
|
54
|
-
|
53
|
+
response = @barcode_api.post_barcode_recognize_from_urlor_content(opts)
|
54
|
+
assert(response, message="Failed to recognize barcode from an url.")
|
55
55
|
end
|
56
56
|
|
57
57
|
def test_put_barcode_generate_file
|
58
|
-
|
59
|
-
|
58
|
+
name = "NewBarcode.png"
|
59
|
+
opts = {text: "Aspose.Barcode for Cloud", type: "qr"}
|
60
60
|
|
61
|
-
|
62
|
-
|
61
|
+
response = @barcode_api.put_barcode_generate_file(name, opts)
|
62
|
+
assert(response, message="Failed to generate barcode and save on server.")
|
63
63
|
end
|
64
64
|
|
65
65
|
def test_put_generate_multiple
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
66
|
+
name = "AsposeBarcode.png"
|
67
|
+
barcode_builders_list = BarcodeBuildersList.new
|
68
|
+
barcode_builders_list.x_step = 1
|
69
|
+
barcode_builders_list.y_step = 2
|
70
|
+
barcode_builder_1 = BarcodeBuilder.new
|
71
|
+
barcode_builder_1.type_of_barcode = "qr"
|
72
|
+
barcode_builder_1.text = "Aspose Your File Format APIs"
|
73
|
+
barcode_builder_2 = BarcodeBuilder.new
|
74
|
+
barcode_builder_2.type_of_barcode = "qr"
|
75
|
+
barcode_builder_2.text = "Aspose.Barcode for Cloud"
|
76
|
+
barcode_builders_list.barcode_builders = [barcode_builder_1, barcode_builder_2]
|
77
|
+
|
78
|
+
response = @barcode_api.put_generate_multiple(name, barcode_builders_list)
|
79
|
+
assert(response, message="Failed to generate image with multiple barcodes and put new file on server")
|
80
80
|
end
|
81
81
|
|
82
82
|
def test_get_barcode_recognize
|
83
|
-
|
84
|
-
|
85
|
-
|
83
|
+
file_name = "barcode.png"
|
84
|
+
upload_file(file_name)
|
85
|
+
opts = {type: "Code39Standard"}
|
86
86
|
|
87
|
-
|
88
|
-
|
87
|
+
response = @barcode_api.get_barcode_recognize(file_name, opts)
|
88
|
+
assert(response, message="Failed to recognize barcode from a file on server.")
|
89
89
|
end
|
90
90
|
|
91
91
|
def test_put_barcode_recognize_from_body
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
92
|
+
file_name = "sample-barcode.jpeg"
|
93
|
+
upload_file(file_name)
|
94
|
+
barcode_reader = BarcodeReader.new
|
95
|
+
barcode_reader.strip_fnc = true
|
96
|
+
barcode_reader.checksum_validation = "Off"
|
97
|
+
opts = {type: "Code39Standard"}
|
98
|
+
|
99
|
+
response = @barcode_api.put_barcode_recognize_from_body(file_name, barcode_reader, opts)
|
100
|
+
assert(response, message="Failed to recognize barcode from file on server with parameters in body.")
|
101
101
|
end
|
102
102
|
|
103
|
-
end
|
103
|
+
end
|