Skip to content

Commit 41ccc09

Browse files
committed
Add bouquet-gate
1 parent 4eeecd9 commit 41ccc09

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+842
-0
lines changed

gate/.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.bundle/
2+
log/*.log
3+
pkg/
4+
spec/dummy/db/*.sqlite3
5+
spec/dummy/db/*.sqlite3-journal
6+
spec/dummy/log/*.log
7+
spec/dummy/tmp/

gate/Gemfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
source 'https://rubygems.org'
2+
3+
# Declare your gem's dependencies in bouquet-gate.gemspec.
4+
# Bundler will treat runtime dependencies like base dependencies, and
5+
# development dependencies will be added by default to the :development group.
6+
gemspec
7+
8+
# Declare any dependencies that are still in development here instead of in
9+
# your gemspec. These might include edge Rails or gems from your path or
10+
# Git. Remember to move these dependencies to your gemspec before releasing
11+
# your gem to rubygems.org.
12+
13+
# To use a debugger
14+
# gem 'byebug', group: [:development, :test]

gate/MIT-LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright 2016 ogom
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.

gate/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Bouquet::Gate
2+
3+
This project rocks and uses MIT-LICENSE.

gate/Rakefile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 = 'Bouquet::Gate'
12+
rdoc.options << '--line-numbers'
13+
rdoc.rdoc_files.include('README.md')
14+
rdoc.rdoc_files.include('lib/**/*.rb')
15+
end
16+
17+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
18+
load 'rails/tasks/engine.rake'
19+
20+
21+
load 'rails/tasks/statistics.rake'
22+
23+
24+
25+
Bundler::GemHelper.install_tasks
26+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Bouquet
2+
module Gate
3+
class ApplicationController < ActionController::API
4+
end
5+
end
6+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Bouquet
2+
module Gate
3+
class ApplicationJob < ActiveJob::Base
4+
end
5+
end
6+
end

gate/app/models/application_record.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module Bouquet
2+
module Gate
3+
class ApplicationRecord < ActiveRecord::Base
4+
self.abstract_class = true
5+
end
6+
end
7+
end

gate/bin/rails

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env ruby
2+
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
3+
4+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
5+
ENGINE_PATH = File.expand_path('../../lib/bouquet/gate/engine', __FILE__)
6+
7+
# Set up gems listed in the Gemfile.
8+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
9+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
10+
11+
require 'rails/all'
12+
require 'rails/engine/commands'

gate/bouquet-gate.gemspec

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
$:.push File.expand_path("../lib", __FILE__)
2+
3+
# Maintain your gem's version:
4+
require "bouquet/gate/version"
5+
6+
# Describe your gem and declare its dependencies:
7+
Gem::Specification.new do |s|
8+
s.name = "bouquet-gate"
9+
s.version = Bouquet::Gate::VERSION
10+
s.authors = ["ogom"]
11+
s.email = ["[email protected]"]
12+
s.homepage = "TODO"
13+
s.summary = "TODO: Summary of Bouquet::Gate."
14+
s.description = "TODO: Description of Bouquet::Gate."
15+
s.license = "MIT"
16+
17+
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
18+
19+
s.add_dependency "rails", ">= 5.0.0.beta1", "< 5.1"
20+
21+
s.add_development_dependency "sqlite3"
22+
end

gate/config/routes.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Bouquet::Gate::Engine.routes.draw do
2+
end

gate/lib/bouquet/gate.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require "bouquet/gate/engine"
2+
3+
module Bouquet
4+
module Gate
5+
# Your code goes here...
6+
end
7+
end

gate/lib/bouquet/gate/engine.rb

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Bouquet
2+
module Gate
3+
class Engine < ::Rails::Engine
4+
isolate_namespace Bouquet::Gate
5+
config.generators.api_only = true
6+
end
7+
end
8+
end

gate/lib/bouquet/gate/version.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Bouquet
2+
module Gate
3+
VERSION = '0.1.0'
4+
end
5+
end
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# desc "Explaining what the task does"
2+
# task :bouquet_gate do
3+
# # Task goes here
4+
# end

gate/spec/dummy/Rakefile

+6
Original file line numberDiff line numberDiff line change
@@ -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+
Rails.application.load_tasks
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
//= link_directory ../javascripts .js
3+
//= link_directory ../stylesheets .css
Original file line numberDiff line numberDiff line change
@@ -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 any plugin's vendor/assets/javascripts directory 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. JavaScript code in this file should be added after the last require_* statement.
9+
//
10+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require_tree .
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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 any plugin's vendor/assets/stylesheets directory 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 bottom of the
9+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10+
* files in this directory. Styles in this file should be added after the last require_* statement.
11+
* It is generally better to create a new file per style scope.
12+
*
13+
*= require_tree .
14+
*= require_self
15+
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Be sure to restart your server when you modify this file. Action Cable runs in an EventMachine loop that does not support auto reloading.
2+
module ApplicationCable
3+
class Channel < ActionCable::Channel::Base
4+
end
5+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Be sure to restart your server when you modify this file. Action Cable runs in an EventMachine loop that does not support auto reloading.
2+
module ApplicationCable
3+
class Connection < ActionCable::Connection::Base
4+
end
5+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class ApplicationController < ActionController::API
2+
end

gate/spec/dummy/app/controllers/concerns/.keep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class ApplicationJob < ActiveJob::Base
2+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class ApplicationMailer < ActionMailer::Base
2+
default from: '[email protected]'
3+
layout 'mailer'
4+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class ApplicationRecord < ActiveRecord::Base
2+
self.abstract_class = true
3+
end

gate/spec/dummy/app/models/concerns/.keep

Whitespace-only changes.

gate/spec/dummy/bin/bundle

+3
Original file line numberDiff line numberDiff line change
@@ -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')

gate/spec/dummy/bin/rails

+4
Original file line numberDiff line numberDiff line change
@@ -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'

gate/spec/dummy/bin/rake

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env ruby
2+
require_relative '../config/boot'
3+
require 'rake'
4+
Rake.application.run

gate/spec/dummy/bin/setup

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env ruby
2+
require 'pathname'
3+
require 'fileutils'
4+
include FileUtils
5+
6+
# path to your application root.
7+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8+
9+
def system!(*args)
10+
system(*args) || abort("\n== Command #{args} failed ==")
11+
end
12+
13+
chdir APP_ROOT do
14+
# This script is a starting point to setup your application.
15+
# Add necessary setup steps to this file.
16+
17+
puts '== Installing dependencies =='
18+
system! 'gem install bundler --conservative'
19+
system('bundle check') or system!('bundle install')
20+
21+
# puts "\n== Copying sample files =="
22+
# unless File.exist?('config/database.yml')
23+
# cp 'config/database.yml.sample', 'config/database.yml'
24+
# end
25+
26+
puts "\n== Preparing database =="
27+
system! 'bin/rails db:setup'
28+
29+
puts "\n== Removing old logs and tempfiles =="
30+
system! 'bin/rails log:clear tmp:clear'
31+
32+
puts "\n== Restarting application server =="
33+
system! 'bin/rails restart'
34+
end

gate/spec/dummy/bin/update

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
require 'pathname'
3+
require 'fileutils'
4+
include FileUtils
5+
6+
# path to your application root.
7+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8+
9+
def system!(*args)
10+
system(*args) || abort("\n== Command #{args} failed ==")
11+
end
12+
13+
chdir APP_ROOT do
14+
# This script is a way to update your development environment automatically.
15+
# Add necessary update steps to this file.
16+
17+
puts '== Installing dependencies =='
18+
system! 'gem install bundler --conservative'
19+
system 'bundle check' or system! 'bundle install'
20+
21+
puts "\n== Updating database =="
22+
system! 'bin/rails db:migrate'
23+
24+
puts "\n== Removing old logs and tempfiles =="
25+
system! 'bin/rails log:clear tmp:clear'
26+
27+
puts "\n== Restarting application server =="
28+
system! 'bin/rails restart'
29+
end

gate/spec/dummy/config.ru

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This file is used by Rack-based servers to start the application.
2+
3+
require ::File.expand_path('../config/environment', __FILE__)
4+
5+
# Action Cable uses EventMachine which requires that all classes are loaded in advance
6+
Rails.application.eager_load!
7+
require 'action_cable/process/logging'
8+
9+
run Rails.application

gate/spec/dummy/config/application.rb

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
require File.expand_path('../boot', __FILE__)
2+
3+
# Pick the frameworks you want:
4+
require "active_record/railtie"
5+
require "action_controller/railtie"
6+
require "action_mailer/railtie"
7+
require "action_view/railtie"
8+
require "sprockets/railtie"
9+
# require "rails/test_unit/railtie"
10+
11+
Bundler.require(*Rails.groups)
12+
require "bouquet/gate"
13+
14+
module Dummy
15+
class Application < Rails::Application
16+
# Settings in config/environments/* take precedence over those specified here.
17+
# Application configuration should go into files in config/initializers
18+
# -- all .rb files in that directory are automatically loaded.
19+
20+
# Only loads a smaller set of middleware suitable for API only apps.
21+
# Middleware like session, flash, cookies can be added back manually.
22+
# Skip views, helpers and assets when generating a new resource.
23+
config.api_only = true
24+
end
25+
end
26+

gate/spec/dummy/config/boot.rb

+5
Original file line numberDiff line numberDiff line change
@@ -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.exist?(ENV['BUNDLE_GEMFILE'])
5+
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)

gate/spec/dummy/config/database.yml

+25
Original file line numberDiff line numberDiff line change
@@ -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+
#
7+
default: &default
8+
adapter: sqlite3
9+
pool: 5
10+
timeout: 5000
11+
12+
development:
13+
<<: *default
14+
database: db/development.sqlite3
15+
16+
# Warning: The database defined as "test" will be erased and
17+
# re-generated from your development database when you run "rake".
18+
# Do not set this db to the same as development or production.
19+
test:
20+
<<: *default
21+
database: db/test.sqlite3
22+
23+
production:
24+
<<: *default
25+
database: db/production.sqlite3

gate/spec/dummy/config/environment.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Load the Rails application.
2+
require File.expand_path('../application', __FILE__)
3+
4+
# Initialize the Rails application.
5+
Rails.application.initialize!

0 commit comments

Comments
 (0)