generate_rails_new 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ecb4c314a303acfbb87787234e9af42b20111e170e191a750dba60c45c2d045e
4
+ data.tar.gz: f5a41db922d2a35c566ec446802ca0b18a5b5451d9897c141d6a4930774bdd4d
5
+ SHA512:
6
+ metadata.gz: 0fe9a37a3c2241000364da7bc39f4a4fa1b45d687c936ee268bd2ae95d614c24cd803ce98e4fce04fad8b1a05d62d5f0ce4222bfcc30830e59611587f28fe816
7
+ data.tar.gz: 3d89ff0c3f6d06e6fae217fb7b686a1bb96f6db5c067fcfe9c7aa933c599292b85d86a7a6923d7b8fe12e7ead7a8a3047b471aae8777246ab172a279ced7b1b3
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ *.gem
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Arthur Hess
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # generate_rails_new
2
+
3
+ This is a command-line interface (CLI) tool that helps create a new Rails application with interactive options.
4
+
5
+ ## Installation
6
+
7
+ You can install it using RubyGems:
8
+
9
+ ```sh
10
+ gem install generate_rails_new
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ To generate a new Rails application, simply run:
16
+
17
+ ```sh
18
+ generate_rails_new
19
+ ```
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/generate_rails_new'
4
+
5
+ GenerateRailsNew.new.generate
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/generate_rails_new/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "generate_rails_new"
7
+ spec.version = GenerateRailsNew::VERSION
8
+ spec.authors = ["Arthur Hess"]
9
+ spec.email = ["contact@arthurhess.com"]
10
+ spec.summary = "CLI tool that helps create a new Rails application with interactive options."
11
+ spec.description = "This gem provides a CLI tool that helps create a new Rails application with interactive options."
12
+ spec.homepage = "https://github.com/arthurhess/generate_rails_new"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files`.split("\n")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.require_paths = ["lib"]
18
+
19
+ spec.add_dependency "thor", "~> 1.2"
20
+ end
21
+
@@ -0,0 +1,3 @@
1
+ module GenerateRailsNew
2
+ VERSION = "0.1.1"
3
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thor'
4
+
5
+ class GenerateRailsNew < Thor
6
+ desc 'generate', 'Build a new Rails application'
7
+ def generate
8
+ app_name = ask('What is the name of your application?', default: 'myapp')
9
+ database = ask('Which database do you want to use? [sqlite3]:',
10
+ limited_to: %w[mysql postgresql sqlite3 oracle sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc], default: 'sqlite3')
11
+
12
+ gitignore = yes?('Add a .gitignore file? [y/N]', :green)
13
+ action_mailer = yes?('Add Action Mailer? [y/N]', :green)
14
+ action_mailbox = yes?('Add Action Mailbox? [y/N]', :green)
15
+ action_text = yes?('Add Action Text? [y/N]', :green)
16
+ active_record = yes?('Add Active Record? [y/N]', :green)
17
+ active_job = yes?('Add Active Job? [y/N]', :green)
18
+ active_storage = yes?('Add Active Storage? [y/N]', :green)
19
+ action_cable = yes?('Add Action Cable? [y/N]', :green)
20
+
21
+ asset_pipeline = ask('Choose your asset pipeline? [sprockets]:', limited_to: %w[sprockets propshaft],
22
+ default: 'sprockets')
23
+
24
+ javascript = ask('Choose your JavaScript approach? [importmap]:', limited_to: %w[importmap webpack esbuild rollup],
25
+ default: 'importmap')
26
+
27
+ css = ask('Choose your CSS preprocessor? [sass]:', limited_to: %w[tailwind bootstrap bulma postcss sass],
28
+ default: 'sass')
29
+
30
+ bundle = yes?('Run bundle install? [y/N]', :green)
31
+
32
+ command = "rails new #{app_name} -d #{database}"
33
+ command << ' --skip-git' unless gitignore
34
+ command << ' --skip-action-mailer' unless action_mailer
35
+ command << ' --skip-action-mailbox' unless action_mailbox
36
+ command << ' --skip-action-text' unless action_text
37
+ command << ' --skip-active-record' unless active_record
38
+ command << ' --skip-active-job' unless active_job
39
+ command << ' --skip-active-storage' unless active_storage
40
+ command << ' --skip-action-cable' unless action_cable
41
+ command << " -a #{asset_pipeline}" unless asset_pipeline == 'sprockets'
42
+ command << " -j #{javascript}" unless javascript == 'importmap'
43
+ command << " -c #{css}" unless css == 'sass'
44
+ command << ' --skip-bundle' unless bundle
45
+
46
+ puts command
47
+ end
48
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: generate_rails_new
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Arthur Hess
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-03-30 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: '1.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
27
+ description: This gem provides a CLI tool that helps create a new Rails application
28
+ with interactive options.
29
+ email:
30
+ - contact@arthurhess.com
31
+ executables:
32
+ - generate_rails_new
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - ".gitignore"
37
+ - LICENSE
38
+ - README.md
39
+ - bin/generate_rails_new
40
+ - generate_rails_new.gemspec
41
+ - lib/generate_rails_new.rb
42
+ - lib/generate_rails_new/version.rb
43
+ homepage: https://github.com/arthurhess/generate_rails_new
44
+ licenses:
45
+ - MIT
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubygems_version: 3.4.6
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: CLI tool that helps create a new Rails application with interactive options.
66
+ test_files: []