rtunesu 0.2.4 → 0.3.5

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.
Files changed (120) hide show
  1. data/.gitignore +3 -0
  2. data/History.txt +0 -5
  3. data/README.txt +2 -2
  4. data/Rakefile +15 -2
  5. data/VERSION +1 -0
  6. data/lib/rtunesu/connection.rb +152 -54
  7. data/lib/rtunesu/document.rb +21 -26
  8. data/lib/rtunesu/entities/course.rb +4 -13
  9. data/lib/rtunesu/entities/division.rb +5 -12
  10. data/lib/rtunesu/entities/external_feed.rb +14 -0
  11. data/lib/rtunesu/entities/group.rb +5 -14
  12. data/lib/rtunesu/entities/permission.rb +1 -5
  13. data/lib/rtunesu/entities/section.rb +15 -11
  14. data/lib/rtunesu/entities/site.rb +6 -13
  15. data/lib/rtunesu/entities/template.rb +4 -0
  16. data/lib/rtunesu/entities/theme.rb +3 -15
  17. data/lib/rtunesu/entities/track.rb +12 -27
  18. data/lib/rtunesu/entity.rb +185 -74
  19. data/lib/rtunesu/log.rb +69 -0
  20. data/lib/rtunesu/subentities.rb +60 -0
  21. data/lib/rtunesu/user.rb +3 -1
  22. data/lib/rtunesu/version.rb +2 -2
  23. data/lib/rtunesu.rb +11 -6
  24. data/lib/show_tree.xml +7 -0
  25. data/spec/connection_spec.rb +6 -30
  26. data/spec/document_spec.rb +82 -8
  27. data/spec/entities/course_spec.rb +13 -40
  28. data/spec/entities/division_spec.rb +13 -3
  29. data/spec/entities/external_feed_spec.rb +21 -0
  30. data/spec/entities/group_spec.rb +14 -3
  31. data/spec/entities/permission_spec.rb +12 -3
  32. data/spec/entities/section_spec.rb +32 -3
  33. data/spec/entities/site_spec.rb +16 -3
  34. data/spec/entities/track_spec.rb +32 -3
  35. data/spec/entity_spec.rb +147 -86
  36. data/spec/fixtures/requests/create_course.xml +17 -0
  37. data/spec/fixtures/requests/create_division.xml +11 -0
  38. data/spec/fixtures/requests/create_group.xml +11 -0
  39. data/spec/fixtures/requests/create_section.xml +11 -0
  40. data/spec/fixtures/requests/delete_course.xml +8 -0
  41. data/spec/fixtures/requests/delete_group.xml +8 -0
  42. data/spec/fixtures/requests/delete_section.txt +8 -0
  43. data/spec/fixtures/requests/show_course.xml +8 -0
  44. data/spec/fixtures/requests/show_group.xml +8 -0
  45. data/spec/fixtures/requests/show_section.xml +8 -0
  46. data/spec/fixtures/requests/update_course.xml +10 -0
  47. data/spec/fixtures/requests/update_group.xml +9 -0
  48. data/spec/fixtures/requests/update_section.txt +10 -0
  49. data/spec/fixtures/responses/failure/create_course.xml +5 -0
  50. data/spec/fixtures/responses/failure/create_division.xml +5 -0
  51. data/spec/fixtures/responses/failure/create_group.xml +5 -0
  52. data/spec/fixtures/responses/failure/create_section.xml +5 -0
  53. data/spec/fixtures/responses/failure/delete_group.xml +5 -0
  54. data/spec/fixtures/responses/failure/show_course.xml +11 -0
  55. data/spec/fixtures/responses/failure/show_division.xml +11 -0
  56. data/spec/fixtures/responses/failure/show_group.xml +11 -0
  57. data/spec/fixtures/responses/failure/show_section.xml +11 -0
  58. data/spec/fixtures/responses/failure/show_site.xml +11 -0
  59. data/spec/fixtures/responses/failure/update_section.txt +5 -0
  60. data/spec/fixtures/responses/success/create_course.xml +5 -0
  61. data/spec/fixtures/responses/success/create_division.xml +5 -0
  62. data/spec/fixtures/responses/success/create_group.xml +5 -0
  63. data/spec/fixtures/responses/success/create_section.xml +5 -0
  64. data/spec/fixtures/responses/success/delete_course.xml +4 -0
  65. data/spec/fixtures/responses/success/delete_division.xml +4 -0
  66. data/spec/fixtures/responses/success/delete_group.xml +4 -0
  67. data/spec/fixtures/responses/success/delete_section.txt +4 -0
  68. data/spec/fixtures/responses/success/delete_section.xml +4 -0
  69. data/spec/fixtures/responses/success/show_course.xml +393 -0
  70. data/spec/fixtures/responses/success/show_division.xml +393 -0
  71. data/spec/fixtures/responses/success/show_group.xml +137 -0
  72. data/spec/fixtures/responses/success/show_section.xml +152 -0
  73. data/spec/fixtures/responses/success/show_site.xml +393 -0
  74. data/spec/fixtures/responses/success/update_course.xml +4 -0
  75. data/spec/fixtures/responses/success/update_division.xml +4 -0
  76. data/spec/fixtures/responses/success/update_group.xml +4 -0
  77. data/spec/fixtures/responses/success/update_section.txt +4 -0
  78. data/spec/fixtures/responses/success/update_section.xml +4 -0
  79. data/spec/fixtures/responses/success/update_site.xml +4 -0
  80. data/spec/spec_helper.rb +72 -7
  81. data/spec/token_generation_spec.rb +23 -0
  82. data/spec/user_spec.rb +3 -3
  83. metadata +81 -76
  84. data/Manifest.txt +0 -77
  85. data/config/hoe.rb +0 -76
  86. data/config/requirements.rb +0 -15
  87. data/lib/multipart.rb +0 -53
  88. data/spec/documents/add_spec.rb +0 -41
  89. data/spec/documents/delete_spec.rb +0 -30
  90. data/spec/documents/merge_spec.rb +0 -30
  91. data/spec/documents/show_tree_spec.rb +0 -16
  92. data/spec/fixtures/add_course.xml +0 -26
  93. data/spec/fixtures/add_division.xml +0 -26
  94. data/spec/fixtures/add_group.xml +0 -27
  95. data/spec/fixtures/add_permission.xml +0 -12
  96. data/spec/fixtures/add_section.xml +0 -34
  97. data/spec/fixtures/add_track.xml +0 -19
  98. data/spec/fixtures/delete_course.xml +0 -8
  99. data/spec/fixtures/delete_division.xml +0 -8
  100. data/spec/fixtures/delete_group.xml +0 -8
  101. data/spec/fixtures/delete_permission.xml +0 -9
  102. data/spec/fixtures/delete_section.xml +0 -8
  103. data/spec/fixtures/delete_track.xml +0 -7
  104. data/spec/fixtures/merge_course.xml +0 -38
  105. data/spec/fixtures/merge_division.xml +0 -47
  106. data/spec/fixtures/merge_group.xml +0 -29
  107. data/spec/fixtures/merge_permission.xml +0 -12
  108. data/spec/fixtures/merge_section.xml +0 -36
  109. data/spec/fixtures/merge_site.xml +0 -31
  110. data/spec/fixtures/merge_track.xml +0 -18
  111. data/spec/fixtures/requests/add_coures_request.xml +0 -0
  112. data/spec/fixtures/show_tree.xml +0 -273
  113. data/spec/fixtures/update_group.xml +0 -7
  114. data/tasks/deployment.rake +0 -34
  115. data/tasks/website.rake +0 -17
  116. data/website/index.html +0 -54
  117. data/website/index.txt +0 -7
  118. data/website/javascripts/rounded_corners_lite.inc.js +0 -285
  119. data/website/stylesheets/screen.css +0 -138
  120. data/website/template.html.erb +0 -48
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUDocument>
3
+ <Version>1.1.3</Version>
4
+ <AddSection>
5
+ <ParentHandle>720939</ParentHandle>
6
+ <ParentPath></ParentPath>
7
+ <Section>
8
+ <Name>example section</Name>
9
+ </Section>
10
+ </AddSection>
11
+ </ITunesUDocument>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUDocument>
3
+ <Version>1.1.3</Version>
4
+ <DeleteCourse>
5
+ <CourseHandle>2628407409</CourseHandle>
6
+ <CoursePath></CoursePath>
7
+ </DeleteCourse>
8
+ </ITunesUDocument>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUDocument>
3
+ <Version>1.1.3</Version>
4
+ <DeleteGroup>
5
+ <GroupHandle>2628591672</GroupHandle>
6
+ <GroupPath></GroupPath>
7
+ </DeleteGroup>
8
+ </ITunesUDocument>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUDocument>
3
+ <Version>1.1.3</Version>
4
+ <DeleteSection>
5
+ <SectionHandle>2628458907</SectionHandle>
6
+ <SectionPath></SectionPath>
7
+ </DeleteSection>
8
+ </ITunesUDocument>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUDocument>
3
+ <Version>1.1.3</Version>
4
+ <ShowTree>
5
+ <Handle>2394598528</Handle>
6
+ <KeyGroup>most</KeyGroup>
7
+ </ShowTree>
8
+ </ITunesUDocument>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUDocument>
3
+ <Version>1.1.3</Version>
4
+ <ShowTree>
5
+ <Handle>2628591672</Handle>
6
+ <KeyGroup>most</KeyGroup>
7
+ </ShowTree>
8
+ </ITunesUDocument>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUDocument>
3
+ <Version>1.1.3</Version>
4
+ <ShowTree>
5
+ <Handle>2514369219</Handle>
6
+ <KeyGroup>most</KeyGroup>
7
+ </ShowTree>
8
+ </ITunesUDocument>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUDocument>
3
+ <Version>1.1.3</Version>
4
+ <MergeCourse>
5
+ <CourseHandle>2514401752</CourseHandle>
6
+ <Course>
7
+ <Name>Test Course X</Name>
8
+ </Course>
9
+ </MergeCourse>
10
+ </ITunesUDocument>
@@ -0,0 +1,9 @@
1
+ <ITunesUDocument>
2
+ <Version>1.1.3</Version>
3
+ <MergeGroup>
4
+ <GroupHandle>2628591672</GroupHandle>
5
+ <Group>
6
+ <Name>A group</Name>
7
+ </Group>
8
+ </MergeGroup>
9
+ </ITunesUDocument>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUDocument>
3
+ <Version>1.1.3</Version>
4
+ <MergeSection>
5
+ <SectionHandle>2628458907</SectionHandle>
6
+ <Section>
7
+ <Name>Example Section</Name>
8
+ </Section>
9
+ </MergeSection>
10
+ </ITunesUDocument>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ <error>Could not find a ParentHandle with handle 2 referenced by the node at root--&gt;ITunesUDocument--&gt;AddCourse</error>
5
+ </ITunesUResponse>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ <error>The item with the specified handle (720939) is not eligible to contain a division.</error>
5
+ </ITunesUResponse>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ <error>fail</error>
5
+ </ITunesUResponse>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ <error>The item with the specified handle (720939) is not eligible to contain a section.</error>
5
+ </ITunesUResponse>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ <error>Could not find a GroupHandle with handle 2628591672 referenced by the node at root--&gt;ITunesUDocument--&gt;DeleteGroup</error>
5
+ </ITunesUResponse>
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <title>404 Not Found</title>
5
+ <meta name="generator" content="Indigo">
6
+ </head>
7
+ <body>
8
+ <h1>Not Found</h1>
9
+ The requested URL /WebObjects/Core.woa/API/GetUploadURL/umich.edu.23945985?credentials=Administrator%40urn%3Amace%3Aumich.edu&identity=%22Pietrek+Glowacki%22+%3Cpietrekg%40umich.edu%3E+%28pietrekg%29+%5B16278351%5D&time=1255903288&signature=2340e3e32f00c2fef43e3b2909b219451154bf4b358735789422bdca36c053cb&type=XMLControlFile was not found on this server.
10
+ </body>
11
+ </html>
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <title>404 Not Found</title>
5
+ <meta name="generator" content="Indigo">
6
+ </head>
7
+ <body>
8
+ <h1>Not Found</h1>
9
+ The requested URL /WebObjects/Core.woa/API/GetUploadURL/umich.edu.23945985?credentials=Administrator%40urn%3Amace%3Aumich.edu&identity=%22Pietrek+Glowacki%22+%3Cpietrekg%40umich.edu%3E+%28pietrekg%29+%5B16278351%5D&time=1255903288&signature=2340e3e32f00c2fef43e3b2909b219451154bf4b358735789422bdca36c053cb&type=XMLControlFile was not found on this server.
10
+ </body>
11
+ </html>
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <title>404 Not Found</title>
5
+ <meta name="generator" content="Indigo">
6
+ </head>
7
+ <body>
8
+ <h1>Not Found</h1>
9
+ The requested URL /WebObjects/Core.woa/API/GetUploadURL/umich.edu.23945985?credentials=Administrator%40urn%3Amace%3Aumich.edu&identity=%22Pietrek+Glowacki%22+%3Cpietrekg%40umich.edu%3E+%28pietrekg%29+%5B16278351%5D&time=1255903288&signature=2340e3e32f00c2fef43e3b2909b219451154bf4b358735789422bdca36c053cb&type=XMLControlFile was not found on this server.
10
+ </body>
11
+ </html>
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <title>404 Not Found</title>
5
+ <meta name="generator" content="Indigo">
6
+ </head>
7
+ <body>
8
+ <h1>Not Found</h1>
9
+ The requested URL /WebObjects/Core.woa/API/GetUploadURL/umich.edu.23945985?credentials=Administrator%40urn%3Amace%3Aumich.edu&identity=%22Pietrek+Glowacki%22+%3Cpietrekg%40umich.edu%3E+%28pietrekg%29+%5B16278351%5D&time=1255903288&signature=2340e3e32f00c2fef43e3b2909b219451154bf4b358735789422bdca36c053cb&type=XMLControlFile was not found on this server.
10
+ </body>
11
+ </html>
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <title>404 Not Found</title>
5
+ <meta name="generator" content="Indigo">
6
+ </head>
7
+ <body>
8
+ <h1>Not Found</h1>
9
+ The requested URL /WebObjects/Core.woa/API/GetUploadURL/umich.edu.23945985?credentials=Administrator%40urn%3Amace%3Aumich.edu&identity=%22Pietrek+Glowacki%22+%3Cpietrekg%40umich.edu%3E+%28pietrekg%29+%5B16278351%5D&time=1255903288&signature=2340e3e32f00c2fef43e3b2909b219451154bf4b358735789422bdca36c053cb&type=XMLControlFile was not found on this server.
10
+ </body>
11
+ </html>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ <error>[org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content starting with element 'Section'. The content must match '(("":SectionHandle),("":SectionPath),("":MergeByHandle),("":Destructive),("":Section))'.]</error>
5
+ </ITunesUResponse>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ <AddedObjectHandle>123456789</AddedObjectHandle>
5
+ </ITunesUResponse>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ <AddedObjectHandle>2628407409</AddedObjectHandle>
5
+ </ITunesUResponse>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ <AddedObjectHandle>2628591672</AddedObjectHandle>
5
+ </ITunesUResponse>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ <AddedObjectHandle>2628458907</AddedObjectHandle>
5
+ </ITunesUResponse>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ </ITunesUResponse>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ </ITunesUResponse>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ </ITunesUResponse>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ </ITunesUResponse>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ </ITunesUResponse>