usd 0.1.0 → 0.1.1

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 +35 -5
  3. data/lib/usd.rb +2 -5
  4. data/usd-0.1.0.gem +0 -0
  5. data/usd.gemspec +1 -2
  6. metadata +2 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b9d6085759d57ba2fc8414411caae2443c7b936be7efa28078eb8e8b28f21b3
4
- data.tar.gz: 98a5eb27eeca21188a17442f1e17392ffa5b17d837dc018200d6e2b1b22cbe6f
3
+ metadata.gz: 2551ffa5aebba533a9cf6ba7707dea22463e206d7c2a97255928a784b7999209
4
+ data.tar.gz: 53df77c32d000385bad3f35872fb08bb12ff11556605a0487a804f2644cf8ab5
5
5
  SHA512:
6
- metadata.gz: b9ada977cb4500b7d5dc0442b65df4dd36d0202819c080ed78225d332f166918bc0d691a7bbd0a1191d2f14a971ade8348e5601abefa6b573d30d0aa72e0ec01
7
- data.tar.gz: 3d0c54c51ec22b86291bd2b4696ba4102a58c822da1eaa8dfe283d422fff7c82245621bda25afb3939c32a58918f4951edecafc6708b1bbf322e1b3a4e5a4f18
6
+ metadata.gz: cc027b31c0264b7646fbfe1021b3a00b689ef10f5cef0e8e9e1f021db0e6ffd20b56a34c83ae625823c380b9fbb25ee49c0a7ebbfb30d676ce7795aed47033f5
7
+ data.tar.gz: ca2febd2ba6442795eb43c086a6f0da7bfcefc185a239bf03d1261ce62f696cb91bd9cbbd7aab7cab4b9d0e71c0e324a0c6b225cad007e0a3637a6f7b220f75f
data/README.md CHANGED
@@ -3,21 +3,25 @@
3
3
 
4
4
  There is a ruby class and a commandline tool rusdc.
5
5
 
6
- # Installation
6
+ # installation
7
7
 
8
8
  just install the gem:
9
9
 
10
- ```
10
+ ```bash
11
11
  sudo gem install usd
12
12
  ```
13
13
 
14
14
  Be aware that you need some compiler-tools and the ruby headers:
15
15
 
16
- ```
16
+ ```bash
17
+ # ubuntu
17
18
  sudo apt-get install build-essential ruby-dev
19
+ # redhat
20
+ yum group install "Development Tools"
21
+ yum install ruby-devel
18
22
  ```
19
23
 
20
- # External Tools
24
+ # external tools
21
25
 
22
26
  Some external dependencies are:
23
27
 
@@ -26,7 +30,7 @@ Some external dependencies are:
26
30
 
27
31
  place both binaries `jq` und `mlr` in a path, which is in your PATH-Environment.
28
32
 
29
- # Funktions from the commandline-tool `rusdc`
33
+ # funktions from the commandline-tool `rusdc`
30
34
 
31
35
  ```
32
36
  rusdc
@@ -51,3 +55,29 @@ Commands:
51
55
  ```
52
56
 
53
57
  the german text will be translated soon.
58
+
59
+ # environment-variables
60
+
61
+ rusdc needs some environment-variables. there are:
62
+
63
+ ```
64
+ usduser
65
+ usdpass
66
+ usdurl
67
+ ```
68
+
69
+ you may set and export them via script:
70
+
71
+ ```bash
72
+ #!/usr/bin/env bash
73
+ # load with `source ./set_env`
74
+
75
+ export usduser=<your username>
76
+ export usdurl="http://<your sdm server>:8050"
77
+ if [ -z "$usdpass" ]
78
+ then
79
+ read -s -p "password for $usduser ? " usdpass
80
+ echo ""
81
+ export usdpass
82
+ fi
83
+ ```
data/lib/usd.rb CHANGED
@@ -6,7 +6,6 @@ require "json"
6
6
  require "yaml"
7
7
  require 'uri'
8
8
  require "time"
9
- require "ostruct"
10
9
  require 'tempfile'
11
10
 
12
11
  class Usd
@@ -88,7 +87,7 @@ class Usd
88
87
 
89
88
  def request(uri, hash={})
90
89
  RestClient.log = STDOUT if @debug
91
- hash = {:method => "get", :header => header(), :unchanged => false, :ostruct => false, :json => "", :base_url => @base_url}.update hash
90
+ hash = {:method => "get", :header => header(), :unchanged => false, :json => "", :base_url => @base_url}.update hash
92
91
  puts "request - hash: #{JSON.pretty_generate(hash)}" if @debug
93
92
  if (uri !~ /^http/)
94
93
  url = URI.escape("#{hash[:base_url]}#{uri}")
@@ -105,9 +104,7 @@ class Usd
105
104
  elsif hash[:method] =~ /delete/i
106
105
  response = RestClient.delete(url, hash[:header])
107
106
  end
108
- if hash[:ostruct]
109
- JSON.parse(response.body, object_class: OpenStruct)
110
- elsif hash[:unchanged]
107
+ if hash[:unchanged]
111
108
  response.body
112
109
  else
113
110
  JSON.parse(response.body)
Binary file
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'usd'
3
- spec.version = '0.1.0'
3
+ spec.version = '0.1.1'
4
4
  spec.date = '2019-10-31'
5
5
  spec.summary = "SDM REST-API-Calls"
6
6
  spec.description = "a Ruby class and a commandlinetool for SDM REST-API-Calls"
@@ -13,5 +13,4 @@ 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.add_runtime_dependency 'ostruct', '~> 0.1', '>= 0.1.0'
17
16
  end
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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Gaida
@@ -70,26 +70,6 @@ dependencies:
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
72
  version: 2.1.0
73
- - !ruby/object:Gem::Dependency
74
- name: ostruct
75
- requirement: !ruby/object:Gem::Requirement
76
- requirements:
77
- - - "~>"
78
- - !ruby/object:Gem::Version
79
- version: '0.1'
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: 0.1.0
83
- type: :runtime
84
- prerelease: false
85
- version_requirements: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '0.1'
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- version: 0.1.0
93
73
  description: a Ruby class and a commandlinetool for SDM REST-API-Calls
94
74
  email: oliver.gaida@sycor.de
95
75
  executables:
@@ -101,6 +81,7 @@ files:
101
81
  - bin/rusdc
102
82
  - bin/set_env
103
83
  - lib/usd.rb
84
+ - usd-0.1.0.gem
104
85
  - usd.gemspec
105
86
  homepage: https://github.com/ogaida/usd
106
87
  licenses: []