rails_steroids 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2555fe6d42a3963553ceba0e1ef9b466985abe50ea9c787833ba43caea144df
4
- data.tar.gz: d2ba659d646e05b6e99a66ec5b353823a1ba0cd9c503ea0aea6951eeb6225d37
3
+ metadata.gz: 20eed22d7344f5356bef72c4d6e534fd8e4fcf2251592be8a0f5192f7039e4a1
4
+ data.tar.gz: c7c65d09a396d27c747fb41f3a243a624e03e56df0aab8bfe741ef523cacf468
5
5
  SHA512:
6
- metadata.gz: 36b3f7518d7ba5ca3d87e8ed55f9f44434b78e6ebddce6cc132c81bfb641d18c526ec92c34c1810ebae91ee847a7183a094a7eda6b7851388fedaed04dbfc778
7
- data.tar.gz: 6950a24fa5226da5fc959ab2fe99961a169ed21fbfafea2d690b124dde00802857d3f28c357f101942a0cc893448239fca51d26266b52806731dc2112ac30bcf
6
+ metadata.gz: f6dce3f695c637de507c9234d1823342c53a76e2ce90c565f2e92e95ba03f46903d96938e0656f20925375826941abca8976ce2b14bf2749972d48de593ce85a
7
+ data.tar.gz: 17081a16d54b6a377f0eff92f59d70c76eed563690f023a03ae14cad4eab8f316c7234d585f6e02cfc259208dc84c298719861a110c14bb41e592962be2a887b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.0] - 2024-02-04
4
+
5
+ - New steroid recipe: new_project (create new Rails project interactively)
6
+
3
7
  ## [0.1.0] - 2024-01-28
4
8
 
5
9
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_steroids (0.1.0)
4
+ rails_steroids (0.2.0)
5
5
  rails
6
6
  railties
7
7
  thor
data/README.md CHANGED
@@ -47,6 +47,7 @@ rails_steroids list
47
47
 
48
48
  | Functionality | Command |
49
49
  |---|---|
50
+ |new_project|`rails_steroids inject steroid:new_project`|
50
51
 
51
52
  ## Development
52
53
 
@@ -0,0 +1,26 @@
1
+ Description:
2
+ `steroid:new_project` will inject New Project functionality.
3
+
4
+ Usage Example:
5
+ # with installed gem
6
+ rails_steroids inject steroid:new_project
7
+ # with bundler
8
+ bin/rails g steroid:new_project
9
+
10
+ What will this do?:
11
+ Create new Rails application with configurations selected interactively.
12
+ Current options available to customize are:
13
+ * Ruby version
14
+ * Rails version
15
+ * Database: mysql, trilogy, postgresql, sqlite3, oracle, sqlserver, jdbcmysql, jdbcsqlite3, jdbcpostgresql, jdbc
16
+ * Asset Pipeline: sprockets, propshaft
17
+ * CSS Processor: tailwind, bootstrap, bulma, postcss, sass
18
+ * Javascript Approach: importmap, bun, webpack, esbuild, rollup
19
+ * API only mode
20
+ * Skip Jbuilder
21
+ * Skip git init, .gitignore and .gitattributes
22
+ * Skip Dockerfile, .dockerignore and bin/docker-entrypoint
23
+ * Skip Action Cable files
24
+ * Skip Hotwire integration
25
+ * Skip test files
26
+ * Skip system test files
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Steroid
4
+ class NewProjectGenerator < Rails::Generators::Base
5
+ desc "Adds New Project to the application"
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ def add_new_project
9
+ say "Injecting steroid: New Project"
10
+ project_name = ask("What is the great name of your Rails project?")
11
+ project_name_underscored = project_name.underscore
12
+ empty_directory project_name_underscored
13
+ ruby_version = ask("Which Ruby version would you like to use?").strip
14
+ create_file "#{project_name_underscored}/.ruby_version" do
15
+ ruby_version
16
+ end
17
+ run "cd #{project_name_underscored}"
18
+ cmd = ["rails"]
19
+ current_rails_version = `rails --version`.gsub('Rails ', '')
20
+ rails_version = ask("Which Rails version would you like to use? You can find Rails version from https://rubygems.org/gems/rails/versions. Current default version is #{current_rails_version}")
21
+ rails_version = rails_version.present? ? rails_version : current_rails_version
22
+ cmd << "_#{rails_version}_"
23
+ cmd << "new"
24
+ cmd << project_name
25
+
26
+ database_name = ask("Choose your database (options: mysql, trilogy, postgresql, sqlite3, oracle, sqlserver, jdbcmysql, jdbcsqlite3, jdbcpostgresql, jdbc)")
27
+ cmd << "--database #{database_name}"
28
+
29
+ asset_pipeline = ask("Choose your asset pipeline (options: sprockets, propshaft)")
30
+ cmd << "--asset-pipeline #{asset_pipeline}"
31
+
32
+ css = ask("Choose CSS processor (options: tailwind, bootstrap, bulma, postcss, sass)")
33
+ cmd << "--css #{css}"
34
+
35
+ js = ask("Choose JavaScript approach (options: importmap, bun, webpack, esbuild, rollup)")
36
+ cmd << "--javascript #{js}"
37
+
38
+ cmd << "--api" if yes?("API only application? (yes/no)")
39
+ cmd << "--skip-jbuilder" if yes?("Skip jbuilder? (yes/no)")
40
+ cmd << "--skip-git" if yes?("Skip git init, .gitignore and .gitattributes? (yes/no)")
41
+ cmd << "--skip-docker" if yes?("Skip Dockerfile, .dockerignore and bin/docker-entrypoint? (yes/no)")
42
+ cmd << "--skip-action-cable" if yes?("Skip Action Cable files? (yes/no)")
43
+ cmd << "--skip-hotwire" if yes?("Skip Hotwire integration? (yes/no)")
44
+ cmd << "--skip-test" if yes?("Skip test files? (yes/no)")
45
+ cmd << "--skip-system-test" if yes?("Skip system test files? (yes/no)")
46
+ cmd << "--no-rc"
47
+ run cmd.join(" ")
48
+ end
49
+ end
50
+ end
@@ -6,12 +6,12 @@ class SteroidGenerator < Rails::Generators::NamedBase
6
6
  # frozen_string_literal: true
7
7
 
8
8
  module Steroid
9
- class #{name.titlecase}Generator < Rails::Generators::Base
9
+ class #{name.camelize}Generator < Rails::Generators::Base
10
10
  desc "Adds #{name.titlecase} to the application"
11
11
  source_root File.expand_path("templates", __dir__)
12
12
 
13
13
  def add_#{name}
14
- say "Injecting steroid: #{name.titlecase}"
14
+ say "Injecting steroid: #{name.titlecase}", :green
15
15
  # Add your other code here or any additional methods below this method
16
16
  end
17
17
  end
@@ -25,6 +25,7 @@ module RailsSteroids
25
25
  puts "| Functionality | Command |"
26
26
  puts "|---|---|"
27
27
  steroid_names = [
28
+ 'new_project',
28
29
  ]
29
30
  steroid_names.each do |steroid|
30
31
  puts "|#{steroid.titlecase}|`rails_steroids inject steroid:#{steroid}`|"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsSteroids
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_steroids
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anand Bait
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-30 00:00:00.000000000 Z
11
+ date: 2024-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -118,6 +118,8 @@ files:
118
118
  - bin/console
119
119
  - bin/rails_steroids
120
120
  - bin/setup
121
+ - lib/generators/steroid/new_project/USAGE
122
+ - lib/generators/steroid/new_project/new_project_generator.rb
121
123
  - lib/generators/steroid/steroid_generator.rb
122
124
  - lib/rails_steroids.rb
123
125
  - lib/rails_steroids/cli.rb