fedex-web-services 1.1.47 → 1.1.48
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/lib/fedex/version.rb
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module Fedex
|
|
2
|
+
module Generators
|
|
3
|
+
class GenerateDefinitionsGenerator < ::Rails::Generators::Base
|
|
4
|
+
FEDEX_INITIALIZER_FILE = File.join(Rails.root, 'config', 'initializers', 'fedex.rb')
|
|
5
|
+
|
|
6
|
+
class_option :wsdl_dir,
|
|
7
|
+
default: File.join(%w(lib fedex web_services wsdl)),
|
|
8
|
+
type: :string,
|
|
9
|
+
desc: "directory where the fedex wsld files are stored"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class_option :skip_initializer,
|
|
13
|
+
default: false,
|
|
14
|
+
type: :boolean,
|
|
15
|
+
desc: "install a rails initializer to load the wsdl definitions"
|
|
16
|
+
|
|
17
|
+
desc "Generate the FedEx WebServices class definitions and create an initializer to load them"
|
|
18
|
+
|
|
19
|
+
def install
|
|
20
|
+
wsdl_dir = options[:wsdl_dir]
|
|
21
|
+
wsdl_files = Dir.glob(File.join(wsdl_dir, '*.wsdl'))
|
|
22
|
+
target_lib_dir = File.join(Rails.root, 'lib')
|
|
23
|
+
|
|
24
|
+
if (wsdl_files.empty?)
|
|
25
|
+
say("Could not find any wsdl files in #{wsdl_dir}", :red)
|
|
26
|
+
else
|
|
27
|
+
Fedex::WebServices::Definitions.generate_definitions(target_lib_dir, *wsdl_files)
|
|
28
|
+
say("Added #{File.join(target_lib_dir, Fedex::WebServices::Definitions::MODULE_PATH)}", :green)
|
|
29
|
+
|
|
30
|
+
unless (options[:skip_initializer])
|
|
31
|
+
create_file(FEDEX_INITIALIZER_FILE,
|
|
32
|
+
"Fedex::WebServices::Definitions.load_definitions('#{target_lib_dir}')")
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fedex-web-services
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.48
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-06-
|
|
12
|
+
date: 2012-06-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: soap4r-ruby19
|
|
@@ -48,6 +48,7 @@ files:
|
|
|
48
48
|
- lib/fedex/web_services/service/ship.rb
|
|
49
49
|
- lib/fedex/web_services.rb
|
|
50
50
|
- lib/fedex.rb
|
|
51
|
+
- lib/generators/fedex/generate_definitions_generator.rb
|
|
51
52
|
homepage: https://github.com/brewski/fedex-web-services
|
|
52
53
|
licenses:
|
|
53
54
|
- MIT
|