platform 3.1.2 → 3.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/.rvmrc +2 -0
  2. data/Gemfile.lock +4 -4
  3. data/README.rdoc +0 -3
  4. data/app/assets/javascripts/platform/api_explorer.js +4 -1
  5. data/app/controllers/platform/api/base_controller.rb +39 -20
  6. data/app/models/platform/application.rb +2 -4
  7. data/app/models/platform/developer.rb +4 -2
  8. data/app/models/platform/logged_exception.rb +2 -2
  9. data/app/models/platform/media/media.rb +6 -3
  10. data/app/views/platform/admin/apps/index.html.erb +1 -1
  11. data/app/views/platform/apps/index.html.erb +2 -2
  12. data/app/views/platform/developer/api_explorer/index.html.erb +9 -5
  13. data/app/views/platform/developer/apps/_form.html.erb +4 -2
  14. data/app/views/platform/developer/apps/index.html.erb +6 -4
  15. data/app/views/platform/developer/common/_header.html.erb +0 -1
  16. data/app/views/platform/developer/dashboard/_statistics.html.erb +1 -1
  17. data/app/views/platform/developer/dashboard/index.html.erb +1 -1
  18. data/app/views/platform/developer/help/oauth_mobile.html.erb +5 -3
  19. data/app/views/platform/developer/registration/index.html.erb +8 -123
  20. data/lib/generators/platform/api_generator.rb +74 -0
  21. data/lib/generators/platform/platform_generator.rb +1 -1
  22. data/lib/generators/platform/proxy_generator.rb +1 -2
  23. data/lib/generators/platform/templates/config/platform/config.yml +9 -8
  24. data/lib/generators/platform/templates/config/platform/data/default_applications.yml +1 -23
  25. data/lib/generators/platform/templates/config/platform/data/default_categories.yml +1 -6
  26. data/lib/generators/platform/templates/config/platform/data/default_permissions.yml +16 -0
  27. data/lib/generators/platform/templates/config/platform/site/features.yml +1 -6
  28. data/lib/generators/platform/templates/db/create_platform_tables.rb +36 -47
  29. data/lib/platform/api/proxy/base.rb +4 -0
  30. data/lib/platform/config.rb +12 -16
  31. data/lib/platform/extensions/action_view_extension.rb +13 -1
  32. data/lib/platform/extensions/hash_extension.rb +69 -0
  33. data/lib/platform/railtie.rb +1 -0
  34. data/lib/platform/version.rb +1 -1
  35. data/lib/tasks/platform.rake +1 -0
  36. data/platform.gemspec +0 -1
  37. data/test/dummy/app/assets/images/logo.png +0 -0
  38. data/test/dummy/app/controllers/api/bookmarks_controller.rb +1 -1
  39. data/test/dummy/app/models/bookmark.rb +0 -2
  40. data/test/dummy/app/models/user.rb +1 -2
  41. data/test/dummy/app/views/home/index.html.erb +2 -2
  42. data/test/dummy/app/views/layouts/_footer.html.erb +1 -1
  43. data/test/dummy/app/views/layouts/_header.html.erb +1 -1
  44. data/test/dummy/config/application.rb +0 -1
  45. data/test/dummy/config/environments/development.rb +3 -1
  46. data/test/dummy/config/initializers/platform.rb +3 -0
  47. data/test/dummy/config/platform/api/1/bookmark.yml +2 -2
  48. data/test/dummy/config/platform/config.yml +10 -9
  49. data/test/dummy/config/platform/data/default_applications.yml +4 -23
  50. data/test/dummy/config/platform/data/default_categories.yml +1 -6
  51. data/test/dummy/config/platform/site/features.yml +1 -6
  52. data/test/dummy/config/routes.rb +1 -1
  53. data/test/dummy/config/tr8n/config.yml +2 -2
  54. data/test/dummy/db/migrate/20111004075531_create_platform_tables.rb +1 -1
  55. data/test/dummy/public/developer_agreement.html +123 -0
  56. metadata +52 -46
  57. data/db/migrate/20110602232141_create_platform_tables.rb +0 -262
@@ -1,262 +0,0 @@
1
- class CreatePlatformTables < ActiveRecord::Migration
2
- def self.up
3
- create_table :platform_developers do |t|
4
- t.integer :user_id, :limit => 8, :null => false
5
- t.string :name, :null => false
6
- t.text :about
7
- t.string :url
8
- t.string :email
9
- t.string :phone
10
- t.timestamps
11
- end
12
- add_index :platform_developers, :user_id
13
-
14
- create_table :platform_applications do |t|
15
- t.integer :developer_id
16
- t.string :name
17
- t.text :description
18
- t.string :state, :default => "new"
19
- t.string :locale
20
- t.string :url
21
- t.string :site_domain
22
- t.string :support_url
23
- t.string :callback_url
24
- t.string :contact_email
25
- t.string :privacy_policy_url
26
- t.string :terms_of_service_url
27
- t.string :permissions
28
- t.string :key
29
- t.string :secret
30
- t.integer :icon_id
31
- t.integer :logo_id
32
- t.string :canvas_name
33
- t.string :canvas_url
34
- t.boolean :auto_resize
35
- t.boolean :auto_login
36
- t.string :mobile_application_type
37
- t.string :ios_bundle_id
38
- t.string :itunes_app_store_id
39
- t.string :android_key_hash
40
- t.integer :rank
41
- t.boolean :auto_signin
42
- t.string :deauthorize_callback_url
43
- t.string :version
44
- t.string :api_version
45
- t.integer :parent_id
46
- t.timestamps
47
- end
48
- add_index :platform_applications, :developer_id
49
- add_index :platform_applications, :key, :unique
50
- add_index :platform_applications, :parent_id
51
-
52
- create_table :platform_application_logs do |t|
53
- t.integer :application_id
54
- t.integer :user_id
55
- t.string :event
56
- t.string :controller
57
- t.string :action
58
- t.string :request_method
59
- t.text :data
60
- t.string :user_agent
61
- t.integer :duration
62
- t.string :host
63
- t.string :country
64
- t.string :ip
65
- t.timestamps
66
- end
67
- add_index :platform_application_logs, [:application_id, :created_at]
68
-
69
- create_table :platform_application_metrics do |t|
70
- t.string :type
71
- t.timestamp :interval
72
- t.integer :application_id
73
- t.integer :active_user_count
74
- t.integer :new_user_count
75
- t.timestamps
76
- end
77
- add_index :platform_application_metrics, [:application_id, :interval], :name => "pamai"
78
-
79
- create_table :platform_application_usage_metrics do |t|
80
- t.string :type
81
- t.timestamp :interval
82
- t.integer :application_id
83
- t.string :event
84
- t.integer :count
85
- t.integer :avg_response_time
86
- t.integer :error_count
87
- t.timestamps
88
- end
89
- add_index :platform_application_usage_metrics, [:application_id, :interval], :name => "paumai"
90
-
91
- create_table :platform_rollup_logs do |t|
92
- t.timestamp :interval
93
- t.timestamp :started_at
94
- t.timestamp :finished_at
95
- t.timestamps
96
- end
97
- add_index :platform_rollup_logs, :interval
98
-
99
- create_table :platform_media do |t|
100
- t.string :type
101
- t.string :file_location
102
- t.string :content_type
103
- t.string :file_name
104
- t.timestamps
105
- end
106
-
107
- create_table :platform_application_developers do |t|
108
- t.integer :application_id
109
- t.integer :developer_id
110
- t.timestamps
111
- end
112
- add_index :platform_application_developers, :application_id
113
- add_index :platform_application_developers, :developer_id
114
-
115
- create_table :platform_oauth_tokens do |t|
116
- t.string :type, :limit => 20
117
- t.integer :user_id, :limit=>8
118
- t.integer :application_id
119
- t.string :token, :limit => 50
120
- t.string :secret, :limit => 50
121
- t.string :verifier, :limit => 20
122
- t.string :callback_url
123
- t.string :scope
124
- t.timestamp :valid_to
125
- t.timestamp :authorized_at, :invalidated_at
126
- t.timestamps
127
- end
128
- add_index :platform_oauth_tokens, :token, :unique
129
-
130
- create_table :platform_ratings do |t|
131
- t.integer :user_id, :limit => 8, :null => false
132
- t.string :object_type
133
- t.integer :object_id
134
- t.integer :value
135
- t.text :comment
136
- t.timestamps
137
- end
138
- add_index :platform_ratings, :user_id
139
- add_index :platform_ratings, [:object_type, :object_id]
140
-
141
- create_table :platform_categories do |t|
142
- t.string :type
143
- t.string :name
144
- t.string :keyword
145
- t.integer :position
146
- t.date :enable_on
147
- t.date :disable_on
148
- t.integer :parent_id
149
- t.timestamps
150
- end
151
- add_index :platform_categories, :parent_id
152
-
153
- create_table :platform_application_categories do |t|
154
- t.integer :category_id, :null => false
155
- t.integer :application_id, :null => false
156
- t.integer :position
157
- t.boolean :featured
158
- t.timestamps
159
- end
160
- add_index :platform_application_categories, :category_id, :name => "pacc"
161
- add_index :platform_application_categories, [:category_id, :application_id], :name => "pacca"
162
-
163
- create_table :platform_forum_topics do |t|
164
- t.string :subject_type
165
- t.integer :subject_id
166
- t.integer :user_id, :null => false
167
- t.text :topic, :null => false
168
- t.timestamps
169
- end
170
- add_index :platform_forum_topics, [:subject_type, :subject_id], :name => "pftss"
171
- add_index :platform_forum_topics, [:user_id], :name => "pftu"
172
-
173
- create_table :platform_forum_messages do |t|
174
- t.integer :forum_topic_id, :null => false
175
- t.integer :user_id, :null => false
176
- t.text :message, :null => false
177
- t.timestamps
178
- end
179
- add_index :platform_forum_messages, [:forum_topic_id]
180
- add_index :platform_forum_messages, [:user_id]
181
-
182
- create_table :platform_permissions do |t|
183
- t.string :keyword, :null => false
184
- t.text :description, :null => false
185
- t.timestamps
186
- end
187
- add_index :platform_permissions, [:keyword]
188
-
189
- create_table :platform_application_permissions do |t|
190
- t.integer :application_id
191
- t.integer :permission_id
192
- t.timestamps
193
- end
194
- add_index :platform_application_permissions, :application_id
195
-
196
- create_table :platform_application_users do |t|
197
- t.integer :application_id, :null => false
198
- t.integer :user_id, :null => false
199
- t.text :data
200
- t.timestamps
201
- end
202
- add_index :platform_application_users, [:application_id]
203
- add_index :platform_application_users, [:user_id]
204
-
205
- create_table :platform_users do |t|
206
- t.string :name
207
- t.string :gender
208
- t.string :email
209
- t.string :password
210
- t.string :mugshot
211
- t.string :link
212
- t.string :locale
213
- t.timestamps
214
- end
215
- add_index :platform_users, [:email]
216
- add_index :platform_users, [:email, :password]
217
-
218
- create_table :platform_admins do |t|
219
- t.integer :user_id
220
- t.integer :level
221
- t.timestamps
222
- end
223
- add_index :platform_admins, [:user_id]
224
-
225
- create_table :platform_logged_exceptions do |t|
226
- t.column :exception_class, :string
227
- t.column :controller_name, :string
228
- t.column :action_name, :string
229
- t.column :server, :string
230
- t.column :message, :text
231
- t.column :backtrace, :text
232
- t.column :environment, :text
233
- t.column :request, :text
234
- t.column :session, :text
235
- t.column :cause, :binary
236
- t.column :user_id, :integer
237
- t.column :application_id, :integer
238
- t.timestamps
239
- end
240
- end
241
-
242
- def self.down
243
- drop_table :platform_developers
244
- drop_table :platform_applications
245
- drop_table :platform_application_logs
246
- drop_table :platform_application_metrics
247
- drop_table :platform_rollup_logs
248
- drop_table :platform_application_developers
249
- drop_table :platform_oauth_tokens
250
- drop_table :platform_ratings
251
- drop_table :platform_categories
252
- drop_table :platform_category_items
253
- drop_table :platform_forum_topics
254
- drop_table :platform_forum_messages
255
- drop_table :platform_permissions
256
- drop_table :platform_application_permissions
257
- drop_table :platform_application_users
258
- drop_table :platform_users
259
- drop_table :platform_admins
260
- drop_table :platform_logged_exceptions
261
- end
262
- end