eco-helpers 1.1.6 → 1.1.7

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
  SHA256:
3
- metadata.gz: e0c1cca427dcc2ced629146debcbe71a05f062002919b68b32e88ebddd86c25c
4
- data.tar.gz: e74e5b3c8007af145e1255903a4a1a26dc785b84004434291524275a5ac38734
3
+ metadata.gz: 99c00079c05c52d513d6f11d32a76b0fe12dfa71cb5a7bba5802e7353b254930
4
+ data.tar.gz: 1ed877e47f96cc47c7845a2ee7d680d3fb37f9684bb4edf4ca5bdd8249387721
5
5
  SHA512:
6
- metadata.gz: 55e089b0827e28aafb5ac51e5b7ff37a09a81ab71160087080ecff70a10a44397dec6d0e2d847f8a5767b52c44a6ae548affd06c28a6e4ccb3d2edf37472f81a
7
- data.tar.gz: 4801acfeedc39e1287808f812845c915316e0bac92d16594fe412899483104cba6604f30e1cf717dae6438c2f4e69a4e1adb1ea7af863d3a2a27273a36b1ec3a
6
+ metadata.gz: 28d0965ab12c534dd1ca0bb990437f5f615489ae30bb3e27486808c59209fcf472abf8c20df56a32ac98312d591924ffba11401c0fa80b27881e9894785ec0c9
7
+ data.tar.gz: 78c86549405bf05044819851251e69ef09fe39fab84e44b2a1198eeaefcf8094df042f0d0586a1fa1fb242df851f1c3eeb72dc04705579feddc529820ad63b13
@@ -48,9 +48,10 @@ module Eco
48
48
  self["active-name"]
49
49
  end
50
50
 
51
- # you can create multiple apis under same root_name (same org)
51
+ # the active environment
52
52
  def active_root_name
53
- active_name.split("-").first
53
+ active_name
54
+ #active_name.split("-").first
54
55
  end
55
56
 
56
57
  def active_api
@@ -65,6 +65,14 @@ module Eco
65
65
  self["target_directories"]
66
66
  end
67
67
 
68
+ def target_file_patterns=(value)
69
+ self["target_file_patterns"] = [value].flatten
70
+ end
71
+
72
+ def target_file_patterns
73
+ self["target_file_patterns"]
74
+ end
75
+
68
76
  end
69
77
  end
70
78
  end
@@ -123,6 +123,26 @@ module Eco
123
123
  session.config.s3storage.target_directories.each_with_object(paths) do |folder, arr|
124
124
  arr.concat(session.s3upload(directory: folder))
125
125
  end
126
+ session.config.s3storage.target_file_patterns.each_with_object(paths) do |pattern, arr|
127
+ filenames = []
128
+ case pattern
129
+ when Regexp
130
+ Dir.entries(".").sort.each do |file|
131
+ next unless File.file?(file) # Skip directories
132
+ filenames.push(file) if file =~ pattern
133
+ end
134
+ when String
135
+ Dir.glob(pattern).sort.each do |file|
136
+ next unless File.file?(file) # Skip directories
137
+ filenames.push(file)
138
+ end
139
+ else
140
+ # missconfiguration
141
+ end
142
+ filenames.each do |file|
143
+ arr.push(session.s3upload(file: file))
144
+ end
145
+ end
126
146
  end
127
147
  end
128
148
 
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "1.1.6"
2
+ VERSION = "1.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura