rest-ftp-daemon 0.306.0 → 0.306.1

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
  SHA1:
3
- metadata.gz: 6edd22943111a9e497528ea36e6890af33f9ef47
4
- data.tar.gz: caeb1289c6f8e878fe926e90d9c8b693c80f26e0
3
+ metadata.gz: 372111b2b2e4ff339dd45950692792e665189752
4
+ data.tar.gz: 951510fba629f42100adc30c231918fad393c19c
5
5
  SHA512:
6
- metadata.gz: 1c4e9793292e1bd0020fd96f9f9d0770200b04aaafe4a8630833021545baa3a4b10ca1d480c52fa5cb80bfa84a1c162f48febdf4995f0cccc2a68baebd76c440
7
- data.tar.gz: f269efbb1a414c0610a2bbdbaba41b641a75e1b97e84c270c1dbb1d1590b871f828d06d538a91cdd3af6ec441a3d7c9ac68ec76485063bbb214b5b2afd3da66b
6
+ metadata.gz: d0fb55a01ba93e20345e929c3f21191aa43de48934a243f2f007bfb6ec518f360930f543220d8071e8c1bb88932e6f89a932cde241b0abd7e85a4d2e24cf0b64
7
+ data.tar.gz: eba0e1863549d8de14877bc095324594e8aa217f17c6589b6fdd1763821226673782767680890a4aae6a56f8f16fa64211308ee5d26b83b97a2a4081a2e54625
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rest-ftp-daemon (0.306.0)
4
+ rest-ftp-daemon (0.306.1)
5
5
  api-auth
6
6
  bmc-daemon-lib (~> 0.2)
7
7
  double-bag-ftps
@@ -17,8 +17,8 @@ module RestFtpDaemon
17
17
 
18
18
  # Inject helpers
19
19
  scope_object = eval("self", binding)
20
- scope_object.extend RestFtpDaemon::HelpViews
21
- scope_object.extend RestFtpDaemon::Helpers
20
+ scope_object.extend RestFtpDaemon::ViewsHelper
21
+ scope_object.extend RestFtpDaemon::CommonHelpers
22
22
 
23
23
  # Do the rendering !
24
24
  haml_engine.render(scope_object, values)
@@ -6,6 +6,10 @@ module RestFtpDaemon
6
6
  include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
7
7
 
8
8
  ### LOGGING & HELPERS
9
+ helpers RestFtpDaemon::CommonHelpers
10
+ helpers RestFtpDaemon::ApiHelpers
11
+ helpers BmcDaemonLib::LoggerHelper
12
+
9
13
  helpers do
10
14
  def log_prefix
11
15
  ['API', nil, nil]
@@ -14,18 +18,6 @@ module RestFtpDaemon
14
18
  def logger
15
19
  Root.logger
16
20
  end
17
-
18
- def log_request
19
- if env.nil?
20
- puts "HTTP_ENV_IS_NIL: #{env.inspect}"
21
- return
22
- end
23
-
24
- request_method = env['REQUEST_METHOD']
25
- request_path = env['REQUEST_PATH']
26
- request_uri = env['REQUEST_URI']
27
- log_info "HTTP #{request_method} #{request_uri}", params
28
- end
29
21
  end
30
22
 
31
23
  before do
@@ -33,8 +25,6 @@ module RestFtpDaemon
33
25
  end
34
26
 
35
27
  ### CLASS CONFIG
36
- helpers RestFtpDaemon::HelpApis
37
- helpers BmcDaemonLib::LoggerHelper
38
28
  logger BmcDaemonLib::LoggerPool.instance.get :api
39
29
  do_not_route_head!
40
30
  do_not_route_options!
@@ -0,0 +1,24 @@
1
+ module RestFtpDaemon
2
+ module ApiHelpers
3
+
4
+ def log_request
5
+ if env.nil?
6
+ puts "HTTP_ENV_IS_NIL: #{env.inspect}"
7
+ return
8
+ end
9
+
10
+ request_method = env['REQUEST_METHOD']
11
+ request_path = env['REQUEST_PATH']
12
+ request_uri = env['REQUEST_URI']
13
+ log_info "HTTP #{request_method} #{request_uri}", params
14
+ end
15
+
16
+ def get_censored_config
17
+ config = Conf.to_hash
18
+ config[:users] = Conf[:users].keys if Conf[:users]
19
+ config[:endpoints] = Conf[:endpoints].keys if Conf[:endpoints]
20
+ config
21
+ end
22
+
23
+ end
24
+ end
@@ -1,5 +1,5 @@
1
1
  module RestFtpDaemon
2
- module Helpers
2
+ module CommonHelpers
3
3
 
4
4
  def format_bytes number, unit="", decimals = 0
5
5
  return "Ø" if number.nil? || number.to_f.zero?
@@ -1,5 +1,5 @@
1
1
  module RestFtpDaemon
2
- module HelpViews
2
+ module ViewsHelper
3
3
 
4
4
  def dashboard_job_url job
5
5
  "#{MOUNT_JOBS}/#{job.id}" if job.respond_to? :id
@@ -5,7 +5,7 @@ module RestFtpDaemon
5
5
  class Job
6
6
  include BmcDaemonLib::LoggerHelper
7
7
  include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
8
- include Helpers
8
+ include CommonHelpers
9
9
 
10
10
  # Class constants
11
11
  FIELDS = [:source, :target, :label, :priority, :pool, :notify, :overwrite, :mkdir, :tempfile]
@@ -4,7 +4,7 @@ module RestFtpDaemon
4
4
  class JobQueue
5
5
  include BmcDaemonLib::LoggerHelper
6
6
  include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
7
- include Helpers
7
+ include CommonHelpers
8
8
 
9
9
  # Class options
10
10
  attr_reader :logger
@@ -5,7 +5,7 @@ require 'rest_client'
5
5
  module RestFtpDaemon
6
6
  class Notification
7
7
  include BmcDaemonLib::LoggerHelper
8
- include Helpers
8
+ include CommonHelpers
9
9
 
10
10
  # Class options
11
11
  attr_reader :logger
@@ -87,7 +87,7 @@ module RestFtpDaemon
87
87
  # Log reponse body
88
88
  response_lines = response.body.lines
89
89
  if response_lines.size > 1
90
- human_size = Helpers.format_bytes(response.body.bytesize, "B")
90
+ human_size = format_bytes(response.body.bytesize, "B")
91
91
  log_info "received [#{response.code}] #{human_size} (#{response_lines.size} lines)", response_lines
92
92
  else
93
93
  log_info "received [#{response.code}] #{response.body.strip}"
@@ -1,6 +1,6 @@
1
1
  module RestFtpDaemon
2
2
  class Paginate
3
- include Helpers
3
+ include CommonHelpers
4
4
 
5
5
  # Class options
6
6
  attr_writer :filter
@@ -18,9 +18,9 @@ require_relative "shared/patch_haml"
18
18
  # Project's libs
19
19
  require_relative "rest-ftp-daemon/constants"
20
20
  require_relative "rest-ftp-daemon/exceptions"
21
- require_relative "rest-ftp-daemon/help_views"
22
- require_relative "rest-ftp-daemon/help_apis"
23
- require_relative "rest-ftp-daemon/helpers"
21
+ require_relative "rest-ftp-daemon/helpers/common"
22
+ require_relative "rest-ftp-daemon/helpers/views"
23
+ require_relative "rest-ftp-daemon/helpers/api"
24
24
  require_relative "rest-ftp-daemon/metrics"
25
25
  require_relative "rest-ftp-daemon/paginate"
26
26
  require_relative "rest-ftp-daemon/uri"
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |spec|
3
3
 
4
4
  # Project version
5
- spec.version = "0.306.0"
5
+ spec.version = "0.306.1"
6
6
 
7
7
  # Project description
8
8
  spec.name = "rest-ftp-daemon"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-ftp-daemon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.306.0
4
+ version: 0.306.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno MEDICI
@@ -335,9 +335,9 @@ files:
335
335
  - lib/rest-ftp-daemon/constants.rb
336
336
  - lib/rest-ftp-daemon/counters.rb
337
337
  - lib/rest-ftp-daemon/exceptions.rb
338
- - lib/rest-ftp-daemon/help_apis.rb
339
- - lib/rest-ftp-daemon/help_views.rb
340
- - lib/rest-ftp-daemon/helpers.rb
338
+ - lib/rest-ftp-daemon/helpers/api.rb
339
+ - lib/rest-ftp-daemon/helpers/common.rb
340
+ - lib/rest-ftp-daemon/helpers/views.rb
341
341
  - lib/rest-ftp-daemon/job.rb
342
342
  - lib/rest-ftp-daemon/job_queue.rb
343
343
  - lib/rest-ftp-daemon/launcher.rb
@@ -1,12 +0,0 @@
1
- module RestFtpDaemon
2
- module HelpApis
3
-
4
- def get_censored_config
5
- config = Conf.to_hash
6
- config[:users] = Conf[:users].keys if Conf[:users]
7
- config[:endpoints] = Conf[:endpoints].keys if Conf[:endpoints]
8
- config
9
- end
10
-
11
- end
12
- end