This is an automated email from the ASF dual-hosted git repository.
rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-runtime-ruby.git
The following commit(s) were added to refs/heads/master by this push:
new efc5a9e scancode fixes (now that I told scancode to look at Ruby
files...) (#46)
efc5a9e is described below
commit efc5a9efc6901539ea8ce5317393d77aa558748a
Author: David Grove <[email protected]>
AuthorDate: Fri Feb 7 22:20:09 2020 -0500
scancode fixes (now that I told scancode to look at Ruby files...) (#46)
---
core/ruby2.5Action/Gemfile | 17 ++++++++++++++++
core/ruby2.5Action/config.ru | 19 +++++++++++++++++-
core/ruby2.5Action/rackapp/filepath.rb | 17 ++++++++++++++++
core/ruby2.5Action/rackapp/init.rb | 17 ++++++++++++++++
core/ruby2.5Action/rackapp/middleware/base.rb | 19 +++++++++++++++++-
.../rackapp/middleware/post_method_validation.rb | 19 +++++++++++++++++-
.../rackapp/middleware/sentinel_handler.rb | 17 ++++++++++++++++
core/ruby2.5Action/rackapp/response/error.rb | 19 +++++++++++++++++-
core/ruby2.5Action/rackapp/response/success.rb | 19 +++++++++++++++++-
core/ruby2.5Action/rackapp/run.rb | 23 +++++++++++++++++++---
core/ruby2.5Action/rackapp/runner.rb | 17 ++++++++++++++++
11 files changed, 195 insertions(+), 8 deletions(-)
diff --git a/core/ruby2.5Action/Gemfile b/core/ruby2.5Action/Gemfile
index ae0a745..59a6f05 100644
--- a/core/ruby2.5Action/Gemfile
+++ b/core/ruby2.5Action/Gemfile
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
source 'https://rubygems.org'
gem 'rack' ~> 2.0.0
diff --git a/core/ruby2.5Action/config.ru b/core/ruby2.5Action/config.ru
index 93c460d..9eee378 100644
--- a/core/ruby2.5Action/config.ru
+++ b/core/ruby2.5Action/config.ru
@@ -1,5 +1,22 @@
#!/usr/bin/ruby
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
require 'rubygems'
require 'json'
require 'zip'
@@ -22,4 +39,4 @@ rackapp = Rack::Builder.app do
end
end
-run rackapp
\ No newline at end of file
+run rackapp
diff --git a/core/ruby2.5Action/rackapp/filepath.rb
b/core/ruby2.5Action/rackapp/filepath.rb
index d660b15..eb06695 100644
--- a/core/ruby2.5Action/rackapp/filepath.rb
+++ b/core/ruby2.5Action/rackapp/filepath.rb
@@ -1,5 +1,22 @@
#!/usr/bin/ruby
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
module Filepath
ROOT = '/action/'
diff --git a/core/ruby2.5Action/rackapp/init.rb
b/core/ruby2.5Action/rackapp/init.rb
index 1e1fd7f..52bc4b6 100644
--- a/core/ruby2.5Action/rackapp/init.rb
+++ b/core/ruby2.5Action/rackapp/init.rb
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
require "#{__dir__}/response/success.rb"
require "#{__dir__}/response/error.rb"
require "#{__dir__}/filepath.rb"
diff --git a/core/ruby2.5Action/rackapp/middleware/base.rb
b/core/ruby2.5Action/rackapp/middleware/base.rb
index d362d66..9b35137 100644
--- a/core/ruby2.5Action/rackapp/middleware/base.rb
+++ b/core/ruby2.5Action/rackapp/middleware/base.rb
@@ -1,5 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
class MiddlewareBase
def initialize(app)
@app = app
end
-end
\ No newline at end of file
+end
diff --git a/core/ruby2.5Action/rackapp/middleware/post_method_validation.rb
b/core/ruby2.5Action/rackapp/middleware/post_method_validation.rb
index 8de8dba..d6ee00e 100644
--- a/core/ruby2.5Action/rackapp/middleware/post_method_validation.rb
+++ b/core/ruby2.5Action/rackapp/middleware/post_method_validation.rb
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
require "#{__dir__}/base.rb"
class HTTPPostMethodValidation < MiddlewareBase
@@ -8,4 +25,4 @@ class HTTPPostMethodValidation < MiddlewareBase
Rack::Response.new 'Something went wrong with the request', 500
end
end
-end
\ No newline at end of file
+end
diff --git a/core/ruby2.5Action/rackapp/middleware/sentinel_handler.rb
b/core/ruby2.5Action/rackapp/middleware/sentinel_handler.rb
index 32c05b5..494bfd5 100644
--- a/core/ruby2.5Action/rackapp/middleware/sentinel_handler.rb
+++ b/core/ruby2.5Action/rackapp/middleware/sentinel_handler.rb
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
require "#{__dir__}/base.rb"
class SentinelHandler < MiddlewareBase
diff --git a/core/ruby2.5Action/rackapp/response/error.rb
b/core/ruby2.5Action/rackapp/response/error.rb
index 57d9584..3c109e4 100644
--- a/core/ruby2.5Action/rackapp/response/error.rb
+++ b/core/ruby2.5Action/rackapp/response/error.rb
@@ -1,5 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
class ErrorResponse < Rack::Response
def initialize(body = [], status = 500, header = {})
super({:error=>body}.to_json, status, header.merge({'Content-Type' =>
'application/json'}))
end
-end
\ No newline at end of file
+end
diff --git a/core/ruby2.5Action/rackapp/response/success.rb
b/core/ruby2.5Action/rackapp/response/success.rb
index 9d3efb2..75575a1 100644
--- a/core/ruby2.5Action/rackapp/response/success.rb
+++ b/core/ruby2.5Action/rackapp/response/success.rb
@@ -1,5 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
class SuccessResponse < Rack::Response
def initialize(body = [], status = 200, header = {})
super body.to_json, status, header.merge({'Content-Type' =>
'application/json'})
end
-end
\ No newline at end of file
+end
diff --git a/core/ruby2.5Action/rackapp/run.rb
b/core/ruby2.5Action/rackapp/run.rb
index 6fdb68d..2b1be1e 100644
--- a/core/ruby2.5Action/rackapp/run.rb
+++ b/core/ruby2.5Action/rackapp/run.rb
@@ -1,11 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
require "#{__dir__}/response/success.rb"
require "#{__dir__}/response/error.rb"
require "#{__dir__}/filepath.rb"
class RunApp
include Filepath
-
- def call(env)
+
+ def call(env)
if !File.exist? ENTRYPOINT then
return ErrorResponse.new 'Invalid Action: no action file found', 500
end
@@ -47,4 +64,4 @@ class RunApp
rescue
false
end
-end
\ No newline at end of file
+end
diff --git a/core/ruby2.5Action/rackapp/runner.rb
b/core/ruby2.5Action/rackapp/runner.rb
index 5f607da..9ad2c33 100644
--- a/core/ruby2.5Action/rackapp/runner.rb
+++ b/core/ruby2.5Action/rackapp/runner.rb
@@ -1,5 +1,22 @@
#!/usr/bin/ruby
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
require 'json'
require "#{__dir__}/filepath.rb"