pipe_fitter 0.2.2 → 0.2.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35272d9ed3c3d4edc4bf88d64b11442e35e3c9a4cace6a98444d83d4c48289dc
4
- data.tar.gz: bed943fbffa0862193d6206f94ba719ab21c99a80b9ba70dea74f333794c1549
3
+ metadata.gz: 16abe221f75664cadd6d2a891f6bdda26e70dac9be50e0011db75d621a432a23
4
+ data.tar.gz: cfd865d45095d2aec7aeb52a62527c57c5fc8db6b7805ab59e8c3198433dd69e
5
5
  SHA512:
6
- metadata.gz: bc2ef02c8e8a3739cbe518045f2560e3a993ab3c29b14980c25a3213e305a71396f47d311a1b3cbf50e0deb3d3fb4bf47cfbd9b699d8e5d9415a4f5eb6a3ad57
7
- data.tar.gz: fdc45689a2e8c8711419c36a7284d0fb8a1321ce27651f1ee3641b8a301e95da745bf394831fe60f4e04bea8d803a5ab7491ece069b375cefb2aafea26321b28
6
+ metadata.gz: 3b685fd1dd462f29af07825649b7cecb88bca7daf129a204aea3328b9541ef8f0119847eaef195a8effc5285f0a727ff4887b1eed6ecd10be427f7de09a8443a
7
+ data.tar.gz: a54a4c6b637f63abd88551c83358a8ce48a9790278cc3704eff7fc84fe796da0034d839d526139c6c93e4792bab99774fd67b6c6a93dc2e6ca3207538ce5def1
@@ -0,0 +1,65 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ types:
9
+ - opened
10
+ - synchronize
11
+ - reopened
12
+ schedule:
13
+ - cron: "0 10 * * 5" # JST 19:00 (Fri)
14
+
15
+ env:
16
+ RUBYOPT: -EUTF-8
17
+
18
+ jobs:
19
+ test:
20
+ runs-on: ubuntu-latest
21
+
22
+ strategy:
23
+ fail-fast: false
24
+
25
+ matrix:
26
+ ruby:
27
+ - "2.6"
28
+ - "2.7"
29
+ - "3.0"
30
+ - "3.1"
31
+ - "3.2"
32
+
33
+ steps:
34
+ - uses: actions/checkout@v3
35
+
36
+ - uses: ruby/setup-ruby@v1
37
+ with:
38
+ ruby-version: ${{ matrix.ruby }}
39
+ bundler-cache: true
40
+
41
+ - run: bundle update --jobs $(nproc) --retry 3
42
+
43
+ - name: bundle update
44
+ run: |
45
+ set -xe
46
+ bundle config path vendor/bundle
47
+ bundle update --jobs $(nproc) --retry 3
48
+
49
+ - name: Setup Code Climate Test Reporter
50
+ uses: aktions/codeclimate-test-reporter@v1
51
+ with:
52
+ codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
53
+ command: before-build
54
+ continue-on-error: true
55
+
56
+ - run: bundle exec rake test
57
+ timeout-minutes: 1
58
+
59
+ - name: Teardown Code Climate Test Reporter
60
+ uses: aktions/codeclimate-test-reporter@v1
61
+ with:
62
+ codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
63
+ command: after-build
64
+ if: always()
65
+ continue-on-error: true
data/exe/pipe_fitter CHANGED
@@ -60,6 +60,7 @@ module PipeFitter
60
60
  p = client.find_registered(definition_file)
61
61
  abort("Pipeline is not registered") if p.nil?
62
62
  puts client.diff(p.id, definition_file, options[:format])
63
+ puts p.to_h.to_json
63
64
  end
64
65
 
65
66
  desc "find_update", "Find pipeline besed on name and uniqueId, update pipeline definition"
@@ -74,6 +75,7 @@ module PipeFitter
74
75
  end
75
76
  res = client.update(p.id, definition_file)
76
77
  puts JSON.pretty_generate(res)
78
+ puts p.to_h.to_json
77
79
  end
78
80
 
79
81
  desc "diff_deploy_files DEFINITION_FILE", "Show deploy files differences"
@@ -83,6 +83,15 @@ module PipeFitter
83
83
  end
84
84
 
85
85
  class PipelineBaseObjects
86
+ def initialize(objs)
87
+ @objs = (objs || []).map { |obj| symbolize_keys(obj) }
88
+ .sort_by { |obj| obj[:id] }.map do |obj|
89
+ obj.sort_by do |k, v|
90
+ [key_order.index(k) || key_order.size + 1, k.to_s, v.to_s]
91
+ end.to_h
92
+ end
93
+ end
94
+
86
95
  def to_objs
87
96
  case @objs
88
97
  when Array then @objs.map { |obj| stringify_keys(obj) }
@@ -126,7 +135,7 @@ module PipeFitter
126
135
  res = []
127
136
  obj.each do |k, v|
128
137
  next if skip_keys.include?(k)
129
- (v.is_a?(Array) ? v : [v]).each do |vv|
138
+ Array(v).each do |vv|
130
139
  if vv.is_a?(Hash) && vv.key?(:ref)
131
140
  res << { key: k, ref_value: vv[:ref] }
132
141
  else
@@ -150,15 +159,8 @@ module PipeFitter
150
159
  new(objs)
151
160
  end
152
161
 
153
- KEY_ORDER = %i(id name).freeze
154
-
155
- def initialize(objs)
156
- @objs = (objs || []).map { |obj| symbolize_keys(obj) }
157
- .sort_by { |obj| obj[:id] }.map do |obj|
158
- obj.sort_by do |k, v|
159
- [KEY_ORDER.index(k) || KEY_ORDER.size + 1, k.to_s, v.to_s]
160
- end.to_h
161
- end
162
+ def key_order
163
+ %i(id name).freeze
162
164
  end
163
165
 
164
166
  def to_api_opts
@@ -179,15 +181,8 @@ module PipeFitter
179
181
  new(objs)
180
182
  end
181
183
 
182
- KEY_ORDER = %i(id).freeze
183
-
184
- def initialize(objs)
185
- @objs = (objs || []).map { |obj| symbolize_keys(obj) }
186
- .sort_by { |obj| obj[:id] }.map do |obj|
187
- obj.sort_by do |k, v|
188
- [KEY_ORDER.index(k) || KEY_ORDER.size + 1, k.to_s, v.to_s]
189
- end.to_h
190
- end
184
+ def key_order
185
+ %i(id).freeze
191
186
  end
192
187
 
193
188
  def to_api_opts
@@ -1,3 +1,3 @@
1
1
  module PipeFitter
2
- VERSION = "0.2.2".freeze
2
+ VERSION = "0.2.4".freeze
3
3
  end
@@ -39,7 +39,7 @@ module PipeFitter
39
39
  private
40
40
 
41
41
  def eval_erb(data, context = {})
42
- ERB.new(data, nil, "-").result(binding).strip
42
+ ERB.new(data, trim_mode: "-").result(binding).strip
43
43
  end
44
44
 
45
45
  def grep_v(filename, pattern)
data/pipe_fitter.gemspec CHANGED
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_runtime_dependency "thor"
26
26
  spec.add_runtime_dependency "hashie"
27
27
  spec.add_runtime_dependency "s3diff", ">= 0.1.2"
28
+ spec.add_runtime_dependency "rexml"
28
29
 
29
30
  spec.add_development_dependency "bundler", ">= 1.3.5"
30
31
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipe_fitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - masa21kik
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-20 00:00:00.000000000 Z
11
+ date: 2023-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.1.2
97
+ - !ruby/object:Gem::Dependency
98
+ name: rexml
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: bundler
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -186,6 +200,7 @@ executables:
186
200
  extensions: []
187
201
  extra_rdoc_files: []
188
202
  files:
203
+ - ".github/workflows/test.yml"
189
204
  - ".gitignore"
190
205
  - ".travis.yml"
191
206
  - Gemfile
@@ -205,7 +220,7 @@ homepage: https://github.com/masa21kik/pipe_fitter
205
220
  licenses:
206
221
  - MIT
207
222
  metadata: {}
208
- post_install_message:
223
+ post_install_message:
209
224
  rdoc_options: []
210
225
  require_paths:
211
226
  - lib
@@ -220,8 +235,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
235
  - !ruby/object:Gem::Version
221
236
  version: '0'
222
237
  requirements: []
223
- rubygems_version: 3.0.3
224
- signing_key:
238
+ rubygems_version: 3.3.7
239
+ signing_key:
225
240
  specification_version: 4
226
241
  summary: PipeFitter is a tool for AWS Data Pipeline.
227
242
  test_files: []