paperplane-rb 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae47af520ac08251f5abda8c09e8cad0d12e2a2e0c8b1222fd0bcaf5d64e3213
4
- data.tar.gz: 98676611ec96ca6613f868eeb7df4b9d27b93e5d3ca14a025aca7aaf876ee8f0
3
+ metadata.gz: 7bac605d7028446810334ec5ce9f549ce2a40884aa766dc82d30384145b85bf8
4
+ data.tar.gz: 1f6055b1cf36e3562861598e7d839a8086ddd03a9cb537bc9954e98532320e7a
5
5
  SHA512:
6
- metadata.gz: 2fa065a06d16adc2fc54552096b084080e676b54d29cfcbf29ddd4a06d7a208733ce899345ed382a61f49397255da32a7b60070ee476334ae6d73419eb106aff
7
- data.tar.gz: 4ac0be8e34fd9d890f9a46e264545851b2b627aff6f2956ac489d701c6911071084539f0e5d5921c47318c97b747ec156c0628cac3aed700e769d7f7237c1af4
6
+ metadata.gz: e5880a18a09467a0a9cd48146b10977d842ceb0acd22deca2491dc9466d160d1126a7d140c7daa8d7b70620f1c6adf6da20f38318e8e718bb37934fd1e728f0e
7
+ data.tar.gz: ed739ace7d040964123f9898115fda612b4c780df711c8d21f396a5f050f4ede22ac2c0a7ee0edb83dd264763eec51c0105445efeafd40ad90e5853668a818d7
data/Gemfile CHANGED
@@ -8,5 +8,3 @@ gemspec
8
8
  gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.0"
11
-
12
- gem 'http'
data/Gemfile.lock CHANGED
@@ -1,14 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paperplane-rb (0.1.6)
4
+ paperplane-rb (0.1.8)
5
5
  http
6
+ webmock
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
11
  addressable (2.8.1)
11
12
  public_suffix (>= 2.0.2, < 6.0)
13
+ crack (0.4.5)
14
+ rexml
12
15
  diff-lcs (1.5.0)
13
16
  domain_name (0.5.20190701)
14
17
  unf (>= 0.0.5, < 1.0.0)
@@ -16,6 +19,7 @@ GEM
16
19
  ffi-compiler (1.0.1)
17
20
  ffi (>= 1.0.0)
18
21
  rake
22
+ hashdiff (1.0.1)
19
23
  http (5.1.1)
20
24
  addressable (~> 2.8)
21
25
  http-cookie (~> 1.0)
@@ -29,6 +33,7 @@ GEM
29
33
  rake (~> 13.0)
30
34
  public_suffix (5.0.1)
31
35
  rake (13.0.6)
36
+ rexml (3.2.5)
32
37
  rspec (3.12.0)
33
38
  rspec-core (~> 3.12.0)
34
39
  rspec-expectations (~> 3.12.0)
@@ -45,12 +50,16 @@ GEM
45
50
  unf (0.1.4)
46
51
  unf_ext
47
52
  unf_ext (0.0.8.2)
53
+ webmock (3.18.1)
54
+ addressable (>= 2.8.0)
55
+ crack (>= 0.3.2)
56
+ hashdiff (>= 0.4.0, < 2.0.0)
48
57
 
49
58
  PLATFORMS
50
59
  arm64-darwin-22
60
+ x86_64-linux
51
61
 
52
62
  DEPENDENCIES
53
- http
54
63
  paperplane-rb!
55
64
  rake (~> 13.0)
56
65
  rspec (~> 3.0)
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # Paperplane
1
+ # paperplane-rb
2
2
 
3
- 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/paperplane`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ A simple gem to interact with the Paperplane PDF API. It just has very basic features that I needed quickly. I'll continue to improve this as I need. Feel free to contribute if you'd like!
6
4
 
7
5
  ## Installation
8
6
 
@@ -10,20 +8,41 @@ Install the gem and add to the application's Gemfile by executing:
10
8
 
11
9
  $ bundle add paperplane
12
10
 
13
- If bundler is not being used to manage dependencies, install the gem by executing:
11
+ Or add it to your `Gemfile` manually:
14
12
 
15
- $ gem install paperplane
13
+ ```ruby
14
+ gem 'paperplane'
15
+ ```
16
16
 
17
17
  ## Usage
18
18
 
19
- TODO: Write usage instructions here
20
-
21
- ## Development
22
-
23
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
-
25
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
19
+ Initialize the library and set your API key(required) and logger(optional).
20
+ ```ruby
21
+ require 'paperplane'
22
+
23
+ Paperplane.configure do |config|
24
+ config.api_key = 'your_paperplane_api_key'
25
+ config.logger = Appsignal::Logger.new("paperplane")
26
+ end
27
+ ```
28
+
29
+ You can now call the different methods:
30
+ ```ruby
31
+ # Download PDF
32
+ url = 'https://en.wikipedia.org/wiki/Airplane'
33
+ output_file = 'example.pdf'
34
+ PaperplaneAPI.download_pdf(url, output_file)
35
+
36
+ # Create Job
37
+ response = PaperplaneAPI.create_job(url)
38
+ puts response
39
+ job_id = response['id']
40
+
41
+ # Show Job
42
+ job = PaperplaneAPI.show_job(job_id)
43
+ puts job
44
+ ```
26
45
 
27
46
  ## Contributing
28
47
 
29
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/paperplane.
48
+ Bug reports and pull requests are welcome on GitHub at https://github.com/nolyoi/paperplane-rb.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paperplane
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.8"
5
5
  end
data/lib/paperplane.rb CHANGED
@@ -22,6 +22,10 @@ module Paperplane
22
22
  yield(config) if block_given?
23
23
  end
24
24
 
25
+ def version
26
+ @version ||= Paperplane::VERSION
27
+ end
28
+
25
29
  def client
26
30
  @client ||= HTTP.basic_auth(user: config.api_key, pass: '')
27
31
  end
data/paperplane.gemspec CHANGED
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  # Uncomment to register a new dependency of your gem
33
33
  spec.add_dependency "http"
34
+ spec.add_dependency "webmock"
34
35
 
35
36
  # For more information and examples about making a new gem, check out our
36
37
  # guide at: https://bundler.io/guides/creating_gem.html
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperplane-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - nolyoi
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: webmock
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  description: A gem to interact with the Paperplane PDF API.
28
42
  email:
29
43
  - nolan@syslogica.io
@@ -42,7 +56,6 @@ files:
42
56
  - lib/paperplane/error.rb
43
57
  - lib/paperplane/version.rb
44
58
  - paperplane.gemspec
45
- - sig/paperplane.rbs
46
59
  homepage: https://github.com/nolyoi
47
60
  licenses: []
48
61
  metadata:
data/sig/paperplane.rbs DELETED
@@ -1,4 +0,0 @@
1
- module Paperplane
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end