usd 1.3.7 → 1.5.1

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: 76168d8702cea6b4f50eb7f35849793c694c5359527bc1643a1e3306ea81aa2b
4
- data.tar.gz: 0c3ffb3e1e0b880c4d2ef297d19af5d3dcdab2fbf6c88418a55037db77368ab8
3
+ metadata.gz: e2d18556bd6e6ab47d9b1f00b472b49541d2dfc276f9d67fe7e366fe65c6cde8
4
+ data.tar.gz: 80f649c851c8b79a588f63cdb9fba232708eb149ffae6069e27d35996ac7a90a
5
5
  SHA512:
6
- metadata.gz: 3521906b5c80e59468a66c0b9ef20c040a81c6b840b105707ca0f29908e39f38aece82fbf1cd3a4de86e5aca6a8ced40265553bb85d206626f53e93e97d5c1e5
7
- data.tar.gz: 6978d0bf488852d0e5e96c34dccf4e745a9435c0ec1a9707a7940815cc58e0a05d0e6266046d31a15f0ba45a1181cded6e51f8af3a223d65f55a8ca25ba3f8e7
6
+ metadata.gz: b0b374caa3e8df59b733199402680a5aa92afb21547020287a4881ce9def2c4246e1275ae069eea202cc6b2933a59fe6ec5c4e4566ad4209ba6ee1e77a5464df
7
+ data.tar.gz: 820594466ab5b0c7308548e8036c4d78da529bc8b4d0e4e32b8c68db23678e05b2c87f76c6e43671ba366060f4f5c1809b0de6d7a196bb679404a12b4f1642ef
data/LICENSE.md CHANGED
File without changes
data/README.md CHANGED
@@ -117,3 +117,7 @@ more examples under [find examples-Wikipage](https://github.com/ogaida/usd/wiki/
117
117
  # senarios
118
118
 
119
119
  <img src="https://yuml.me/diagram/scruffy/class/[SDM%20REST-API{bg:red}]<->[usd-gem{bg:green}]<->[rusdc{bg:orange}],[ruby-script{bg:orange}]<->[usd-gem],[sinatra%20web-app{bg:orange}]<->[usd-gem],[bash commands]<->[rusdc],[shell-scripts]<->[rusdc],[import]->[ruby-script],[ruby-script]->[export],[reports]<-[sinatra%20web-app]<-[drop datafiles/emails/create objects]">
120
+
121
+ # feedback
122
+
123
+ Since I could only test this gem in a 14.1 environment, I would be interested to know whether it also works in a version 17 environment of CA Service Management. Any kind of feedback is very welcome.
data/bin/rusdc CHANGED
@@ -520,7 +520,7 @@ class Rusdc < Thor
520
520
  })
521
521
  data = loadcon.update({:type => "json", :data => json})
522
522
  if data.class == RestClient::BadRequest
523
- puts "BadRequest-Response from USD-API, try to update via IDs. be aware to specify a ref_obj if it's not nr."
523
+ puts "Hint: Do not panic, I got a bad Request-Response from USD-API. Now I try again to update via IDs of COMMON_NAME arguments. Be aware to specify a ref_obj if it's not nr."
524
524
  cn_id = loadcon.search(obj,{'fields' => "@id","wc" => "#{Usd::CN[obj]} = '#{cn}' and delete_flag = 0"})[0]["@id"]
525
525
  value_id = loadcon.search(ref_obj,{'fields' => "@id","wc" => "#{Usd::CN[ref_obj]} = '#{v}' and delete_flag = 0"})[0]["@id"]
526
526
  invoke "update_ref_attr_by_id", [obj, cn_id, k, value_id]
data/bin/set_env CHANGED
File without changes
data/change_log.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # rusdc changelog
2
2
 
3
+ ## 1.5.0
4
+
5
+ - sdm-access token caching changed, now for multiple user-sessions in one environment
6
+
7
+ ## 1.4.2
8
+
9
+ - count number changed for search method from fixed value of 50 to dynamic value
10
+
11
+ ## 1.4.1
12
+
13
+ - changed some comments
14
+
15
+ ## 1.4.0
16
+
17
+ - remove "warning: URI.escape is obsolete"
18
+
3
19
  ## 1.3.7
4
20
 
5
21
  - Bugfix in rusdc-function `get_attachment_of_co`
data/images/vcard.png CHANGED
File without changes
data/lib/usd.rb CHANGED
@@ -11,6 +11,7 @@ require 'tempfile'
11
11
  class Usd
12
12
 
13
13
  CN={
14
+ "grc" => "type",
14
15
  "chg" => "chg_ref_num",
15
16
  "cnt" => "combo_name",
16
17
  "arcpur_rule" => "name",
@@ -91,7 +92,7 @@ class Usd
91
92
  @base_url = base_url
92
93
  @user = user
93
94
  @debug = false
94
- remfile = "#{ENV["HOME"]}/.usd"
95
+ remfile = "#{ENV["HOME"]}/.usd_#{user}"
95
96
  if File.exist?(remfile) and hash[:save_access_key]
96
97
  tt = YAML.load(File.open(remfile,"r"))
97
98
  if (tt.expiration_date - Time.now.to_i ) > 900 and tt.base_url == base_url
@@ -119,8 +120,9 @@ class Usd
119
120
  "accept" => "application/json",
120
121
  "authorization" => "Basic #{encoded}",
121
122
  "cache-control" => "no-cache"
122
- },
123
- log: Logger.new(STDOUT)
123
+ }
124
+ #,
125
+ #log: Logger.new(STDOUT)
124
126
  )
125
127
  authData=JSON.parse(response.body)
126
128
  if authData['rest_access']['access_key'] > 0
@@ -160,10 +162,11 @@ class Usd
160
162
  RestClient.log = STDOUT if @debug
161
163
  hash = {:method => "get", :header => header(), :unchanged => false, :json => "", :base_url => @base_url}.update hash
162
164
  puts "request - hash: #{JSON.pretty_generate(hash)}" if @debug
165
+ parser = URI::RFC2396_Parser.new
163
166
  if (uri !~ /^http/)
164
- url = URI.escape("#{hash[:base_url]}#{uri}")
167
+ url = parser.escape("#{hash[:base_url]}#{uri}")
165
168
  else
166
- url = URI.escape(uri)
169
+ url = parser.escape(uri)
167
170
  end
168
171
  begin
169
172
  if hash[:method] == "get"
@@ -271,7 +274,7 @@ class Usd
271
274
  else
272
275
  retArray = res_rdata["collection_#{object}"][object]
273
276
  if total_count > (count + start - 1)
274
- new_params = {"start" => (start + 50)}
277
+ new_params = {"start" => (start + count)}
275
278
  params = params.update new_params
276
279
  retArray += search(object,params)
277
280
  end
@@ -283,7 +286,8 @@ class Usd
283
286
  baseurl =~ /^([^:]+):/
284
287
  server = $1
285
288
  filename = File.basename(file)
286
- filename_escaped = URI.escape(filename)
289
+ #filename_escaped = URI.escape(filename)
290
+ filename_escaped = filename.gsub(/[^0-9A-Za-z.\-]/, '_')
287
291
  uri = "/caisd-rest/attmnt?repositoryId=1002&serverName=#{server}&mimeType=Text&description=#{filename_escaped}"
288
292
  url = URI("#{baseurl}#{uri}")
289
293
  http = Net::HTTP.new(url.host, url.port);
data/usd.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'usd'
3
- spec.version = '1.3.7'
4
- spec.date = '2020-09-29'
3
+ spec.version = '1.5.1'
4
+ spec.date = '2021-02-24'
5
5
  spec.summary = "SDM REST-API-Calls"
6
6
  spec.description = "a Ruby class and a commandlinetool for SDM REST-API-Calls"
7
7
  spec.authors = ["Oliver Gaida"]
@@ -13,4 +13,5 @@ Gem::Specification.new do |spec|
13
13
  spec.add_runtime_dependency 'thor', '~> 0.20', '>= 0.20.3'
14
14
  spec.add_runtime_dependency 'rest-client', '~> 2.0', '>= 2.0.0'
15
15
  spec.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
16
+ spec.license = 'MIT'
16
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Gaida
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-29 00:00:00.000000000 Z
11
+ date: 2021-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -86,7 +86,8 @@ files:
86
86
  - lib/usd.rb
87
87
  - usd.gemspec
88
88
  homepage: https://github.com/ogaida/usd
89
- licenses: []
89
+ licenses:
90
+ - MIT
90
91
  metadata: {}
91
92
  post_install_message:
92
93
  rdoc_options: []
@@ -103,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
104
  - !ruby/object:Gem::Version
104
105
  version: '0'
105
106
  requirements: []
106
- rubyforge_project:
107
- rubygems_version: 2.7.6
107
+ rubygems_version: 3.1.2
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: SDM REST-API-Calls