interfax 1.1.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +19 -4
- data/lib/interfax/client.rb +8 -4
- data/lib/interfax/outbound/delivery.rb +1 -1
- data/lib/interfax/outbound.rb +1 -1
- data/lib/interfax/version.rb +1 -1
- data/lib/interfax.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 55d673c5fd839809a644439bd8ed4de14c8c1018ebc3adce0935e82efdd98228
|
4
|
+
data.tar.gz: a0a064893dc599f083c8cc53957d5eac5b69bbad08e7c3e015acd9d4930a7baf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5d1b8f1948d87e0e4e8bae3070e55c224be1eaee1f3525fc04f1de4599a627f06a20c7f680f07b1c6e76dcd7567e6734717e5bf5cb583bd741a85e28b695e6c
|
7
|
+
data.tar.gz: ec97b3f5bf76d5c26f933f9047e9d2865560730fb95767a2dad0391eab6d1e9d9d4cd3ce52f8b5062d30f23fc581dca4b6ce046dbdeaff27afb2e2dcabe678ed
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Send and receive faxes in Ruby with the [InterFAX](https://www.interfax.net/en/d
|
|
11
11
|
This gem requires Ruby 2.1+. You can install install it directly or via bundler.
|
12
12
|
|
13
13
|
```ruby
|
14
|
-
gem 'interfax'
|
14
|
+
gem 'interfax'
|
15
15
|
```
|
16
16
|
|
17
17
|
## Getting started
|
@@ -76,7 +76,7 @@ There are a few ways to send a fax. One way is to directly provide a file path o
|
|
76
76
|
# with a path
|
77
77
|
interfax.outbound.deliver(faxNumber: "+11111111112", file: 'folder/fax.txt')
|
78
78
|
# with a URL
|
79
|
-
interfax.outbound.deliver(faxNumber: "+11111111112", file: 'https://s3.aws.com/example/fax.
|
79
|
+
interfax.outbound.deliver(faxNumber: "+11111111112", file: 'https://s3.aws.com/example/fax.html')
|
80
80
|
```
|
81
81
|
|
82
82
|
InterFAX supports over 20 file types including HTML, PDF, TXT, Word, and many more. For a full list see the [Supported File Types](https://www.interfax.net/en/help/supported_file_types) documentation.
|
@@ -103,7 +103,7 @@ interfax.outbound.deliver(faxNumber: "+11111111112", file: file)
|
|
103
103
|
To send multiple files just pass in an array strings and [`InterFAX::File`](#interfaxfile) objects.
|
104
104
|
|
105
105
|
```rb
|
106
|
-
interfax.outbound.deliver(faxNumber: "+11111111112", files: ['file://fax.pdf', 'https://s3.aws.com/example/fax.
|
106
|
+
interfax.outbound.deliver(faxNumber: "+11111111112", files: ['file://fax.pdf', 'https://s3.aws.com/example/fax.html'])
|
107
107
|
```
|
108
108
|
|
109
109
|
Under the hood every path and string is turned into a [InterFAX::File](#interfaxfile) object. For more information see [the documentation](#interfaxfile) for this class.
|
@@ -526,10 +526,25 @@ bundle install # install dependencies
|
|
526
526
|
rake spec # run all tests
|
527
527
|
```
|
528
528
|
|
529
|
+
### Configuring a custom host
|
530
|
+
|
531
|
+
It might be necessary to specifyc a different host for testing purposes. To
|
532
|
+
achieve this, specify the `host` parameter or `INTERFAX_HOST` environment
|
533
|
+
variable.
|
534
|
+
|
535
|
+
|
536
|
+
```ruby
|
537
|
+
interfax = InterFAX::Client.new(
|
538
|
+
username: '...',
|
539
|
+
password: '...',
|
540
|
+
host: 'test.domain.com'
|
541
|
+
)
|
542
|
+
```
|
543
|
+
|
529
544
|
## License
|
530
545
|
|
531
546
|
This library is released under the [MIT License](LICENSE).
|
532
547
|
|
533
548
|
## Credits
|
534
549
|
|
535
|
-
Many thanks go to [Sascha Brink](https://github.com/sbrink) for building the pre 1.0 version of this gem and supporting it for so many years.
|
550
|
+
Many thanks go to [Sascha Brink] (https://github.com/sbrink) for building the pre 1.0 version of this gem and supporting it for so many years.
|
data/lib/interfax/client.rb
CHANGED
@@ -9,10 +9,10 @@ module InterFAX
|
|
9
9
|
class BadRequestError < StandardError; end
|
10
10
|
class UnauthorizedError < StandardError; end
|
11
11
|
|
12
|
-
attr_accessor :username, :password, :http
|
12
|
+
attr_accessor :username, :password, :http, :host
|
13
13
|
attr_writer :outbound, :inbound, :account, :documents, :files
|
14
14
|
|
15
|
-
|
15
|
+
HOST = "rest.interfax.net".freeze
|
16
16
|
USER_AGENT = "InterFAX Ruby #{InterFAX::VERSION}".freeze
|
17
17
|
|
18
18
|
def initialize(options = {})
|
@@ -24,7 +24,11 @@ module InterFAX
|
|
24
24
|
ENV['INTERFAX_PASSWORD'] || raise(KeyError, "Missing required argument: password")
|
25
25
|
end
|
26
26
|
|
27
|
-
self.
|
27
|
+
self.host = options.fetch(:host) do
|
28
|
+
ENV['INTERFAX_HOST'] || HOST
|
29
|
+
end
|
30
|
+
|
31
|
+
self.http = Net::HTTP.new(host, Net::HTTP.https_default_port)
|
28
32
|
http.set_debug_output $stdout if options[:debug]
|
29
33
|
http.use_ssl = true
|
30
34
|
end
|
@@ -79,7 +83,7 @@ module InterFAX
|
|
79
83
|
|
80
84
|
def uri_for(path, params = {}, keys = {})
|
81
85
|
params = validate(params, keys)
|
82
|
-
uri = URI("https://#{
|
86
|
+
uri = URI("https://#{host}#{path}")
|
83
87
|
uri.query = URI.encode_www_form(params)
|
84
88
|
uri
|
85
89
|
end
|
data/lib/interfax/outbound.rb
CHANGED
data/lib/interfax/version.rb
CHANGED
data/lib/interfax.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: interfax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- InterFAX
|
8
8
|
- Cristiano Betta
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-07-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mimemagic
|
@@ -112,7 +112,7 @@ homepage: https://github.com/interfax/interfax-ruby
|
|
112
112
|
licenses:
|
113
113
|
- MIT
|
114
114
|
metadata: {}
|
115
|
-
post_install_message:
|
115
|
+
post_install_message:
|
116
116
|
rdoc_options: []
|
117
117
|
require_paths:
|
118
118
|
- lib
|
@@ -127,9 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
|
-
|
131
|
-
|
132
|
-
signing_key:
|
130
|
+
rubygems_version: 3.3.7
|
131
|
+
signing_key:
|
133
132
|
specification_version: 4
|
134
133
|
summary: Send and receive faxes with InterFAX
|
135
134
|
test_files: []
|