fastlane-plugin-ftps 0.1.5 → 0.1.7
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 +4 -4
- data/README.md +1 -1
- data/lib/fastlane/plugin/ftps/actions/ftps_action.rb +51 -5
- data/lib/fastlane/plugin/ftps/version.rb +2 -2
- data/lib/fastlane/plugin/ftps.rb +3 -3
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cba373f32a2fd54c2eb083c14504719fbe5299ae39fe56856e69af3a2fce449c
|
4
|
+
data.tar.gz: 9cc4d57eadb6b2010e4cea462d395f79b2f5ebb5b6d3957cb455990f7ef23bf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ee9ecbd16ef15b0aaefe47725f462df5c994daf6064f2ceed7df0d683754dd1428047a9321dabbff8e509a135f3eec93155c4e27ae89cc7ae862afb3805fefb
|
7
|
+
data.tar.gz: e5aec3eff00a6ff180d22b06a263e73bbf7a991b35f9984c38377ee28735faeae648924774170b9cd76802fbac83e607c99737537ef0d85481d32e724e223ac5
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# ftps plugin
|
2
2
|
|
3
3
|
[](https://rubygems.org/gems/fastlane-plugin-ftp)
|
4
4
|
[](https://travis-ci.org/PoissonBallon/fastlane-ftp-plugin)
|
@@ -16,6 +16,13 @@ module Fastlane
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
def self.connect_ftp(params)
|
20
|
+
ftp = connect_ftp(params)
|
21
|
+
ensure_remote_path(ftp, folder)
|
22
|
+
ftp.close
|
23
|
+
end
|
24
|
+
|
25
|
+
|
19
26
|
def self.open(params, folder)
|
20
27
|
ftp = Net::FTP.new(params[:host], params[:options])
|
21
28
|
ftp.connect(params[:host], params[:port])
|
@@ -38,11 +45,7 @@ module Fastlane
|
|
38
45
|
end
|
39
46
|
|
40
47
|
def self.put(params)
|
41
|
-
ftp =
|
42
|
-
progressbar = ProgressBar.create(:format => '%a |%b>>%i| %p%% %t', :starting_at => 0)
|
43
|
-
ftp.connect(params[:host], params[:port])
|
44
|
-
ftp.login(params[:username], params[:password])
|
45
|
-
ftp.passive = true
|
48
|
+
ftp = connect_ftp(params)
|
46
49
|
ftp.chdir(params[:upload][:dest])
|
47
50
|
filesize = File.size(params[:upload][:src])
|
48
51
|
progressbar.total = filesize
|
@@ -65,6 +68,49 @@ module Fastlane
|
|
65
68
|
UI.success("Successfully download #{params[:download][:dest]}")
|
66
69
|
end
|
67
70
|
|
71
|
+
def self.put_multiple(params, file_paths)
|
72
|
+
ftp = connect_ftp(params)
|
73
|
+
|
74
|
+
# Upewniamy się, że ścieżka (folder) do której wgrywamy istnieje.
|
75
|
+
ensure_remote_path(ftp, params[:upload][:dest])
|
76
|
+
ftp.chdir(params[:upload][:dest])
|
77
|
+
|
78
|
+
total_size = file_paths.reduce(0) { |sum, file_path| sum + File.size(file_path) }
|
79
|
+
progressbar = ProgressBar.create(
|
80
|
+
format: '%a |%b>>%i| %p%% %t',
|
81
|
+
total: total_size,
|
82
|
+
starting_at: 0
|
83
|
+
)
|
84
|
+
|
85
|
+
file_paths.each do |local_file|
|
86
|
+
filename = File.basename(local_file)
|
87
|
+
ftp.putbinaryfile(local_file, filename) do |data|
|
88
|
+
progressbar.progress += data.size
|
89
|
+
end
|
90
|
+
UI.message("Uploaded: #{filename}")
|
91
|
+
end
|
92
|
+
|
93
|
+
ftp.close
|
94
|
+
UI.success("Successfully uploaded all files to #{params[:upload][:dest]}")
|
95
|
+
end
|
96
|
+
|
97
|
+
def ensure_remote_path(ftp, folder)
|
98
|
+
parts = folder.split('/')
|
99
|
+
current_path = ''
|
100
|
+
parts.each do |part|
|
101
|
+
# Pomijamy puste elementy (np. jeśli folder zaczyna się od '/')
|
102
|
+
next if part.empty?
|
103
|
+
|
104
|
+
current_path = "#{current_path}/#{part}"
|
105
|
+
begin
|
106
|
+
ftp.chdir(current_path)
|
107
|
+
rescue Net::FTPPermError
|
108
|
+
ftp.mkdir(part)
|
109
|
+
ftp.chdir(current_path)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
68
114
|
#####################################################
|
69
115
|
# @!group Documentation
|
70
116
|
#####################################################
|
data/lib/fastlane/plugin/ftps.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require 'fastlane/plugin/
|
1
|
+
require 'fastlane/plugin/ftps/version'
|
2
2
|
|
3
3
|
module Fastlane
|
4
|
-
module
|
4
|
+
module Ftps
|
5
5
|
# Return all .rb files inside the "actions" and "helper" directory
|
6
6
|
def self.all_classes
|
7
7
|
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
@@ -11,6 +11,6 @@ end
|
|
11
11
|
|
12
12
|
# By default we want to import all available actions and helpers
|
13
13
|
# A plugin can contain any number of actions and plugins
|
14
|
-
Fastlane::
|
14
|
+
Fastlane::Ftps.all_classes.each do |current|
|
15
15
|
require current
|
16
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-ftps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafał Dziuryk
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-progressbar
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 2.2.0
|
111
|
-
description:
|
111
|
+
description:
|
112
112
|
email: rafal.dziuryk@appvinio.com
|
113
113
|
executables: []
|
114
114
|
extensions: []
|
@@ -124,7 +124,7 @@ homepage: https://github.com/rafaldziuryk/fastlane-ftps-plugin
|
|
124
124
|
licenses:
|
125
125
|
- MIT
|
126
126
|
metadata: {}
|
127
|
-
post_install_message:
|
127
|
+
post_install_message:
|
128
128
|
rdoc_options: []
|
129
129
|
require_paths:
|
130
130
|
- lib
|
@@ -139,8 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
|
-
rubygems_version: 3.
|
143
|
-
signing_key:
|
142
|
+
rubygems_version: 3.4.10
|
143
|
+
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: Simple ftp upload and download for Fastlane
|
146
146
|
test_files: []
|