All Projects → kuntoaji → sinator

kuntoaji / sinator

Licence: MIT license
Sinatra application generator

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects

Projects that are alternatives of or similar to sinator

rack-simple user agent
Rack::SimpleUserAgent is stupidly simple UA detector
Stars: ✭ 13 (-31.58%)
Mutual labels:  sinatra, gem
Pluck to hash
Extend ActiveRecord pluck to return array of hashes
Stars: ✭ 275 (+1347.37%)
Mutual labels:  rubygems, sinatra
Ginatra
A web frontend for Git repositories
Stars: ✭ 522 (+2647.37%)
Mutual labels:  sinatra, web-application
books
List of all Ruby books
Stars: ✭ 49 (+157.89%)
Mutual labels:  sinatra, gems
jpl-space-calendar
An app for parsing and publishing the JPL Space Calendar in JSON and ICalendar formats.
Stars: ✭ 13 (-31.58%)
Mutual labels:  sinatra, puma
Will paginate
Pagination library for Rails, Sinatra, Merb, DataMapper, and more
Stars: ✭ 5,621 (+29484.21%)
Mutual labels:  sinatra, sequel
jquery-datatables
Jquery datatables ruby gems for assets pipeline
Stars: ✭ 73 (+284.21%)
Mutual labels:  rubygems, gem
Materialize Sass
Materializecss rubygem for Rails Asset Pipeline / Sprockets
Stars: ✭ 785 (+4031.58%)
Mutual labels:  rubygems, gem
Instagram Crawler
Crawl instagram photos, posts and videos for download.
Stars: ✭ 178 (+836.84%)
Mutual labels:  rubygems, gem
Tabler Rubygem
Rubygem for https://tabler.github.io
Stars: ✭ 77 (+305.26%)
Mutual labels:  rubygems, gem
harvesting
Ruby wrapper for the Harvest API v2
Stars: ✭ 24 (+26.32%)
Mutual labels:  rubygems, gem
fcmpush
Firebase Cloud Messaging API wrapper for Ruby, suppot HTTP v1 API including access_token auto refresh feature.
Stars: ✭ 44 (+131.58%)
Mutual labels:  rubygems, gem
encrypted cookie
AES-128 encrypted session cookies for Rack (and Sinatra and other frameworks).
Stars: ✭ 54 (+184.21%)
Mutual labels:  sinatra, gems
coordinator-bot
A tutorial that builds a simple bot for Facebook Messenger with Ruby and Sinatra
Stars: ✭ 16 (-15.79%)
Mutual labels:  sinatra
bundle outdated formatter
Formatter for `bundle outdated` command
Stars: ✭ 16 (-15.79%)
Mutual labels:  gem
hidden-gems
Ranking of Steam games which favors "hidden gems". Featured in PC Gamer.
Stars: ✭ 37 (+94.74%)
Mutual labels:  gems
rsgem
Rootstrap way ® to generate gems
Stars: ✭ 26 (+36.84%)
Mutual labels:  gem
Viewer
Viewer is a configurable application template that enables you to display an ArcGIS web map using a variety of tools.
Stars: ✭ 56 (+194.74%)
Mutual labels:  web-application
sqlike
Golang Sequel ORM that supports Enum, JSON, Spatial, and many more
Stars: ✭ 18 (-5.26%)
Mutual labels:  sequel
aws-sqs-sns-client
AWS SNS SQS client UI
Stars: ✭ 26 (+36.84%)
Mutual labels:  web-application

Gem Version Maintainability Test Coverage

Background

Sinator is Sinatra application generator. It will generate Sinatra application with minimum configuration. The reasons behind this project because I want to create many small web application based on sinatra with other third party ruby gems as foundation.

Features

  • Generate Sinatra based web application without database
  • Generate Sinatra based web application with PostgreSQL database configuration and Sequel as ORM
  • Rake task for assets precompile and assets clean

Installation

gem install sinator

with Bundler, put this code in your Gemfile:

gem 'sinator'

How to Use

Generate app in current directory without database.

sinator -n my_app

Generate app in target directory without database.

sinator -n my_app -t target/dir

Generate app in current directory with database. -d option will generate app with Sequel ORM and PostgreSQL adapter.

sinator -n my_app -d

Run web server on localhost.

bundle exec puma

Run application console / interactive mode / IRB.

bundle exec tux

Example Usage

This example assume that PostgreSQL is already running. See github.com/kuntoaji/todo_sinator for Todo Application generated with Sinator.

  1. run sinator -n my_app -d
  2. cd my_app
  3. run bundle install
  4. configure your database setting in config/database.yml
  5. create database with createdb my_app_development.
  6. create file db/migrations/001_create_artists.rb and put the following code:
Sequel.migration do
  up do
    create_table(:artists) do
      primary_key :id
      String :name, :null=>false
    end
  end

  down do
    drop_table(:artists)
  end
end
  1. run rake db:migrate
  2. create file app/models/Artist.rb and put the following code:
class Artist < Sequel::Model
end
  1. create file app/routes/artists.rb and put the following code:
class MyApp
  get '/artists' do
    @artists = Artist.all
    erb :"artists/index"
  end

  post '/artists' do
    @artist = Artist.new
    @artist.name = params[:name]
    @artist.save

    redirect '/artists'
  end
end
  1. create file app/views/artists/index.erb and put the following code:
<h1>List of Artist</h1>
<ul>
  <% @artists.each do |artist| %>
    <li><%= artist.name %></li>
  <% end %>
</ul>

<form action="/artists" method="post">
  <%= Rack::Csrf.tag(env) %>
  <input type="text" name="name" />
  <button>Submit</button>
</form>
  1. run the server bundle exec puma
  2. open url localhost:9292/artists
  3. Enjoy! :)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].