fdk 0.0.20 → 0.0.27

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf44c78f30f73ef02883f583ed7d3d1718a5f32e58fb04cbcf5e61730a8a0792
4
- data.tar.gz: 4c997f610e8d1b6a654fba5ce0362a05abe70bd1fab035e7a007b063c47fac56
3
+ metadata.gz: 962f4bb9230b63e9209958f22baa093975dbc5a8bb6281eb5ce32d7a9daa651e
4
+ data.tar.gz: caaf91e233e1cba31a45ae98ec885826a15deace00965a2418a8e4dc415160bf
5
5
  SHA512:
6
- metadata.gz: b3212288e1ede41978bd0489b5a4ee95371cbcfa04e0514103b80819ed43e9abd1126e0325babf0294eb01c392b3d994e1151449eac190dcd988623f8d342522
7
- data.tar.gz: 22224118f8a1be06f74c16f4c85a09a7033c2d3aced3e41e6b39ff64b900b56180054f452cd8683944f4390180c967a8dd87649954c176225729a4de98b2a94f
6
+ metadata.gz: f7a71baf72d9ce5b242019a8346e683f55bbd7262b20e1a0c82709473e52c355c23f9afd1ba74e904be4be816afd94035a136575d21a9b96e3fea087b8193afb
7
+ data.tar.gz: 98da75369366c113ef3662b58771ead32f7d7802a73639ad937cb1ac6f768524047b433b43ec0178cdd72563ea395277b5498a8a039e6dc3d599d5e5b47aa948
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
- # Ruby Function Developer Kit (FDK)
2
- This provides a Ruby framework for developing functions for use with [Fn](https://fnproject.github.io).
1
+ # Function Development Kit for Ruby
2
+ The Function Development Kit for Ruby (FDK for Ruby) provides a Ruby framework for developing functions for use with [Fn](https://fnproject.github.io).
3
3
 
4
4
  [![CircleCI](https://circleci.com/gh/fnproject/fdk-ruby.svg?style=svg)](https://circleci.com/gh/fnproject/fdk-ruby)
5
5
 
data/lib/fdk/call.rb CHANGED
@@ -1,10 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ #
4
+ # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
3
19
  module FDK
4
20
  # Call represents a call to the target function or lambda
5
21
  class Call
6
- FILTER_HEADERS = ["content-length", "te", "transfer-encoding",
7
- "upgrade", "trailer"].freeze
22
+ FILTER_HEADERS = %w[content-length te transfer-encoding upgrade trailer].freeze
8
23
 
9
24
  attr_reader :request, :response
10
25
  attr_accessor :error
data/lib/fdk/context.rb CHANGED
@@ -1,5 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ #
4
+ # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
3
19
  require "date"
4
20
 
5
21
  module FDK
@@ -35,6 +51,8 @@ module FDK
35
51
  # Represents outbound HTTP headers
36
52
  class OutHeaders < InHeaders
37
53
  def initialize(headers, key_in_fn)
54
+ headers["Fn-Fdk-Version"] = ["fdk-ruby/#{FDK::VERSION}"]
55
+ headers["Fn-Fdk-Runtime"] = ["ruby/#{RUBY_VERSION}"]
38
56
  super(headers, key_in_fn)
39
57
  end
40
58
 
@@ -64,8 +82,7 @@ module FDK
64
82
  # Replace X with the upper cased name of the config variable you set.
65
83
  # e.g. minio_secret=secret will be exposed via MINIO_SECRET env var.
66
84
 
67
- attr_reader :headers
68
- attr_reader :response_headers
85
+ attr_reader :headers, :response_headers
69
86
 
70
87
  def initialize(headers_in, headers_out)
71
88
  @headers = headers_in
@@ -105,8 +122,7 @@ module FDK
105
122
  # Represents the context data (inbound && outbound)
106
123
  # for the execution passed as HTTP headers
107
124
  class HTTPContext
108
- attr_reader :headers
109
- attr_reader :response_headers
125
+ attr_reader :headers, :response_headers
110
126
 
111
127
  def initialize(ctx)
112
128
  fn_http_h_ = "fn-http-h-"
data/lib/fdk/function.rb CHANGED
@@ -1,9 +1,26 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ #
4
+ # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
3
19
  module FDK
4
20
  # Function represents a function function or lambda
5
21
  class Function
6
22
  attr_reader :format, :function
23
+
7
24
  def initialize(function:, format:)
8
25
  raise "'#{format}' not supported in Ruby FDK." unless format == "http-stream"
9
26
 
data/lib/fdk/listener.rb CHANGED
@@ -1,5 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ #
4
+ # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
3
19
  module FDK
4
20
  # Represents the socket that Fn uses to communicate
5
21
  # with the FDK (and thence the function)
@@ -73,7 +89,7 @@ module FDK
73
89
  end
74
90
 
75
91
  def private_socket_path
76
- socket_path + ".private"
92
+ "#{socket_path}.private"
77
93
  end
78
94
 
79
95
  def log_frame_header(headers)
data/lib/fdk/runner.rb CHANGED
@@ -1,5 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ #
4
+ # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
3
19
  require "webrick"
4
20
  require "fileutils"
5
21
  require "json"
@@ -1,5 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ #
4
+ # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
3
19
  module FDK
4
20
  # ParsedInput stores raw input and can parse it as
5
21
  # JSON (add extra formats as required)
data/lib/fdk/version.rb CHANGED
@@ -1,5 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ #
4
+ # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
3
19
  module FDK
4
- VERSION = "0.0.20"
20
+ VERSION = "0.0.27"
5
21
  end
data/lib/fdk.rb CHANGED
@@ -1,5 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ #
4
+ # Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
3
19
  require_relative "fdk/version"
4
20
  require_relative "fdk/runner"
5
21
  require_relative "fdk/context"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Reeder
@@ -10,48 +10,48 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-05-15 00:00:00.000000000 Z
13
+ date: 2021-09-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
20
- - !ruby/object:Gem::Version
21
- version: 2.1.0
22
19
  - - "~>"
23
20
  - !ruby/object:Gem::Version
24
- version: '2.1'
21
+ version: '2.5'
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: 2.5.1
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
28
28
  requirements:
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- version: 2.1.0
32
29
  - - "~>"
33
30
  - !ruby/object:Gem::Version
34
- version: '2.1'
31
+ version: '2.5'
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 2.5.1
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: webrick
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '1.4'
41
+ version: '1.7'
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- version: 1.4.2
44
+ version: 1.7.0
45
45
  type: :runtime
46
46
  prerelease: false
47
47
  version_requirements: !ruby/object:Gem::Requirement
48
48
  requirements:
49
49
  - - "~>"
50
50
  - !ruby/object:Gem::Version
51
- version: '1.4'
51
+ version: '1.7'
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 1.4.2
54
+ version: 1.7.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: net_http_unix
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -61,7 +61,7 @@ dependencies:
61
61
  version: '0.2'
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
- version: 0.2.1
64
+ version: 0.2.2
65
65
  type: :development
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
@@ -71,21 +71,21 @@ dependencies:
71
71
  version: '0.2'
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 0.2.1
74
+ version: 0.2.2
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rubocop
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '0.60'
81
+ version: '1.21'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '0.60'
88
+ version: '1.21'
89
89
  description: Ruby Function Developer Kit for Fn Project.
90
90
  email:
91
91
  - treeder@gmail.com
@@ -118,14 +118,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
118
  requirements:
119
119
  - - ">="
120
120
  - !ruby/object:Gem::Version
121
- version: '2.4'
121
+ version: '2.5'
122
122
  required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - ">="
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  requirements: []
128
- rubygems_version: 3.0.3
128
+ rubygems_version: 3.1.6
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Ruby FDK for Fn Project