yieldmanager 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/README.rdoc CHANGED
@@ -134,6 +134,13 @@ raised during processing. It's the recommended method to ensure you don't
134
134
  hang connections when things go wrong. If you use start/end, make sure you
135
135
  wrap your logic in a begin/ensure clause and call end_session from the ensure.
136
136
 
137
+ == RE: Ruby 1.9
138
+
139
+ In an effort to be a good ruby citizen, KarateCode and I have made the gem
140
+ 1.9 compatible, but it is based on soap4r 1.5.8, which generates some warnings
141
+ in 1.9. Until a newer version of soap4r is released, you may see some of these
142
+ warnings at runtime. Rest assured I'll upgrade as soon as soap4r does.
143
+
137
144
  == Note on Patches/Pull Requests
138
145
 
139
146
  * Fork the project.
@@ -145,6 +152,10 @@ wrap your logic in a begin/ensure clause and call end_session from the ensure.
145
152
  bump version in a commit by itself I can ignore when I pull)
146
153
  * Send me a pull request. Bonus points for topic branches.
147
154
 
155
+ == Thanks for contributing!
156
+ * manlycode[https://github.com/manlycode] (Chris Rittersdorf)
157
+ * KarateCode[https://github.com/KarateCode] (Michael Schneider)
158
+
148
159
  == Copyright
149
160
 
150
- Copyright (c) 2009 Bill Gathen. See LICENSE for details.
161
+ Copyright (c) 2009-2011 Bill Gathen. See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1
1
+ 0.7.0
@@ -1,5 +1,7 @@
1
1
  require 'open-uri'
2
- require 'ftools'
2
+ if RUBY_VERSION[0,3] != "1.9"
3
+ require 'ftools'
4
+ end
3
5
  require 'fileutils'
4
6
 
5
7
  module Yieldmanager
@@ -39,7 +41,7 @@ private
39
41
  if File.exists?(dir)
40
42
  FileUtils.rm_rf dir
41
43
  end
42
- File.makedirs(dir)
44
+ FileUtils::mkdir_p(dir)
43
45
  end
44
46
  end
45
47
 
@@ -3,6 +3,47 @@ require 'soap/wsdlDriver'
3
3
  require 'open-uri'
4
4
  require 'hpricot'
5
5
 
6
+ # 1.8.7 uses Hash#index as the norm, but 1.9.2 uses Hash#key
7
+ if RUBY_VERSION[0,3] == "1.9"
8
+ class SOAP::RPC::SOAPMethod
9
+ private
10
+ def init_param(param_def)
11
+ param_def.each do |io_type, name, param_type|
12
+ mapped_class, nsdef, namedef = SOAP::RPC::SOAPMethod.parse_param_type(param_type)
13
+ if nsdef && namedef
14
+ type_qname = XSD::QName.new(nsdef, namedef)
15
+ elsif mapped_class
16
+ # Ruby 1.8.7 way:
17
+ # type_qname = TypeMap.index(mapped_class)
18
+ # Ruby 1.9.2 way:
19
+ type_qname = TypeMap.key(mapped_class)
20
+ end
21
+ case io_type
22
+ when IN
23
+ @signature.push([IN, name, type_qname])
24
+ @inparam_names.push(name)
25
+ when OUT
26
+ @signature.push([OUT, name, type_qname])
27
+ @outparam_names.push(name)
28
+ when INOUT
29
+ @signature.push([INOUT, name, type_qname])
30
+ @inoutparam_names.push(name)
31
+ when RETVAL
32
+ if @retval_name
33
+ raise MethodDefinitionError.new('duplicated retval')
34
+ end
35
+ @retval_name = name
36
+ @retval_class_name = mapped_class
37
+ else
38
+ raise MethodDefinitionError.new("unknown type: #{io_type}")
39
+ end
40
+ end
41
+ end
42
+
43
+ end
44
+ end
45
+
46
+
6
47
  # Monkey-patch to eliminate bogus "cannot be null" errors from YM wsdl
7
48
  class WSDL::XMLSchema::SimpleType
8
49
  private
@@ -155,4 +196,4 @@ private
155
196
  SOAP::WSDLDriverFactory.new(wsdl_path).create_rpc_driver
156
197
  end
157
198
  end
158
- end
199
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,15 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
  require 'yieldmanager'
4
- require 'spec'
5
- require 'spec/autorun'
6
- require 'patch_detector'
7
- Spec::Runner.configure do |config|
8
-
4
+ begin
5
+ require 'spec'
6
+ require 'spec/autorun'
7
+ Spec::Runner.configure do |config|
8
+ end
9
+ rescue LoadError
10
+ require 'rspec'
11
+ require 'rspec/autorun'
12
+ Rspec.configure do |config|
13
+ end
9
14
  end
15
+ require 'patch_detector'
@@ -28,7 +28,7 @@ describe "A build run" do
28
28
  ["test","prod"].each do |env|
29
29
  dir = "#{WSDL_DIR}/#{API_VERSION}/#{env}"
30
30
  bad_wsdl = "#{dir}/bad.wsdl"
31
- File.makedirs(dir)
31
+ FileUtils::mkdir_p(dir)
32
32
  File.open(bad_wsdl, "w") { |file| file.write("bad.wsdl") }
33
33
  Yieldmanager::Builder.build_wsdls_for(API_VERSION)
34
34
  File.exists?(bad_wsdl).should be_false
data/yieldmanager.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{yieldmanager}
8
- s.version = "0.6.1"
8
+ s.version = "0.7.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bill Gathen"]
12
- s.date = %q{2010-12-03}
12
+ s.date = %q{2011-01-05}
13
13
  s.description = %q{This gem offers full access to YieldManager's API tools (read/write) as well as ad-hoc reporting through the Reportware tool}
14
14
  s.email = %q{bill@billgathen.com}
15
15
  s.extra_rdoc_files = [
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
  ]
20
20
  s.files = [
21
21
  ".document",
22
+ ".rspec",
22
23
  "LICENSE",
23
24
  "README.rdoc",
24
25
  "Rakefile",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yieldmanager
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 6
9
- - 1
10
- version: 0.6.1
8
+ - 7
9
+ - 0
10
+ version: 0.7.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bill Gathen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-03 00:00:00 -05:00
18
+ date: 2011-01-05 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -62,6 +62,7 @@ extra_rdoc_files:
62
62
  - TODO
63
63
  files:
64
64
  - .document
65
+ - .rspec
65
66
  - LICENSE
66
67
  - README.rdoc
67
68
  - Rakefile