thecore_ftp_helpers 1.1.24 → 2.0.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
- SHA1:
3
- metadata.gz: b82f64f09f258cb58e9e40523c40f3deaaedb8f5
4
- data.tar.gz: 9ad5ae0673d36a64640c42b03525b036430f3191
2
+ SHA256:
3
+ metadata.gz: 0dbd641735f5466ed9d98cf051a0a7f3e3f8d33765cf3cf8abc888af9dec458f
4
+ data.tar.gz: e4fabc772235c4218d17a739b9e6993d88872095abc98b34d69784bb16d44f52
5
5
  SHA512:
6
- metadata.gz: 8e94c2b290c00bd8fc0f180da72060e7c6270e764d46547b646da049ed75e338118bbd98b9ebb5a1532b953d1c99302e28195ae7b36a9d604aca48ec8e7ba282
7
- data.tar.gz: 1b7ad392d249f0dee55ec5fb24bc62814913aa737c3e071280380f63d476846ca8a182cebe6deeaaaa13644fa19fb7afe1492338d966087f60990ac9a084b9c5
6
+ metadata.gz: 2aa188d8d607ee7cf6ca7d3a1c912ed1cfc558097f8a4c4e6f5bc9b968ef263da03b0aac997ad34018957efbf534d062405787b9cf87e37ac57e4465b88e854d
7
+ data.tar.gz: f66cf310f1ea5a1f00672658d6cca91b0ff081d4b7baca47d3de58861c363d46911a74f8adc22a04ea7408300574f9c1ab0ed95f7e43130173f0648f8461c5c4
@@ -1,6 +1,5 @@
1
1
 
2
2
  Rails.application.configure do
3
3
  config.after_initialize do
4
- require 'abilities_thecore_ftp_helpers_concern'
5
4
  end
6
5
  end
@@ -1,7 +1,7 @@
1
1
 
2
- require 'thecore'
2
+ # require 'thecore'
3
3
  require 'net/ftp'
4
- require 'thecore_servers'
4
+ require 'thecore_backend_commons'
5
5
  require "thecore_ftp_helpers/engine"
6
6
 
7
7
  module ThecoreFtpHelpers
@@ -10,11 +10,19 @@ module ThecoreFtpHelpers
10
10
  def self.list_most_recent_file address, username, password, directory, pattern, close = true, from = nil
11
11
  puts "Connecting to FTP"
12
12
  ftp = Net::FTP.open address, username, password
13
- ftp.passive = false
13
+ # ftp.passive = false
14
14
  puts "Entering directory: #{directory}"
15
15
  ftp.chdir(directory)
16
16
  puts "Listing all files which respond to this pattern: #{pattern}"
17
- files = ftp.list(pattern)
17
+ begin
18
+ files = ftp.nlst(pattern)
19
+ rescue => exception
20
+ # If we are here, maybe it's beacause of passive mode and the network too secure
21
+ # let's switch to active mode and try again
22
+ ftp.passive = false
23
+ files = ftp.nlst(pattern)
24
+ end
25
+
18
26
  puts "Last import time: #{from.strftime('%Y-%m-%d %H:%M:%S.%N')}"
19
27
  files = files.select {|f|
20
28
  puts "For file: #{f}"
@@ -1,9 +1,8 @@
1
- require 'thecore'
2
1
  module ThecoreFtpHelpers
3
2
  class Engine < ::Rails::Engine
4
3
 
5
4
  initializer 'thecore_ftp_helpers.add_to_migrations' do |app|
6
- unless app.root.to_s == root.to_s
5
+ unless app.root.to_s.match root.to_s
7
6
  # APPEND TO MAIN APP MIGRATIONS FROM THIS GEM
8
7
  config.paths['db/migrate'].expanded.each do |expanded_path|
9
8
  app.config.paths['db/migrate'] << expanded_path
@@ -1,3 +1,3 @@
1
1
  module ThecoreFtpHelpers
2
- VERSION = '1.1.24'
2
+ VERSION = '2.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_ftp_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.24
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-31 00:00:00.000000000 Z
11
+ date: 2020-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: thecore_servers
14
+ name: thecore_backend_commons
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '2.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '2.3'
27
27
  description: Thecorized thecore_ftp_helpers full description.
28
28
  email:
29
29
  - gabriele.tassoni@gmail.com
@@ -37,7 +37,6 @@ files:
37
37
  - app/assets/config/thecore_ftp_helpers_manifest.js
38
38
  - config/initializers/thecore_ftp_helpers_after_initialize.rb
39
39
  - config/routes.rb
40
- - lib/abilities_thecore_ftp_helpers_concern.rb
41
40
  - lib/tasks/thecore_ftp_helpers_tasks.rake
42
41
  - lib/thecore_ftp_helpers.rb
43
42
  - lib/thecore_ftp_helpers/engine.rb
@@ -61,8 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
60
  - !ruby/object:Gem::Version
62
61
  version: '0'
63
62
  requirements: []
64
- rubyforge_project:
65
- rubygems_version: 2.6.14
63
+ rubygems_version: 3.0.3
66
64
  signing_key:
67
65
  specification_version: 4
68
66
  summary: Thecorized thecore_ftp_helpers
@@ -1,23 +0,0 @@
1
-
2
- require 'active_support/concern'
3
-
4
- module ThecoreFtpHelperAbilitiesConcern
5
- extend ActiveSupport::Concern
6
- included do
7
- def thecore_ftp_helpers_abilities user
8
- if user
9
- # if the user is logged in, it can do certain tasks regardless his role
10
- if user.admin?
11
- # if the user is an admin, it can do a lot of things, usually
12
- end
13
-
14
- if user.has_role? :role
15
- # a specific role, brings specific powers
16
- end
17
- end
18
- end
19
- end
20
- end
21
-
22
- # include the extension
23
- TheCoreAbilities.send(:include, ThecoreFtpHelperAbilitiesConcern)