portatext 1.5.2 → 1.5.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 +4 -4
- data/lib/portatext/command/api/inspect.rb +28 -0
- data/lib/portatext/command/api/jobs.rb +5 -0
- data/lib/portatext/command/base.rb +3 -0
- data/lib/portatext.rb +1 -0
- data/portatext.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ea1a8905e2c094b9a61e6bbee55bd6535efcfa1
|
4
|
+
data.tar.gz: d312b954fd5f59223e4717cd97db2a6743f2508a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1bd0679d2a85b5849978dfb02ac3c1ccd7a126ceb34bfc6848ae8ebd83a42f20a0b7b606cd9d54c5e995b8d1bfc40febe9b4b7a447ef5f403894a669f7bf176
|
7
|
+
data.tar.gz: ef53c875e5ddc7ce7c300205dc51163e869154fbc9981beaf8803aa4079b79ea53614dc8c4e999e876c52ffe784b25608746bb6fcadb3eb84fc5b6d069055bc5
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module PortaText
|
2
|
+
module Command
|
3
|
+
module Api
|
4
|
+
# The inspect endpoint.
|
5
|
+
# https://github.com/PortaText/docs/wiki/REST-API#api_inspect
|
6
|
+
#
|
7
|
+
# Author:: Marcelo Gornstein (mailto:marcelog@portatext.com)
|
8
|
+
# Copyright:: Copyright (c) 2015 PortaText
|
9
|
+
# License:: Apache-2.0
|
10
|
+
class NumberInspect < Base
|
11
|
+
def number(number)
|
12
|
+
set :number, number
|
13
|
+
end
|
14
|
+
|
15
|
+
def csv(file)
|
16
|
+
set :file, file
|
17
|
+
end
|
18
|
+
|
19
|
+
def endpoint(_method)
|
20
|
+
number = @args[:number]
|
21
|
+
@args.delete :number
|
22
|
+
return "inspect/#{number}" unless number.nil?
|
23
|
+
'inspect'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -16,6 +16,10 @@ module PortaText
|
|
16
16
|
set :page, page
|
17
17
|
end
|
18
18
|
|
19
|
+
def save_to(file)
|
20
|
+
set :accept_any_file, file
|
21
|
+
end
|
22
|
+
|
19
23
|
def endpoint(_method)
|
20
24
|
page = @args[:page]
|
21
25
|
@args.delete :page
|
@@ -24,6 +28,7 @@ module PortaText
|
|
24
28
|
return endpoint if @args[:id].nil?
|
25
29
|
id = @args[:id]
|
26
30
|
@args.delete :id
|
31
|
+
return "jobs/#{id}/result" unless @args[:accept_any_file].nil?
|
27
32
|
"jobs/#{id}"
|
28
33
|
end
|
29
34
|
end
|
@@ -41,6 +41,7 @@ module PortaText
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def accept_content_type(_method)
|
44
|
+
return '*/*' unless @args[:accept_any_file].nil?
|
44
45
|
return 'text/csv' unless @args[:accept_file].nil?
|
45
46
|
'application/json'
|
46
47
|
end
|
@@ -61,7 +62,9 @@ module PortaText
|
|
61
62
|
a_type = accept_content_type method
|
62
63
|
command_endpoint = endpoint(method)
|
63
64
|
file = @args[:accept_file]
|
65
|
+
file ||= @args[:accept_any_file]
|
64
66
|
@args.delete :accept_file
|
67
|
+
@args.delete :accept_any_file
|
65
68
|
@client.run(
|
66
69
|
command_endpoint, method, content_type(method),
|
67
70
|
a_type, body(method), file
|
data/lib/portatext.rb
CHANGED
@@ -39,6 +39,7 @@ require_relative 'portatext/command/api/number_verify'
|
|
39
39
|
require_relative 'portatext/command/api/services'
|
40
40
|
require_relative 'portatext/command/api/trunks'
|
41
41
|
require_relative 'portatext/command/api/version'
|
42
|
+
require_relative 'portatext/command/api/inspect'
|
42
43
|
|
43
44
|
# The PortaText namespace.
|
44
45
|
#
|
data/portatext.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: portatext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PortaText
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- lib/portatext/command/api/did_search.rb
|
151
151
|
- lib/portatext/command/api/did_settings.rb
|
152
152
|
- lib/portatext/command/api/email_verify.rb
|
153
|
+
- lib/portatext/command/api/inspect.rb
|
153
154
|
- lib/portatext/command/api/jobs.rb
|
154
155
|
- lib/portatext/command/api/me.rb
|
155
156
|
- lib/portatext/command/api/my_password.rb
|