Browse Source

kemalyst is now amber (#2953)

* kemalyst is now amber

* remove from travis.yml
Dru Jensen 8 years ago
parent
commit
9ab0b6ab96

+ 0 - 1
.travis.yml

@@ -40,7 +40,6 @@ env:
     - "TESTDIR=Crystal/amber"
     - "TESTDIR=Crystal/crystal"
     - "TESTDIR=Crystal/kemal"
-    - "TESTDIR=Crystal/kemalyst"
     - "TESTDIR=D/vibed"
     - "TESTDIR=D/hunt"
     - "TESTDIR=D/collie"

+ 0 - 7
frameworks/Crystal/kemalyst/.gitignore

@@ -1,7 +0,0 @@
-/doc/
-/libs/
-/lib/
-/.crystal/
-/.shards/
-.env
-!shard.lock

+ 0 - 21
frameworks/Crystal/kemalyst/LICENSE

@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2016 
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.

+ 0 - 49
frameworks/Crystal/kemalyst/README.md

@@ -1,49 +0,0 @@
-# kemalyst
-
-Kemalyst is a Rails like framework for Crystal.  It provides many of the same capabilities as rails, written in a language similar to ruby but is compiled to native binary.  It gives you C speed but Ruby ease.
-
-## Installation
-
-Create a pg database called `demo` and configure the `config/database.yml`
-to provide the credentials to access the table.
-
-Then:
-```
-shards update
-kgen migrate up
-```
-
-## Usage
-
-To run the demo:
-```
-crystal build src/kemalyst.cr
-./kemalyst
-```
-
-## Docker and Docker Compose
-
-This will start an instance of postgres, migrate the database, run the specs,
-and launch the site at http://localhost:3000
-```
-docker-compose up -d
-```
-
-To view the logs:
-```
-docker-compose logs -f
-```
-
-Note: The Docker images are compatible with Heroku.  
-
-## Contributing
-
-1. Fork it ( https://github.com/drujensen/FrameworkBenchmarks/fork )
-2. Create your feature branch (git checkout -b my-new-feature)
-3. Commit your changes (git commit -am 'Add some feature')
-4. Push to the branch (git push origin my-new-feature)
-5. Create a new Pull Request
-
-## Contributors
-
-- [drujensen](https://github.com/drujensen) Dru Jensen - creator, maintainer

+ 0 - 29
frameworks/Crystal/kemalyst/benchmark_config.json

@@ -1,29 +0,0 @@
-{
-  "framework": "kemalyst",
-  "tests": [{
-    "default": {
-      "setup_file": "setup",
-      "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/queries?queries=",
-      "fortune_url": "/fortunes",
-      "update_url": "/updates?queries=",
-      "plaintext_url": "/plaintext",
-      "port": 3000,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "Postgres",
-      "framework": "Kemalyst",
-      "language": "Crystal",
-      "flavor": "None",
-      "orm": "Full",
-      "platform": "None",
-      "webserver": "None",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "Kemalyst (MVC, Postgres)",
-      "notes": "",
-      "versus": "kemal"
-    }
-  }]
-}

+ 0 - 19
frameworks/Crystal/kemalyst/config/application.cr

@@ -1,19 +0,0 @@
-require "../src/middleware/custom_headers"
-
-Kemalyst::Application.config do |config|
-  # Set the binding host ip address.  Defaults to "0.0.0.0"
-  # config.host = "0.0.0.0"
-
-  # Set the port.  Defaults to 3000.
-  # config.port = 3000
-
-  # Configure reuse_port option
-  config.reuse_port = true
-
-  # Disable unused middleware
-  config.handlers.clear
-  config.handlers << Kemalyst::Handler::Error.instance
-  config.handlers << Kemalyst::Handler::Params.instance
-  config.handlers << Middleware::CustomHeaders.instance
-  config.handlers << Kemalyst::Handler::Router.instance
-end

+ 0 - 2
frameworks/Crystal/kemalyst/config/database.yml

@@ -1,2 +0,0 @@
-pg:
-  database: postgres://benchmarkdbuser:benchmarkdbpass@TFB-database/hello_world

+ 0 - 10
frameworks/Crystal/kemalyst/config/routes.cr

@@ -1,10 +0,0 @@
-require "../src/controllers/*"
-
-include Kemalyst::Handler
-
-get "/plaintext", benchmark, plaintext
-get "/json", benchmark, json
-get "/db", benchmark, db
-get "/queries", benchmark, queries
-get "/updates", benchmark, updates
-get "/fortunes", benchmark, fortunes

+ 0 - 13
frameworks/Crystal/kemalyst/setup.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql crystal
-
-shards install
-
-crystal build --release src/kemalyst.cr
-
-for i in $(seq 1 $(nproc --all)); do
-  ./kemalyst &
-done
-
-wait

+ 0 - 70
frameworks/Crystal/kemalyst/shard.lock

@@ -1,70 +0,0 @@
-version: 1.0
-shards:
-  db:
-    github: crystal-lang/crystal-db
-    version: 0.4.2
-
-  expect:
-    github: dukex/expect.cr
-    commit: 17c31a0f42815cd914a630852bb2ee0da6a39dc0
-
-  kemalyst:
-    github: kemalyst/kemalyst
-    version: 0.10.2
-
-  kemalyst-model:
-    github: kemalyst/kemalyst-model
-    version: 0.6.2
-
-  kemalyst-spec:
-    github: kemalyst/kemalyst-spec
-    version: 0.1.1
-
-  kemalyst-validators:
-    github: kemalyst/kemalyst-validators
-    version: 0.2.0
-
-  kilt:
-    github: jeromegn/kilt
-    version: 0.3.3
-
-  mocks:
-    github: waterlink/mocks.cr
-    version: 0.9.5
-
-  pg:
-    github: will/crystal-pg
-    version: 0.13.3
-
-  pool:
-    github: ysbaddaden/pool
-    version: 0.2.3
-
-  quartz-mailer:
-    github: amber-crystal/quartz-mailer
-    commit: 9361ae75f178cb62585aa1b6047a2269f553d2d5
-
-  radix:
-    github: luislavena/radix
-    version: 0.3.8
-
-  redis:
-    github: stefanwille/crystal-redis
-    version: 1.8.0
-
-  sidekiq:
-    github: kemalyst/sidekiq-cli.cr
-    commit: 199757a164daa9fd9d7fe7b334eed2af8ec8c26c
-
-  singleton:
-    github: waterlink/singleton.cr
-    version: 1.0.0
-
-  slang:
-    github: jeromegn/slang
-    commit: b817c89c7e5ae39562710c0d6c7f42cee685e14f
-
-  smtp:
-    github: raydf/smtp.cr
-    commit: 1301f244fd1e251244b0a9fb7f8bc817da9c8854
-

+ 0 - 34
frameworks/Crystal/kemalyst/shard.yml

@@ -1,34 +0,0 @@
-name: kemalyst
-version: 0.1.0
-
-authors:
-  - your_name <your_email>
-
-license: MIT
-
-dependencies:
-  kemalyst:
-    github: kemalyst/kemalyst
-
-  kemalyst-model:
-    github: kemalyst/kemalyst-model
-
-  kemalyst-spec:
-    github: kemalyst/kemalyst-spec
-
-  pg:
-    github: will/crystal-pg
-
-
-#  mysql:
-#    github: crystal-lang/crystal-mysql
-#  pg:
-#    github: will/crystal-pg
-#  sqlite3:
-#    github: crystal-lang/crystal-sqlite3
-
-development_dependencies:
-  expect:
-    github: dukex/expect.cr
-  mocks:
-    github: waterlink/mocks.cr

+ 0 - 64
frameworks/Crystal/kemalyst/src/controllers/benchmark_controller.cr

@@ -1,64 +0,0 @@
-require "../models/*"
-
-class BenchmarkController < Kemalyst::Controller
-  def plaintext
-    text "Hello, World!"
-  end
-
-  def json
-    results = {message: "Hello, World!"}
-    json results.to_json
-  end
-
-  def db
-    results = {} of Symbol => Int32
-    if world = World.find rand(1..10_000)
-      results = {id: world.id, randomNumber: world.randomNumber}
-    end
-    json results.to_json
-  end
-
-  def queries
-    queries = params["queries"].as(String)
-    queries = queries.to_i? || 1
-    queries = queries.clamp(1..500)
-
-    results = (1..queries).map do
-      if world = World.find rand(1..10_000)
-        {id: world.id, randomNumber: world.randomNumber}
-      end
-    end
-
-    json results.to_json
-  end
-
-  def updates
-    queries = params["queries"].as(String)
-    queries = queries.to_i? || 1
-    queries = queries.clamp(1..500)
-
-    results = (1..queries).map do
-      world = World.find rand(1..10_000)
-      if world
-        world.randomNumber = rand(1..10_000)
-        world.save
-        {id: world.id, randomNumber: world.randomNumber}
-      end
-    end
-
-    json results.to_json
-  end
-
-  def fortunes
-    fortune = Fortune.new
-    fortune.id = 0
-    fortune.message = "Additional fortune added at request time."
-
-    fortunes = Fortune.all
-    fortunes << fortune
-    fortunes.sort_by! { |fortune| fortune.message.not_nil! }
-
-    html render("fortune/index.slang", "main.slang")
-  end
-end
-

+ 0 - 4
frameworks/Crystal/kemalyst/src/kemalyst.cr

@@ -1,4 +0,0 @@
-require "kemalyst"
-require "../config/*"
-
-Kemalyst::Application.instance.start

+ 0 - 13
frameworks/Crystal/kemalyst/src/middleware/custom_headers.cr

@@ -1,13 +0,0 @@
-module Middleware 
-  class CustomHeaders < Kemalyst::Handler::Base
-    def self.instance
-      @@instance ||= new
-    end
-
-    def call(context)
-      context.response.headers["Server"] = "Kemalyst"
-      context.response.headers["Date"] = Time.now.to_s
-      call_next(context)
-    end
-  end
-end

+ 0 - 8
frameworks/Crystal/kemalyst/src/models/fortune.cr

@@ -1,8 +0,0 @@
-require "kemalyst-model/adapter/pg"
-
-class Fortune < Kemalyst::Model
-  adapter pg
-  table_name fortune
-  primary id : Int32
-  field message : String
-end

+ 0 - 9
frameworks/Crystal/kemalyst/src/models/world.cr

@@ -1,9 +0,0 @@
-require "kemalyst-model/adapter/pg"
-
-class World < Kemalyst::Model
-  adapter pg
-  table_name world
-  primary id : Int32
-  field randomNumber : Int32
-end
-

+ 0 - 8
frameworks/Crystal/kemalyst/src/views/fortune/index.slang

@@ -1,8 +0,0 @@
-table
-  tr
-    th id
-    th message
-  - fortunes.each do |fortune|
-    tr
-      td = fortune.id
-      td = fortune.message

+ 0 - 6
frameworks/Crystal/kemalyst/src/views/layouts/main.slang

@@ -1,6 +0,0 @@
-doctype html
-html
-  head
-    title Fortunes
-  body == content
-