xplanner 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/LICENSE.txt +22 -0
- data/lib/config/version.rb +1 -1
- data/lib/helpers/xplanner_model_helper.rb +5 -0
- data/lib/models/project.rb +5 -1
- data/lib/xplanner.rb +5 -3
- data/test/test_helper.rb +1 -0
- data/test/tests.rb +4 -0
- metadata +11 -10
data/.gitignore
CHANGED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Tom Gladhill
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/config/version.rb
CHANGED
@@ -1,11 +1,16 @@
|
|
1
1
|
module XPlanner
|
2
2
|
class ModelHelper
|
3
3
|
@@soap_client = false
|
4
|
+
@@base_url = ''
|
4
5
|
|
5
6
|
def self.set_soap_client( client )
|
6
7
|
@@soap_client = client
|
7
8
|
end
|
8
9
|
|
10
|
+
def self.set_base_url( url )
|
11
|
+
@@base_url = url
|
12
|
+
end
|
13
|
+
|
9
14
|
def self.invalid_usage
|
10
15
|
raise 'No SoapClient initialised'
|
11
16
|
end
|
data/lib/models/project.rb
CHANGED
@@ -36,7 +36,7 @@ module XPlanner
|
|
36
36
|
def self.delete( id )
|
37
37
|
rpc = :remove_project
|
38
38
|
payload = { :id => id }
|
39
|
-
|
39
|
+
remote_action( rpc, payload )
|
40
40
|
end
|
41
41
|
|
42
42
|
def delete
|
@@ -48,5 +48,9 @@ module XPlanner
|
|
48
48
|
payload = { :projectData => create_payload }
|
49
49
|
remote_action( rpc, payload )
|
50
50
|
end
|
51
|
+
|
52
|
+
def link
|
53
|
+
link_to_this_project = @@base_url + "do/view/project?oid=#{@id}"
|
54
|
+
end
|
51
55
|
end
|
52
56
|
end
|
data/lib/xplanner.rb
CHANGED
@@ -9,10 +9,11 @@ require 'uri'
|
|
9
9
|
|
10
10
|
module XPlanner
|
11
11
|
def self.setup( config = {} )
|
12
|
-
url = config[:
|
12
|
+
url = config[:url] ||= @@default_config[:xplanner_url]
|
13
|
+
user = config[:user] ||= @@default_config[:username]
|
14
|
+
pass = config[:pass] ||= @@default_config[:password]
|
15
|
+
|
13
16
|
wsdl = URI::join(url, 'soap/XPlanner?wsdl').to_s
|
14
|
-
user = config[:username] ||= @@default_config[:username]
|
15
|
-
pass = config[:password] ||= @@default_config[:password]
|
16
17
|
|
17
18
|
client_config = {
|
18
19
|
:wsdl => wsdl,
|
@@ -21,5 +22,6 @@ module XPlanner
|
|
21
22
|
}
|
22
23
|
|
23
24
|
ModelHelper.set_soap_client SoapClient.new( client_config )
|
25
|
+
ModelHelper.set_base_url( url )
|
24
26
|
end
|
25
27
|
end
|
data/test/test_helper.rb
CHANGED
data/test/tests.rb
CHANGED
@@ -27,6 +27,10 @@ describe 'XPlanner+ SOAP interface' do
|
|
27
27
|
this_project.description.should include ' O_o '
|
28
28
|
end
|
29
29
|
|
30
|
+
it 'creates link tot he project on XPlanner' do
|
31
|
+
(@myProject.link =~ URI::regexp).should_not be_nil
|
32
|
+
end
|
33
|
+
|
30
34
|
it 'Delete' do
|
31
35
|
result = @myProject.delete
|
32
36
|
result.should equal true
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xplanner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-21 00:00:00.000000000 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: savon
|
17
|
-
requirement: &
|
17
|
+
requirement: &2168461780 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 1.2.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2168461780
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: nokogiri
|
28
|
-
requirement: &
|
28
|
+
requirement: &2168461280 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 1.5.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2168461280
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: activesupport
|
39
|
-
requirement: &
|
39
|
+
requirement: &2168460820 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 3.2.0
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2168460820
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: rspec
|
50
|
-
requirement: &
|
50
|
+
requirement: &2168460440 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2168460440
|
59
59
|
description: Ruby wrapper for XPlanner+ SOAP interface
|
60
60
|
email:
|
61
61
|
- whoojemaflip@gmail.com
|
@@ -65,6 +65,7 @@ extra_rdoc_files: []
|
|
65
65
|
files:
|
66
66
|
- .gitignore
|
67
67
|
- Gemfile
|
68
|
+
- LICENSE.txt
|
68
69
|
- README.md
|
69
70
|
- lib/config/default_config.rb
|
70
71
|
- lib/config/savon_config.rb
|