eco-rake 0.2.0 → 0.2.2

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: 628181cc7bb3f65177780f0ce04dba3e16ce33256bd708c1619a214699622fc5
4
- data.tar.gz: d70cadf71bcc60f3578993ef16d10300f938bce65ae325faf2e3a9ae86e82c23
3
+ metadata.gz: c120b2774e460a491cd6ed503fcbd0b6a3060fd95fdd6cf246a6b5006dbe8152
4
+ data.tar.gz: 21f02bd7ba91e6bb257f035fc7eccaee157dcd05e921d46ec727d06cd67bcb21
5
5
  SHA512:
6
- metadata.gz: 46504cb702b95c53a542a93cb749951a31093cdd7191f6364c100e58f70c62646448b3341cd4a87c979b4c4c15f2ab2d926f28852191fe92d32ed76e99694ccf
7
- data.tar.gz: dc9bb1377d36e0bcca062d85cfe90305167771210095563b3fe122a52a06f1d57153cf4d2723b61ec18e9e285add8915f297ca6cc0b1f3253a344d7f871060bc
6
+ metadata.gz: 6d78872f66404e488cedb140214e50fc034dbc29933c3bc915bde8c61f8c61f91d8358f55a437c6a7c1538d6d75a228536d814da966224be8998f7af50faa5c5
7
+ data.tar.gz: 41f4e52423002f61f53df3a63601d618da3ed473b45a749e7d5d90e15268e4c5e34f9b31a44f19a18db0c6a8797cdc3ea1d80834101af7f557683aabe3b9dd46
data/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## [0.2.1] - 2024-08-xx
5
+ ## [0.2.3] - 2024-08-xx
6
6
 
7
7
  ### Added
8
8
 
@@ -10,6 +10,18 @@ All notable changes to this project will be documented in this file.
10
10
 
11
11
  ### Changed
12
12
 
13
+ ## [0.2.2] - 2024-08-08
14
+
15
+ ### Fixed
16
+
17
+ - fixed typo
18
+
19
+ ## [0.2.1] - 2024-08-07
20
+
21
+ ### Added
22
+
23
+ - `SNAPSHOT_MODE` new mode: `:delta_last`
24
+
13
25
  ## [0.2.0] - 2024-08-01
14
26
 
15
27
  ### Changed
@@ -29,13 +29,13 @@ class EcoRake
29
29
  def task(*_args)
30
30
  return missing_files_notify unless latest_file
31
31
  return process_deltas if delta?
32
- return process_full_file if full?
32
+ return process_full_file if full? || delta_last?
33
33
  end
34
34
 
35
35
  private
36
36
 
37
37
  def process_full_file
38
- sh people_get_command unless options[:no_get]
38
+ sh people_get_command unless options[:no_get] || delta_last?
39
39
  sh_continue sync_command(latest_file)
40
40
  clear_files unless options[:simulate]
41
41
  end
@@ -44,6 +44,7 @@ class EcoRake
44
44
  target_files.each do |file|
45
45
  sh sync_command(file)
46
46
  next if options[:simulate]
47
+
47
48
  puts "Deleting file #{file}"
48
49
  File.delete(file)
49
50
  end
@@ -66,7 +67,7 @@ class EcoRake
66
67
  cmd << ruby_runner
67
68
  cmd << forward_option(:enviro)
68
69
  cmd << forward_option(:schema)
69
- cmd << '-get-partial' if delta?
70
+ cmd << '-get-partial' if delta? || delta_last?
70
71
  cmd << base_command(file)
71
72
  cmd.concat(forward_options(*self.class::ADDITIONAL_OPTIONS))
72
73
  cmd = yield(cmd) if block_given?
@@ -87,7 +88,7 @@ class EcoRake
87
88
  when :hris
88
89
  msg = "Inconsistent configuration in #{self.class}. BASE_USECASE is '#{usecase}', "
89
90
  msg << "but file SNAPSHOT_MODE is '#{snapshot_mode}'"
90
- raise msg if delta?
91
+ raise msg if delta? || delta_last?
91
92
  "-hris-from #{double_quote(file_or_folder)}"
92
93
  when :upsert
93
94
  "-upsert-from #{double_quote(file_or_folder)}"
@@ -105,6 +106,10 @@ class EcoRake
105
106
  %i[partial delta].any? {|m| m == mode}
106
107
  end
107
108
 
109
+ def delta_last?
110
+ snapshot_mode.to_s.downcase.to_sym == :delta_last
111
+ end
112
+
108
113
  # Amont the `target_files` the last in alphabetic order.
109
114
  def latest_file
110
115
  @latest_file ||= target_files.last
@@ -1,5 +1,5 @@
1
1
  require 'rake-commander'
2
2
 
3
3
  class EcoRake < RakeCommander
4
- VERSION = '0.2.0'.freeze
4
+ VERSION = '0.2.2'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura Samper
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-01 00:00:00.000000000 Z
11
+ date: 2024-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake