usd 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -2
  3. data/change_log.md +4 -0
  4. data/lib/usd.rb +3 -2
  5. data/usd.gemspec +2 -2
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70fbd18a6341df303be1897efab57eefae5c72db3f4e94af89cd7da4900281ad
4
- data.tar.gz: ee6882af88f19c208d113bab4d96b2b7725d4e0c635b02c6e885153dd6c95475
3
+ metadata.gz: 2f200b7489e39e8790b98cd217f685141c977eea38b009ff4e7c086aa475868a
4
+ data.tar.gz: e520b09923e8ebc24e2ddf3f03d2c4d455896e99dc708b0439a23c0f37154a61
5
5
  SHA512:
6
- metadata.gz: a9954d1e3f35a7d2f506e94cf5354f2e3c4ff74b27c855f56fe7e13310bd5cef8e5addc4937e1c01dfee23e803680da3e6c39a32eab22812efb8708279031d88
7
- data.tar.gz: e9f4192677bb57d007d8eb98640e8a5e2de42d8053f906caae1ec3494c314f4ef41753b06151a842c935f8e972740319d7ae65d4bfec2fa7bb8105c4971cd550
6
+ metadata.gz: 1a66a5e24cf6651dab72a6c5a564c466d8320f7c2d9c3c74a5d832b90eb384a257043d245dcb2636e270631a775cdb25e3dd3ec584bcf3ce01f484485354375b
7
+ data.tar.gz: c4bb48aa371fcd9770e8fb3e64e4c79dcebed55cf6100aa1ca330f0fe403c66427fc5c94ac7a5ed7fd334376ffd2e62ddb927e1346698d91d1bfef9066091f7b
data/README.md CHANGED
@@ -56,13 +56,14 @@ rusdc get_attachment_of_co <co_name> <filename> # d
56
56
  rusdc get_attachment_of_in <incident> <filename> # download an attachment of an Incident and print it out on stdout
57
57
  rusdc help [COMMAND] # Describe available commands or one specific command
58
58
  rusdc in_add_2_chg <changeorder> <incident> # add incident to changeorder
59
- rusdc in_add_attachment <in> <file> # attach the file to incident
59
+ rusdc in_add_attachment <in> <file> # attach a file to an incident or problem
60
60
  rusdc in_list_child_ins <in> # list all child-incidents of one incident
61
61
  rusdc list_attachments_of_ci <ci_name> # list all attachments of a CI
62
62
  rusdc list_attachments_of_co <co_name> # list all attachments of a changeorder
63
- rusdc list_attachments_of_in <in> # list all attachments of an Incident
63
+ rusdc list_attachments_of_in <in> # list all attachments of an incident or problem
64
64
  rusdc nr_add_attachment <nr> <file> # attach the file to nr
65
65
  rusdc nr_add_child <nr-name> <child-name> # add one child CI to another CI
66
+ rusdc nr_add_contact <nr> <cnt_email> # add contact to configuration-item
66
67
  rusdc nr_add_org <nr> <org> # add an Organisation to a ConfigurationItem
67
68
  rusdc nr_changes <nr> [inactive-too] # list all open changeorders of one CI
68
69
  rusdc nr_childs <ci-name> # lists all childs CIs of a specific CI
@@ -1,5 +1,9 @@
1
1
  # rusdc changelog
2
2
 
3
+ ## 1.3.6
4
+
5
+ - Bugfix : uploaded filename with special character will be renamed with `URI.escape`
6
+
3
7
  ## 1.3.5
4
8
 
5
9
  - new function `nr_add_contact <nr> <email>` to assign a contact to a configuration-item
data/lib/usd.rb CHANGED
@@ -283,7 +283,8 @@ class Usd
283
283
  baseurl =~ /^([^:]+):/
284
284
  server = $1
285
285
  filename = File.basename(file)
286
- uri = "/caisd-rest/attmnt?repositoryId=1002&serverName=#{server}&mimeType=Text&description=#{filename}"
286
+ filename_escaped = URI.escape(filename)
287
+ uri = "/caisd-rest/attmnt?repositoryId=1002&serverName=#{server}&mimeType=Text&description=#{filename_escaped}"
287
288
  url = URI("#{baseurl}#{uri}")
288
289
  http = Net::HTTP.new(url.host, url.port);
289
290
  request = Net::HTTP::Post.new(url)
@@ -294,7 +295,7 @@ class Usd
294
295
  fileObj = File.open(file, "rb")
295
296
  fileContent = fileObj.read
296
297
  fileObj.close
297
- request.body = "--*****MessageBoundary*****\r\n \r\nContent-Disposition: form-data; name=\"payload\" \r\nContent-Type: application/xml; CHARACTERSET=UTF-8 \r\n\r\n \r\n<attmnt> \r\n<repository id=\"1002\"></repository> \r\n<orig_file_name>#{filename}</orig_file_name> \r\n<attmnt_name>#{filename}</attmnt_name> \r\n<description>Uploaded with rusdc from rubygem usd</description> \r\n</attmnt> \r\n\r\n \r\n--*****MessageBoundary*****\r\n \r\nContent-Disposition: form-data; name=\"#{filename}\"; filename=\"#{filename}\" \r\nContent-Type: application/octet-stream \r\nContent-Transfer-Encoding: base64\r\n\r\n#{Base64.encode64(fileContent)}\r\n\r\n \r\n--*****MessageBoundary*****--\r\n"
298
+ request.body = "--*****MessageBoundary*****\r\n \r\nContent-Disposition: form-data; name=\"payload\" \r\nContent-Type: application/xml; CHARACTERSET=UTF-8 \r\n\r\n \r\n<attmnt> \r\n<repository id=\"1002\"></repository> \r\n<orig_file_name>#{filename_escaped}</orig_file_name> \r\n<attmnt_name>#{filename_escaped}</attmnt_name> \r\n<description>Uploaded with rusdc from rubygem usd</description> \r\n</attmnt> \r\n\r\n \r\n--*****MessageBoundary*****\r\n \r\nContent-Disposition: form-data; name=\"#{filename_escaped}\"; filename=\"#{filename_escaped}\" \r\nContent-Type: application/octet-stream \r\nContent-Transfer-Encoding: base64\r\n\r\n#{Base64.encode64(fileContent)}\r\n\r\n \r\n--*****MessageBoundary*****--\r\n"
298
299
  response = http.request(request)
299
300
  response.read_body
300
301
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'usd'
3
- spec.version = '1.3.5'
4
- spec.date = '2020-09-25'
3
+ spec.version = '1.3.6'
4
+ spec.date = '2020-09-29'
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"]
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.5
4
+ version: 1.3.6
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-25 00:00:00.000000000 Z
11
+ date: 2020-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor