Skip to content

Commit

Permalink
annotorias
Browse files Browse the repository at this point in the history
  • Loading branch information
gr1d99 committed Mar 27, 2020
0 parents commit db27511
Show file tree
Hide file tree
Showing 11 changed files with 183 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config/database.yml
.idea/
16 changes: 16 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
source 'https://rubygems.org'

gem 'sinatra'

gem 'activerecord'
gem 'pg'
gem 'rake'
gem 'shrine', '~> 3.0'
gem 'sinatra-activerecord'
gem 'sinatra-contrib'

group :development do
gem 'pry'
gem 'shotgun'
gem 'tux'
end
98 changes: 98 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
GEM
remote: https://rubygems.org/
specs:
activemodel (6.0.2.2)
activesupport (= 6.0.2.2)
activerecord (6.0.2.2)
activemodel (= 6.0.2.2)
activesupport (= 6.0.2.2)
activesupport (6.0.2.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
backports (3.17.0)
bond (0.5.1)
coderay (1.1.2)
concurrent-ruby (1.1.6)
content_disposition (1.0.0)
down (5.1.1)
addressable (~> 2.5)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
method_source (1.0.0)
minitest (5.14.0)
multi_json (1.14.1)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
pg (1.2.3)
pry (0.13.0)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.3)
rack (2.2.2)
rack-protection (2.0.8.1)
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (13.0.1)
ripl (0.7.1)
bond (~> 0.5.1)
ripl-multi_line (0.3.1)
ripl (>= 0.3.6)
ripl-rack (0.2.1)
rack (>= 1.0)
rack-test (~> 0.6.2)
ripl (>= 0.7.0)
ruby2_keywords (0.0.2)
shotgun (0.9.2)
rack (>= 1.0)
shrine (3.2.1)
content_disposition (~> 1.0)
down (~> 5.1)
sinatra (2.0.8.1)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.8.1)
tilt (~> 2.0)
sinatra-activerecord (2.0.14)
activerecord (>= 3.2)
sinatra (>= 1.0)
sinatra-contrib (2.0.8.1)
backports (>= 2.8.2)
multi_json
mustermann (~> 1.0)
rack-protection (= 2.0.8.1)
sinatra (= 2.0.8.1)
tilt (~> 2.0)
thread_safe (0.3.6)
tilt (2.0.10)
tux (0.3.0)
ripl (>= 0.3.5)
ripl-multi_line (>= 0.2.4)
ripl-rack (>= 0.2.0)
sinatra (>= 1.2.1)
tzinfo (1.2.6)
thread_safe (~> 0.1)
zeitwerk (2.3.0)

PLATFORMS
ruby

DEPENDENCIES
activerecord
pg
pry
rake
shotgun
shrine (~> 3.0)
sinatra
sinatra-activerecord
sinatra-contrib
tux

BUNDLED WITH
2.1.4
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require './config/environment'
require 'sinatra/activerecord/rake'
9 changes: 9 additions & 0 deletions api/images.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Application
class Api < Sinatra::Base
get '/' do
json images: []
end
end
end
13 changes: 13 additions & 0 deletions application.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

require 'sinatra/base'
require 'sinatra/json'

module Application
class Api < Sinatra::Base
end
end

Dir[File.dirname(__FILE__) + '/api/**'].sort.each do |route|
require route
end
3 changes: 3 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require './config/environment.rb'
require './application'
run Application::Api
2 changes: 2 additions & 0 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ENV['APP_ENV'] ||= 'development'
Bundler.require(:default, ENV['APP_ENV'])
9 changes: 9 additions & 0 deletions db/migrate/20200327105306_create_photos.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class CreatePhotos < ActiveRecord::Migration[6.0]
def change
create_table :photos do |t|
t.string :name
t.text :photo_data
t.timestamps null: false
end
end
end
25 changes: 25 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `rails
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2020_03_27_105306) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "photos", force: :cascade do |t|
t.string "name"
t.text "photo_data"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end

end
4 changes: 4 additions & 0 deletions models/photo.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

class Photo < ActiveRecord::Base
end

0 comments on commit db27511

Please sign in to comment.