lti_public_resources 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +34 -0
  5. data/app/controllers/lti_public_resources/api_controller.rb +123 -0
  6. data/app/controllers/lti_public_resources/application_controller.rb +28 -0
  7. data/app/controllers/lti_public_resources/ember_controller.rb +18 -0
  8. data/app/views/lti_public_resources/ember/app.html.erb +43 -0
  9. data/config/lti_public_resources_config.yml.example +7 -0
  10. data/config/routes.rb +10 -0
  11. data/lib/lti_public_resources/engine.rb +19 -0
  12. data/lib/lti_public_resources/lti_public_resources_config.rb +27 -0
  13. data/lib/lti_public_resources/version.rb +3 -0
  14. data/lib/lti_public_resources.rb +59 -0
  15. data/lib/tasks/lti_public_resources_tasks.rake +4 -0
  16. data/test/controllers/lti_public_resources/api_controller_test.rb +9 -0
  17. data/test/controllers/lti_public_resources/ember_controller_test.rb +11 -0
  18. data/test/dummy/README.rdoc +28 -0
  19. data/test/dummy/Rakefile +6 -0
  20. data/test/dummy/app/assets/javascripts/application.js +13 -0
  21. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  22. data/test/dummy/app/controllers/application_controller.rb +5 -0
  23. data/test/dummy/app/helpers/application_helper.rb +2 -0
  24. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  25. data/test/dummy/bin/bundle +3 -0
  26. data/test/dummy/bin/rails +4 -0
  27. data/test/dummy/bin/rake +4 -0
  28. data/test/dummy/config/application.rb +23 -0
  29. data/test/dummy/config/boot.rb +5 -0
  30. data/test/dummy/config/database.yml +25 -0
  31. data/test/dummy/config/environment.rb +5 -0
  32. data/test/dummy/config/environments/development.rb +29 -0
  33. data/test/dummy/config/environments/production.rb +80 -0
  34. data/test/dummy/config/environments/test.rb +36 -0
  35. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  36. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  37. data/test/dummy/config/initializers/inflections.rb +16 -0
  38. data/test/dummy/config/initializers/mime_types.rb +5 -0
  39. data/test/dummy/config/initializers/secret_token.rb +12 -0
  40. data/test/dummy/config/initializers/session_store.rb +3 -0
  41. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  42. data/test/dummy/config/locales/en.yml +23 -0
  43. data/test/dummy/config/routes.rb +4 -0
  44. data/test/dummy/config.ru +4 -0
  45. data/test/dummy/db/development.sqlite3 +0 -0
  46. data/test/dummy/log/development.log +7627 -0
  47. data/test/dummy/public/404.html +58 -0
  48. data/test/dummy/public/422.html +58 -0
  49. data/test/dummy/public/500.html +57 -0
  50. data/test/dummy/public/favicon.ico +0 -0
  51. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  52. data/test/dummy/tmp/cache/assets/development/sprockets/3475a5d4af07e8438bb3206b4fd665f1 +0 -0
  53. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  54. data/test/dummy/tmp/cache/assets/development/sprockets/374351d9e7a72880c59cb588879dcc92 +0 -0
  55. data/test/dummy/tmp/cache/assets/development/sprockets/40a189a5701341989411168b2f04b001 +0 -0
  56. data/test/dummy/tmp/cache/assets/development/sprockets/594d8e1916ab24a8257587125baba5f3 +0 -0
  57. data/test/dummy/tmp/cache/assets/development/sprockets/5cd771c7ecb7f92df29b1cf31ace30e5 +0 -0
  58. data/test/dummy/tmp/cache/assets/development/sprockets/5d5a33398e14a87cb353e1ce3df386b8 +0 -0
  59. data/test/dummy/tmp/cache/assets/development/sprockets/72dfa57fc484d0b4771ede0da5bdce6d +0 -0
  60. data/test/dummy/tmp/cache/assets/development/sprockets/79e4c02adfa3be301ce7bb604d502cee +0 -0
  61. data/test/dummy/tmp/cache/assets/development/sprockets/a498030c77e11b553f40fed3f23389c0 +0 -0
  62. data/test/dummy/tmp/cache/assets/development/sprockets/b3704c9ca90d353e610f6a28dfe50e58 +0 -0
  63. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  64. data/test/dummy/tmp/cache/assets/development/sprockets/eec047541657615239a6efd089cd0d7b +0 -0
  65. data/test/dummy/tmp/cache/assets/development/sprockets/ffd034e84822331c80a8c0007c62985c +0 -0
  66. data/test/helpers/lti_public_resources/api_helper_test.rb +6 -0
  67. data/test/helpers/lti_public_resources/ember_helper_test.rb +6 -0
  68. data/test/integration/navigation_test.rb +10 -0
  69. data/test/lti_public_resources_test.rb +7 -0
  70. data/test/test_helper.rb +15 -0
  71. metadata +225 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ba026e3f8726be3d209b73c838051ca3f2116ec0
4
+ data.tar.gz: a3d4cac31d06ca3930a3f01b888c8a0eda2d7bdf
5
+ SHA512:
6
+ metadata.gz: abb3b54573292ff0284e55c6ecd0d266616f8062eff5a9705da09e2c04472b649aafe136756da398b8982e0536e70b2df0f136be2d4f8eb3b6b88eb5716475c0
7
+ data.tar.gz: a7d1b3fe4db5adeb62a38291e7b7de7cab998bb2df63f924e5accbc4ad0c73efe8e8f3e7b9709fc521660ac0c0f549b7442c5c328b7561e82da9b2c4ec59d45c
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2013 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = LtiPublicResources
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'LtiPublicResources'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+
22
+ Bundler::GemHelper.install_tasks
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = false
31
+ end
32
+
33
+
34
+ task default: :test
@@ -0,0 +1,123 @@
1
+ require_dependency "lti_public_resources/application_controller"
2
+
3
+ module LtiPublicResources
4
+ class ApiController < ApplicationController
5
+ before_action :load_apps
6
+
7
+ def lti_apps
8
+ render json: { lti_apps: @apps }
9
+ end
10
+
11
+ def lti_app
12
+ tool_id = params[:id].to_sym
13
+ lti_app = @apps[tool_id]
14
+ render json: { lti_app: lti_app }
15
+ end
16
+
17
+ def search
18
+ tool_id = params[:tool_id].to_sym
19
+ lti_app = @apps[tool_id]
20
+ driver = LtiPublicResources.drivers[tool_id]
21
+
22
+ case lti_app[:tool_type]
23
+ when 'search'
24
+ q = {
25
+ query: params[:query],
26
+ page: (params[:page] ? params[:page].to_i : 1),
27
+ content_filter: APR::RequestCriteria::CONTENT_FILTER_NONE,
28
+ sort: APR::RequestCriteria::SORT_RELEVANCE
29
+ }
30
+ puts q.inspect
31
+ criteria = APR::RequestCriteria.new(q)
32
+ when 'browse'
33
+ criteria = APR::RequestCriteria.new(folder: params[:folder])
34
+ else
35
+ raise StandardError.new("Unknown tool type!")
36
+ end
37
+
38
+ results = driver.perform_request(criteria)
39
+ render json: { driver_response: results }
40
+ end
41
+
42
+ def browse
43
+ tool_id = params[:tool_id].to_sym
44
+ lti_app = @apps[tool_id]
45
+ driver = LtiPublicResources.drivers[tool_id]
46
+ folder = params[:folder]
47
+ criteria = APR::RequestCriteria.new(folder: folder)
48
+ results = driver.perform_request(criteria)
49
+ render json: { driver_response: results }
50
+ end
51
+
52
+ def embed
53
+ tp = tool_provider(params)
54
+ return_type = params[:return_type]
55
+ redirect_url = build_url(tp, return_type)
56
+ ret = return_type.to_json
57
+ if redirect_url.present?
58
+ ret = { redirectUrl: redirect_url }.to_json
59
+ end
60
+ render json: ret
61
+ end
62
+
63
+ def config
64
+ host = request.scheme + "://" + request.host_with_port + request.env['SCRIPT_NAME']
65
+
66
+ if params[:id]
67
+ tool_id = params[:id]
68
+ lti_app = @apps[tool_id.to_sym]
69
+ name = lti_app[:name]
70
+ description = lti_app[:description]
71
+ icon = "#{host}/assets/images/#{lti_app[:icon_path]}"
72
+ text = lti_app[:name]
73
+ url = host + "/?tool_id=" + tool_id
74
+ else
75
+ name = "Public Resources"
76
+ description = "Collection of public resources"
77
+ icon = "#{host}/assets/images/public_resources_icon.png"
78
+ text = "Public Resources"
79
+ url = host
80
+ end
81
+
82
+ tc = IMS::LTI::ToolConfig.new(:title => name, :launch_url => url)
83
+ tc.description = description
84
+ tc.extend IMS::LTI::Extensions::Canvas::ToolConfig
85
+ tc.canvas_privacy_anonymous!
86
+ tc.canvas_domain! request.host_with_port
87
+ tc.canvas_text! text
88
+ tc.canvas_icon_url! icon
89
+ tc.canvas_selector_dimensions! 560, 600
90
+ tc.canvas_editor_button!
91
+ tc.canvas_resource_selection!
92
+
93
+ render xml: tc.to_xml(:indent => 2)
94
+ end
95
+
96
+ private
97
+
98
+ def load_apps
99
+ @apps = LtiPublicResources.apps
100
+ end
101
+
102
+ def tool_provider(params)
103
+ tp = IMS::LTI::ToolProvider.new(nil, nil, params[:launch_params] || params)
104
+ tp.extend IMS::LTI::Extensions::Content::ToolProvider
105
+ tp
106
+ end
107
+
108
+ def build_url(tp, return_type)
109
+ if tp.accepts_content?
110
+ case return_type['return_type']
111
+ when 'iframe'
112
+ redirect_url = tp.iframe_content_return_url(return_type['url'], return_type['width'], return_type['height'], return_type['title'])
113
+ when 'url'
114
+ redirect_url = tp.url_content_return_url(return_type['url'], return_type['title'])
115
+ when 'lti_launch'
116
+ redirect_url = tp.lti_launch_content_return_url(return_type['url'], return_type['title'], return_type['title'])
117
+ end
118
+ return redirect_url
119
+ end
120
+ end
121
+
122
+ end
123
+ end
@@ -0,0 +1,28 @@
1
+ module LtiPublicResources
2
+ class ApplicationController < ActionController::Base
3
+ before_filter :cors_preflight_check
4
+ after_filter :cors_set_access_control_headers
5
+
6
+ # For all responses in this controller, return the CORS access control headers.
7
+ def cors_set_access_control_headers
8
+ headers['Access-Control-Allow-Origin'] = '*'
9
+ headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'
10
+ headers['Access-Control-Request-Method'] = '*'
11
+ headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
12
+ headers['Access-Control-Max-Age'] = "1728000"
13
+ end
14
+
15
+ # If this is a preflight OPTIONS request, then short-circuit the
16
+ # request, return only the necessary headers and return an empty
17
+ # text/plain.
18
+ def cors_preflight_check
19
+ if request.method == :options
20
+ headers['Access-Control-Allow-Origin'] = '*'
21
+ headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'
22
+ headers['Access-Control-Allow-Headers'] = '*'
23
+ headers['Access-Control-Max-Age'] = '1728000'
24
+ render :text => '', :content_type => 'text/plain'
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,18 @@
1
+ require_dependency "lti_public_resources/application_controller"
2
+
3
+ module LtiPublicResources
4
+ class EmberController < ApplicationController
5
+ def app
6
+ @full_path = request.env['SCRIPT_NAME']
7
+ @env = {
8
+ 'CONFIG' => {
9
+ host: @full_path,
10
+ imagePath: '/lti_public_resources/assets/images'
11
+ },
12
+ 'TOOL_ID' => params[:tool_id] || '',
13
+ 'LAUNCH_PARAMS' => params.reject!{ |k,v| ['controller','action'].include? k }
14
+ }
15
+ render layout: false
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,43 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <title>Public Resources LTI</title>
7
+ <meta name="description" content="">
8
+ <meta name="viewport" content="width=device-width, initial-scale=1">
9
+ <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
10
+ <link rel="stylesheet" href="/lti_public_resources/assets/app.min.css">
11
+
12
+ <style>
13
+ /*#wrapper header { background-image: url('/lti_public_resources/lti_public_resources/assets/images/khan_academy_logo.png') !important; }*/
14
+ #wrapper .khan_academy header { background-image: url('/lti_public_resources/assets/images/khan_academy_logo.png') !important; }
15
+ #wrapper .quizlet header { background-image: url('/lti_public_resources/assets/images/quizlet_logo.png') !important; }
16
+ #wrapper .youtube header { background-image: url('/lti_public_resources/assets/images/youtube_logo.png') !important; }
17
+ #wrapper .vimeo header { background-image: url('/lti_public_resources/assets/images/vimeo_logo.png') !important; }
18
+ #wrapper .schooltube header { background-image: url('/lti_public_resources/assets/images/schooltube_logo.png') !important; }
19
+ </style>
20
+
21
+ <script>
22
+ window.ENV = <%=raw @env.to_json %>;
23
+ </script>
24
+
25
+ <script src="/lti_public_resources/assets/vendor.min.js"></script>
26
+
27
+ <script src="/lti_public_resources/assets/app.min.js"></script>
28
+
29
+ </head>
30
+ <body>
31
+ <!--[if lt IE 8]>
32
+ <p class="browsehappy">
33
+ You are using an <strong>outdated</strong> browser. Please
34
+ <a href="http://browsehappy.com/">upgrade your browser</a>
35
+ to improve your experience.
36
+ </p>
37
+ <![endif]-->
38
+
39
+ <script>
40
+ window.App = require('appkit/app')["default"].create();
41
+ </script>
42
+ </body>
43
+ </html>
@@ -0,0 +1,7 @@
1
+ vimeo:
2
+ consumer_key: VIMEO_CONSUMER_KEY
3
+ consumer_secret: VIMEO_CONSUMER_SECRET
4
+ access_token: VIMEO_ACCESS_TOKEN
5
+ access_token_secret: VIMEO_ACCESS_TOKEN_SECRET
6
+ quizlet:
7
+ client_id: QUIZLET_CLIENT_ID
data/config/routes.rb ADDED
@@ -0,0 +1,10 @@
1
+ LtiPublicResources::Engine.routes.draw do
2
+ root "ember#app"
3
+
4
+ get 'api/lti_apps' => 'api#lti_apps'
5
+ get 'api/lti_apps/:id' => 'api#lti_app'
6
+ post 'api/search' => 'api#search'
7
+ post 'api/browse' => 'api#browse'
8
+ post 'api/embed' => 'api#embed'
9
+ get 'config.xml' => 'api#config'
10
+ end
@@ -0,0 +1,19 @@
1
+ module LtiPublicResources
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace LtiPublicResources
4
+
5
+ initializer "static assets" do |app|
6
+ app.middleware.use ::ActionDispatch::Static, "#{root}/public"
7
+ end
8
+
9
+ initializer "lti_public_resources.load_app_instance_data" do |app|
10
+ LtiPublicResources.setup do |config|
11
+ config.app_root = app.root
12
+ end
13
+ end
14
+
15
+ initializer "lti_public_resources.lti_public_resources_config" do |app|
16
+ LtiPublicResources::LtiPublicResourcesConfig.setup!
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,27 @@
1
+ module LtiPublicResources
2
+ module LtiPublicResourcesConfig
3
+ def self.load_config
4
+ YAML::load(File.open(config_file))
5
+ end
6
+
7
+ def self.config_file
8
+ LtiPublicResources.app_root.join('config/lti_public_resources_config.yml')
9
+ end
10
+
11
+ def self.setup!
12
+ if File.exists?(config_file)
13
+ Rails.logger.info "Initializing using #{config_file}"
14
+ settings = load_config.deep_symbolize_keys
15
+ LtiPublicResources.drivers = {
16
+ youtube: APR::Drivers::Youtube.new,
17
+ vimeo: APR::Drivers::Vimeo.new(settings[:vimeo]),
18
+ schooltube: APR::Drivers::Schooltube.new,
19
+ khan_academy: APR::Drivers::KhanAcademy.new,
20
+ quizlet: APR::Drivers::Quizlet.new(settings[:quizlet])
21
+ }
22
+ else
23
+ raise "Warning: missing config file #{config_file}."
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,3 @@
1
+ module LtiPublicResources
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,59 @@
1
+ require 'ostruct'
2
+ require 'active_public_resources'
3
+ require 'ims/lti'
4
+ require 'lti_public_resources/lti_public_resources_config'
5
+
6
+ module LtiPublicResources
7
+ mattr_accessor :app_root, :drivers
8
+
9
+ def self.setup
10
+ yield self
11
+ end
12
+
13
+ def self.apps
14
+ {
15
+ youtube: {
16
+ name: "YouTube",
17
+ description: "Search publicly available YouTube videos. A new icon will show up in your course rich editor letting you search YouTube and click to embed videos in your course material.",
18
+ tool_id: "youtube",
19
+ tool_type: "search",
20
+ icon_path: "youtube_icon.png",
21
+ image_url: "youtube_banner.png"
22
+ },
23
+ vimeo: {
24
+ name: "Vimeo",
25
+ description: "Vimeo is a video sharing website on which users can upload, share, and view videos. The community of Vimeo includes indie, professional, and novice filmmakers.",
26
+ tool_id: "vimeo",
27
+ tool_type: "search",
28
+ icon_path: "vimeo_icon.png",
29
+ image_url: "vimeo_banner.png"
30
+ },
31
+ schooltube: {
32
+ name: "SchoolTube",
33
+ description: "SchoolTube is a public, searchable collection of videos uploaded from schools. Videos can be inserted as links or embedded in course material.",
34
+ tool_id: "schooltube",
35
+ tool_type: "search",
36
+ icon_path: "schooltube_icon.png",
37
+ image_url: "schooltube_banner.png"
38
+ },
39
+ khan_academy: {
40
+ name: "Khan Academy",
41
+ description: "Search for and embed Khan Academy lessons and exercise into course material. Khan Academy focuses on short lessons on math, science, etc. Uses the embedded player so students earn points for watching videos.",
42
+ tool_id: "khan_academy",
43
+ tool_type: "browse",
44
+ icon_path: "khan_academy_icon.png",
45
+ image_url: "khan_academy_banner.png"
46
+ },
47
+ quizlet: {
48
+ name: "Quizlet",
49
+ description: "Search for and embed publicly available flashcards and question sets from Quizlet. Questions can be embedded directly into content as flash cards, review, or as a study game.",
50
+ tool_id: "quizlet",
51
+ tool_type: "search",
52
+ icon_path: "quizlet_icon.png",
53
+ image_url: "quizlet_banner.png"
54
+ }
55
+ }
56
+ end
57
+ end
58
+
59
+ require 'lti_public_resources/engine'
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :lti_public_resources do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module LtiPublicResources
4
+ class ApiControllerTest < ActionController::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ require 'test_helper'
2
+
3
+ module LtiPublicResources
4
+ class EmberControllerTest < ActionController::TestCase
5
+ test "should get index" do
6
+ get :index
7
+ assert_response :success
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
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
+
6
+ Dummy::Application.load_tasks
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,23 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "lti_public_resources"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
+ # config.time_zone = 'Central Time (US & Canada)'
17
+
18
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
+ # config.i18n.default_locale = :de
21
+ end
22
+ end
23
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Dummy::Application.initialize!
@@ -0,0 +1,29 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger.
20
+ config.active_support.deprecation = :log
21
+
22
+ # Raise an error on page load if there are pending migrations
23
+ config.active_record.migration_error = :page_load
24
+
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
28
+ config.assets.debug = true
29
+ end