projecto 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/lib/projecto/app_builder.rb +25 -0
- data/lib/projecto/generators/app_generator.rb +10 -1
- data/lib/projecto/version.rb +1 -1
- data/templates/Procfile +1 -0
- data/templates/assets/config/manifest.js +3 -0
- data/templates/assets/javascripts/application.js +1 -0
- data/templates/views/application.html.erb +16 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbbc922bb240b3787bf20672db8ef950536bb286932756d5e7fa0b78589d3bd8
|
4
|
+
data.tar.gz: 1b00bf8b7a2cab5c3d543baaf634710512aa5e69981117eb2e91d4e735926200
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 339e15b3902f0f6232ebcfb6b8087d5b5755a130ee371014ede8aedd51dc1ebcfa46f25e1e0b2dd3a589d202281b3d769e2928b6542e6664ca056581a7ee23d4
|
7
|
+
data.tar.gz: a4bef57ace3611a9a0bc5f65326af6c80cb1e99842164d7e8fba4aaee93166c1f1adb8ff356710f1d565a5e927606393d3712df2f6fde810564fc5cf753b7573
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Projecto
|
1
|
+
# Projecto [![Gem Version](https://badge.fury.io/rb/projecto.svg)](https://badge.fury.io/rb/projecto)
|
2
2
|
|
3
3
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/projecto`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
4
|
|
@@ -25,6 +25,8 @@ Or building the gem
|
|
25
25
|
$ gem build projecto.gemspec
|
26
26
|
|
27
27
|
## Usage
|
28
|
+
### Installing a new project
|
29
|
+
$ projecto <directory of the project to install>
|
28
30
|
|
29
31
|
### Running the test for a project
|
30
32
|
|
data/lib/projecto/app_builder.rb
CHANGED
@@ -14,5 +14,30 @@ module Projecto
|
|
14
14
|
template "rspec/rails_helper", "spec/rails_helper.rb", force: true
|
15
15
|
template "rspec/spec_helper", "spec/spec_helper.rb", force: true
|
16
16
|
end
|
17
|
+
|
18
|
+
def custom_application_config
|
19
|
+
config = <<-RUBY
|
20
|
+
config.generators do |g|
|
21
|
+
g.orm :active_record
|
22
|
+
g.test_framework :test_unit, fixtures: true
|
23
|
+
g.integration_tool :test_unit
|
24
|
+
end
|
25
|
+
RUBY
|
26
|
+
|
27
|
+
inject_into_class "config/application.rb", "Application", config
|
28
|
+
end
|
29
|
+
|
30
|
+
def setup_heroku
|
31
|
+
copy_file "Procfile", "Procfile", force: true
|
32
|
+
end
|
33
|
+
|
34
|
+
def setup_assets
|
35
|
+
copy_file "assets/config/manifest.js", "app/assets/config/manifest.js", force: true
|
36
|
+
copy_file "assets/javascripts/application.js", "app/assets/javascripts/application.js", force: true
|
37
|
+
end
|
38
|
+
|
39
|
+
def setup_view_application
|
40
|
+
template "views/application.html.erb", "app/views/layouts/application.html.erb", force: true
|
41
|
+
end
|
17
42
|
end
|
18
43
|
end
|
@@ -5,7 +5,12 @@ module Projecto
|
|
5
5
|
class AppGenerator < Rails::Generators::AppGenerator
|
6
6
|
class_option :database, type: :string, aliases: "-d", default: "postgresql",
|
7
7
|
desc: "Configure for selected database (options: #{DATABASES.join('/')})"
|
8
|
-
|
8
|
+
class_option :skip_action_cable, type: :boolean, default: true,
|
9
|
+
desc: "Skip Action Cable"
|
10
|
+
class_option :skip_javascript, type: :boolean, default: true,
|
11
|
+
desc: "delete app/javascript"
|
12
|
+
class_option :skip_sprockets, type: :boolean, default: false,
|
13
|
+
desc: "Do not skip sprockets"
|
9
14
|
class_option :skip_bootsnap, type: :boolean, default: true,
|
10
15
|
desc: "Skip bootsnap gem"
|
11
16
|
class_option :skip_turbolinks, type: :boolean, default: false,
|
@@ -20,6 +25,10 @@ module Projecto
|
|
20
25
|
def projecto_customizations
|
21
26
|
build :set_ruby_version
|
22
27
|
build :setup_rspec
|
28
|
+
build :custom_application_config
|
29
|
+
build :setup_assets
|
30
|
+
build :setup_heroku
|
31
|
+
build :setup_view_application
|
23
32
|
end
|
24
33
|
|
25
34
|
protected
|
data/lib/projecto/version.rb
CHANGED
data/templates/Procfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
web: bin/rails server
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require_tree .
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
<!DOCTYPE html>
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<title><%= camelized %></title>
|
6
|
+
<%%= csrf_meta_tags %>
|
7
|
+
<%%= csp_meta_tag %>
|
8
|
+
|
9
|
+
<%%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
10
|
+
<%%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
11
|
+
</head>
|
12
|
+
|
13
|
+
<body>
|
14
|
+
<%%= yield %>
|
15
|
+
</body>
|
16
|
+
</html>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: projecto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anto Dominic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -165,8 +165,12 @@ files:
|
|
165
165
|
- spec/support/capybara.rb
|
166
166
|
- spec/support/test_helper.rb
|
167
167
|
- templates/Gemfile.erb
|
168
|
+
- templates/Procfile
|
169
|
+
- templates/assets/config/manifest.js
|
170
|
+
- templates/assets/javascripts/application.js
|
168
171
|
- templates/rspec/rails_helper
|
169
172
|
- templates/rspec/spec_helper
|
173
|
+
- templates/views/application.html.erb
|
170
174
|
homepage: https://web-examiner.herokuapp.com
|
171
175
|
licenses:
|
172
176
|
- MIT
|