breezy_pdf 0.0.5 → 0.0.6

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: f8d27edda885f9527fa809af02d965e38a7f5b2c93f18a1348e3846be5d11228
4
- data.tar.gz: 9192d74c3bf111a8af649808483f21f19914dd38bee03f018b9e7a7ef57930df
3
+ metadata.gz: d76c399264bcaaf8cec44a4aeb8553052221648cd290859a5b05317679b127a7
4
+ data.tar.gz: c0912d302b1963b5d365cbe401e1ce0e8b9e6c1f0395a8d59b6d49f63666fb79
5
5
  SHA512:
6
- metadata.gz: 77bef75383f9284939168f4fd269e788bbd4e3d463737bcbf56409a036f5a093d3fa5a7182b348f3e06f40b6906b5531dd754a052d54b47cad6392568c271bb7
7
- data.tar.gz: 804555e81bcbd51e9ce72ffd31dea6fd51e5ac588d154922e465300cbb260102ca51f5dbdad8577b34ec3eca21a4233bf7bf65379f64318c097bd9f52c5cd15f
6
+ metadata.gz: 511cd0849e44967558dfb7c53fab7ee500335f0461460f782f40f6a9b1eba915d195919700072c95e8cc45b4ce909b49270282f233c04ddf112d9c9b03f8df79
7
+ data.tar.gz: f66e495037c091a71fd41bb4c88ff39c1bfd166f34e9f5dd07096694f32d35bab640fcc7af58d4a78e30d63a177b87fd0b9889d7bba9945b120289d060c3c55e
@@ -16,3 +16,9 @@ Metrics/PerceivedComplexity:
16
16
  Enabled: false
17
17
  Metrics/AbcSize:
18
18
  Enabled: false
19
+ Security/Open:
20
+ Enabled: false
21
+ Naming/HeredocDelimiterNaming:
22
+ Enabled: false
23
+ Style/SafeNavigation:
24
+ Enabled:
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- breezy_pdf (0.0.5)
4
+ breezy_pdf (0.0.6)
5
5
  concurrent-ruby
6
6
  nokogiri
7
7
 
@@ -22,14 +22,13 @@ GEM
22
22
  rack (2.0.4)
23
23
  rack-test (0.8.3)
24
24
  rack (>= 1.0, < 3)
25
- rainbow (2.2.2)
26
- rake
25
+ rainbow (3.0.0)
27
26
  rake (10.5.0)
28
- rubocop (0.49.0)
27
+ rubocop (0.54.0)
29
28
  parallel (~> 1.10)
30
- parser (>= 2.3.3.1, < 3.0)
29
+ parser (>= 2.5)
31
30
  powerpack (~> 0.1)
32
- rainbow (>= 1.99.1, < 3.0)
31
+ rainbow (>= 2.2.2, < 4.0)
33
32
  ruby-progressbar (~> 1.7)
34
33
  unicode-display_width (~> 1.0, >= 1.0.1)
35
34
  ruby-progressbar (1.9.0)
@@ -45,7 +44,7 @@ DEPENDENCIES
45
44
  minitest-stub-const
46
45
  rack-test
47
46
  rake (~> 10.0)
48
- rubocop (= 0.49)
47
+ rubocop
49
48
 
50
49
  BUNDLED WITH
51
50
  1.16.0
data/README.md CHANGED
@@ -78,9 +78,9 @@ BreezyPDF.setup do |config|
78
78
  # Middleware Path Matchers
79
79
  #
80
80
  # An array for Regular Expressions which identify which URL's should be
81
- # intercepted by the Middleware. Defaults to [/\.pdf$/], which will match
82
- # all requests ending with a .pdf extension.
83
- # config.middleware_path_matchers = [/\.pdf$/]
81
+ # intercepted by the Middleware. Defaults to [/\.pdf/], which will match
82
+ # all requests containing a .pdf extension.
83
+ # config.middleware_path_matchers = [/\.pdf/]
84
84
 
85
85
 
86
86
  # Treat URL's as Private
@@ -1,7 +1,7 @@
1
1
 
2
2
  # frozen_string_literal: true
3
3
 
4
- lib = File.expand_path("../lib", __FILE__)
4
+ lib = File.expand_path("lib", __dir__)
5
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
6
  require "breezy_pdf/version"
7
7
 
@@ -24,13 +24,13 @@ Gem::Specification.new do |spec|
24
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
25
  spec.require_paths = ["lib"]
26
26
 
27
- spec.add_dependency "nokogiri"
28
27
  spec.add_dependency "concurrent-ruby"
28
+ spec.add_dependency "nokogiri"
29
29
 
30
30
  spec.add_development_dependency "bundler", "~> 1.16"
31
- spec.add_development_dependency "rake", "~> 10.0"
32
31
  spec.add_development_dependency "minitest", "~> 5.0"
33
32
  spec.add_development_dependency "minitest-stub-const"
34
33
  spec.add_development_dependency "rack-test"
35
- spec.add_development_dependency "rubocop", "0.49"
34
+ spec.add_development_dependency "rake", "~> 10.0"
35
+ spec.add_development_dependency "rubocop"
36
36
  end
@@ -39,7 +39,7 @@ module BreezyPDF
39
39
  @@base_url = "https://breezypdf.com/api"
40
40
 
41
41
  mattr_accessor :middleware_path_matchers
42
- @@middleware_path_matchers = [/\.pdf$/]
42
+ @@middleware_path_matchers = [/\.pdf/]
43
43
 
44
44
  mattr_accessor :treat_urls_as_private
45
45
  @@treat_urls_as_private = true
@@ -53,17 +53,15 @@ module BreezyPDF::Intercept
53
53
  end
54
54
 
55
55
  def path
56
- path = env["PATH_INFO"]
57
-
58
- BreezyPDF.middleware_path_matchers.each do |regex|
59
- path = path.gsub(regex, "")
60
- end
61
-
62
- path
56
+ env["PATH_INFO"].gsub(/\.pdf/, "")
63
57
  end
64
58
 
65
59
  def base_url
66
- "#{env['rack.url_scheme']}://#{env['SERVER_NAME']}:#{env['SERVER_PORT']}"
60
+ "#{env['rack.url_scheme']}://#{env['SERVER_NAME']}#{port}"
61
+ end
62
+
63
+ def port
64
+ ":#{env['SERVER_PORT']}" unless [80, 443].include?(env['SERVER_PORT'].to_i)
67
65
  end
68
66
  end
69
67
  end
@@ -17,7 +17,7 @@ module BreezyPDF::Intercept
17
17
  private
18
18
 
19
19
  def public_url
20
- "#{env['rack.url_scheme']}://#{env['SERVER_NAME']}:#{env['SERVER_PORT']}" \
20
+ "#{env['rack.url_scheme']}://#{env['SERVER_NAME']}#{port}" \
21
21
  "#{path}?#{env['QUERY_STRING']}"
22
22
  end
23
23
 
@@ -30,5 +30,9 @@ module BreezyPDF::Intercept
30
30
 
31
31
  path
32
32
  end
33
+
34
+ def port
35
+ ":#{env['SERVER_PORT']}" unless [80, 443].include?(env['SERVER_PORT'].to_i)
36
+ end
33
37
  end
34
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BreezyPDF
4
- VERSION = "0.0.5"
4
+ VERSION = "0.0.6"
5
5
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breezy_pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Westendorf
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-25 00:00:00.000000000 Z
11
+ date: 2018-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: nokogiri
14
+ name: concurrent-ruby
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: concurrent-ruby
28
+ name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.16'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '10.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '10.0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: minitest
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -108,20 +94,34 @@ dependencies:
108
94
  - - ">="
109
95
  - !ruby/object:Gem::Version
110
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '10.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '10.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rubocop
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '0.49'
117
+ version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '0.49'
124
+ version: '0'
125
125
  description: Client and Rack Middlware which submits URL's and HTML fragments to be
126
126
  rendered as a PDF
127
127
  email: