activesp 0.0.5 → 0.0.6

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -34,6 +34,8 @@ require 'activesp/caching'
34
34
  require 'activesp/associations'
35
35
  require 'activesp/persistent_caching'
36
36
 
37
+ require 'activesp/errors'
38
+
37
39
  require 'activesp/base'
38
40
 
39
41
  require 'activesp/connection'
@@ -0,0 +1,6 @@
1
+ module ActiveSP
2
+
3
+ class AccessDenied < Exception
4
+ end
5
+
6
+ end
@@ -44,21 +44,24 @@ module ActiveSP
44
44
  def initialize(site, id, title = nil, attributes_before_type_cast1 = nil, attributes_before_type_cast2 = nil)
45
45
  @site, @id = site, id
46
46
  @Title = title if title
47
- @attributes_before_type_cast1 = attributes_before_type_cast1 if attributes_before_type_cast1
48
- @attributes_before_type_cast2 = attributes_before_type_cast2 if attributes_before_type_cast2
47
+ # This testing for emptiness of RootFolder is necessary because it is empty
48
+ # in bulk calls.
49
+ @attributes_before_type_cast1 = attributes_before_type_cast1 if attributes_before_type_cast1 && attributes_before_type_cast1["RootFolder"] != ""
50
+ @attributes_before_type_cast2 = attributes_before_type_cast2 if attributes_before_type_cast2 && attributes_before_type_cast2["RootFolder"] != ""
49
51
  end
50
52
 
51
53
  # The URL of the list
52
54
  # @return [String]
53
55
  def url
54
- # Dirty. Used to use RootFolder, but if you get the data from the bulk calls, RootFolder is the empty
55
- # string rather than what it should be. That's what you get with web services as an afterthought I guess.
56
- view_url = ::File.dirname(attributes["DefaultViewUrl"])
57
- result = URL(@site.url).join(view_url).to_s
58
- if ::File.basename(result) == "Forms" and dir = ::File.dirname(result) and dir.length > @site.url.length
59
- result = dir
60
- end
61
- result
56
+ URL(@site.url).join(attributes["RootFolder"]).to_s
57
+ # # Dirty. Used to use RootFolder, but if you get the data from the bulk calls, RootFolder is the empty
58
+ # # string rather than what it should be. That's what you get with web services as an afterthought I guess.
59
+ # view_url = ::File.dirname(attributes["DefaultViewUrl"])
60
+ # result = URL(@site.url).join(view_url).to_s
61
+ # if ::File.basename(result) == "Forms" and dir = ::File.dirname(result) and dir.length > @site.url.length
62
+ # result = dir
63
+ # end
64
+ # result
62
65
  end
63
66
  cache :url
64
67
 
@@ -293,6 +293,12 @@ module ActiveSP
293
293
  end
294
294
  yield soap if block_given?
295
295
  end
296
+ rescue Savon::SOAPFault => e
297
+ if e.error_code == 0x80004005
298
+ raise AccessDenied, "access denied"
299
+ else
300
+ raise e
301
+ end
296
302
  ensure
297
303
  t2 = Time.now
298
304
  puts "SP - time: %.3fs, site: %s, service: %s, method: %s, body: %s" % [t2 - t1, @site.url, @name, m, body.inspect] if @site.connection.trace
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Peter Vanbroekhoven
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-29 00:00:00 +02:00
18
+ date: 2010-12-06 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -24,12 +24,15 @@ dependencies:
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ">="
27
+ - - "="
28
28
  - !ruby/object:Gem::Version
29
- hash: 3
29
+ hash: 117
30
30
  segments:
31
31
  - 0
32
- version: "0"
32
+ - 7
33
+ - 2
34
+ - 5
35
+ version: 0.7.2.5
33
36
  type: :runtime
34
37
  version_requirements: *id001
35
38
  - !ruby/object:Gem::Dependency
@@ -64,6 +67,7 @@ files:
64
67
  - lib/activesp/caching.rb
65
68
  - lib/activesp/connection.rb
66
69
  - lib/activesp/content_type.rb
70
+ - lib/activesp/errors.rb
67
71
  - lib/activesp/field.rb
68
72
  - lib/activesp/file.rb
69
73
  - lib/activesp/folder.rb