openstax_api 2.5.0 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82c1d8fd8e664cbc123a25a9d3c4ac70db77d576
4
- data.tar.gz: cdb0d6fb0baf3f34fc993e1ec98699e690d93e7f
3
+ metadata.gz: 4e9f64fc680c9305cdab0cf7c5763750825793bc
4
+ data.tar.gz: 0d469d8177f3417341d18e502ba8c575bc7bb153
5
5
  SHA512:
6
- metadata.gz: 667519e687915fb9c384adfc4e5f65b5b512cdb85a362af1243a05c67f1ec5c37bd5dc63e7a0054f3400e4bd8063e4129fa16a8597606f8662f6c3532627388e
7
- data.tar.gz: d5bca9ec2800c1ca7d0ed1c6a6d21e9994bc5406ddfae6f89c3caa76aee7a3f0938e2ccdf2a424c69761b7a980eba50ddf562bfe3050bc293fe60158c9240f7b
6
+ metadata.gz: acdfccc6cda3472e3f14f7cee2e2feb21175d5208719a0adbf42f8f4a368259b583f3dafa8012504e170e31f736826aa18f8a52ba5b2ee0c9b3bb13cdd15c6b7
7
+ data.tar.gz: 1e9d2348a19c27782de4f31ed8740120b3ce6346e45ce8d452d56a6fb8cb91c3cf258dbb98a4c4e7df3889e4852b08e44f8ddc0b93df2d490d466ee4e450988e
data/README.md CHANGED
@@ -54,15 +54,17 @@ Finally, this gem allows API routes to be simplified by using the api method, li
54
54
  ```rb
55
55
  apipie
56
56
 
57
- get 'api', to: 'static_pages#api'
57
+ api :v1 do
58
+ get '/your_api_v1_routes_go_here'
59
+ end
58
60
 
59
- api :v1, true do
60
- get '/your_api_routes_go_here'
61
+ api :v2, default: true do
62
+ get '/your_api_v2_routes_go_here'
61
63
  end
62
64
  ```
63
65
 
64
- The api route method takes a version argument and a boolean.
65
- If the boolean is true, that version is the default (latest) and will always match the Accept header. It should be defined last, as any API route after that will be ignored.
66
+ The api route method takes a version argument and an options hash.
67
+ If the `:default` option is set to true, that version is the default (latest) and will always match the Accept header. It should be defined last, as any API route after that will be ignored.
66
68
 
67
69
  ## Testing
68
70
 
@@ -1,5 +1,5 @@
1
1
  module OpenStax
2
2
  module Api
3
- VERSION = "2.5.0"
3
+ VERSION = "2.5.1"
4
4
  end
5
5
  end
@@ -5125,3 +5125,228 @@ Connecting to database specified by database.yml
5125
5125
   (0.0ms) rollback transaction
5126
5126
   (0.0ms) begin transaction
5127
5127
   (0.0ms) rollback transaction
5128
+  (1.7ms) CREATE TABLE "dummy_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "username" varchar(255), "password_hash" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
5129
+  (0.9ms) CREATE TABLE "oauth_access_grants" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "resource_owner_id" integer NOT NULL, "application_id" integer NOT NULL, "token" varchar(255) NOT NULL, "expires_in" integer NOT NULL, "redirect_uri" text NOT NULL, "created_at" datetime NOT NULL, "revoked_at" datetime, "scopes" varchar(255))
5130
+  (0.1ms) select sqlite_version(*)
5131
+  (0.9ms) CREATE UNIQUE INDEX "index_oauth_access_grants_on_token" ON "oauth_access_grants" ("token")
5132
+  (0.8ms) CREATE TABLE "oauth_access_tokens" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "resource_owner_id" integer, "application_id" integer, "token" varchar(255) NOT NULL, "refresh_token" varchar(255), "expires_in" integer, "revoked_at" datetime, "created_at" datetime NOT NULL, "scopes" varchar(255)) 
5133
+  (0.8ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_refresh_token" ON "oauth_access_tokens" ("refresh_token")
5134
+  (0.1ms)  SELECT sql
5135
+ FROM sqlite_master
5136
+ WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
5137
+ UNION ALL
5138
+ SELECT sql
5139
+ FROM sqlite_temp_master
5140
+ WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
5141
+ 
5142
+  (0.7ms) CREATE INDEX "index_oauth_access_tokens_on_resource_owner_id" ON "oauth_access_tokens" ("resource_owner_id")
5143
+  (0.1ms)  SELECT sql
5144
+ FROM sqlite_master
5145
+ WHERE name='index_oauth_access_tokens_on_resource_owner_id' AND type='index'
5146
+ UNION ALL
5147
+ SELECT sql
5148
+ FROM sqlite_temp_master
5149
+ WHERE name='index_oauth_access_tokens_on_resource_owner_id' AND type='index'
5150
+ 
5151
+  (0.1ms) SELECT sql
5152
+ FROM sqlite_master
5153
+ WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
5154
+ UNION ALL
5155
+ SELECT sql
5156
+ FROM sqlite_temp_master
5157
+ WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
5158
+
5159
+  (0.8ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_token" ON "oauth_access_tokens" ("token")
5160
+  (0.8ms) CREATE TABLE "oauth_applications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "uid" varchar(255) NOT NULL, "secret" varchar(255) NOT NULL, "redirect_uri" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
5161
+  (0.7ms) CREATE UNIQUE INDEX "index_oauth_applications_on_uid" ON "oauth_applications" ("uid")
5162
+  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
5163
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5164
+  (0.1ms) SELECT version FROM "schema_migrations"
5165
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
5166
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
5167
+  (0.4ms) begin transaction
5168
+  (0.0ms) SAVEPOINT active_record_1
5169
+ SQL (0.3ms) INSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-29 22:34:28.677251"], ["updated_at", "2014-09-29 22:34:28.677251"]]
5170
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5171
+ DummyUser Load (0.1ms) SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" = 1 ORDER BY "dummy_users"."id" ASC LIMIT 1
5172
+  (0.9ms) rollback transaction
5173
+  (0.1ms) begin transaction
5174
+ DummyUser Load (0.1ms) SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" IS NULL ORDER BY "dummy_users"."id" ASC LIMIT 1
5175
+  (0.0ms) rollback transaction
5176
+  (0.0ms) begin transaction
5177
+  (0.0ms) SAVEPOINT active_record_1
5178
+ SQL (0.2ms) INSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-29 22:34:28.686780"], ["updated_at", "2014-09-29 22:34:28.686780"]]
5179
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5180
+  (0.3ms) rollback transaction
5181
+  (0.0ms) begin transaction
5182
+  (0.0ms) rollback transaction
5183
+  (0.1ms) begin transaction
5184
+  (0.0ms) rollback transaction
5185
+  (0.0ms) begin transaction
5186
+  (0.0ms) rollback transaction
5187
+  (0.0ms) begin transaction
5188
+  (0.0ms) rollback transaction
5189
+  (0.0ms) begin transaction
5190
+  (0.0ms) rollback transaction
5191
+  (0.0ms) begin transaction
5192
+  (0.0ms) rollback transaction
5193
+  (0.0ms) begin transaction
5194
+  (0.0ms) rollback transaction
5195
+  (0.0ms) begin transaction
5196
+  (0.0ms) rollback transaction
5197
+  (0.0ms) begin transaction
5198
+  (0.1ms) rollback transaction
5199
+  (0.0ms) begin transaction
5200
+  (0.0ms) rollback transaction
5201
+  (0.0ms) begin transaction
5202
+  (0.0ms) rollback transaction
5203
+  (1.3ms) CREATE TABLE "dummy_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "username" varchar(255), "password_hash" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
5204
+  (0.7ms) CREATE TABLE "oauth_access_grants" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "resource_owner_id" integer NOT NULL, "application_id" integer NOT NULL, "token" varchar(255) NOT NULL, "expires_in" integer NOT NULL, "redirect_uri" text NOT NULL, "created_at" datetime NOT NULL, "revoked_at" datetime, "scopes" varchar(255))
5205
+  (0.1ms) select sqlite_version(*)
5206
+  (5.1ms) CREATE UNIQUE INDEX "index_oauth_access_grants_on_token" ON "oauth_access_grants" ("token")
5207
+  (2.8ms) CREATE TABLE "oauth_access_tokens" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "resource_owner_id" integer, "application_id" integer, "token" varchar(255) NOT NULL, "refresh_token" varchar(255), "expires_in" integer, "revoked_at" datetime, "created_at" datetime NOT NULL, "scopes" varchar(255)) 
5208
+  (5.9ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_refresh_token" ON "oauth_access_tokens" ("refresh_token")
5209
+  (0.1ms)  SELECT sql
5210
+ FROM sqlite_master
5211
+ WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
5212
+ UNION ALL
5213
+ SELECT sql
5214
+ FROM sqlite_temp_master
5215
+ WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
5216
+ 
5217
+  (0.5ms) CREATE INDEX "index_oauth_access_tokens_on_resource_owner_id" ON "oauth_access_tokens" ("resource_owner_id")
5218
+  (0.1ms)  SELECT sql
5219
+ FROM sqlite_master
5220
+ WHERE name='index_oauth_access_tokens_on_resource_owner_id' AND type='index'
5221
+ UNION ALL
5222
+ SELECT sql
5223
+ FROM sqlite_temp_master
5224
+ WHERE name='index_oauth_access_tokens_on_resource_owner_id' AND type='index'
5225
+ 
5226
+  (0.1ms) SELECT sql
5227
+ FROM sqlite_master
5228
+ WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
5229
+ UNION ALL
5230
+ SELECT sql
5231
+ FROM sqlite_temp_master
5232
+ WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
5233
+
5234
+  (0.6ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_token" ON "oauth_access_tokens" ("token")
5235
+  (2.0ms) CREATE TABLE "oauth_applications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "uid" varchar(255) NOT NULL, "secret" varchar(255) NOT NULL, "redirect_uri" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
5236
+  (0.6ms) CREATE UNIQUE INDEX "index_oauth_applications_on_uid" ON "oauth_applications" ("uid")
5237
+  (1.5ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
5238
+  (4.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5239
+  (0.1ms) SELECT version FROM "schema_migrations"
5240
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
5241
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
5242
+  (0.4ms) begin transaction
5243
+  (0.0ms) rollback transaction
5244
+  (0.0ms) begin transaction
5245
+  (0.0ms) rollback transaction
5246
+  (0.0ms) begin transaction
5247
+  (0.0ms) rollback transaction
5248
+  (0.0ms) begin transaction
5249
+  (0.0ms) rollback transaction
5250
+  (0.0ms) begin transaction
5251
+  (0.0ms) rollback transaction
5252
+  (0.0ms) begin transaction
5253
+  (0.0ms) rollback transaction
5254
+  (0.0ms) begin transaction
5255
+  (0.0ms) rollback transaction
5256
+  (0.0ms) begin transaction
5257
+  (0.0ms) rollback transaction
5258
+  (0.0ms) begin transaction
5259
+  (0.0ms) rollback transaction
5260
+  (0.0ms) begin transaction
5261
+  (0.0ms) SAVEPOINT active_record_1
5262
+ SQL (0.3ms) INSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-29 22:36:13.116101"], ["updated_at", "2014-09-29 22:36:13.116101"]]
5263
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5264
+  (1.0ms) rollback transaction
5265
+  (0.1ms) begin transaction
5266
+  (0.1ms) SAVEPOINT active_record_1
5267
+ SQL (0.3ms) INSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-29 22:36:13.122915"], ["updated_at", "2014-09-29 22:36:13.122915"]]
5268
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5269
+ DummyUser Load (0.1ms) SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" = 1 ORDER BY "dummy_users"."id" ASC LIMIT 1
5270
+  (7.4ms) rollback transaction
5271
+  (0.1ms) begin transaction
5272
+ DummyUser Load (0.2ms) SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" IS NULL ORDER BY "dummy_users"."id" ASC LIMIT 1
5273
+  (0.1ms) rollback transaction
5274
+  (0.0ms) begin transaction
5275
+  (0.0ms) rollback transaction
5276
+  (0.1ms) begin transaction
5277
+  (0.1ms) rollback transaction
5278
+  (1.3ms) CREATE TABLE "dummy_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "username" varchar(255), "password_hash" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
5279
+  (0.5ms) CREATE TABLE "oauth_access_grants" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "resource_owner_id" integer NOT NULL, "application_id" integer NOT NULL, "token" varchar(255) NOT NULL, "expires_in" integer NOT NULL, "redirect_uri" text NOT NULL, "created_at" datetime NOT NULL, "revoked_at" datetime, "scopes" varchar(255))
5280
+  (0.1ms) select sqlite_version(*)
5281
+  (11.0ms) CREATE UNIQUE INDEX "index_oauth_access_grants_on_token" ON "oauth_access_grants" ("token")
5282
+  (0.7ms) CREATE TABLE "oauth_access_tokens" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "resource_owner_id" integer, "application_id" integer, "token" varchar(255) NOT NULL, "refresh_token" varchar(255), "expires_in" integer, "revoked_at" datetime, "created_at" datetime NOT NULL, "scopes" varchar(255)) 
5283
+  (14.9ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_refresh_token" ON "oauth_access_tokens" ("refresh_token")
5284
+  (0.1ms)  SELECT sql
5285
+ FROM sqlite_master
5286
+ WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
5287
+ UNION ALL
5288
+ SELECT sql
5289
+ FROM sqlite_temp_master
5290
+ WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
5291
+ 
5292
+  (0.7ms) CREATE INDEX "index_oauth_access_tokens_on_resource_owner_id" ON "oauth_access_tokens" ("resource_owner_id")
5293
+  (0.1ms)  SELECT sql
5294
+ FROM sqlite_master
5295
+ WHERE name='index_oauth_access_tokens_on_resource_owner_id' AND type='index'
5296
+ UNION ALL
5297
+ SELECT sql
5298
+ FROM sqlite_temp_master
5299
+ WHERE name='index_oauth_access_tokens_on_resource_owner_id' AND type='index'
5300
+ 
5301
+  (0.1ms) SELECT sql
5302
+ FROM sqlite_master
5303
+ WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
5304
+ UNION ALL
5305
+ SELECT sql
5306
+ FROM sqlite_temp_master
5307
+ WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
5308
+
5309
+  (5.9ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_token" ON "oauth_access_tokens" ("token")
5310
+  (17.3ms) CREATE TABLE "oauth_applications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "uid" varchar(255) NOT NULL, "secret" varchar(255) NOT NULL, "redirect_uri" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
5311
+  (0.9ms) CREATE UNIQUE INDEX "index_oauth_applications_on_uid" ON "oauth_applications" ("uid")
5312
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
5313
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5314
+  (0.1ms) SELECT version FROM "schema_migrations"
5315
+  (6.3ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
5316
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
5317
+  (0.4ms) begin transaction
5318
+  (0.1ms) rollback transaction
5319
+  (0.0ms) begin transaction
5320
+  (0.0ms) SAVEPOINT active_record_1
5321
+ SQL (0.3ms) INSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-29 22:36:31.958601"], ["updated_at", "2014-09-29 22:36:31.958601"]]
5322
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5323
+ DummyUser Load (0.1ms) SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" = 1 ORDER BY "dummy_users"."id" ASC LIMIT 1
5324
+  (0.8ms) rollback transaction
5325
+  (0.0ms) begin transaction
5326
+  (0.0ms) SAVEPOINT active_record_1
5327
+ SQL (0.2ms) INSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-29 22:36:31.966732"], ["updated_at", "2014-09-29 22:36:31.966732"]]
5328
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5329
+  (25.7ms) rollback transaction
5330
+  (0.1ms) begin transaction
5331
+ DummyUser Load (0.1ms) SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" IS NULL ORDER BY "dummy_users"."id" ASC LIMIT 1
5332
+  (0.0ms) rollback transaction
5333
+  (0.0ms) begin transaction
5334
+  (0.0ms) rollback transaction
5335
+  (0.0ms) begin transaction
5336
+  (0.0ms) rollback transaction
5337
+  (0.0ms) begin transaction
5338
+  (0.0ms) rollback transaction
5339
+  (0.0ms) begin transaction
5340
+  (0.0ms) rollback transaction
5341
+  (0.0ms) begin transaction
5342
+  (0.0ms) rollback transaction
5343
+  (0.0ms) begin transaction
5344
+  (0.0ms) rollback transaction
5345
+  (0.0ms) begin transaction
5346
+  (0.0ms) rollback transaction
5347
+  (0.0ms) begin transaction
5348
+  (0.0ms) rollback transaction
5349
+  (0.0ms) begin transaction
5350
+  (0.0ms) rollback transaction
5351
+  (0.0ms) begin transaction
5352
+  (0.1ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstax_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dante Soares