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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45c27bbfb7edbe8f5c01860b4e4f0a9e207b7da8
4
- data.tar.gz: 43d7537f58483adaae038c63c68a2f165495dc45
3
+ metadata.gz: a5629468c30de716b91b391649758a2b175ea729
4
+ data.tar.gz: e54286b3183689bae4f7369b8bce896f3d6cf869
5
5
  SHA512:
6
- metadata.gz: f4542cb79a125a6649073825c5eae73b8270f11037ebd95b62fc0de1cc28d7cf5da8437b2e3cc756a1d0f2d34d842c1540b54a27a8eb06e3754b8eb938de3d1d
7
- data.tar.gz: 6032ee2636e0813b182fda6b4e06fa61af87219a892e1afa9e413cfa78586bfb0bfd5e1823bce8cdf7316f2e933c2680c4fe8f26651b12fc8751257354d9b25e
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
@@ -1,5 +1,5 @@
1
1
  module OpenStax
2
2
  module Api
3
- VERSION = "2.3.0"
3
+ VERSION = "2.3.1"
4
4
  end
5
5
  end
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
 
@@ -3925,3 +3925,153 @@ Connecting to database specified by database.yml
3925
3925
   (0.1ms) rollback transaction
3926
3926
   (0.1ms) begin transaction
3927
3927
   (0.1ms) rollback transaction
3928
+  (1.4ms) 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) 
3929
+  (1.0ms) 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
+  (0.1ms) select sqlite_version(*)
3931
+  (0.9ms) CREATE UNIQUE INDEX "index_oauth_access_grants_on_token" ON "oauth_access_grants" ("token")
3932
+  (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)) 
3933
+  (0.7ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_refresh_token" ON "oauth_access_tokens" ("refresh_token")
3934
+  (0.1ms)  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
+ 
3942
+  (0.8ms) CREATE INDEX "index_oauth_access_tokens_on_resource_owner_id" ON "oauth_access_tokens" ("resource_owner_id")
3943
+  (0.1ms)  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
+ 
3951
+  (0.1ms) 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
+  (0.8ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_token" ON "oauth_access_tokens" ("token")
3960
+  (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)
3961
+  (0.6ms) CREATE UNIQUE INDEX "index_oauth_applications_on_uid" ON "oauth_applications" ("uid")
3962
+  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
3963
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3964
+  (0.1ms) SELECT version FROM "schema_migrations"
3965
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
3966
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
3967
+  (0.5ms) begin transaction
3968
+  (0.1ms) rollback transaction
3969
+  (0.0ms) begin transaction
3970
+  (0.1ms) rollback transaction
3971
+  (0.0ms) begin transaction
3972
+  (0.0ms) rollback transaction
3973
+  (0.0ms) begin transaction
3974
+  (0.1ms) rollback transaction
3975
+  (0.0ms) begin transaction
3976
+  (0.0ms) rollback transaction
3977
+  (0.0ms) begin transaction
3978
+  (0.0ms) rollback transaction
3979
+  (0.0ms) begin transaction
3980
+  (0.0ms) rollback transaction
3981
+  (0.0ms) begin transaction
3982
+  (0.0ms) rollback transaction
3983
+  (0.0ms) begin transaction
3984
+  (0.0ms) rollback transaction
3985
+  (0.0ms) begin transaction
3986
+  (0.0ms) rollback transaction
3987
+  (0.0ms) begin transaction
3988
+  (0.1ms) SAVEPOINT active_record_1
3989
+ SQL (0.4ms) INSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-26 19:22:35.031079"], ["updated_at", "2014-09-26 19:22:35.031079"]]
3990
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3991
+  (0.3ms) rollback transaction
3992
+  (0.1ms) begin transaction
3993
+ DummyUser Load (0.2ms) SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" IS NULL ORDER BY "dummy_users"."id" ASC LIMIT 1
3994
+  (0.1ms) rollback transaction
3995
+  (0.0ms) begin transaction
3996
+  (0.0ms) SAVEPOINT active_record_1
3997
+ SQL (0.2ms) INSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-26 19:22:35.041842"], ["updated_at", "2014-09-26 19:22:35.041842"]]
3998
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3999
+ DummyUser Load (0.1ms) SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" = 1 ORDER BY "dummy_users"."id" ASC LIMIT 1
4000
+  (0.3ms) rollback transaction
4001
+  (0.0ms) begin transaction
4002
+  (0.0ms) rollback transaction
4003
+  (0.9ms) 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) 
4004
+  (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))
4005
+  (0.0ms) select sqlite_version(*)
4006
+  (0.7ms) CREATE UNIQUE INDEX "index_oauth_access_grants_on_token" ON "oauth_access_grants" ("token")
4007
+  (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)) 
4008
+  (0.8ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_refresh_token" ON "oauth_access_tokens" ("refresh_token")
4009
+  (0.1ms)  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
+ 
4017
+  (0.7ms) CREATE INDEX "index_oauth_access_tokens_on_resource_owner_id" ON "oauth_access_tokens" ("resource_owner_id")
4018
+  (0.1ms)  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
+ 
4026
+  (0.1ms) 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
+  (0.7ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_token" ON "oauth_access_tokens" ("token")
4035
+  (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)
4036
+  (0.7ms) CREATE UNIQUE INDEX "index_oauth_applications_on_uid" ON "oauth_applications" ("uid")
4037
+  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
4038
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4039
+  (0.1ms) SELECT version FROM "schema_migrations"
4040
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
4041
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
4042
+  (0.4ms) begin transaction
4043
+  (0.0ms) rollback transaction
4044
+  (0.0ms) begin transaction
4045
+  (0.0ms) rollback transaction
4046
+  (0.0ms) begin transaction
4047
+  (0.0ms) rollback transaction
4048
+  (0.0ms) begin transaction
4049
+  (0.0ms) rollback transaction
4050
+  (0.0ms) begin transaction
4051
+  (0.0ms) rollback transaction
4052
+  (0.0ms) begin transaction
4053
+  (0.0ms) rollback transaction
4054
+  (0.0ms) begin transaction
4055
+  (0.0ms) rollback transaction
4056
+  (0.0ms) begin transaction
4057
+  (0.0ms) rollback transaction
4058
+  (0.0ms) begin transaction
4059
+  (0.0ms) rollback transaction
4060
+  (0.0ms) begin transaction
4061
+  (0.0ms) SAVEPOINT active_record_1
4062
+ SQL (0.3ms) INSERT INTO "dummy_users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-09-26 19:38:29.603305"], ["updated_at", "2014-09-26 19:38:29.603305"]]
4063
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4064
+  (1.0ms) rollback transaction
4065
+  (0.1ms) begin transaction
4066
+  (0.1ms) SAVEPOINT active_record_1
4067
+ SQL (0.3ms) 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
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4069
+ DummyUser Load (0.1ms) SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" = 1 ORDER BY "dummy_users"."id" ASC LIMIT 1
4070
+  (0.3ms) rollback transaction
4071
+  (0.0ms) begin transaction
4072
+ DummyUser Load (0.1ms) SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" IS NULL ORDER BY "dummy_users"."id" ASC LIMIT 1
4073
+  (0.0ms) rollback transaction
4074
+  (0.0ms) begin transaction
4075
+  (0.0ms) rollback transaction
4076
+  (0.0ms) begin transaction
4077
+  (0.0ms) 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.0
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-24 00:00:00.000000000 Z
12
+ date: 2014-09-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails