openstax_api 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openstax/api/routing_mapper_includes.rb +3 -2
- data/lib/openstax/api/version.rb +1 -1
- data/lib/openstax_api.rb +5 -0
- data/spec/dummy/log/test.log +150 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5629468c30de716b91b391649758a2b175ea729
|
4
|
+
data.tar.gz: e54286b3183689bae4f7369b8bce896f3d6cf869
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e2cf10423d2d147b72eea5ebbdae967fcb46273da34656e98f18fbcb6641729ceca952b85aa421c8b95edfb5cf32e7d52ca392b382bd0fda600338c1e308e1e
|
7
|
+
data.tar.gz: 42f3deafb56ee2a911c3c0a011f782a5ea1f47707bc890a153b424d0f98594b824e08efc997004f1a5a9e2baba041088e009dc0f5d320bba3aec019c67c3c248
|
@@ -5,6 +5,8 @@ module OpenStax
|
|
5
5
|
module RoutingMapperIncludes
|
6
6
|
def api(version, options = {})
|
7
7
|
api_namespace = (options.delete(:namespace) || 'api').to_s
|
8
|
+
routing_error_app = options.delete(:routing_error_app) || \
|
9
|
+
OpenStax::Api.configuration.routing_error_app
|
8
10
|
constraints = Constraints.new(version: version,
|
9
11
|
default: options.delete(:default))
|
10
12
|
|
@@ -16,8 +18,7 @@ module OpenStax
|
|
16
18
|
|
17
19
|
yield
|
18
20
|
|
19
|
-
match '/*other', via: [:get, :post, :put, :patch, :delete],
|
20
|
-
to: lambda { |env| [404, {"Content-Type" => 'application/json'}, ['']] }
|
21
|
+
match '/*other', via: [:get, :post, :put, :patch, :delete], to: routing_error_app
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
data/lib/openstax/api/version.rb
CHANGED
data/lib/openstax_api.rb
CHANGED
@@ -31,13 +31,18 @@ module OpenStax
|
|
31
31
|
# current_user_method is a String containing the name of your controller
|
32
32
|
# method that returns the current user.
|
33
33
|
#
|
34
|
+
# routing_error_app is a Rack application that responds to routing errors for the API
|
35
|
+
#
|
34
36
|
class Configuration
|
35
37
|
attr_accessor :user_class_name
|
36
38
|
attr_accessor :current_user_method
|
39
|
+
attr_accessor :routing_error_app
|
37
40
|
|
38
41
|
def initialize
|
39
42
|
@user_class_name = 'User'
|
40
43
|
@current_user_method = 'current_user'
|
44
|
+
@routing_error_app = lambda { |env|
|
45
|
+
[404, {"Content-Type" => 'application/json'}, ['']] }
|
41
46
|
end
|
42
47
|
end
|
43
48
|
|
data/spec/dummy/log/test.log
CHANGED
@@ -3925,3 +3925,153 @@ Connecting to database specified by database.yml
|
|
3925
3925
|
[1m[35m (0.1ms)[0m rollback transaction
|
3926
3926
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3927
3927
|
[1m[35m (0.1ms)[0m rollback transaction
|
3928
|
+
[1m[36m (1.4ms)[0m [1mCREATE 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) [0m
|
3929
|
+
[1m[35m (1.0ms)[0m 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))
|
3930
|
+
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
3931
|
+
[1m[35m (0.9ms)[0m CREATE UNIQUE INDEX "index_oauth_access_grants_on_token" ON "oauth_access_grants" ("token")
|
3932
|
+
[1m[36m (0.8ms)[0m [1mCREATE 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)) [0m
|
3933
|
+
[1m[35m (0.7ms)[0m CREATE UNIQUE INDEX "index_oauth_access_tokens_on_refresh_token" ON "oauth_access_tokens" ("refresh_token")
|
3934
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3935
|
+
FROM sqlite_master
|
3936
|
+
WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
|
3937
|
+
UNION ALL
|
3938
|
+
SELECT sql
|
3939
|
+
FROM sqlite_temp_master
|
3940
|
+
WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
|
3941
|
+
[0m
|
3942
|
+
[1m[35m (0.8ms)[0m CREATE INDEX "index_oauth_access_tokens_on_resource_owner_id" ON "oauth_access_tokens" ("resource_owner_id")
|
3943
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
3944
|
+
FROM sqlite_master
|
3945
|
+
WHERE name='index_oauth_access_tokens_on_resource_owner_id' AND type='index'
|
3946
|
+
UNION ALL
|
3947
|
+
SELECT sql
|
3948
|
+
FROM sqlite_temp_master
|
3949
|
+
WHERE name='index_oauth_access_tokens_on_resource_owner_id' AND type='index'
|
3950
|
+
[0m
|
3951
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
3952
|
+
FROM sqlite_master
|
3953
|
+
WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
|
3954
|
+
UNION ALL
|
3955
|
+
SELECT sql
|
3956
|
+
FROM sqlite_temp_master
|
3957
|
+
WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
|
3958
|
+
|
3959
|
+
[1m[36m (0.8ms)[0m [1mCREATE UNIQUE INDEX "index_oauth_access_tokens_on_token" ON "oauth_access_tokens" ("token")[0m
|
3960
|
+
[1m[35m (0.8ms)[0m 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)
|
3961
|
+
[1m[36m (0.6ms)[0m [1mCREATE UNIQUE INDEX "index_oauth_applications_on_uid" ON "oauth_applications" ("uid")[0m
|
3962
|
+
[1m[35m (0.7ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
3963
|
+
[1m[36m (0.7ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
3964
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
3965
|
+
[1m[36m (0.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('1')[0m
|
3966
|
+
[1m[35m (0.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
3967
|
+
[1m[36m (0.5ms)[0m [1mbegin transaction[0m
|
3968
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3969
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3970
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3971
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3972
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3973
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3974
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3975
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3976
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3977
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3978
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3979
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3980
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3981
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3982
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3983
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3984
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3985
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3986
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3987
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3988
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
3989
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2014-09-26 19:22:35.031079"], ["updated_at", "2014-09-26 19:22:35.031079"]]
|
3990
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
3991
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
3992
|
+
[1m[35m (0.1ms)[0m begin transaction
|
3993
|
+
[1m[36mDummyUser Load (0.2ms)[0m [1mSELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" IS NULL ORDER BY "dummy_users"."id" ASC LIMIT 1[0m
|
3994
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3995
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3996
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
3997
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2014-09-26 19:22:35.041842"], ["updated_at", "2014-09-26 19:22:35.041842"]]
|
3998
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
3999
|
+
[1m[36mDummyUser Load (0.1ms)[0m [1mSELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" = 1 ORDER BY "dummy_users"."id" ASC LIMIT 1[0m
|
4000
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
4001
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4002
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4003
|
+
[1m[36m (0.9ms)[0m [1mCREATE 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) [0m
|
4004
|
+
[1m[35m (0.7ms)[0m 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))
|
4005
|
+
[1m[36m (0.0ms)[0m [1mselect sqlite_version(*)[0m
|
4006
|
+
[1m[35m (0.7ms)[0m CREATE UNIQUE INDEX "index_oauth_access_grants_on_token" ON "oauth_access_grants" ("token")
|
4007
|
+
[1m[36m (0.7ms)[0m [1mCREATE 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)) [0m
|
4008
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "index_oauth_access_tokens_on_refresh_token" ON "oauth_access_tokens" ("refresh_token")
|
4009
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
4010
|
+
FROM sqlite_master
|
4011
|
+
WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
|
4012
|
+
UNION ALL
|
4013
|
+
SELECT sql
|
4014
|
+
FROM sqlite_temp_master
|
4015
|
+
WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
|
4016
|
+
[0m
|
4017
|
+
[1m[35m (0.7ms)[0m CREATE INDEX "index_oauth_access_tokens_on_resource_owner_id" ON "oauth_access_tokens" ("resource_owner_id")
|
4018
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
4019
|
+
FROM sqlite_master
|
4020
|
+
WHERE name='index_oauth_access_tokens_on_resource_owner_id' AND type='index'
|
4021
|
+
UNION ALL
|
4022
|
+
SELECT sql
|
4023
|
+
FROM sqlite_temp_master
|
4024
|
+
WHERE name='index_oauth_access_tokens_on_resource_owner_id' AND type='index'
|
4025
|
+
[0m
|
4026
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
4027
|
+
FROM sqlite_master
|
4028
|
+
WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
|
4029
|
+
UNION ALL
|
4030
|
+
SELECT sql
|
4031
|
+
FROM sqlite_temp_master
|
4032
|
+
WHERE name='index_oauth_access_tokens_on_refresh_token' AND type='index'
|
4033
|
+
|
4034
|
+
[1m[36m (0.7ms)[0m [1mCREATE UNIQUE INDEX "index_oauth_access_tokens_on_token" ON "oauth_access_tokens" ("token")[0m
|
4035
|
+
[1m[35m (0.8ms)[0m 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)
|
4036
|
+
[1m[36m (0.7ms)[0m [1mCREATE UNIQUE INDEX "index_oauth_applications_on_uid" ON "oauth_applications" ("uid")[0m
|
4037
|
+
[1m[35m (0.7ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
4038
|
+
[1m[36m (0.7ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
4039
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
4040
|
+
[1m[36m (0.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('1')[0m
|
4041
|
+
[1m[35m (0.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('0')
|
4042
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
4043
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4044
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4045
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4046
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4047
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4048
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4049
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4050
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4051
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4052
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4053
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4054
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4055
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4056
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4057
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4058
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4059
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4060
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4061
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
4062
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?)[0m [["created_at", "2014-09-26 19:38:29.603305"], ["updated_at", "2014-09-26 19:38:29.603305"]]
|
4063
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
4064
|
+
[1m[36m (1.0ms)[0m [1mrollback transaction[0m
|
4065
|
+
[1m[35m (0.1ms)[0m begin transaction
|
4066
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
4067
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-26 19:38:29.610869"], ["updated_at", "2014-09-26 19:38:29.610869"]]
|
4068
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
4069
|
+
[1m[35mDummyUser Load (0.1ms)[0m SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" = 1 ORDER BY "dummy_users"."id" ASC LIMIT 1
|
4070
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
4071
|
+
[1m[35m (0.0ms)[0m begin transaction
|
4072
|
+
[1m[36mDummyUser Load (0.1ms)[0m [1mSELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" IS NULL ORDER BY "dummy_users"."id" ASC LIMIT 1[0m
|
4073
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4074
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4075
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
4076
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4077
|
+
[1m[35m (0.0ms)[0m 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.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dante Soares
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-09-
|
12
|
+
date: 2014-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|