ratom-instructure 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/History.txt +135 -0
  2. data/LICENSE +20 -0
  3. data/README.rdoc +293 -0
  4. data/Rakefile +59 -0
  5. data/VERSION.yml +5 -0
  6. data/lib/atom.rb +796 -0
  7. data/lib/atom/configuration.rb +24 -0
  8. data/lib/atom/pub.rb +251 -0
  9. data/lib/atom/version.rb +7 -0
  10. data/lib/atom/xml/parser.rb +413 -0
  11. data/ratom.gemspec +95 -0
  12. data/spec/app/member_entry.atom +31 -0
  13. data/spec/app/service.xml +36 -0
  14. data/spec/app/service_xml_base.xml +37 -0
  15. data/spec/atom/pub_spec.rb +517 -0
  16. data/spec/atom_spec.rb +1385 -0
  17. data/spec/conformance/baseuri.atom +19 -0
  18. data/spec/conformance/divtest.atom +32 -0
  19. data/spec/conformance/linktests.xml +103 -0
  20. data/spec/conformance/nondefaultnamespace-baseline.atom +25 -0
  21. data/spec/conformance/nondefaultnamespace-xhtml.atom +25 -0
  22. data/spec/conformance/nondefaultnamespace.atom +25 -0
  23. data/spec/conformance/ordertest.xml +112 -0
  24. data/spec/conformance/title/html-cdata.atom +22 -0
  25. data/spec/conformance/title/html-entity.atom +22 -0
  26. data/spec/conformance/title/html-ncr.atom +22 -0
  27. data/spec/conformance/title/text-cdata.atom +22 -0
  28. data/spec/conformance/title/text-entity.atom +21 -0
  29. data/spec/conformance/title/text-ncr.atom +21 -0
  30. data/spec/conformance/title/xhtml-entity.atom +21 -0
  31. data/spec/conformance/title/xhtml-ncr.atom +21 -0
  32. data/spec/conformance/unknown-namespace.atom +25 -0
  33. data/spec/conformance/xmlbase.atom +133 -0
  34. data/spec/fixtures/complex_single_entry.atom +45 -0
  35. data/spec/fixtures/created_entry.atom +31 -0
  36. data/spec/fixtures/entry.atom +30 -0
  37. data/spec/fixtures/entry_with_custom_extensions.atom +8 -0
  38. data/spec/fixtures/entry_with_simple_extensions.atom +31 -0
  39. data/spec/fixtures/entry_with_single_custom_extension.atom +6 -0
  40. data/spec/fixtures/multiple_entry.atom +0 -0
  41. data/spec/fixtures/simple_single_entry.atom +21 -0
  42. data/spec/fixtures/with_stylesheet.atom +8 -0
  43. data/spec/paging/first_paged_feed.atom +21 -0
  44. data/spec/paging/last_paged_feed.atom +21 -0
  45. data/spec/paging/middle_paged_feed.atom +22 -0
  46. data/spec/property.rb +31 -0
  47. data/spec/spec.opts +1 -0
  48. data/spec/spec_helper.rb +46 -0
  49. metadata +147 -0
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <feed xmlns="http://www.w3.org/2005/Atom">
3
+ <title>Example Feed</title>
4
+ <link href="http://example.org/"/>
5
+ <link rel="self" href="http://example.org/index.atom?page=3"/>
6
+ <link rel="first" href="http://example.org/index.atom"/>
7
+ <link rel="prev" href="http://example.org/index.atom?page=2"/>
8
+ <link rel="next" href="http://example.org/index.atom?page=4"/>
9
+ <link rel="last" href="http://example.org/index.atom?page=10"/>
10
+ <updated>2003-12-13T18:30:02Z</updated>
11
+ <author>
12
+ <name>John Doe</name>
13
+ </author>
14
+ <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
15
+ <entry>
16
+ <title>Atom-Powered Robots Run Amok</title>
17
+ <link href="http://example.org/2003/12/13/atom03"/>
18
+ <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
19
+ <updated>2003-11-15T18:30:02Z</updated>
20
+ <summary>Some text.</summary>
21
+ </entry>
22
+ </feed>
@@ -0,0 +1,31 @@
1
+ module Atom
2
+ module Extensions
3
+ class Property
4
+ include Atom::Xml::Parseable
5
+
6
+ namespace "http://custom.namespace"
7
+ attribute :name, :value
8
+
9
+ def initialize(name = nil, value = nil)
10
+ if name && value
11
+ initialize_with_o :name => name, :value => value
12
+ else
13
+ initialize_with_o(name) { yield if block_given? }
14
+ end
15
+ end
16
+
17
+ def initialize_with_o(o = nil)
18
+ case o
19
+ when String, XML::Reader
20
+ parse o, :once => true
21
+ when Hash
22
+ o.each do |name,value|
23
+ self.send :"#{name}=", value
24
+ end
25
+ else
26
+ yield(self) if block_given?
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1 @@
1
+ --colour
@@ -0,0 +1,46 @@
1
+ # Copyright (c) 2008 The Kaphan Foundation
2
+ #
3
+ # For licensing information see LICENSE.
4
+ #
5
+ # Please visit http://www.peerworks.org/contact for further information.
6
+ #
7
+ begin
8
+ require 'spec'
9
+ rescue LoadError
10
+ require 'rubygems'
11
+ gem 'rspec'
12
+ require 'spec'
13
+ end
14
+
15
+ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
16
+ require 'atom'
17
+
18
+ Spec::Runner.configure do |config|
19
+
20
+ def mock_response(klass, body, headers = {})
21
+ response = klass.new(nil, nil, nil)
22
+ response.stub!(:body).and_return(body)
23
+
24
+ headers.each do |k, v|
25
+ response.stub!(:[]).with(k).and_return(v)
26
+ end
27
+
28
+ response
29
+ end
30
+
31
+ def mock_http_get(url, response, user = nil, pass = nil)
32
+ req = mock('request')
33
+ Net::HTTP::Get.should_receive(:new).with(url.request_uri).and_return(req)
34
+
35
+ if user && pass
36
+ req.should_receive(:basic_auth).with(user, pass)
37
+ end
38
+
39
+ http = mock('http')
40
+ http.should_receive(:request).with(req).and_return(response)
41
+ http.stub!(:use_ssl=)
42
+ http.stub!(:verify_mode=)
43
+ http.stub!(:verify_depth=)
44
+ Net::HTTP.should_receive(:new).with(url.host, url.port).and_return(http)
45
+ end
46
+ end
metadata ADDED
@@ -0,0 +1,147 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ratom-instructure
3
+ version: !ruby/object:Gem::Version
4
+ hash: 21
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 6
9
+ - 9
10
+ version: 0.6.9
11
+ platform: ruby
12
+ authors:
13
+ - Peerworks
14
+ - Sean Geoghegan
15
+ - Jacob Fugal
16
+ autorequire:
17
+ bindir: bin
18
+ cert_chain: []
19
+
20
+ date: 2011-07-13 00:00:00 Z
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ name: rspec
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ hash: 3
31
+ segments:
32
+ - 0
33
+ version: "0"
34
+ type: :development
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: libxml-ruby
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 23
45
+ segments:
46
+ - 1
47
+ - 1
48
+ - 2
49
+ version: 1.1.2
50
+ type: :runtime
51
+ version_requirements: *id002
52
+ description: A fast Atom Syndication and Publication API based on libxml
53
+ email: seangeo@gmail.com
54
+ executables: []
55
+
56
+ extensions: []
57
+
58
+ extra_rdoc_files:
59
+ - LICENSE
60
+ - README.rdoc
61
+ files:
62
+ - History.txt
63
+ - LICENSE
64
+ - README.rdoc
65
+ - Rakefile
66
+ - VERSION.yml
67
+ - lib/atom.rb
68
+ - lib/atom/configuration.rb
69
+ - lib/atom/pub.rb
70
+ - lib/atom/version.rb
71
+ - lib/atom/xml/parser.rb
72
+ - ratom.gemspec
73
+ - spec/app/member_entry.atom
74
+ - spec/app/service.xml
75
+ - spec/app/service_xml_base.xml
76
+ - spec/atom/pub_spec.rb
77
+ - spec/atom_spec.rb
78
+ - spec/conformance/baseuri.atom
79
+ - spec/conformance/divtest.atom
80
+ - spec/conformance/linktests.xml
81
+ - spec/conformance/nondefaultnamespace-baseline.atom
82
+ - spec/conformance/nondefaultnamespace-xhtml.atom
83
+ - spec/conformance/nondefaultnamespace.atom
84
+ - spec/conformance/ordertest.xml
85
+ - spec/conformance/title/html-cdata.atom
86
+ - spec/conformance/title/html-entity.atom
87
+ - spec/conformance/title/html-ncr.atom
88
+ - spec/conformance/title/text-cdata.atom
89
+ - spec/conformance/title/text-entity.atom
90
+ - spec/conformance/title/text-ncr.atom
91
+ - spec/conformance/title/xhtml-entity.atom
92
+ - spec/conformance/title/xhtml-ncr.atom
93
+ - spec/conformance/unknown-namespace.atom
94
+ - spec/conformance/xmlbase.atom
95
+ - spec/fixtures/complex_single_entry.atom
96
+ - spec/fixtures/created_entry.atom
97
+ - spec/fixtures/entry.atom
98
+ - spec/fixtures/entry_with_custom_extensions.atom
99
+ - spec/fixtures/entry_with_simple_extensions.atom
100
+ - spec/fixtures/entry_with_single_custom_extension.atom
101
+ - spec/fixtures/multiple_entry.atom
102
+ - spec/fixtures/simple_single_entry.atom
103
+ - spec/fixtures/with_stylesheet.atom
104
+ - spec/paging/first_paged_feed.atom
105
+ - spec/paging/last_paged_feed.atom
106
+ - spec/paging/middle_paged_feed.atom
107
+ - spec/property.rb
108
+ - spec/spec.opts
109
+ - spec/spec_helper.rb
110
+ homepage: http://github.com/lukfugl/ratom
111
+ licenses: []
112
+
113
+ post_install_message:
114
+ rdoc_options: []
115
+
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ none: false
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ hash: 3
124
+ segments:
125
+ - 0
126
+ version: "0"
127
+ required_rubygems_version: !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ hash: 3
133
+ segments:
134
+ - 0
135
+ version: "0"
136
+ requirements: []
137
+
138
+ rubyforge_project:
139
+ rubygems_version: 1.8.10
140
+ signing_key:
141
+ specification_version: 3
142
+ summary: Atom Syndication and Publication API
143
+ test_files:
144
+ - spec/atom/pub_spec.rb
145
+ - spec/atom_spec.rb
146
+ - spec/property.rb
147
+ - spec/spec_helper.rb