usd 0.3 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rusdc +7 -4
  3. data/change_log.md +4 -0
  4. data/usd.gemspec +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01c14a85c19914e885ffd003e8b4584ab7f89a15305866abade4ea4888625940
4
- data.tar.gz: e89f3b47d89b9040077400049e91aa0700f4c68d41b19c6cf7fde7a97f8e46c8
3
+ metadata.gz: d3d2a11346d32e1cd5810370fb50b4dbb4d4da9f36375a27cb26cf39325142b9
4
+ data.tar.gz: 00c0893c1b33408e16619aeaaeae67f6396da165d30aefc85bd6b645cbf11482
5
5
  SHA512:
6
- metadata.gz: 5857ce4ebc1a8b24b59a1ce22e63cdaa9384724401d6aae189a3345c952ce74e22332b2a0a25ec3cf2bc3e3f059f298ca9455e391028f20675cd2069adeb4f3e
7
- data.tar.gz: 97a5207333d77ece64e71b7883f8198bdd8fad5f47f772d72d6f438aaebb3e95ff6179bdbfd81d07574a033181a50642a2ede5f155aa6e62e1453e0170bc3770
6
+ metadata.gz: 4da79eee6164891fe192dd639d83a28d89593b81f1c816942964991587308299bd1d28a6ced8755c203f8750354ba192615babba1861374bad25b47d0e3bf2b5
7
+ data.tar.gz: 193d05f6931a377fe1cd8fd3d5cd3a8cb65296719b58ab2717a7711599c005700bd83d5116d434be68232f90d85b13a84931ef087394fb4e723f4802e0ee6a91
data/bin/rusdc CHANGED
@@ -127,6 +127,7 @@ class Rusdc < Thor
127
127
  case options[:format]
128
128
  when "json"
129
129
  puts mlr
130
+ e
130
131
  exit exitcode
131
132
  when "yaml"
132
133
  # keys not sorted, maybe a todo
@@ -383,8 +384,8 @@ class Rusdc < Thor
383
384
  puts loadcon.update({:type => "json", :data => json})
384
385
  end
385
386
 
386
- desc "update_ref_attr <obj> <common_name> <key> <value>", "updates a referenced attribute of one object."
387
- def update_ref_attr(obj, cn, k, v)
387
+ desc "update_ref_attr <obj> <common_name> <key> <value> [ref_obj=nr]", "updates a referenced attribute of one object."
388
+ def update_ref_attr(obj, cn, k, v, ref_obj = "nr")
388
389
  template = ERB.new <<-EOF
389
390
  {
390
391
  "<%= obj %>": {
@@ -403,8 +404,10 @@ class Rusdc < Thor
403
404
  })
404
405
  data = loadcon.update({:type => "json", :data => json})
405
406
  if data.class == RestClient::BadRequest
406
- puts "direkte Ausführung bekommt einen BadRequest, versuche Update über IDs. #{Usd::CN["cnt"]}"
407
- #find(obj, wc="obj", fields="@COMMON_NAME")
407
+ puts "direkte Ausführung bekommt einen BadRequest, versuche Update über IDs. #{Usd::CN[obj]}"
408
+ cn_id = loadcon.search(obj,{'fields' => "@id","wc" => "#{Usd::CN[obj]} = '#{cn}' and delete_flag = 0"})[0]["@id"]
409
+ value_id = loadcon.search(ref_obj,{'fields' => "@id","wc" => "#{Usd::CN[obj]} = '#{v}' and delete_flag = 0"})[0]["@id"]
410
+ invoke "update_ref_attr_by_id", [obj, cn_id, k, value_id]
408
411
  else
409
412
  puts data
410
413
  end
data/change_log.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # rusdc changelog
2
2
 
3
+ ## 1.0
4
+
5
+ - `update_ref_attr` rusdc-function fetches the IDs to update the object by itself.
6
+
3
7
  ## 0.3
4
8
 
5
9
  - some common_name resolution
data/usd.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'usd'
3
- spec.version = '0.3'
3
+ spec.version = '1.0'
4
4
  spec.date = '2020-08-31'
5
5
  spec.summary = "SDM REST-API-Calls"
6
6
  spec.description = "a Ruby class and a commandlinetool for SDM REST-API-Calls"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usd
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '1.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Gaida