wmls 1.0.1 → 1.0.2

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/README.md +3 -1
  3. data/bin/wmls +4 -4
  4. data/lib/wmls.rb +10 -0
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57c9ed31fec8e429b43fe0e1234159a42d546e83
4
- data.tar.gz: cab99e605a6e360002012cf24cfd7ee354700f4d
3
+ metadata.gz: 5b51a8cc37350c29b0170132ec516fe6dd7e6aba
4
+ data.tar.gz: 89d8eddeee3e12c43141ce090a653360720d9add
5
5
  SHA512:
6
- metadata.gz: 476f4c2b180095ce16bf169e327e0431d1fdec8cd6c44ddae79c8c9fbc44e300d4e29a7e0c1423cc39728e6bb887023570cbac100479bcb440bfe585618cfc6e
7
- data.tar.gz: 0a785b7404263d55e21c3f52892be9faeb96c19e4dbec0bdd000cfd911599bda477b89c28f5194c1290bded671e0c186eee5d8189d36a203c39b04b836952793
6
+ metadata.gz: 7e89d94b39fd7efc4d76d82b39bde7d1b2334e7445693ee12bf998075daa4807735e48550b4b1235b42a0e95076adfafc6adafcfaa48709497cf444149c7c47a
7
+ data.tar.gz: 6fd9b38be5a6fc8b90c70de1acab2ae0c8d784e1b1fbe0d9fe8becc4e8f980fcae0f30c047d1cc2b7e8beebc06358046863d747852911e94e01137c206d11974
data/README.md CHANGED
@@ -43,12 +43,13 @@ Pass substitution values for these values on the wmls command line, e.g:
43
43
 
44
44
  ```
45
45
  wmls -DuidWell=ABC -DuidWellbore=1234 -q...
46
- ```
46
+ ```
47
47
 
48
48
  ##License
49
49
  Apache 2.0
50
50
 
51
51
  ##History
52
+
52
53
  10 Mar 2011 -- initial commit.
53
54
  16 Oct 2011 -- added -D option to wmls command line tool (0.1.7)
54
55
  01 May 2012 -- added GetCap support (0.1.8)
@@ -61,5 +62,6 @@ Apache 2.0
61
62
  21 Jul 2015 -- revert back to REXML. (nokogiri install too fragile) (0.1.18) (do not install this version)
62
63
  19 Apr 2016 -- revert back to 0.1.15 plus endDateTimeIndex fix (1.0.0)
63
64
  20 Apr 2016 -- enlarge REXML parameter to permit parsing up to 1GB responses (1.0.1)
65
+ 20 Apr 2016 -- really support -v parameter, for verbose diagnostics (1.0.2)
64
66
 
65
67
  [![Gem Version](https://badge.fury.io/rb/wmls.svg)](https://badge.fury.io/rb/wmls)
data/bin/wmls CHANGED
@@ -20,9 +20,9 @@ options = {:defs => {}}
20
20
 
21
21
  opts =OptionParser.new do |o|
22
22
  o.banner = "Usage: wmls [options]"
23
- # o.on("-v", "--verbose", "Run verbosely") do |v|
24
- # options[:verbose] = v
25
- # end
23
+ o.on("-v", "--verbose", "Print request and response headers and SOAP bodies to stderr") do |v|
24
+ options[:verbose] = v
25
+ end
26
26
  o.on("-DVARIABLE=VALUE", "Define a substitution variable. Use this multiple times to replace %variable% with value in the template.") do |v|
27
27
  m = /([a-zA-Z0-9_]*)=(.*)/.match(v.to_s)
28
28
  #puts " -D #{m[1]} = #{m[2]}"
@@ -86,7 +86,7 @@ template= get_file_as_string(options[:query], options[:defs] ) unless options[:a
86
86
 
87
87
  wmls = Wmls.new options[:url], options[:user_name], options[:password]
88
88
  wmls.timeout = options[:timeout].to_i if (options[:timeout])
89
-
89
+ wmls.verbose = options[:verbose] if (options[:verbose])
90
90
  case options[:action]
91
91
  when :add
92
92
  result = wmls.add_to_store(template, options[:optionsin])
@@ -35,6 +35,9 @@ class Wmls
35
35
  # The HTTP timeout in seconds (default 60)
36
36
  attr_accessor :timeout
37
37
 
38
+ # Shouls we run verbosely
39
+ attr_accessor :verbose
40
+
38
41
  # Construct a new Wmls instance.
39
42
  # url The URL of the remote WMLS service
40
43
  # user_name, password Credentials for the remote service
@@ -47,6 +50,7 @@ class Wmls
47
50
  @optionsIn = ''
48
51
  @capabilitiesIn = ''
49
52
  @timeout = 60
53
+ @verbose = false
50
54
 
51
55
  @envelope_begin = <<END
52
56
  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
@@ -216,7 +220,13 @@ END
216
220
 
217
221
  def send(envelope_middle, headers)
218
222
  envelope = @envelope_begin + envelope_middle + @envelope_end
223
+ $stderr.puts headers if @verbose
224
+ $stderr.puts envelope if @verbose
225
+
219
226
  response = post(envelope, @url, @user_name, @password, headers)
227
+
228
+ $stderr.puts response.to_hash if @verbose
229
+ $stderr.puts response.body if @verbose
220
230
  extract_response(response.body)
221
231
  end
222
232
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wmls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hugh Winkler
@@ -34,7 +34,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
34
34
  requirements:
35
35
  - - ">="
36
36
  - !ruby/object:Gem::Version
37
- version: '0'
37
+ version: 1.8.7.376
38
38
  required_rubygems_version: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - ">="