pdf_kitchen 0.1.0 → 0.2.0
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/.DS_Store +0 -0
- data/README.md +11 -24
- data/lib/pdf_kitchen.rb +8 -4
- data/pdf_kitchen.gemspec +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ff8b1e10cee8470d4662cd88af0745d31d8942bfde7fe4b81c9a0f041a4f64b
|
|
4
|
+
data.tar.gz: ef604c95e69a3f91006f18c553e5d840b5b02085d22af46b406097527ecf4061
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 14e8e5597fab524938c14196baffc01f6dad1d3fe4e40bcc410dedc830699df481df90487a59b4d10ba5ef16c9462affb0c7693c85033aa6bf7fecd137d22da0
|
|
7
|
+
data.tar.gz: 22a4b222ebe1173ca2f6740e83853fd075b77229f79c164d832c9a33dd81f999dfd7bd9a62028cc8208e4d535475eff43e6a8b69a342cdd1851f11db66e6f0b2
|
data/.DS_Store
ADDED
|
Binary file
|
data/README.md
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
# PdfKitchen
|
|
2
2
|
|
|
3
|
-
## gem作成までの手順
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
gem update bundler
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/pdf_kitchen`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
13
|
-
|
|
14
|
-
TODO: Delete this and the text above, and describe your gem
|
|
15
|
-
|
|
16
3
|
## Installation
|
|
17
4
|
|
|
18
5
|
Add this line to your application's Gemfile:
|
|
@@ -31,14 +18,14 @@ Or install it yourself as:
|
|
|
31
18
|
|
|
32
19
|
## Usage
|
|
33
20
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
21
|
+
```
|
|
22
|
+
PdfKitchen::Api.get({
|
|
23
|
+
filename: "/var/www/html/aaa.pdf",
|
|
24
|
+
access_token: "システムで発行するtoken",
|
|
25
|
+
access_secret_token: "システムで発行するsecret-token",
|
|
26
|
+
data: {
|
|
27
|
+
text1: "aaa"
|
|
28
|
+
...
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
```
|
data/lib/pdf_kitchen.rb
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
require "pdf_kitchen/version"
|
|
2
2
|
require 'net/http'
|
|
3
3
|
require 'uri'
|
|
4
|
+
require 'json'
|
|
4
5
|
|
|
5
6
|
module PdfKitchen
|
|
6
7
|
class Error < StandardError; end
|
|
7
8
|
# Your code goes here...
|
|
8
9
|
class Api
|
|
9
|
-
def self.
|
|
10
|
+
def self.post(filename: "sample.pdf", access_token:, access_secret_token:, data: {})
|
|
10
11
|
uri = URI.parse('https://dev.pdf.kitchen/app/kitchen/cooking')
|
|
11
12
|
https = Net::HTTP.new(uri.host, uri.port)
|
|
12
13
|
https.use_ssl = true
|
|
13
14
|
|
|
14
15
|
req = Net::HTTP::Post.new(uri)
|
|
15
16
|
req["Content-Type"] = "application/json"
|
|
16
|
-
req.basic_auth
|
|
17
|
-
|
|
17
|
+
req.basic_auth access_token, access_secret_token
|
|
18
|
+
req.body = data.to_json
|
|
18
19
|
res = https.request(req)
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
File.open(filename, "w") do |f|
|
|
22
|
+
f.puts(res.body)
|
|
23
|
+
end
|
|
20
24
|
end
|
|
21
25
|
end
|
|
22
26
|
end
|
data/pdf_kitchen.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pdf_kitchen
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- tanaka
|
|
@@ -45,6 +45,7 @@ executables: []
|
|
|
45
45
|
extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
|
47
47
|
files:
|
|
48
|
+
- ".DS_Store"
|
|
48
49
|
- ".gitignore"
|
|
49
50
|
- Gemfile
|
|
50
51
|
- Gemfile.lock
|