jmoses_apipie-rails 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. data/.gitignore +11 -0
  2. data/.rspec +2 -0
  3. data/.travis.yml +4 -0
  4. data/APACHE-LICENSE-2.0 +202 -0
  5. data/CHANGELOG +55 -0
  6. data/Gemfile +3 -0
  7. data/MIT-LICENSE +20 -0
  8. data/NOTICE +4 -0
  9. data/README.rst +938 -0
  10. data/Rakefile +13 -0
  11. data/apipie-rails.gemspec +26 -0
  12. data/app/controllers/apipie/apipies_controller.rb +105 -0
  13. data/app/public/apipie/javascripts/apipie.js +6 -0
  14. data/app/public/apipie/javascripts/bundled/bootstrap-collapse.js +138 -0
  15. data/app/public/apipie/javascripts/bundled/bootstrap.js +1726 -0
  16. data/app/public/apipie/javascripts/bundled/jquery-1.7.2.js +9404 -0
  17. data/app/public/apipie/javascripts/bundled/prettify.js +28 -0
  18. data/app/public/apipie/stylesheets/application.css +20 -0
  19. data/app/public/apipie/stylesheets/bundled/bootstrap-responsive.min.css +12 -0
  20. data/app/public/apipie/stylesheets/bundled/bootstrap.min.css +689 -0
  21. data/app/public/apipie/stylesheets/bundled/prettify.css +30 -0
  22. data/app/views/apipie/apipies/_disqus.html.erb +11 -0
  23. data/app/views/apipie/apipies/_params.html.erb +29 -0
  24. data/app/views/apipie/apipies/_params_plain.html.erb +16 -0
  25. data/app/views/apipie/apipies/apipie_404.html.erb +12 -0
  26. data/app/views/apipie/apipies/getting_started.html.erb +4 -0
  27. data/app/views/apipie/apipies/index.html.erb +43 -0
  28. data/app/views/apipie/apipies/method.html.erb +71 -0
  29. data/app/views/apipie/apipies/plain.html.erb +70 -0
  30. data/app/views/apipie/apipies/resource.html.erb +98 -0
  31. data/app/views/apipie/apipies/static.html.erb +101 -0
  32. data/app/views/layouts/apipie/apipie.html.erb +26 -0
  33. data/lib/apipie-rails.rb +15 -0
  34. data/lib/apipie/apipie_module.rb +62 -0
  35. data/lib/apipie/application.rb +334 -0
  36. data/lib/apipie/client/generator.rb +135 -0
  37. data/lib/apipie/configuration.rb +128 -0
  38. data/lib/apipie/dsl_definition.rb +379 -0
  39. data/lib/apipie/error_description.rb +25 -0
  40. data/lib/apipie/errors.rb +38 -0
  41. data/lib/apipie/extractor.rb +151 -0
  42. data/lib/apipie/extractor/collector.rb +113 -0
  43. data/lib/apipie/extractor/recorder.rb +124 -0
  44. data/lib/apipie/extractor/writer.rb +367 -0
  45. data/lib/apipie/helpers.rb +52 -0
  46. data/lib/apipie/markup.rb +48 -0
  47. data/lib/apipie/method_description.rb +191 -0
  48. data/lib/apipie/param_description.rb +204 -0
  49. data/lib/apipie/railtie.rb +9 -0
  50. data/lib/apipie/resource_description.rb +102 -0
  51. data/lib/apipie/routing.rb +15 -0
  52. data/lib/apipie/see_description.rb +39 -0
  53. data/lib/apipie/static_dispatcher.rb +59 -0
  54. data/lib/apipie/validator.rb +310 -0
  55. data/lib/apipie/version.rb +3 -0
  56. data/lib/generators/apipie/install/README +6 -0
  57. data/lib/generators/apipie/install/install_generator.rb +25 -0
  58. data/lib/generators/apipie/install/templates/initializer.rb.erb +7 -0
  59. data/lib/tasks/apipie.rake +166 -0
  60. data/rel-eng/packages/.readme +3 -0
  61. data/rel-eng/packages/rubygem-apipie-rails +1 -0
  62. data/rel-eng/tito.props +5 -0
  63. data/spec/controllers/api/v1/architectures_controller_spec.rb +30 -0
  64. data/spec/controllers/api/v2/architectures_controller_spec.rb +12 -0
  65. data/spec/controllers/api/v2/nested/resources_controller_spec.rb +11 -0
  66. data/spec/controllers/apipies_controller_spec.rb +141 -0
  67. data/spec/controllers/concerns_controller_spec.rb +42 -0
  68. data/spec/controllers/users_controller_spec.rb +473 -0
  69. data/spec/dummy/Rakefile +7 -0
  70. data/spec/dummy/app/controllers/api/base_controller.rb +4 -0
  71. data/spec/dummy/app/controllers/api/v1/architectures_controller.rb +42 -0
  72. data/spec/dummy/app/controllers/api/v1/base_controller.rb +11 -0
  73. data/spec/dummy/app/controllers/api/v2/architectures_controller.rb +30 -0
  74. data/spec/dummy/app/controllers/api/v2/base_controller.rb +11 -0
  75. data/spec/dummy/app/controllers/api/v2/nested/architectures_controller.rb +30 -0
  76. data/spec/dummy/app/controllers/api/v2/nested/resources_controller.rb +33 -0
  77. data/spec/dummy/app/controllers/application_controller.rb +6 -0
  78. data/spec/dummy/app/controllers/concerns/sample_controller.rb +39 -0
  79. data/spec/dummy/app/controllers/concerns_controller.rb +8 -0
  80. data/spec/dummy/app/controllers/twitter_example_controller.rb +302 -0
  81. data/spec/dummy/app/controllers/users_controller.rb +251 -0
  82. data/spec/dummy/app/views/layouts/application.html.erb +21 -0
  83. data/spec/dummy/config.ru +4 -0
  84. data/spec/dummy/config/application.rb +45 -0
  85. data/spec/dummy/config/boot.rb +10 -0
  86. data/spec/dummy/config/database.yml +21 -0
  87. data/spec/dummy/config/environment.rb +8 -0
  88. data/spec/dummy/config/environments/development.rb +25 -0
  89. data/spec/dummy/config/environments/production.rb +49 -0
  90. data/spec/dummy/config/environments/test.rb +35 -0
  91. data/spec/dummy/config/initializers/apipie.rb +102 -0
  92. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  93. data/spec/dummy/config/initializers/inflections.rb +10 -0
  94. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  95. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  96. data/spec/dummy/config/initializers/session_store.rb +8 -0
  97. data/spec/dummy/config/locales/en.yml +5 -0
  98. data/spec/dummy/config/routes.rb +22 -0
  99. data/spec/dummy/db/.gitkeep +0 -0
  100. data/spec/dummy/doc/apipie_examples.yml +28 -0
  101. data/spec/dummy/public/404.html +26 -0
  102. data/spec/dummy/public/422.html +26 -0
  103. data/spec/dummy/public/500.html +26 -0
  104. data/spec/dummy/public/favicon.ico +0 -0
  105. data/spec/dummy/public/javascripts/application.js +2 -0
  106. data/spec/dummy/public/javascripts/controls.js +965 -0
  107. data/spec/dummy/public/javascripts/dragdrop.js +974 -0
  108. data/spec/dummy/public/javascripts/effects.js +1123 -0
  109. data/spec/dummy/public/javascripts/prototype.js +6001 -0
  110. data/spec/dummy/public/javascripts/rails.js +202 -0
  111. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  112. data/spec/dummy/script/rails +6 -0
  113. data/spec/lib/application_spec.rb +38 -0
  114. data/spec/lib/method_description_spec.rb +30 -0
  115. data/spec/lib/param_description_spec.rb +174 -0
  116. data/spec/lib/param_group_spec.rb +45 -0
  117. data/spec/lib/resource_description_spec.rb +30 -0
  118. data/spec/lib/validator_spec.rb +46 -0
  119. data/spec/spec_helper.rb +32 -0
  120. metadata +337 -0
@@ -0,0 +1,7 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+ require 'rake'
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,4 @@
1
+ module Api
2
+ class BaseController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,42 @@
1
+ module Api
2
+ module V1
3
+ class ArchitecturesController < V1::BaseController
4
+ resource_description { name 'Architectures' }
5
+ api :GET, "/architectures/", "List all architectures."
6
+ def index
7
+ end
8
+
9
+ api :GET, "/architectures/:id/", "Show an architecture."
10
+ def show
11
+ end
12
+
13
+ def_param_group :timestamps do
14
+ param :created_at, String
15
+ param :updated_at, String
16
+ end
17
+
18
+ def_param_group :arch do
19
+ param :architecture, Hash, :required => true do
20
+ param :name, String, :required => true
21
+ param_group :timestamps
22
+ end
23
+ end
24
+
25
+ api :POST, "/architectures/", "Create an architecture."
26
+ param_group :arch
27
+ def create
28
+ end
29
+
30
+ api :PUT, "/architectures/:id/", "Update an architecture."
31
+ param :architecture, Hash, :required => true do
32
+ param :name, String
33
+ end
34
+ def update
35
+ end
36
+
37
+ api :DELETE, "/architecturess/:id/", "Delete an architecture."
38
+ def destroy
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,11 @@
1
+ module Api
2
+ module V1
3
+ class BaseController < Api::BaseController
4
+ resource_description do
5
+ api_version '1.0'
6
+ app_info 'Version 1.0 description'
7
+ api_base_url '/api/v1'
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,30 @@
1
+ module Api
2
+ module V2
3
+ class ArchitecturesController < V2::BaseController
4
+ resource_description { name 'Architectures' }
5
+ api :GET, "/architectures/", "List all architectures."
6
+ def index
7
+ end
8
+
9
+ api :GET, "/architectures/:id/", "Show an architecture."
10
+ def show
11
+ end
12
+
13
+ api :POST, "/architectures/", "Create an architecture."
14
+ param_group :arch, Api::V1::ArchitecturesController
15
+ def create
16
+ end
17
+
18
+ api :PUT, "/architectures/:id/", "Update an architecture."
19
+ param :architecture, Hash, :required => true do
20
+ param :name, String
21
+ end
22
+ def update
23
+ end
24
+
25
+ api :DELETE, "/architecturess/:id/", "Delete an architecture."
26
+ def destroy
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,11 @@
1
+ module Api
2
+ module V2
3
+ class BaseController < Api::BaseController
4
+ resource_description do
5
+ api_version '2.0'
6
+ app_info 'Version 2.0 description'
7
+ api_base_url '/api/v2'
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,30 @@
1
+ module Api
2
+ module V2
3
+ class Nested::ArchitecturesController < V2::BaseController
4
+ resource_description { name 'Architectures' }
5
+ api :GET, "/nested/architectures/", "List all nested architectures."
6
+ def index
7
+ end
8
+
9
+ api :GET, "/nested/architectures/:id/", "Show a nested architecture."
10
+ def show
11
+ end
12
+
13
+ api :POST, "/nested/architectures/", "Create a nested architecture."
14
+ param_group :arch, Api::V1::ArchitecturesController
15
+ def create
16
+ end
17
+
18
+ api :PUT, "/nested/architectures/:id/", "Update a nested architecture."
19
+ param :architecture, Hash, :required => true do
20
+ param :name, String
21
+ end
22
+ def update
23
+ end
24
+
25
+ api :DELETE, "/architecturess/:id/", "Delete a nested architecture."
26
+ def destroy
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,33 @@
1
+ module Api
2
+ module V2
3
+ class Nested::ResourcesController < V2::BaseController
4
+ resource_description do
5
+ name 'Resources'
6
+ resource_id "resource"
7
+ end
8
+ api :GET, "/nested/resources/", "List all nested resources."
9
+ def index
10
+ end
11
+
12
+ api :GET, "/nested/resources/:id/", "Show a nested resource."
13
+ def show
14
+ end
15
+
16
+ api :POST, "/nested/resources/", "Create a nested resource."
17
+ param_group :arch, Api::V1::ArchitecturesController
18
+ def create
19
+ end
20
+
21
+ api :PUT, "/nested/resources/:id/", "Update a nested resource."
22
+ param :architecture, Hash, :required => true do
23
+ param :name, String
24
+ end
25
+ def update
26
+ end
27
+
28
+ api :DELETE, "/resources/:id/", "Delete a nested resource."
29
+ def destroy
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,6 @@
1
+ class ApplicationController < ActionController::Base
2
+
3
+ resource_description do
4
+ param :oauth, String, :desc => "Authorization", :required => false
5
+ end
6
+ end
@@ -0,0 +1,39 @@
1
+ module Concerns::SampleController
2
+ extend Apipie::DSL::Concern
3
+
4
+ api :GET, '/:controller_path'
5
+ def index
6
+ render :text => "OK #{params.inspect}"
7
+ end
8
+
9
+ api :GET, '/:resource_id/:id'
10
+ param :id, String
11
+ def show
12
+ render :text => "OK #{params.inspect}"
13
+ end
14
+
15
+ def_param_group :concern do
16
+ param :concern, Hash, :required => true, :action_aware => true do
17
+ param :name, String, "Name of a :concern"
18
+ param :concern_type, String
19
+ end
20
+ end
21
+
22
+ api :POST, '/:resource_id', "Create a :concern"
23
+ param_group :concern
24
+ def create
25
+ render :text => "OK #{params.inspect}"
26
+ end
27
+
28
+ api :PUT, '/:resource_id/:id'
29
+ param :id, String
30
+ param_group :concern
31
+ def update
32
+ render :text => "OK #{params.inspect}"
33
+ end
34
+
35
+ api :GET, '/:resource_id/:custom_subst'
36
+ def custom
37
+ render :text => "OK #{params.inspect}"
38
+ end
39
+ end
@@ -0,0 +1,8 @@
1
+ class ConcernsController < ApplicationController
2
+
3
+ resource_description { resource_id 'concern_resources' }
4
+
5
+ apipie_concern_subst(:concern => 'user', :custom_subst => 'custom', 'string_subst' => 'string')
6
+ include ::Concerns::SampleController
7
+
8
+ end
@@ -0,0 +1,302 @@
1
+ class TwitterExampleController < ApplicationController
2
+
3
+ resource_description do
4
+ name 'TwitterUsers'
5
+ short_description 'Users are at the center of everything Twitter: they follow, they favorite, and tweet & retweet.'
6
+ path '/twitter_example/'
7
+ description "Long description of this resource."
8
+ end
9
+
10
+ api :GET, '/twitter_example/lookup', 'Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.'
11
+ param :screen_name, String, :desc => 'A comma separated list of screen names, up to 100 are allowed in a single request. You are strongly encouraged to use a POST for larger (up to 100 screen names) requests.'
12
+ param :user_id, Integer, :desc => 'A comma separated list of user IDs, up to 100 are allowed in a single request. You are strongly encouraged to use a POST for larger requests.'
13
+ param :include_entities, String, :desc => 'When set to either <code>true</code>, <code>t</code> or <code>1</code>, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future. See Tweet Entities for more detail on entities.'
14
+
15
+ description <<-EOS
16
+ Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two. The author's most recent status (if the authenticating user has permission) will be returned inline.
17
+
18
+ This method is crucial for consumers of the {Streaming API}[link:https://dev.twitter.com/pages/streaming_api]. It's also well suited for use in tandem with friends/ids[link:https://dev.twitter.com/doc/get/friends/ids] and followers/ids[link:https://dev.twitter.com/doc/get/followers/ids].
19
+
20
+ === Extended description
21
+ There are a few things to note when using this method.
22
+
23
+ * You must be following a protected user to be able to see their most recent status update. If you don't follow a protected user their status will be removed.
24
+ * The order of user IDs or screen names may not match the order of users in the returned array.
25
+ * If a requested user is unknown, suspended, or deleted, then that user will not be returned in the results list.
26
+ * You are strongly encouraged to use a POST for larger requests.
27
+ EOS
28
+ def lookup
29
+ render :text => "lookup"
30
+ end
31
+
32
+ api :GET, '/twitter_example/profile_image/:screen_name', 'Access the profile image in various sizes for the user with the indicated screen_name.'
33
+ param :screen_name, String, :required => true, :desc => 'The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID.'
34
+ param :size, ['bigger','normal','mini','original'], :desc => <<-EOS
35
+ Specifies the size of image to fetch. Not specifying a size will give the default, normal size of 48px by 48px. Valid options include:
36
+
37
+ * bigger - 73px by 73px
38
+ * normal - 48px by 48px
39
+ * mini - 24px by 24px
40
+ * original - undefined. This will be the size the image was originally uploaded in. The filesize of original images can be very big so use this parameter with caution.
41
+ EOS
42
+ description <<-EOS
43
+ Access the profile image in various sizes for the user with the indicated screen_name. If no size is provided the normal image is returned.
44
+
45
+ This resource does not return JSON or XML, but instead returns a 302 redirect to the actual image resource.
46
+
47
+ This method should only be used by application developers to lookup or check the profile image URL for a user. This method must not be used as the image source URL presented to users of your application.
48
+ EOS
49
+ def profile_image
50
+ render :text => "profile_image of '#{params[:screen_name]}'"
51
+ end
52
+
53
+ api :GET, '/twitter_example/search', 'Runs a search for users similar to Find People button on Twitter.com.'
54
+ param :q, String, :desc => 'The search query to run against people search.', :required => true
55
+ param :page, Integer, :desc => 'Specifies the page of results to retrieve.'
56
+ param :per_page, Integer, :desc => 'The number of people to retrieve. Maxiumum of 20 allowed per page.'
57
+ param :include_entities, String, :desc => 'When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future. See Tweet Entities for more detail on entities.'
58
+ description <<-EOS
59
+ Runs a search for users similar to Find People button on Twitter.com. The results returned by people search on Twitter.com are the same as those returned by this API request. Note that unlike GET search, this method does not support any operators.
60
+
61
+ Only the first 1000 matches are available.
62
+
63
+ === Extended description
64
+ This method has a feature-specific rate limit of 60 calls per hour that is applied in conjunction with the main REST API rate limit. Calls to this method will count against the feature-specific rate limit and the main REST API rate limit. If either limit is exhausted, the request will fail. You can monitor the status of the feature-specific rate limit by inspecting the HTTP response headers <tt>X-FeatureRateLimit-Limit</tt>, <tt>X-FeatureRateLimit-Remaining</tt>, and <tt>X-FeatureRateLimit-Reset</tt>. These headers correspond to the <tt>X-RateLimit</tt> headers provided by the main REST API limit.
65
+ EOS
66
+
67
+ example <<-EDOC
68
+ [
69
+ {
70
+ "name": "Twitter API",
71
+ "profile_sidebar_border_color": "87bc44",
72
+ "profile_background_tile": false,
73
+ "profile_sidebar_fill_color": "e0ff92",
74
+ "location": "San Francisco, CA",
75
+ "profile_image_url": "http://a3.twimg.com/profile_images/689684365/api_normal.png",
76
+ "created_at": "Wed May 23 06:01:13 +0000 2007",
77
+ "profile_link_color": "0000ff",
78
+ "favourites_count": 2,
79
+ "url": "http://apiwiki.twitter.com",
80
+ "contributors_enabled": true,
81
+ "utc_offset": -28800,
82
+ "id": 6253282,
83
+ "profile_use_background_image": true,
84
+ "profile_text_color": "000000",
85
+ "protected": false,
86
+ "followers_count": 160753,
87
+ "lang": "en",
88
+ "verified": true,
89
+ "profile_background_color": "c1dfee",
90
+ "geo_enabled": true,
91
+ "notifications": null,
92
+ "description": "The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.",
93
+ "time_zone": "Pacific Time (US & Canada)",
94
+ "friends_count": 19,
95
+ "statuses_count": 1858,
96
+ "profile_background_image_url": "http://a3.twimg.com/profile_background_images/59931895/twitterapi-background-new.png",
97
+ "status": {
98
+ "coordinates": null,
99
+ "favorited": false,
100
+ "created_at": "Tue Jun 22 16:53:28 +0000 2010",
101
+ "truncated": false,
102
+ "text": "@Demonicpagan possible some part of your signature generation is incorrect & fails for real reasons.. follow up on the list if you suspect",
103
+ "contributors": null,
104
+ "id": 16783999399,
105
+ "geo": null,
106
+ "in_reply_to_user_id": 6339722,
107
+ "place": null,
108
+ "source": "<a href="http://www.tweetdeck.com" rel="nofollow">TweetDeck</a>",
109
+ "in_reply_to_screen_name": "Demonicpagan",
110
+ "in_reply_to_status_id": 16781827477
111
+ },
112
+ "screen_name": "twitterapi",
113
+ "following": null
114
+ },
115
+ ...
116
+ {
117
+ "name": "twitterAPI",
118
+ "profile_sidebar_border_color": "87bc44",
119
+ "profile_background_tile": false,
120
+ "profile_sidebar_fill_color": "e0ff92",
121
+ "location": null,
122
+ "profile_image_url": "http://s.twimg.com/a/1277162817/images/default_profile_6_normal.png",
123
+ "created_at": "Fri Jun 04 12:07:25 +0000 2010",
124
+ "profile_link_color": "0000ff",
125
+ "favourites_count": 0,
126
+ "url": null,
127
+ "contributors_enabled": false,
128
+ "utc_offset": null,
129
+ "id": 151851125,
130
+ "profile_use_background_image": true,
131
+ "profile_text_color": "000000",
132
+ "protected": false,
133
+ "followers_count": 0,
134
+ "lang": "ja",
135
+ "verified": false,
136
+ "profile_background_color": "9ae4e8",
137
+ "geo_enabled": false,
138
+ "notifications": false,
139
+ "description": null,
140
+ "time_zone": null,
141
+ "friends_count": 0,
142
+ "statuses_count": 0,
143
+ "profile_background_image_url": "http://s.twimg.com/a/1277162817/images/themes/theme1/bg.png",
144
+ "screen_name": "popoAPI",
145
+ "following": false
146
+ }
147
+ ]
148
+ EDOC
149
+ def search
150
+ render :text => 'search'
151
+ end
152
+
153
+ api :GET, '/twitter_example/:id', 'Returns extended information of a given user, specified by ID or screen name as per the required id parameter.'
154
+ param :id, :number, :required => true, :desc => <<-EOS
155
+ The ID of the user for whom to return results for. Either an id or screen_name is required for this method.
156
+ EOS
157
+ param :screen_name, String, :desc => 'The screen name of the user for...'
158
+ description <<-EDOC
159
+ Returns extended information of a given user, specified by ID or screen name as per the required id parameter. The author's most recent status will be returned inline.
160
+ EDOC
161
+ def show
162
+ render :text => "show #{params}"
163
+ end
164
+
165
+ api :GET, '/twitter_example/contributors', 'Returns an array of users who can contribute to the specified account.'
166
+ param :user_id, Integer, :desc => 'The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name.'
167
+ param :screen_name, String, :desc => 'The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID.'
168
+ param :include_entities, String
169
+ param :skip_status, ['t','true','1'],
170
+ :description => 'When set to either true, t or 1 statuses will not be included in the returned user objects.'
171
+
172
+ description "Look at examples."
173
+
174
+ example <<-EDOC
175
+ GET https://api.twitter.com/1/twitter_example/contributors.json?screen_name=twitterapi&include_entities=true&skip_status=true
176
+ [
177
+ {
178
+ "profile_sidebar_border_color": "C0DEED",
179
+ "profile_background_tile": false,
180
+ "name": "Matt Harris",
181
+ "profile_sidebar_fill_color": "DDEEF6",
182
+ "expanded_url": "http://themattharris.com",
183
+ "created_at": "Sat Feb 17 20:49:54 +0000 2007",
184
+ "location": "SFO/LHR/YVR/JAX/IAD/AUS",
185
+ "profile_image_url": "http://a1.twimg.com/profile_images/554181350/matt_normal.jpg",
186
+ "follow_request_sent": false,
187
+ "is_translator": false,
188
+ "profile_link_color": "0084B4",
189
+ "id_str": "777925",
190
+ "entities": {
191
+ "urls": [
192
+
193
+ ],
194
+ "hashtags": [
195
+
196
+ ],
197
+ "user_mentions": [
198
+ {
199
+ "name": "Cindy Li",
200
+ "id_str": "29733",
201
+ "id": 29733,
202
+ "indices": [
203
+ 45,
204
+ 53
205
+ ],
206
+ "screen_name": "cindyli"
207
+ }
208
+ ]
209
+ },
210
+ "default_profile": true,
211
+ "url": "http://t.co/292MnqA",
212
+ "contributors_enabled": false,
213
+ "favourites_count": 120,
214
+ "id": 777925,
215
+ "utc_offset": -28800,
216
+ "listed_count": 271,
217
+ "profile_use_background_image": true,
218
+ "followers_count": 6242,
219
+ "lang": "en",
220
+ "protected": false,
221
+ "profile_text_color": "333333",
222
+ "profile_background_color": "C0DEED",
223
+ "time_zone": "Pacific Time (US & Canada)",
224
+ "geo_enabled": true,
225
+ "description": "Developer Advocate at Twitter and married to @cindyli. NASA enthusiast, British expat and all around geek living in San Francisco.",
226
+ "notifications": false,
227
+ "verified": false,
228
+ "profile_background_image_url": "http://a0.twimg.com/images/themes/theme1/bg.png",
229
+ "statuses_count": 3835,
230
+ "display_url": "themattharris.com",
231
+ "friends_count": 360,
232
+ "default_profile_image": false,
233
+ "following": false,
234
+ "show_all_inline_media": false,
235
+ "screen_name": "themattharris"
236
+ },
237
+ ...
238
+ ]
239
+ EDOC
240
+ example <<-EDOC
241
+ Another example...
242
+ {
243
+ "profile_sidebar_border_color": "547980",
244
+ "profile_background_tile": true,
245
+ "name": "Ryan Sarver",
246
+ "profile_sidebar_fill_color": "F8FCF2",
247
+ "expanded_url": "http://sarver.org",
248
+ "created_at": "Mon Feb 26 18:05:55 +0000 2007",
249
+ "location": "San Francisco, CA",
250
+ "profile_image_url": "http://a2.twimg.com/profile_images/644997837/ryan_sarver_twitter_big_normal.jpg",
251
+ "follow_request_sent": false,
252
+ "is_translator": false,
253
+ "profile_link_color": "547980",
254
+ "id_str": "795649",
255
+ "entities": {
256
+ "urls": [
257
+
258
+ ],
259
+ "hashtags": [
260
+
261
+ ],
262
+ "user_mentions": [
263
+
264
+ ]
265
+ },
266
+ "default_profile": false,
267
+ "contributors_enabled": true,
268
+ "url": "http://t.co/Lzsetyk",
269
+ "favourites_count": 246,
270
+ "id": 795649,
271
+ "utc_offset": -28800,
272
+ "profile_use_background_image": true,
273
+ "listed_count": 1384,
274
+ "followers_count": 280756,
275
+ "lang": "en",
276
+ "protected": false,
277
+ "profile_text_color": "594F4F",
278
+ "profile_background_color": "45ADA8",
279
+ "time_zone": "Pacific Time (US & Canada)",
280
+ "geo_enabled": true,
281
+ "description": "platform/api at twitter",
282
+ "notifications": false,
283
+ "verified": false,
284
+ "friends_count": 1022,
285
+ "profile_background_image_url": "http://a0.twimg.com/profile_background_images/113854313/xa60e82408188860c483d73444d53e21.png",
286
+ "display_url": "sarver.org",
287
+ "default_profile_image": false,
288
+ "statuses_count": 7031,
289
+ "following": false,
290
+ "show_all_inline_media": true,
291
+ "screen_name": "rsarver"
292
+ }
293
+ EDOC
294
+ def contributors
295
+ render :text => 'contributors'
296
+ end
297
+
298
+ def index
299
+ render :text => 'twitter example'
300
+ end
301
+
302
+ end