tagcrumbs 0.3.1 → 0.3.2

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 (183) hide show
  1. data/History.txt +5 -0
  2. data/Manifest.txt +79 -56
  3. data/README.rdoc +9 -1
  4. data/Rakefile +2 -1
  5. data/TODO.txt +0 -7
  6. data/config/website.yml +2 -0
  7. data/examples/filter_new.rb +7 -3
  8. data/examples/placemark_new_suggestions.rb +4 -2
  9. data/examples/request_authorization.rb +1 -1
  10. data/examples/tagcrumbs_find.rb +3 -3
  11. data/examples/user.rb +1 -1
  12. data/lib/console.rb +14 -0
  13. data/lib/tagcrumbs.rb +41 -14
  14. data/lib/tagcrumbs/cli.rb +1 -1
  15. data/lib/tagcrumbs/config_store.rb +3 -3
  16. data/lib/tagcrumbs/core_extensions.rb +19 -0
  17. data/lib/tagcrumbs/parsers/json_parser.rb +7 -3
  18. data/lib/tagcrumbs/proxy.rb +6 -3
  19. data/lib/tagcrumbs/requestor.rb +22 -5
  20. data/lib/tagcrumbs/resources/{array.rb → collection.rb} +8 -7
  21. data/lib/tagcrumbs/resources/models/access_token.rb +8 -0
  22. data/lib/tagcrumbs/resources/models/accessors.rb +17 -3
  23. data/lib/tagcrumbs/resources/models/activity.rb +1 -0
  24. data/lib/tagcrumbs/resources/models/application.rb +9 -0
  25. data/lib/tagcrumbs/resources/models/comment.rb +2 -0
  26. data/lib/tagcrumbs/resources/models/email_recommendation.rb +17 -0
  27. data/lib/tagcrumbs/resources/models/favorite.rb +2 -1
  28. data/lib/tagcrumbs/resources/models/filter.rb +2 -2
  29. data/lib/tagcrumbs/resources/models/flag.rb +3 -0
  30. data/lib/tagcrumbs/resources/models/model.rb +8 -7
  31. data/lib/tagcrumbs/resources/models/paragraph.rb +8 -0
  32. data/lib/tagcrumbs/resources/models/picture.rb +4 -4
  33. data/lib/tagcrumbs/resources/models/place.rb +3 -3
  34. data/lib/tagcrumbs/resources/models/placemark.rb +3 -2
  35. data/lib/tagcrumbs/resources/models/profile.rb +0 -1
  36. data/lib/tagcrumbs/resources/models/profile_link.rb +1 -1
  37. data/lib/tagcrumbs/resources/models/root.rb +3 -3
  38. data/lib/tagcrumbs/resources/models/settings.rb +2 -1
  39. data/lib/tagcrumbs/resources/models/tagcrumb.rb +4 -12
  40. data/lib/tagcrumbs/resources/models/user.rb +27 -6
  41. data/lib/tagcrumbs/resources/models/user_recommendation.rb +1 -1
  42. data/lib/tagcrumbs/resources/resource.rb +4 -4
  43. data/script/console +8 -3
  44. data/spec/fixtures_external/README.rdoc +15 -0
  45. data/spec/fixtures_external/json/access_token.json +11 -0
  46. data/spec/{fixtures → fixtures_external/json}/activity.json +32 -25
  47. data/spec/{fixtures → fixtures_external/json}/address.json +22 -25
  48. data/spec/fixtures_external/json/application.json +13 -0
  49. data/spec/{fixtures → fixtures_external/json}/city.json +2 -11
  50. data/spec/{fixtures → fixtures_external/json}/comment.json +51 -44
  51. data/spec/{fixtures → fixtures_external/json}/country.json +1 -4
  52. data/spec/fixtures_external/json/email_recommendation.json +286 -0
  53. data/spec/{fixtures → fixtures_external/json}/fanship.json +30 -30
  54. data/spec/{fixtures → fixtures_external/json}/favorite.json +45 -47
  55. data/spec/{fixtures → fixtures_external/json}/filter.json +30 -42
  56. data/spec/{fixtures → fixtures_external/json}/friendship.json +30 -30
  57. data/spec/fixtures_external/json/geoname.json +18 -0
  58. data/spec/{fixtures → fixtures_external/json}/link.json +41 -44
  59. data/spec/{fixtures → fixtures_external/json}/location.json +21 -31
  60. data/spec/fixtures_external/json/paragraph.json +12 -0
  61. data/spec/fixtures_external/json/picture.json +129 -0
  62. data/spec/fixtures_external/json/picture_upload.json +9 -0
  63. data/spec/{fixtures → fixtures_external/json}/placemark.json +136 -142
  64. data/spec/fixtures_external/json/placemarks.json +851 -0
  65. data/spec/{fixtures → fixtures_external/json}/profile.json +65 -94
  66. data/spec/fixtures_external/json/profile_link.json +123 -0
  67. data/spec/{fixtures → fixtures_external/json}/root.json +17 -21
  68. data/spec/{fixtures → fixtures_external/json}/settings.json +26 -19
  69. data/spec/{fixtures → fixtures_external/json}/state.json +2 -8
  70. data/spec/{fixtures → fixtures_external/json}/subscription.json +41 -44
  71. data/spec/fixtures_external/json/suggestions.json +302 -0
  72. data/spec/{fixtures → fixtures_external/json}/tag.json +0 -0
  73. data/spec/{fixtures → fixtures_external/json}/user.json +44 -20
  74. data/spec/{fixtures → fixtures_external/json}/user_recommendation.json +52 -55
  75. data/spec/fixtures_external/json/validation_errors.json +6 -0
  76. data/spec/fixtures_external/kml/network_link.kml +24 -0
  77. data/spec/fixtures_external/kml/tagcrumbs.kml +64 -0
  78. data/spec/fixtures_external/rdf/placemark.rdf +56 -0
  79. data/spec/fixtures_external/rss/tagcrumbs.rss +24 -0
  80. data/spec/fixtures_external/xml/access_token.xml +5 -0
  81. data/spec/fixtures_external/xml/activity.xml +62 -0
  82. data/spec/fixtures_external/xml/address.xml +51 -0
  83. data/spec/fixtures_external/xml/application.xml +5 -0
  84. data/spec/fixtures_external/xml/city.xml +27 -0
  85. data/spec/fixtures_external/xml/comment.xml +81 -0
  86. data/spec/fixtures_external/xml/country.xml +10 -0
  87. data/spec/fixtures_external/xml/email_recommendation.xml +78 -0
  88. data/spec/fixtures_external/xml/fanship.xml +49 -0
  89. data/spec/fixtures_external/xml/favorite.xml +97 -0
  90. data/spec/fixtures_external/xml/filter.xml +68 -0
  91. data/spec/fixtures_external/xml/friendship.xml +49 -0
  92. data/spec/fixtures_external/xml/geoname.xml +6 -0
  93. data/spec/fixtures_external/xml/link.xml +78 -0
  94. data/spec/fixtures_external/xml/location.xml +58 -0
  95. data/spec/fixtures_external/xml/paragraph.xml +8 -0
  96. data/spec/fixtures_external/xml/picture.xml +36 -0
  97. data/spec/fixtures_external/xml/picture_upload.xml +153 -0
  98. data/spec/fixtures_external/xml/placemark.xml +54 -0
  99. data/spec/fixtures_external/xml/placemarks.xml +336 -0
  100. data/spec/fixtures_external/xml/profile.xml +77 -0
  101. data/spec/fixtures_external/xml/profile_link.xml +34 -0
  102. data/spec/fixtures_external/xml/root.xml +12 -0
  103. data/spec/fixtures_external/xml/settings.xml +42 -0
  104. data/spec/fixtures_external/xml/state.xml +19 -0
  105. data/spec/fixtures_external/xml/subscription.xml +76 -0
  106. data/spec/fixtures_external/xml/suggestions.xml +106 -0
  107. data/spec/{fixtures → fixtures_external/xml}/tag.xml +2 -2
  108. data/spec/fixtures_external/xml/user.xml +37 -0
  109. data/spec/fixtures_external/xml/user_recommendation.xml +94 -0
  110. data/spec/fixtures_external/xml/validation_errors.xml +5 -0
  111. data/spec/spec_helper.rb +12 -2
  112. data/spec/tagcrumbs/requestor_spec.rb +2 -2
  113. data/spec/tagcrumbs/resources/array_spec.rb +38 -38
  114. data/spec/tagcrumbs/resources/models/access_token_spec.rb +16 -0
  115. data/spec/tagcrumbs/resources/models/accessors_spec.rb +2 -2
  116. data/spec/tagcrumbs/resources/models/activity_spec.rb +5 -1
  117. data/spec/tagcrumbs/resources/models/address_spec.rb +1 -1
  118. data/spec/tagcrumbs/resources/models/application_spec.rb +17 -0
  119. data/spec/tagcrumbs/resources/models/city_spec.rb +2 -5
  120. data/spec/tagcrumbs/resources/models/comment_spec.rb +8 -2
  121. data/spec/tagcrumbs/resources/models/country_spec.rb +2 -4
  122. data/spec/tagcrumbs/resources/models/email_recommendation_spec.rb +31 -0
  123. data/spec/tagcrumbs/resources/models/fanship_spec.rb +1 -1
  124. data/spec/tagcrumbs/resources/models/favorite_spec.rb +5 -1
  125. data/spec/tagcrumbs/resources/models/filter_spec.rb +3 -4
  126. data/spec/tagcrumbs/resources/models/friendship_spec.rb +1 -1
  127. data/spec/tagcrumbs/resources/models/geoname_spec.rb +1 -1
  128. data/spec/tagcrumbs/resources/models/link_spec.rb +1 -1
  129. data/spec/tagcrumbs/resources/models/location_spec.rb +1 -1
  130. data/spec/tagcrumbs/resources/models/model_spec.rb +20 -3
  131. data/spec/tagcrumbs/resources/models/paragraph_spec.rb +21 -0
  132. data/spec/tagcrumbs/resources/models/picture_spec.rb +13 -21
  133. data/spec/tagcrumbs/resources/models/place_spec.rb +3 -3
  134. data/spec/tagcrumbs/resources/models/placemark_spec.rb +11 -9
  135. data/spec/tagcrumbs/resources/models/profile_link_spec.rb +6 -12
  136. data/spec/tagcrumbs/resources/models/profile_spec.rb +5 -12
  137. data/spec/tagcrumbs/resources/models/root_spec.rb +15 -19
  138. data/spec/tagcrumbs/resources/models/settings_spec.rb +3 -1
  139. data/spec/tagcrumbs/resources/models/state_spec.rb +2 -5
  140. data/spec/tagcrumbs/resources/models/subscription_spec.rb +1 -1
  141. data/spec/tagcrumbs/resources/models/suggestions_spec.rb +7 -7
  142. data/spec/tagcrumbs/resources/models/tag_spec.rb +1 -1
  143. data/spec/tagcrumbs/resources/models/tagcrumb_spec.rb +3 -11
  144. data/spec/tagcrumbs/resources/models/user_recommendation_spec.rb +1 -1
  145. data/spec/tagcrumbs/resources/models/user_spec.rb +35 -27
  146. data/spec/tagcrumbs/resources/resource_spec.rb +3 -3
  147. data/spec/tagcrumbs_spec.rb +7 -7
  148. data/tagcrumbs.gemspec +2 -2
  149. metadata +82 -58
  150. data/examples/tagcrumbs_search.rb +0 -7
  151. data/lib/tagcrumbs/validations.rb +0 -301
  152. data/spec/fixtures/activity.xml +0 -66
  153. data/spec/fixtures/address.xml +0 -58
  154. data/spec/fixtures/city.xml +0 -34
  155. data/spec/fixtures/comment.xml +0 -87
  156. data/spec/fixtures/country.xml +0 -13
  157. data/spec/fixtures/fanship.xml +0 -54
  158. data/spec/fixtures/favorite.xml +0 -109
  159. data/spec/fixtures/filter.xml +0 -80
  160. data/spec/fixtures/friendship.xml +0 -54
  161. data/spec/fixtures/geoname.json +0 -18
  162. data/spec/fixtures/geoname.xml +0 -6
  163. data/spec/fixtures/link.xml +0 -88
  164. data/spec/fixtures/location.xml +0 -71
  165. data/spec/fixtures/picture.json +0 -154
  166. data/spec/fixtures/picture.xml +0 -49
  167. data/spec/fixtures/placemark.xml +0 -58
  168. data/spec/fixtures/placemarks.json +0 -887
  169. data/spec/fixtures/placemarks.xml +0 -348
  170. data/spec/fixtures/profile.xml +0 -100
  171. data/spec/fixtures/profile_link.json +0 -156
  172. data/spec/fixtures/profile_link.xml +0 -49
  173. data/spec/fixtures/root.xml +0 -14
  174. data/spec/fixtures/settings.xml +0 -45
  175. data/spec/fixtures/state.xml +0 -23
  176. data/spec/fixtures/subscription.xml +0 -86
  177. data/spec/fixtures/suggestions.json +0 -1877
  178. data/spec/fixtures/suggestions.xml +0 -724
  179. data/spec/fixtures/user.xml +0 -31
  180. data/spec/fixtures/user_recommendation.xml +0 -106
  181. data/spec/fixtures/validation_errors.json +0 -5
  182. data/spec/fixtures/validation_errors.xml +0 -5
  183. data/spec/tagcrumbs/validations_spec.rb +0 -27
@@ -1,3 +1,8 @@
1
+ == 0.3.2 XXX
2
+
3
+ * 1 major enhancement:
4
+ * Support for Credentials to OAuth Proxy
5
+
1
6
  == 0.3.1 2009-06-14
2
7
 
3
8
  * 1 major enhancement:
@@ -6,6 +6,7 @@ README.rdoc
6
6
  Rakefile
7
7
  TODO.txt
8
8
  bin/tagcrumbs
9
+ config/website.yml
9
10
  examples/address_update.rb
10
11
  examples/comment_new.rb
11
12
  examples/favorite_new.rb
@@ -22,15 +23,16 @@ examples/request_authorization.rb
22
23
  examples/settings_update.rb
23
24
  examples/subscription_new.rb
24
25
  examples/tagcrumbs_find.rb
25
- examples/tagcrumbs_search.rb
26
26
  examples/user.rb
27
27
  examples/user_recommendation_new.rb
28
+ lib/console.rb
28
29
  lib/tagcrumbs.rb
29
30
  lib/tagcrumbs/builders/builder.rb
30
31
  lib/tagcrumbs/builders/json_builder.rb
31
32
  lib/tagcrumbs/builders/xml_builder.rb
32
33
  lib/tagcrumbs/cli.rb
33
34
  lib/tagcrumbs/config_store.rb
35
+ lib/tagcrumbs/core_extensions.rb
34
36
  lib/tagcrumbs/exceptions.rb
35
37
  lib/tagcrumbs/node.rb
36
38
  lib/tagcrumbs/parsers/json_parser.rb
@@ -38,13 +40,16 @@ lib/tagcrumbs/parsers/parser.rb
38
40
  lib/tagcrumbs/parsers/xml_parser.rb
39
41
  lib/tagcrumbs/proxy.rb
40
42
  lib/tagcrumbs/requestor.rb
41
- lib/tagcrumbs/resources/array.rb
43
+ lib/tagcrumbs/resources/collection.rb
44
+ lib/tagcrumbs/resources/models/access_token.rb
42
45
  lib/tagcrumbs/resources/models/accessors.rb
43
46
  lib/tagcrumbs/resources/models/activity.rb
44
47
  lib/tagcrumbs/resources/models/address.rb
48
+ lib/tagcrumbs/resources/models/application.rb
45
49
  lib/tagcrumbs/resources/models/city.rb
46
50
  lib/tagcrumbs/resources/models/comment.rb
47
51
  lib/tagcrumbs/resources/models/country.rb
52
+ lib/tagcrumbs/resources/models/email_recommendation.rb
48
53
  lib/tagcrumbs/resources/models/fanship.rb
49
54
  lib/tagcrumbs/resources/models/favorite.rb
50
55
  lib/tagcrumbs/resources/models/filter.rb
@@ -54,6 +59,7 @@ lib/tagcrumbs/resources/models/geoname.rb
54
59
  lib/tagcrumbs/resources/models/link.rb
55
60
  lib/tagcrumbs/resources/models/location.rb
56
61
  lib/tagcrumbs/resources/models/model.rb
62
+ lib/tagcrumbs/resources/models/paragraph.rb
57
63
  lib/tagcrumbs/resources/models/picture.rb
58
64
  lib/tagcrumbs/resources/models/place.rb
59
65
  lib/tagcrumbs/resources/models/placemark.rb
@@ -69,65 +75,79 @@ lib/tagcrumbs/resources/models/tagcrumb.rb
69
75
  lib/tagcrumbs/resources/models/user.rb
70
76
  lib/tagcrumbs/resources/models/user_recommendation.rb
71
77
  lib/tagcrumbs/resources/resource.rb
72
- lib/tagcrumbs/validations.rb
73
78
  script/console
74
79
  script/destroy
75
80
  script/generate
76
- spec/fixtures/activity.json
77
- spec/fixtures/activity.xml
78
- spec/fixtures/address.json
79
- spec/fixtures/address.xml
80
- spec/fixtures/city.json
81
- spec/fixtures/city.xml
82
- spec/fixtures/comment.json
83
- spec/fixtures/comment.xml
84
- spec/fixtures/country.json
85
- spec/fixtures/country.xml
86
- spec/fixtures/fanship.json
87
- spec/fixtures/fanship.xml
88
- spec/fixtures/favorite.json
89
- spec/fixtures/favorite.xml
90
- spec/fixtures/filter.json
91
- spec/fixtures/filter.xml
92
- spec/fixtures/friendship.json
93
- spec/fixtures/friendship.xml
94
- spec/fixtures/geoname.json
95
- spec/fixtures/geoname.xml
96
81
  spec/fixtures/json_parser.json
97
- spec/fixtures/link.json
98
- spec/fixtures/link.xml
99
- spec/fixtures/location.json
100
- spec/fixtures/location.xml
101
- spec/fixtures/picture.json
102
82
  spec/fixtures/picture.png
103
- spec/fixtures/picture.xml
104
- spec/fixtures/placemark.json
105
- spec/fixtures/placemark.xml
106
- spec/fixtures/placemarks.json
107
- spec/fixtures/placemarks.xml
108
- spec/fixtures/profile.json
109
- spec/fixtures/profile.xml
110
- spec/fixtures/profile_link.json
111
- spec/fixtures/profile_link.xml
112
- spec/fixtures/root.json
113
- spec/fixtures/root.xml
114
- spec/fixtures/settings.json
115
- spec/fixtures/settings.xml
116
- spec/fixtures/state.json
117
- spec/fixtures/state.xml
118
- spec/fixtures/subscription.json
119
- spec/fixtures/subscription.xml
120
- spec/fixtures/suggestions.json
121
- spec/fixtures/suggestions.xml
122
- spec/fixtures/tag.json
123
- spec/fixtures/tag.xml
124
- spec/fixtures/user.json
125
- spec/fixtures/user.xml
126
- spec/fixtures/user_recommendation.json
127
- spec/fixtures/user_recommendation.xml
128
- spec/fixtures/validation_errors.json
129
- spec/fixtures/validation_errors.xml
130
83
  spec/fixtures/xml_parser.xml
84
+ spec/fixtures_external/README.rdoc
85
+ spec/fixtures_external/json/access_token.json
86
+ spec/fixtures_external/json/activity.json
87
+ spec/fixtures_external/json/address.json
88
+ spec/fixtures_external/json/application.json
89
+ spec/fixtures_external/json/city.json
90
+ spec/fixtures_external/json/comment.json
91
+ spec/fixtures_external/json/country.json
92
+ spec/fixtures_external/json/email_recommendation.json
93
+ spec/fixtures_external/json/fanship.json
94
+ spec/fixtures_external/json/favorite.json
95
+ spec/fixtures_external/json/filter.json
96
+ spec/fixtures_external/json/friendship.json
97
+ spec/fixtures_external/json/geoname.json
98
+ spec/fixtures_external/json/link.json
99
+ spec/fixtures_external/json/location.json
100
+ spec/fixtures_external/json/paragraph.json
101
+ spec/fixtures_external/json/picture.json
102
+ spec/fixtures_external/json/picture_upload.json
103
+ spec/fixtures_external/json/placemark.json
104
+ spec/fixtures_external/json/placemarks.json
105
+ spec/fixtures_external/json/profile.json
106
+ spec/fixtures_external/json/profile_link.json
107
+ spec/fixtures_external/json/root.json
108
+ spec/fixtures_external/json/settings.json
109
+ spec/fixtures_external/json/state.json
110
+ spec/fixtures_external/json/subscription.json
111
+ spec/fixtures_external/json/suggestions.json
112
+ spec/fixtures_external/json/tag.json
113
+ spec/fixtures_external/json/user.json
114
+ spec/fixtures_external/json/user_recommendation.json
115
+ spec/fixtures_external/json/validation_errors.json
116
+ spec/fixtures_external/kml/network_link.kml
117
+ spec/fixtures_external/kml/tagcrumbs.kml
118
+ spec/fixtures_external/rdf/placemark.rdf
119
+ spec/fixtures_external/rss/tagcrumbs.rss
120
+ spec/fixtures_external/xml/access_token.xml
121
+ spec/fixtures_external/xml/activity.xml
122
+ spec/fixtures_external/xml/address.xml
123
+ spec/fixtures_external/xml/application.xml
124
+ spec/fixtures_external/xml/city.xml
125
+ spec/fixtures_external/xml/comment.xml
126
+ spec/fixtures_external/xml/country.xml
127
+ spec/fixtures_external/xml/email_recommendation.xml
128
+ spec/fixtures_external/xml/fanship.xml
129
+ spec/fixtures_external/xml/favorite.xml
130
+ spec/fixtures_external/xml/filter.xml
131
+ spec/fixtures_external/xml/friendship.xml
132
+ spec/fixtures_external/xml/geoname.xml
133
+ spec/fixtures_external/xml/link.xml
134
+ spec/fixtures_external/xml/location.xml
135
+ spec/fixtures_external/xml/paragraph.xml
136
+ spec/fixtures_external/xml/picture.xml
137
+ spec/fixtures_external/xml/picture_upload.xml
138
+ spec/fixtures_external/xml/placemark.xml
139
+ spec/fixtures_external/xml/placemarks.xml
140
+ spec/fixtures_external/xml/profile.xml
141
+ spec/fixtures_external/xml/profile_link.xml
142
+ spec/fixtures_external/xml/root.xml
143
+ spec/fixtures_external/xml/settings.xml
144
+ spec/fixtures_external/xml/state.xml
145
+ spec/fixtures_external/xml/subscription.xml
146
+ spec/fixtures_external/xml/suggestions.xml
147
+ spec/fixtures_external/xml/tag.xml
148
+ spec/fixtures_external/xml/user.xml
149
+ spec/fixtures_external/xml/user_recommendation.xml
150
+ spec/fixtures_external/xml/validation_errors.xml
131
151
  spec/spec.opts
132
152
  spec/spec_helper.rb
133
153
  spec/tagcrumbs/builders/builder_spec.rb
@@ -141,12 +161,15 @@ spec/tagcrumbs/parsers/xml_parser_spec.rb
141
161
  spec/tagcrumbs/proxy_spec.rb
142
162
  spec/tagcrumbs/requestor_spec.rb
143
163
  spec/tagcrumbs/resources/array_spec.rb
164
+ spec/tagcrumbs/resources/models/access_token_spec.rb
144
165
  spec/tagcrumbs/resources/models/accessors_spec.rb
145
166
  spec/tagcrumbs/resources/models/activity_spec.rb
146
167
  spec/tagcrumbs/resources/models/address_spec.rb
168
+ spec/tagcrumbs/resources/models/application_spec.rb
147
169
  spec/tagcrumbs/resources/models/city_spec.rb
148
170
  spec/tagcrumbs/resources/models/comment_spec.rb
149
171
  spec/tagcrumbs/resources/models/country_spec.rb
172
+ spec/tagcrumbs/resources/models/email_recommendation_spec.rb
150
173
  spec/tagcrumbs/resources/models/fanship_spec.rb
151
174
  spec/tagcrumbs/resources/models/favorite_spec.rb
152
175
  spec/tagcrumbs/resources/models/filter_spec.rb
@@ -156,6 +179,7 @@ spec/tagcrumbs/resources/models/geoname_spec.rb
156
179
  spec/tagcrumbs/resources/models/link_spec.rb
157
180
  spec/tagcrumbs/resources/models/location_spec.rb
158
181
  spec/tagcrumbs/resources/models/model_spec.rb
182
+ spec/tagcrumbs/resources/models/paragraph_spec.rb
159
183
  spec/tagcrumbs/resources/models/picture_spec.rb
160
184
  spec/tagcrumbs/resources/models/place_spec.rb
161
185
  spec/tagcrumbs/resources/models/placemark_spec.rb
@@ -171,7 +195,6 @@ spec/tagcrumbs/resources/models/tagcrumb_spec.rb
171
195
  spec/tagcrumbs/resources/models/user_recommendation_spec.rb
172
196
  spec/tagcrumbs/resources/models/user_spec.rb
173
197
  spec/tagcrumbs/resources/resource_spec.rb
174
- spec/tagcrumbs/validations_spec.rb
175
198
  spec/tagcrumbs_spec.rb
176
199
  tagcrumbs.gemspec
177
200
  tasks/rspec.rake
@@ -7,7 +7,7 @@ This is a RubyGem that provides an ActiveRecord-like interface to the www.tagcru
7
7
  == WEBSITES:
8
8
 
9
9
  * http://www.tagcrumbs.com/
10
- * http://developers.tagcrumbs.com/
10
+ * http://wiki.tagcrumbs.com/developers
11
11
  * http://github.com/tagcrumbs/tagcrumbs_gem
12
12
  * http://tagcrumbs.rubyforge.org/
13
13
 
@@ -22,6 +22,7 @@ This is a RubyGem that provides an ActiveRecord-like interface to the www.tagcru
22
22
  * Validation error messages are read from the server and loaded into the objects
23
23
  * Find Tagcrumbs by many filter criteria
24
24
  * Load name, tag and city suggestions to help a user create a new placemark
25
+ * Create new User Accounts on tagcrumbs.com
25
26
 
26
27
  == SYNOPSIS:
27
28
 
@@ -41,5 +42,12 @@ This is a RubyGem that provides an ActiveRecord-like interface to the www.tagcru
41
42
 
42
43
  * sudo gem install tagcrumbs
43
44
 
45
+ == SPECS:
46
+
47
+ Some fixtures are in a git submodule, this makes them reusable for different libraries. If you want to run the tests execute the following first:
48
+
49
+ git submodule init
50
+ git submodule update
51
+
44
52
  == LICENSE:
45
53
  * see License.txt for more information
data/Rakefile CHANGED
@@ -24,7 +24,8 @@ $hoe = Hoe.new('tagcrumbs', Tagcrumbs::VERSION) do |p|
24
24
 
25
25
  p.clean_globs |= %w[**/.DS_Store tmp *.log]
26
26
  path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
27
- p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
27
+ # p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
28
+ # p.remote_rdoc_dir = ''
28
29
  p.rsync_args = '-av --delete --ignore-errors'
29
30
  end
30
31
 
data/TODO.txt CHANGED
@@ -1,17 +1,10 @@
1
- - push to rubyforge
2
-
3
- - have more examples in rdoc
4
1
  - test on windows
5
2
  - filter activities by location
6
- - direct access to total_entries in proxy if present in document
7
3
 
8
4
  == next steps
9
- - implement http-basic to oauth proxy
10
5
  - migrate to ruby 1.9
11
6
 
12
7
  == future version
13
8
  - add distances with georuby?
14
- - email recommendations?
15
- - client_application?
16
9
 
17
10
 
@@ -0,0 +1,2 @@
1
+ host: sashthebash@rubyforge.org
2
+ remote_dir: /var/www/gforge-projects/tagcrumbs
@@ -2,8 +2,8 @@
2
2
 
3
3
  require File.dirname(__FILE__) + '/request_authorization'
4
4
 
5
- filter = Tagcrumbs::Filter.new(:name => 'Friends Favs in Germany', :from => 'friends', :tagcrumb_type => 'Favorite',
6
- :country => Tagcrumbs::Country.search('germany').first)
5
+ filter = Tagcrumbs::Filter.new(:name => 'Friends Favs in Stuttgart', :from => 'friends', :tagcrumb_type => 'Favorite',
6
+ :city => Tagcrumbs::City.search('stuttgart').first)
7
7
 
8
8
  if filter.save
9
9
  puts "Saved Filter successfully at #{filter.created_at}. URL: #{filter.resource_url}"
@@ -12,4 +12,8 @@ else
12
12
  puts filter.errors.full_messages.join("\n")
13
13
  end
14
14
 
15
- puts "First Favorite: #{filter.tagcrumbs.first.name}"
15
+ if filter.tagcrumbs.present?
16
+ puts "First Favorite: #{filter.tagcrumbs.first.placemark.name}"
17
+ end
18
+
19
+ filter.destroy
@@ -10,11 +10,13 @@ placemark.latitude = 49
10
10
  placemark.longitude = 9
11
11
 
12
12
  suggestions = placemark.suggestions # load suggestions from the webservice
13
-
13
+ #require 'ruby-debug'
14
+ #debugger
14
15
  # Of course you would let the user pick from the suggestions
15
16
  placemark.name = suggestions.names.first || 'no suggestions found'
17
+ placemark.private = false
16
18
  placemark.city = suggestions.cities.first
17
- placemark.tag_list = suggestions.popular_tags.first.name
19
+ placemark.tag_list = suggestions.popular_tags.first && suggestions.popular_tags.first.name
18
20
 
19
21
  if placemark.save
20
22
  puts "Saved Placemark successfully at #{placemark.created_at}. URL: #{placemark.resource_url}"
@@ -13,7 +13,7 @@ unless Tagcrumbs.valid_credentials?
13
13
  print "Press Enter to continue..."
14
14
  gets
15
15
 
16
- if Tagcrumbs.exchange_request_token!
16
+ if Tagcrumbs.access_token_from_request_token
17
17
  puts "Authorization succeeded."
18
18
 
19
19
  config_store.update(Tagcrumbs.options.slice(:access_token, :access_secret))
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby -rubygems
2
2
 
3
- require File.dirname(__FILE__) + '/../lib/tagcrumbs' # this would not be needed if we only search for public Tagcrumbs
3
+ require File.dirname(__FILE__) + '/request_authorization' # this would not be needed if we only search for public Tagcrumbs
4
4
 
5
5
  # Find the latest Tagcrumbs in Stuttgart, Germany
6
6
  stuttgart = Tagcrumbs::City.search('stuttgart').first
@@ -13,11 +13,11 @@ from_cornelius = Tagcrumbs::Tagcrumb.find(:username => 'cornelius', :from => :us
13
13
  puts "Total Favorites of Cornelius in the last two weeks: #{from_cornelius.total_entries}"
14
14
 
15
15
  # Find all Placemarks near the current location
16
- nearby = Tagcrumbs::Tagcrumb.find(:from => :everybody, :within => 0.55)
16
+ nearby = Tagcrumbs::Tagcrumb.find(:from => :everybody, :range => :medium)
17
17
  puts "A total of #{nearby.total_entries} Tagcrumbs near your current location"
18
18
 
19
19
  # Find all Placemarks near any other location
20
- nearby_other = Tagcrumbs::Tagcrumb.find(:from => :everybody, :within => 0.55, :latitude => 49, :longitude => 9, :sort => :distance, :order => :asc, :per_page => 50)
20
+ nearby_other = Tagcrumbs::Tagcrumb.find(:from => :everybody, :range => :long, :latitude => 49, :longitude => 9, :sort => :distance, :order => :asc, :per_page => 50)
21
21
  puts "A total of #{nearby_other.total_entries} Tagcrumbs nearby (49, 9)"
22
22
 
23
23
  # Find Placemarks with certain tags
@@ -16,7 +16,7 @@ end
16
16
 
17
17
  puts "== Your last comments:"
18
18
 
19
- user.comments.each do |comment|
19
+ user.comments(:per_page => 10).each do |comment|
20
20
  puts comment.text
21
21
  end
22
22
 
@@ -0,0 +1,14 @@
1
+ # Custom initializer script so that different Tagcrumbs configurations can easily be loaded when using script/console
2
+ require 'ruby-debug'
3
+
4
+ config_file = ENV['HOME'] + '/.tagcrumbs'
5
+
6
+ # optionally load another config file
7
+ if ENV['TC_ENV']
8
+ config_file += '_' + ENV['TC_ENV']
9
+ end
10
+
11
+ puts "* Loading Tagcrumbs configuration from #{config_file} and merging with defaults"
12
+ @config = Tagcrumbs::ConfigStore.load(config_file)
13
+
14
+ Tagcrumbs.configure(@config.options)
@@ -2,7 +2,6 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  require 'rubygems'
5
- #require 'ruby-debug'
6
5
 
7
6
  gem 'activesupport', '2.3.2'
8
7
  require 'active_support'
@@ -25,6 +24,9 @@ require 'mime/types'
25
24
  gem 'builder', '2.1.2'
26
25
  require 'builder'
27
26
 
27
+ require 'zlib'
28
+
29
+
28
30
  # Inflections must be available before classes are loaded, needed to automatically find the correct classes
29
31
  ActiveSupport::Inflector.inflections do |inflect|
30
32
  inflect.irregular 'address', 'address'
@@ -32,7 +34,7 @@ ActiveSupport::Inflector.inflections do |inflect|
32
34
  inflect.uncountable "suggestions"
33
35
  end
34
36
 
35
- require 'tagcrumbs/validations'
37
+ require 'tagcrumbs/core_extensions'
36
38
  require 'tagcrumbs/config_store'
37
39
  require 'tagcrumbs/exceptions'
38
40
 
@@ -53,7 +55,7 @@ require 'tagcrumbs/proxy'
53
55
 
54
56
  # resources
55
57
  require 'tagcrumbs/resources/resource'
56
- require 'tagcrumbs/resources/array'
58
+ require 'tagcrumbs/resources/collection'
57
59
 
58
60
  # models
59
61
  require 'tagcrumbs/resources/models/accessors'
@@ -61,11 +63,14 @@ require 'tagcrumbs/resources/models/model'
61
63
  require 'tagcrumbs/resources/models/tagcrumb'
62
64
  require 'tagcrumbs/resources/models/place'
63
65
 
66
+ require 'tagcrumbs/resources/models/access_token'
64
67
  require 'tagcrumbs/resources/models/address'
65
68
  require 'tagcrumbs/resources/models/activity'
69
+ require 'tagcrumbs/resources/models/application'
66
70
  require 'tagcrumbs/resources/models/city'
67
71
  require 'tagcrumbs/resources/models/comment'
68
72
  require 'tagcrumbs/resources/models/country'
73
+ require 'tagcrumbs/resources/models/email_recommendation'
69
74
  require 'tagcrumbs/resources/models/fanship'
70
75
  require 'tagcrumbs/resources/models/favorite'
71
76
  require 'tagcrumbs/resources/models/filter'
@@ -74,6 +79,7 @@ require 'tagcrumbs/resources/models/friendship'
74
79
  require 'tagcrumbs/resources/models/geoname'
75
80
  require 'tagcrumbs/resources/models/link'
76
81
  require 'tagcrumbs/resources/models/location'
82
+ require 'tagcrumbs/resources/models/paragraph'
77
83
  require 'tagcrumbs/resources/models/picture'
78
84
  require 'tagcrumbs/resources/models/placemark'
79
85
  require 'tagcrumbs/resources/models/profile'
@@ -89,7 +95,7 @@ require 'tagcrumbs/resources/models/user_recommendation'
89
95
 
90
96
 
91
97
  module Tagcrumbs
92
- VERSION = '0.3.1'
98
+ VERSION = '0.3.2'
93
99
 
94
100
  class << self
95
101
  # Returns the default configuration options of the gem. You can overwrite the options with configure
@@ -98,10 +104,13 @@ module Tagcrumbs
98
104
  :consumer_token => 'ZQAR3nW5D3S5JgU8EAKEfA',
99
105
  :consumer_secret => 'vMc7NA77eraJc9TwyImshEEMVgrEy4C8YURVlwoyrHE',
100
106
  :format => :xml,
107
+ :compression => true,
101
108
  :consumer_options =>
102
109
  {
103
- :site => 'http://www.tagcrumbs.com'
104
- #:site => 'http://localhost:2999'
110
+ :site => 'http://www.tagcrumbs.com',
111
+ :request_token_path => 'https://www.tagcrumbs.com/oauth/request_token',
112
+ :access_token_path => 'https://www.tagcrumbs.com/oauth/access_token',
113
+ :access_token_from_credentials_path => 'https://www.tagcrumbs.com/oauth/access_token_from_credentials'
105
114
  }
106
115
  }
107
116
  end
@@ -124,12 +133,13 @@ module Tagcrumbs
124
133
  # request_token:: The OAuth request token that you received that you can exchange against an access token
125
134
  # request_secret:: The OAuth request secret that you received that you can exchange against an access token
126
135
  # format:: The Tagcrumbs webservice supports XML and JSON. You can specify the format of your requests here
136
+ # compression:: Use gzip compression to save bandwidth
127
137
  def configure(new_options={})
128
138
  new_options.symbolize_keys!
129
139
  new_options.assert_valid_keys(:consumer_secret, :consumer_token, :consumer_options,
130
140
  :access_token, :access_secret,
131
141
  :request_token, :request_secret,
132
- :format)
142
+ :format, :compression)
133
143
 
134
144
  self.options.merge!(new_options)
135
145
  end
@@ -155,18 +165,35 @@ module Tagcrumbs
155
165
  # After you redirected the user to the authorize_url and after the user authorized your application you can exchange
156
166
  # the request_token against an access_token that you can use to make all further signed requests.
157
167
  # You should use configure to pass in your access_token and access_secret for all further web service calls.
158
- def exchange_request_token!
159
- return @@access_token if defined?(@@access_token)
160
- @@access_token = request_token.get_access_token
168
+ def access_token_from_request_token
169
+ return @@access_token_from_request_token if defined?(@@access_token_from_request_token)
170
+ @@access_token_from_request_token = request_token.get_access_token
161
171
 
162
- options[:access_token] = @@access_token.token
163
- options[:access_secret] = @@access_token.secret
172
+ options[:access_token] = @@access_token_from_request_token.token
173
+ options[:access_secret] = @@access_token_from_request_token.secret
164
174
 
165
- @@access_token
175
+ @@access_token_from_request_token
166
176
  rescue OAuth::Unauthorized
167
177
  nil
168
178
  end
169
179
 
180
+ # Get an access token for all further requests by authenticating with the user's username and password.
181
+ # Access to this must be requested from Tagcrumbs. It makes dealing with certain types of applications easier (mobile).
182
+ # You should not ask for access_tokens all the time but keep the access token that you received around and not store the username and password
183
+ # of the user.
184
+ def access_token_from_credentials(username, password)
185
+ return @@access_token_from_credentials if defined?(@@access_token_from_credentials)
186
+
187
+ @@access_token_from_credentials = Requestor.new.access_token_from_credentials(username, password)
188
+
189
+ options[:access_token] = @@access_token_from_credentials.token
190
+ options[:access_secret] = @@access_token_from_credentials.secret
191
+
192
+ @@access_token_from_credentials
193
+ rescue OAuth::Unauthorized
194
+ nil
195
+ end
196
+
170
197
  # Returns the current user that approved the application and owns the current access_token
171
198
  # This is also used internally to automatically request all the URLs to POST new resources to.
172
199
  def current_user
@@ -184,7 +211,7 @@ module Tagcrumbs
184
211
  :per_page => [1, 5, 7, 10, 25, 50, 100],
185
212
  :from => [:you, :friends, :fans, :recommendations, :everybody, :user],
186
213
  :tagcrumb_type => ['Placemark', 'Favorite'],
187
- :within => [0.015, 0.15, 0.55],
214
+ :range => [:short, :medium, :long],
188
215
  :sort => [:date, :distance, :name, :favorites, :comments],
189
216
  :order => [:asc, :desc],
190
217
  :w => [:unknown, :country, :state, :city, :zip, :street, :intersection, :address, :premise, :nearby, :everywhere]