corneal-new 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/bin/corneal +6 -0
- data/lib/corneal.rb +11 -0
- data/lib/corneal/cli.rb +24 -0
- data/lib/corneal/generators/app/app_generator.rb +129 -0
- data/lib/corneal/generators/app/templates/Gemfile +19 -0
- data/lib/corneal/generators/app/templates/README.md +1 -0
- data/lib/corneal/generators/app/templates/Rakefile +8 -0
- data/lib/corneal/generators/app/templates/app/controllers/application_controller.rb +14 -0
- data/lib/corneal/generators/app/templates/app/models/.gitkeep +0 -0
- data/lib/corneal/generators/app/templates/app/views/layout.erb.tt +32 -0
- data/lib/corneal/generators/app/templates/app/views/welcome.erb +23 -0
- data/lib/corneal/generators/app/templates/config.ru +7 -0
- data/lib/corneal/generators/app/templates/config/db.yml +35 -0
- data/lib/corneal/generators/app/templates/config/environment.rb +12 -0
- data/lib/corneal/generators/app/templates/config/initializers/database.rb +11 -0
- data/lib/corneal/generators/app/templates/config/initializers/redis.rb +7 -0
- data/lib/corneal/generators/app/templates/config/redis.yml +14 -0
- data/lib/corneal/generators/app/templates/public/favicon.ico +0 -0
- data/lib/corneal/generators/app/templates/public/images/.gitkeep +0 -0
- data/lib/corneal/generators/app/templates/public/images/corneal-small.png +0 -0
- data/lib/corneal/generators/app/templates/public/javascripts/.gitkeep +0 -0
- data/lib/corneal/generators/app/templates/public/stylesheets/main.css +115 -0
- data/lib/corneal/generators/app/templates/spec/application_controller_spec.rb +13 -0
- data/lib/corneal/generators/app/templates/spec/spec_helper.rb +36 -0
- data/lib/corneal/generators/controller/controller_generator.rb +37 -0
- data/lib/corneal/generators/controller/templates/controller.rb.erb +37 -0
- data/lib/corneal/generators/controller/templates/views/edit.html.erb +1 -0
- data/lib/corneal/generators/controller/templates/views/index.html.erb +1 -0
- data/lib/corneal/generators/controller/templates/views/new.html.erb +1 -0
- data/lib/corneal/generators/controller/templates/views/show.html.erb +1 -0
- data/lib/corneal/generators/model/migration.rb.erb +10 -0
- data/lib/corneal/generators/model/model.rb.erb +2 -0
- data/lib/corneal/generators/model/model_generator.rb +59 -0
- data/lib/corneal/generators/scaffold/scaffold_generator.rb +22 -0
- data/lib/corneal/version.rb +9 -0
- data/lib/extensions/string.rb +37 -0
- data/spec/corneal/cli_spec.rb +15 -0
- data/spec/corneal/version_spec.rb +27 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/string_extension_spec.rb +53 -0
- metadata +146 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 5fa1f96b7bd08ae90f58137e5db976da00ac6b5810c97c590465c293daa27cf5
|
|
4
|
+
data.tar.gz: c256c2ac76d8c7a3216442e0f44a9fe4fcd1261fbf2810850836449b3bae71d2
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: fc4173a9d7800e179f536bc5426c667483327222e730a1c1e67fd7fad6e1985fabd9abc53a94cf9ab7840985a646b2c1338a397ae18103e642739347ee25126c
|
|
7
|
+
data.tar.gz: 0323e9f6b9176d38970b9d32a7a1711f3e10ceb8c23f272cfb22ac142e34852bb5b806be42165eb8f25e3d27a10888e3aa46dc357446e14aab6c1df763cdf7d3
|
data/bin/corneal
ADDED
data/lib/corneal.rb
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require "extensions/string"
|
|
2
|
+
require "corneal/generators/app/app_generator"
|
|
3
|
+
require "corneal/generators/model/model_generator"
|
|
4
|
+
require "corneal/generators/scaffold/scaffold_generator"
|
|
5
|
+
require "corneal/generators/controller/controller_generator"
|
|
6
|
+
require "corneal/version"
|
|
7
|
+
require "corneal/cli"
|
|
8
|
+
|
|
9
|
+
module Corneal
|
|
10
|
+
|
|
11
|
+
end
|
data/lib/corneal/cli.rb
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require "thor"
|
|
2
|
+
|
|
3
|
+
module Corneal
|
|
4
|
+
class CLI < Thor
|
|
5
|
+
|
|
6
|
+
desc "-v", "Show Corneal version number"
|
|
7
|
+
map %w[-v --version] => :version
|
|
8
|
+
# USAGE: corneal -v
|
|
9
|
+
def version
|
|
10
|
+
say "Corneal #{Corneal::VERSION::STRING}"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# register(class_name, subcommand_alias, usage_list_string, description_string)
|
|
15
|
+
register Corneal::Generators::AppGenerator, "new", "new APP_PATH", "Creates a new Sinatra application"
|
|
16
|
+
register Corneal::Generators::ModelGenerator, "model", "model NAME", "Generate a model"
|
|
17
|
+
register Corneal::Generators::ControllerGenerator, "controller", "controller NAME", "Generate a controller"
|
|
18
|
+
register Corneal::Generators::ScaffoldGenerator, "scaffold", "scaffold NAME", "Generate a model with its associated views and controllers"
|
|
19
|
+
|
|
20
|
+
def self.exit_on_failure
|
|
21
|
+
true
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
require "thor/group"
|
|
3
|
+
|
|
4
|
+
module Corneal
|
|
5
|
+
module Generators
|
|
6
|
+
class AppGenerator < Thor::Group
|
|
7
|
+
include Thor::Actions
|
|
8
|
+
|
|
9
|
+
desc "Creates a new Sinatra application"
|
|
10
|
+
argument :name, :type => :string, :desc => "The name of the new application"
|
|
11
|
+
class_option :capistrano, :type => :boolean, :desc => "Include Capistrano configuration"
|
|
12
|
+
class_option :database, :aliases => "-d", :default => "", :desc => "The type of database to use"
|
|
13
|
+
class_option :redis, :type => :boolean, :desc => "Include Redis configuration"
|
|
14
|
+
class_option :rvm, :type => :boolean, :desc => "Create .ruby-version (ruby-2.1.0) and .ruby-gemset"
|
|
15
|
+
class_option :bundle, :type => :boolean, :desc => "Run bundle after generating the app"
|
|
16
|
+
class_option :git, :type => :boolean, :desc => "Initialize a Git repository"
|
|
17
|
+
|
|
18
|
+
# Creates instance variables from options passed to corneal.
|
|
19
|
+
def setup
|
|
20
|
+
@app_path = name.directory_name
|
|
21
|
+
@name = name.file_name
|
|
22
|
+
|
|
23
|
+
options.each do |key, value|
|
|
24
|
+
instance_variable_set "@#{key.to_s}".to_sym, value
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def self.source_root
|
|
29
|
+
File.expand_path(File.join(File.dirname(__FILE__), "templates"))
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create empty directories
|
|
33
|
+
def create_empty_directories
|
|
34
|
+
%w{config/initializers lib spec}.each do |dir|
|
|
35
|
+
empty_directory File.join(@app_path, dir)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
empty_directory File.join(@app_path, 'db/migrate')
|
|
39
|
+
|
|
40
|
+
create_file File.join(@app_path, "lib", ".gitkeep")
|
|
41
|
+
template "config/environment.rb", File.join(@app_path, "config/environment.rb")
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def create_public_directory
|
|
45
|
+
%w{public/stylesheets public/javascripts public/images}.each do |dir|
|
|
46
|
+
directory dir, File.join(@app_path, dir)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
template "public/favicon.ico", File.join(@app_path, "public/favicon.ico")
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def create_app_directory
|
|
53
|
+
%w{app/controllers app/views app/models}.each do |dir|
|
|
54
|
+
directory dir, File.join(@app_path, dir)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def create_app_spec
|
|
59
|
+
template "spec/application_controller_spec.rb", File.join(@app_path, "spec/application_controller_spec.rb")
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def create_spec_helper
|
|
63
|
+
template "spec/spec_helper.rb", File.join(@app_path, "spec/spec_helper.rb")
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def create_config
|
|
67
|
+
template "config.ru", File.join(@app_path, "config.ru")
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def create_gemfile
|
|
71
|
+
template "Gemfile", File.join(@app_path, "Gemfile")
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def create_rakefile
|
|
75
|
+
template "Rakefile", File.join(@app_path, "Rakefile")
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def create_readme
|
|
79
|
+
copy_file "README.md", File.join(@app_path, "README.md")
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def create_db_config
|
|
83
|
+
template("config/db.yml", File.join(@app_path, "config/db.yml")) unless @database.empty?
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def create_database_initializer
|
|
87
|
+
template("config/initializers/database.rb", File.join(@app_path, "config/initializers/database.rb")) unless @database.empty?
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def create_redis_config
|
|
91
|
+
copy_file("config/redis.yml", File.join(@app_path, "config/redis.yml")) if @redis
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def create_redis_initializer
|
|
95
|
+
template("config/initializers/redis.rb", File.join(@app_path, "config/initializers/redis.rb")) if @redis
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def create_capistrano_config
|
|
99
|
+
if @capistrano
|
|
100
|
+
inside(@app_path) do
|
|
101
|
+
run('cap install')
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def create_rvm_gemset
|
|
107
|
+
if @rvm
|
|
108
|
+
create_file(File.join(@app_path, '.ruby-version'), 'ruby-2.6.0')
|
|
109
|
+
create_file(File.join(@app_path, '.ruby-gemset'), @app_path)
|
|
110
|
+
|
|
111
|
+
@bundle = false
|
|
112
|
+
puts "You need to run 'bundle install' manually."
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def initialize_git_repo
|
|
117
|
+
inside(@app_path) do
|
|
118
|
+
run('git init .') if @git
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def install_dependencies
|
|
123
|
+
inside(@app_path) do
|
|
124
|
+
run('bundle') if @bundle
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
source 'http://rubygems.org'
|
|
2
|
+
|
|
3
|
+
gem 'sinatra'
|
|
4
|
+
gem 'activerecord', '~> 5.2'
|
|
5
|
+
gem 'sinatra-activerecord', :require => 'sinatra/activerecord'
|
|
6
|
+
gem 'rake'
|
|
7
|
+
gem 'require_all'
|
|
8
|
+
gem 'sqlite3'
|
|
9
|
+
gem 'thin'
|
|
10
|
+
gem 'shotgun'
|
|
11
|
+
gem 'pry'
|
|
12
|
+
gem 'bcrypt'
|
|
13
|
+
gem 'tux'
|
|
14
|
+
|
|
15
|
+
group :test do
|
|
16
|
+
gem 'rspec'
|
|
17
|
+
gem 'capybara'
|
|
18
|
+
gem 'rack-test'
|
|
19
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
File without changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
|
|
3
|
+
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
|
|
4
|
+
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
|
|
5
|
+
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
|
|
6
|
+
<head>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
|
|
9
|
+
|
|
10
|
+
<title><%= @name.camel_case %></title>
|
|
11
|
+
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
13
|
+
|
|
14
|
+
<link rel="stylesheet" href="/stylesheets/main.css" />
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<div class="wrapper">
|
|
18
|
+
|
|
19
|
+
<%%= yield %>
|
|
20
|
+
|
|
21
|
+
<footer class="branding">
|
|
22
|
+
<small>© <%= Time.now.year %> <strong><%= @name.camel_case %></strong></small>
|
|
23
|
+
</footer>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
|
|
27
|
+
<!--[if lt IE 7]>
|
|
28
|
+
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js"></script>
|
|
29
|
+
<script>window.attachEvent("onload",function(){CFInstall.check({mode:"overlay"})})</script>
|
|
30
|
+
<![endif]-->
|
|
31
|
+
</body>
|
|
32
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<div class="container">
|
|
2
|
+
<header><img src="images/corneal-small.png" class="img-responsive main-image"></header>
|
|
3
|
+
<div class="col-md-8 col-md-offset-2">
|
|
4
|
+
<h2>Sinatra Template Default Page</h2>
|
|
5
|
+
|
|
6
|
+
<div class="content">
|
|
7
|
+
<p>Welcome to the Sinatra Template! If you're seeing this page, then everything is working
|
|
8
|
+
as expected. To get started, delete this file (<code>app/views/welcome.erb)</code> and begin adding
|
|
9
|
+
your own actions to <code>application_controller.rb</code>. For more information, see the <a href="https://github.com/thebrianemory/corneal">README</a>.</p>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<div class="sidebar">
|
|
13
|
+
<h3>Environment</h3>
|
|
14
|
+
<ul>
|
|
15
|
+
<li><b>Ruby:</b> <%= RUBY_VERSION %></li>
|
|
16
|
+
<li><b>Environment:</b> <%= ENV["RACK_ENV"] %></li>
|
|
17
|
+
<li><b>Server:</b> <%= @env["SERVER_SOFTWARE"] %></li>
|
|
18
|
+
<li><b>Port:</b> <%= @env["SERVER_PORT"] %></li>
|
|
19
|
+
</ul>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Sequel Database Configuration
|
|
2
|
+
<% if @database == "sqlite" %>
|
|
3
|
+
development: "sqlite://db/development.sqlite3"
|
|
4
|
+
test: "sqlite://db/test.sqlite3"
|
|
5
|
+
production: "sqlite://db/production.sqlite3"
|
|
6
|
+
<% elsif @database == "postgres" %>
|
|
7
|
+
development: "postgres://<%= `whoami`.chop %>@localhost/<%= @name %>_development"
|
|
8
|
+
test: "postgres://<%= `whoami`.chop %>@localhost/<%= @name %>_test"
|
|
9
|
+
production: "postgres://<%= `whoami`.chop %>@localhost/<%= @name %>_production"
|
|
10
|
+
<% elsif @database == "mysql" %>
|
|
11
|
+
development: "mysql2://<%= `whoami`.chop %>@localhost/<%= @name %>_development"
|
|
12
|
+
test: "mysql2://<%= `whoami`.chop %>@localhost/<%= @name %>_test"
|
|
13
|
+
production: "mysql2://<%= `whoami`.chop %>@localhost/<%= @name %>_production"
|
|
14
|
+
<% elsif @database == "mongo" %>
|
|
15
|
+
development:
|
|
16
|
+
host: localhost
|
|
17
|
+
port: 27017
|
|
18
|
+
database: <%= @name %>_development
|
|
19
|
+
username:
|
|
20
|
+
password:
|
|
21
|
+
|
|
22
|
+
test:
|
|
23
|
+
host: localhost
|
|
24
|
+
port: 27017
|
|
25
|
+
database: <%= @name %>_test
|
|
26
|
+
username:
|
|
27
|
+
password:
|
|
28
|
+
|
|
29
|
+
production:
|
|
30
|
+
host: localhost
|
|
31
|
+
port: 27017
|
|
32
|
+
database: <%= @name %>_production
|
|
33
|
+
username:
|
|
34
|
+
password:
|
|
35
|
+
<% end %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
ENV['SINATRA_ENV'] ||= "development"
|
|
2
|
+
|
|
3
|
+
require 'bundler/setup'
|
|
4
|
+
Bundler.require(:default, ENV['SINATRA_ENV'])
|
|
5
|
+
|
|
6
|
+
ActiveRecord::Base.establish_connection(
|
|
7
|
+
:adapter => "sqlite3",
|
|
8
|
+
:database => "db/#{ENV['SINATRA_ENV']}.sqlite"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
require './app/controllers/application_controller'
|
|
12
|
+
require_all 'app'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<% unless @database.empty? -%>
|
|
2
|
+
require "yaml"
|
|
3
|
+
settings = YAML::load_file("config/db.yml")
|
|
4
|
+
<% if @database != 'mongo' -%>
|
|
5
|
+
# Sequel Configuration
|
|
6
|
+
require "sequel"
|
|
7
|
+
DB = Sequel.connect(settings[ENV['RACK_ENV']])
|
|
8
|
+
<% else -%>
|
|
9
|
+
# MongoDB Configuration
|
|
10
|
+
<% end -%>
|
|
11
|
+
<% end -%>
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
@media screen {
|
|
2
|
+
/* --- Reset Styles --- */
|
|
3
|
+
* {
|
|
4
|
+
list-style: none;
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
html, body {
|
|
10
|
+
height: 100%;
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* --- Welcome Page Styles --- */
|
|
15
|
+
body {
|
|
16
|
+
background-color: lightblue;
|
|
17
|
+
color: #333;
|
|
18
|
+
font-family: Sans-Serif;
|
|
19
|
+
line-height: 18px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.wrapper {
|
|
23
|
+
background: #fff;
|
|
24
|
+
-moz-box-shadow: 0 0 10px rgba(0,0,0,.3);
|
|
25
|
+
-webkit-box-shadow: 0 0 10px rgba(0,0,0,.3);
|
|
26
|
+
box-shadow: 0 0 10px rgba(0,0,0,.3);
|
|
27
|
+
margin: 16px auto;
|
|
28
|
+
max-width: 960px;
|
|
29
|
+
padding: 2.25%; /* 18px / 800px */
|
|
30
|
+
width: 85%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
h1 {
|
|
34
|
+
font-size: 36px;
|
|
35
|
+
line-height: 54px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
h2 {
|
|
39
|
+
border-bottom: 2px solid #ccc;
|
|
40
|
+
font-size: 24px;
|
|
41
|
+
line-height: 36px;
|
|
42
|
+
margin-bottom: 16px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
h3 {
|
|
46
|
+
font-size: 18px;
|
|
47
|
+
line-height: 36px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
p {
|
|
51
|
+
margin-bottom: 18px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.main {
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.content {
|
|
59
|
+
float: left;
|
|
60
|
+
width: 60%; /* 480px / 800px */
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.sidebar {
|
|
64
|
+
background: #eee;
|
|
65
|
+
border: 1px solid #ccc;
|
|
66
|
+
float: right;
|
|
67
|
+
padding: 2.08333333333%; /* 5px / 240px */
|
|
68
|
+
width: 30%; /* 240px / 800px */
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.sidebar ul {
|
|
72
|
+
font-size: 14px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.branding {
|
|
76
|
+
clear: both;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
footer.branding {
|
|
80
|
+
border-top: 2px solid #ccc;
|
|
81
|
+
margin-top: 20px;
|
|
82
|
+
padding-top: 20px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media screen and (max-width: 600px) {
|
|
87
|
+
.wrapper {
|
|
88
|
+
-moz-box-shadow: none;
|
|
89
|
+
-webkit-box-shadow: none;
|
|
90
|
+
box-shadow: none;
|
|
91
|
+
width: auto;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.content, .sidebar {
|
|
95
|
+
float: none;
|
|
96
|
+
width: 100%;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.sidebar {
|
|
100
|
+
background: transparent;
|
|
101
|
+
border: none;
|
|
102
|
+
border-top: 2px solid #ccc;
|
|
103
|
+
padding: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
h1 {
|
|
107
|
+
font-size: 24px;
|
|
108
|
+
line-height: 36px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
h2 {
|
|
112
|
+
font-size: 18px;
|
|
113
|
+
line-height: 24px;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require_relative "spec_helper"
|
|
2
|
+
|
|
3
|
+
def app
|
|
4
|
+
ApplicationController
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
describe ApplicationController do
|
|
8
|
+
it "responds with a welcome message" do
|
|
9
|
+
get '/'
|
|
10
|
+
expect(last_response.status).to eq(200)
|
|
11
|
+
expect(last_response.body).to include("Welcome to the Sinatra Template!")
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
ENV["SINATRA_ENV"] = "test"
|
|
2
|
+
|
|
3
|
+
require_relative '../config/environment'
|
|
4
|
+
require 'rack/test'
|
|
5
|
+
require 'capybara/rspec'
|
|
6
|
+
require 'capybara/dsl'
|
|
7
|
+
|
|
8
|
+
if ActiveRecord::Base.connection.migration_context.needs_migration?
|
|
9
|
+
raise 'Migrations are pending. Run `rake db:migrate` to resolve the issue.'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
ActiveRecord::Base.logger = nil
|
|
13
|
+
|
|
14
|
+
RSpec.configure do |config|
|
|
15
|
+
config.run_all_when_everything_filtered = true
|
|
16
|
+
config.filter_run :focus
|
|
17
|
+
config.include Rack::Test::Methods
|
|
18
|
+
config.include Capybara::DSL
|
|
19
|
+
DatabaseCleaner.strategy = :truncation
|
|
20
|
+
|
|
21
|
+
config.before do
|
|
22
|
+
DatabaseCleaner.clean
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
config.after do
|
|
26
|
+
DatabaseCleaner.clean
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
config.order = 'default'
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def app
|
|
33
|
+
Rack::Builder.parse_file('config.ru').first
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
Capybara.app = app
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require "thor/group"
|
|
2
|
+
require "active_support/inflector"
|
|
3
|
+
|
|
4
|
+
module Corneal
|
|
5
|
+
module Generators
|
|
6
|
+
class ControllerGenerator < Thor::Group
|
|
7
|
+
include Thor::Actions
|
|
8
|
+
attr_reader :controller_name, :class_name, :file_name
|
|
9
|
+
|
|
10
|
+
desc "Generate an Controller with associated views"
|
|
11
|
+
argument :name, type: :string, desc: "Name of the controller"
|
|
12
|
+
|
|
13
|
+
# --no-views make views optional
|
|
14
|
+
class_option :views, type: :boolean, default: true, desc: "Generate views for controller"
|
|
15
|
+
|
|
16
|
+
def self.source_root
|
|
17
|
+
File.dirname(__FILE__)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def setup
|
|
21
|
+
@controller_name = name.pluralize.underscore
|
|
22
|
+
@class_name = "#{controller_name.camel_case}Controller"
|
|
23
|
+
@file_name = class_name.underscore
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def create_controller
|
|
27
|
+
template "templates/controller.rb.erb", File.join("app/controllers", "#{file_name}.rb")
|
|
28
|
+
insert_into_file "config.ru", "use #{class_name}\n", after: "run ApplicationController\n"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def create_views
|
|
32
|
+
return unless options[:views]
|
|
33
|
+
directory "templates/views", File.join("app/views", "#{controller_name}")
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
class <%= class_name %> < ApplicationController
|
|
2
|
+
|
|
3
|
+
# GET: /<%= controller_name %>
|
|
4
|
+
get "/<%= controller_name %>" do
|
|
5
|
+
erb :"/<%= controller_name %>/index.html"
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
# GET: /<%= controller_name %>/new
|
|
9
|
+
get "/<%= controller_name %>/new" do
|
|
10
|
+
erb :"/<%= controller_name %>/new.html"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# POST: /<%= controller_name %>
|
|
14
|
+
post "/<%= controller_name %>" do
|
|
15
|
+
redirect "/<%= controller_name %>"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# GET: /<%= controller_name %>/5
|
|
19
|
+
get "/<%= controller_name %>/:id" do
|
|
20
|
+
erb :"/<%= controller_name %>/show.html"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# GET: /<%= controller_name %>/5/edit
|
|
24
|
+
get "/<%= controller_name %>/:id/edit" do
|
|
25
|
+
erb :"/<%= controller_name %>/edit.html"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# PATCH: /<%= controller_name %>/5
|
|
29
|
+
patch "/<%= controller_name %>/:id" do
|
|
30
|
+
redirect "/<%= controller_name %>/:id"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# DELETE: /<%= controller_name %>/5/delete
|
|
34
|
+
delete "/<%= controller_name %>/:id/delete" do
|
|
35
|
+
redirect "/<%= controller_name %>"
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h1>Insert the form to edit an instance of your model here.</h1>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h1>This is the Model's index page.</h1>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h1>Insert the form to create a new instance of your model.</h1>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h1>This is the show page for an individual instance of your model.</h1>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
class <%= migration_class_name %> < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
create_table :<%= table_name %> do |t|
|
|
4
|
+
<% attributes.each do |attribute| -%>
|
|
5
|
+
t.<%= attribute[:type] %> :<%= attribute[:name] %>
|
|
6
|
+
<% end %>
|
|
7
|
+
t.timestamps null: false
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
require "thor/group"
|
|
2
|
+
require "active_support/inflector"
|
|
3
|
+
|
|
4
|
+
module Corneal
|
|
5
|
+
module Generators
|
|
6
|
+
class ModelGenerator < Thor::Group
|
|
7
|
+
include Thor::Actions
|
|
8
|
+
attr_reader :file_name, :class_name, :model_name, :migration_name, :migration_class_name, :table_name
|
|
9
|
+
|
|
10
|
+
desc "Generate an ActiveRecord model"
|
|
11
|
+
argument :name, type: :string, desc: "Name of the model"
|
|
12
|
+
argument :attributes, type: :array, default: [], banner: "field:type field:type"
|
|
13
|
+
|
|
14
|
+
# --no-migration make migrations optional
|
|
15
|
+
class_option :migration, type: :boolean, default: true, desc: "Generate migration for model"
|
|
16
|
+
|
|
17
|
+
def self.source_root
|
|
18
|
+
File.dirname(__FILE__)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def setup
|
|
22
|
+
@model_name = name.singularize
|
|
23
|
+
@class_name = model_name.camel_case
|
|
24
|
+
@file_name = model_name.underscore
|
|
25
|
+
@table_name = file_name.pluralize
|
|
26
|
+
@migration_name = "create_#{table_name}"
|
|
27
|
+
@migration_class_name = migration_name.camel_case
|
|
28
|
+
|
|
29
|
+
attributes.map! do |attribute|
|
|
30
|
+
field = attribute.split(":")
|
|
31
|
+
{ name: field[0], type: field[1] || "string" }
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def create_model
|
|
36
|
+
unless model_name == name
|
|
37
|
+
say "[WARNING] The model name '#{name}' was recognized as a plural, using the singular '#{model_name}' instead."
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
template "model.rb.erb", File.join("app/models", "#{file_name}.rb")
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def create_migration
|
|
44
|
+
return unless options[:migration]
|
|
45
|
+
|
|
46
|
+
migration_files = Dir.entries("db/migrate").select { |path| !File.directory? path }
|
|
47
|
+
|
|
48
|
+
if duplicate = migration_files.find { |file| file.include?(migration_name) }
|
|
49
|
+
say_status :identical, "db/migrate/#{duplicate}", :blue
|
|
50
|
+
else
|
|
51
|
+
version = Time.now.utc.strftime("%Y%m%d%H%M%S")
|
|
52
|
+
migration_file_name = "#{version}_#{migration_name}.rb"
|
|
53
|
+
|
|
54
|
+
template "migration.rb.erb", File.join("db/migrate", migration_file_name)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require "thor/group"
|
|
2
|
+
require 'active_support/inflector'
|
|
3
|
+
|
|
4
|
+
module Corneal
|
|
5
|
+
module Generators
|
|
6
|
+
class ScaffoldGenerator < Thor::Group
|
|
7
|
+
include Thor::Actions
|
|
8
|
+
|
|
9
|
+
desc "Generate an ActiveRecord model with it's associated views and controllers"
|
|
10
|
+
argument :name, type: :string, desc: "Name of the model"
|
|
11
|
+
argument :attributes, type: :array, default: [], banner: "field:type field:type"
|
|
12
|
+
|
|
13
|
+
def create_model
|
|
14
|
+
ModelGenerator.new([name, attributes]).invoke_all
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def create_controller
|
|
18
|
+
ControllerGenerator.new([name]).invoke_all
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module Corneal
|
|
2
|
+
module Extensions
|
|
3
|
+
module String
|
|
4
|
+
def camel_case
|
|
5
|
+
return self.gsub(/^./) { |l| l.capitalize } if !match(/[_-]/)
|
|
6
|
+
altered_self = self.downcase.capitalize
|
|
7
|
+
altered_self.scan(/[_-][a-zA-Z]/).each do |match|
|
|
8
|
+
altered_self.gsub!(match, match[1].upcase)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
altered_self
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def camel_case!
|
|
15
|
+
self.replace camel_case
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def directory_name
|
|
19
|
+
self.downcase.gsub(/[^a-z|\-|\_]/, '')
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def file_name
|
|
23
|
+
self.gsub(/[\-| ]/, '_').
|
|
24
|
+
gsub(/([A-Z]+|[A-Z][a-z])/) { |x| "_#{x}" }.
|
|
25
|
+
sub(/^_/, "").
|
|
26
|
+
gsub(/_{2,}+/, "_").
|
|
27
|
+
downcase
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def file_name!
|
|
31
|
+
self.replace file_name
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
String.send(:include, Corneal::Extensions::String)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'fakefs'
|
|
2
|
+
require_relative "../spec_helper"
|
|
3
|
+
require_relative "../../lib/corneal"
|
|
4
|
+
|
|
5
|
+
describe Corneal::VERSION do
|
|
6
|
+
subject { Corneal::Generators::AppGenerator }
|
|
7
|
+
|
|
8
|
+
describe "source_root" do
|
|
9
|
+
it "should return with a full path" do
|
|
10
|
+
pwd = File.dirname(__FILE__)
|
|
11
|
+
template_path = pwd.sub 'spec/corneal', 'lib/corneal/generators/app/templates'
|
|
12
|
+
subject.source_root.must_equal template_path
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require_relative "../spec_helper"
|
|
2
|
+
require_relative "../../lib/corneal/version"
|
|
3
|
+
|
|
4
|
+
describe Corneal::VERSION do
|
|
5
|
+
subject { Corneal::VERSION }
|
|
6
|
+
|
|
7
|
+
let(:major) { subject::MAJOR }
|
|
8
|
+
let(:minor) { subject::MINOR }
|
|
9
|
+
let(:tiny) { subject::TINY }
|
|
10
|
+
let(:string) { subject::STRING }
|
|
11
|
+
|
|
12
|
+
it "should have a major version" do
|
|
13
|
+
major.must_be_kind_of Fixnum
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "should have a minor version" do
|
|
17
|
+
minor.must_be_kind_of Fixnum
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "should have a tiny version" do
|
|
21
|
+
tiny.must_be_kind_of Fixnum
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it "should have a string representation of the version number" do
|
|
25
|
+
string.must_equal "#{major}.#{minor}.#{tiny}"
|
|
26
|
+
end
|
|
27
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
require_relative "spec_helper"
|
|
2
|
+
require_relative "../lib/extensions/string.rb"
|
|
3
|
+
|
|
4
|
+
describe String do
|
|
5
|
+
it "should ignore an already camel cased string" do
|
|
6
|
+
"MyApp".camel_case.must_equal "MyApp"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should capitalize an all lower case string" do
|
|
10
|
+
"myapp".camel_case.must_equal "Myapp"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
it "should camel case a lower case string with underscores" do
|
|
14
|
+
"my_app".camel_case.must_equal "MyApp"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it "should camel case a lower case string with hyphens" do
|
|
18
|
+
"my-app".camel_case.must_equal "MyApp"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it "should camel case an uppercase string with underscores" do
|
|
22
|
+
"MY_APP".camel_case.must_equal "MyApp"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it "should camel case an uppercase string with hyphens" do
|
|
26
|
+
"MY-APP".camel_case.must_equal "MyApp"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it "should camel case a string with a hyphen preceding a capital letter" do
|
|
30
|
+
"my_App".camel_case.must_equal "MyApp"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it "should underscore a camel cased string" do
|
|
34
|
+
"MyApp".file_name.must_equal "my_app"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
it "should underscore a hypenated string" do
|
|
38
|
+
"my-app".file_name.must_equal "my_app"
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it "should ignore an already underscored string" do
|
|
42
|
+
"my_app".file_name.must_equal "my_app"
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it "should_underscore_a_string_with_a_hyphen_preceding_a_capital_letter" do
|
|
46
|
+
"my_App".file_name.must_equal "my_app"
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
it "should allow dashes in directory names, but not in filenames" do
|
|
50
|
+
"my-App".directory_name.must_equal "my-app"
|
|
51
|
+
"my-App".file_name.must_equal "my_app"
|
|
52
|
+
end
|
|
53
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: corneal-new
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.3.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Brian Emory, Corinna Brock Moore
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2021-04-05 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: thor
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0.18'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0.18'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: activesupport
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '5.0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '5.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: bundler
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '1.5'
|
|
48
|
+
- - ">="
|
|
49
|
+
- !ruby/object:Gem::Version
|
|
50
|
+
version: 1.5.1
|
|
51
|
+
type: :development
|
|
52
|
+
prerelease: false
|
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
54
|
+
requirements:
|
|
55
|
+
- - "~>"
|
|
56
|
+
- !ruby/object:Gem::Version
|
|
57
|
+
version: '1.5'
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: 1.5.1
|
|
61
|
+
- !ruby/object:Gem::Dependency
|
|
62
|
+
name: minitest
|
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - "~>"
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '5.2'
|
|
68
|
+
type: :development
|
|
69
|
+
prerelease: false
|
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - "~>"
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '5.2'
|
|
75
|
+
description: Corneal is a Sinatra app generator with Rails-like simplicity, updated
|
|
76
|
+
for 2021 gems.
|
|
77
|
+
email: corinna@flatironschool.com
|
|
78
|
+
executables:
|
|
79
|
+
- corneal
|
|
80
|
+
extensions: []
|
|
81
|
+
extra_rdoc_files: []
|
|
82
|
+
files:
|
|
83
|
+
- bin/corneal
|
|
84
|
+
- lib/corneal.rb
|
|
85
|
+
- lib/corneal/cli.rb
|
|
86
|
+
- lib/corneal/generators/app/app_generator.rb
|
|
87
|
+
- lib/corneal/generators/app/templates/Gemfile
|
|
88
|
+
- lib/corneal/generators/app/templates/README.md
|
|
89
|
+
- lib/corneal/generators/app/templates/Rakefile
|
|
90
|
+
- lib/corneal/generators/app/templates/app/controllers/application_controller.rb
|
|
91
|
+
- lib/corneal/generators/app/templates/app/models/.gitkeep
|
|
92
|
+
- lib/corneal/generators/app/templates/app/views/layout.erb.tt
|
|
93
|
+
- lib/corneal/generators/app/templates/app/views/welcome.erb
|
|
94
|
+
- lib/corneal/generators/app/templates/config.ru
|
|
95
|
+
- lib/corneal/generators/app/templates/config/db.yml
|
|
96
|
+
- lib/corneal/generators/app/templates/config/environment.rb
|
|
97
|
+
- lib/corneal/generators/app/templates/config/initializers/database.rb
|
|
98
|
+
- lib/corneal/generators/app/templates/config/initializers/redis.rb
|
|
99
|
+
- lib/corneal/generators/app/templates/config/redis.yml
|
|
100
|
+
- lib/corneal/generators/app/templates/public/favicon.ico
|
|
101
|
+
- lib/corneal/generators/app/templates/public/images/.gitkeep
|
|
102
|
+
- lib/corneal/generators/app/templates/public/images/corneal-small.png
|
|
103
|
+
- lib/corneal/generators/app/templates/public/javascripts/.gitkeep
|
|
104
|
+
- lib/corneal/generators/app/templates/public/stylesheets/main.css
|
|
105
|
+
- lib/corneal/generators/app/templates/spec/application_controller_spec.rb
|
|
106
|
+
- lib/corneal/generators/app/templates/spec/spec_helper.rb
|
|
107
|
+
- lib/corneal/generators/controller/controller_generator.rb
|
|
108
|
+
- lib/corneal/generators/controller/templates/controller.rb.erb
|
|
109
|
+
- lib/corneal/generators/controller/templates/views/edit.html.erb
|
|
110
|
+
- lib/corneal/generators/controller/templates/views/index.html.erb
|
|
111
|
+
- lib/corneal/generators/controller/templates/views/new.html.erb
|
|
112
|
+
- lib/corneal/generators/controller/templates/views/show.html.erb
|
|
113
|
+
- lib/corneal/generators/model/migration.rb.erb
|
|
114
|
+
- lib/corneal/generators/model/model.rb.erb
|
|
115
|
+
- lib/corneal/generators/model/model_generator.rb
|
|
116
|
+
- lib/corneal/generators/scaffold/scaffold_generator.rb
|
|
117
|
+
- lib/corneal/version.rb
|
|
118
|
+
- lib/extensions/string.rb
|
|
119
|
+
- spec/corneal/cli_spec.rb
|
|
120
|
+
- spec/corneal/version_spec.rb
|
|
121
|
+
- spec/spec_helper.rb
|
|
122
|
+
- spec/string_extension_spec.rb
|
|
123
|
+
homepage: https://github.com/cjbrock/corneal-new
|
|
124
|
+
licenses:
|
|
125
|
+
- MIT
|
|
126
|
+
metadata: {}
|
|
127
|
+
post_install_message:
|
|
128
|
+
rdoc_options: []
|
|
129
|
+
require_paths:
|
|
130
|
+
- lib
|
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
132
|
+
requirements:
|
|
133
|
+
- - ">="
|
|
134
|
+
- !ruby/object:Gem::Version
|
|
135
|
+
version: '0'
|
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
|
+
requirements:
|
|
138
|
+
- - ">="
|
|
139
|
+
- !ruby/object:Gem::Version
|
|
140
|
+
version: '0'
|
|
141
|
+
requirements: []
|
|
142
|
+
rubygems_version: 3.1.4
|
|
143
|
+
signing_key:
|
|
144
|
+
specification_version: 4
|
|
145
|
+
summary: A updated version of the Sinatra app generator.
|
|
146
|
+
test_files: []
|