From 31f976e0b6fd81db912bac88132a1938084083a7 Mon Sep 17 00:00:00 2001 From: joaoGabriel55 Date: Sun, 18 Aug 2024 19:10:41 -0300 Subject: [PATCH 1/6] fix: update config.ru file --- lib/sinatra_scaffold/cli.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sinatra_scaffold/cli.rb b/lib/sinatra_scaffold/cli.rb index 80f398b..55a62c6 100644 --- a/lib/sinatra_scaffold/cli.rb +++ b/lib/sinatra_scaffold/cli.rb @@ -27,7 +27,7 @@ def create_directory_structure(app_name) def create_main_files(app_name) File.write("#{app_name}/config.ru", <<~RUBY) - require "./app" + require "./server" run Sinatra::Application RUBY @@ -131,6 +131,7 @@ def app gem "sinatra" gem "dotenv" gem "rake" + gem "rackup" group :test do gem "rack-test" From 73b69382a6761f1913d2b1e7222466899605975c Mon Sep 17 00:00:00 2001 From: joaoGabriel55 Date: Sun, 18 Aug 2024 19:17:13 -0300 Subject: [PATCH 2/6] build: add rerun lib --- lib/sinatra_scaffold/cli.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/sinatra_scaffold/cli.rb b/lib/sinatra_scaffold/cli.rb index 55a62c6..392b72e 100644 --- a/lib/sinatra_scaffold/cli.rb +++ b/lib/sinatra_scaffold/cli.rb @@ -141,6 +141,7 @@ def app group :development, :test do gem "pry" gem "standard" + gem "rerun" end RUBY @@ -160,10 +161,18 @@ def app My Sinatra application ## Running - Run: + Using ruby: ```sh ruby server.rb ``` + Running watching changes: + ```sh + rerun ruby server.rb + ``` + Running with rackup: + ```sh + bundle exec rackup config.ru -p 3000 + ``` ## Testing Run: From fc2f7d0189f56adb1e17454f00019176c13c4f17 Mon Sep 17 00:00:00 2001 From: joaoGabriel55 Date: Sun, 18 Aug 2024 19:20:31 -0300 Subject: [PATCH 3/6] build: bump version --- CHANGELOG.md | 6 ++++++ lib/sinatra_scaffold/version.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aec18fe..5b23e58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,3 +3,9 @@ ## [0.1.0] - 2024-08-16 - Initial release + +## [0.1.1] - 2024-08-18 + +- Update `config.ru` file +- Added `rackup` gem +- Added `rerun` gem to enable auto restart of server after code changes \ No newline at end of file diff --git a/lib/sinatra_scaffold/version.rb b/lib/sinatra_scaffold/version.rb index b8381e5..19e28bb 100644 --- a/lib/sinatra_scaffold/version.rb +++ b/lib/sinatra_scaffold/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module SinatraScaffold - VERSION = "0.1.0" + VERSION = "0.1.1" end From 6468bdae7d757e8c95027b83e502377d4e0fff7b Mon Sep 17 00:00:00 2001 From: joaoGabriel55 Date: Sun, 18 Aug 2024 19:22:23 -0300 Subject: [PATCH 4/6] docs: update README.md --- .gitignore | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b795af9..de5eb49 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,4 @@ # rspec failure tracking .rspec_status -sinatra-scaffold-0.1.0.gem +*.gem diff --git a/README.md b/README.md index 54ddaeb..bbe1591 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ bundle install Build and install gem locally ```sh -gem build sinatra-scaffold.gemspec && gem install ./sinatra-scaffold-0.1.0.gem +gem build sinatra-scaffold.gemspec && gem install ./sinatra-scaffold-[version].gem ``` Run lint From f11111d030bb452a1cdb7ebe43d1141dbeec2a36 Mon Sep 17 00:00:00 2001 From: joaoGabriel55 Date: Sun, 18 Aug 2024 19:30:50 -0300 Subject: [PATCH 5/6] build: update rspec version --- sinatra-scaffold.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sinatra-scaffold.gemspec b/sinatra-scaffold.gemspec index 7e32a10..8f084c8 100644 --- a/sinatra-scaffold.gemspec +++ b/sinatra-scaffold.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| # Uncomment to register a new dependency of your gem spec.add_development_dependency "standard", "~> 1.3" spec.add_development_dependency "rake", "~> 13.0" - spec.add_development_dependency "rspec", "~> 1.3" + spec.add_development_dependency "rspec", "~> 3.0" spec.add_dependency "thor", "~> 1.3" # For more information and examples about making a new gem, check out our From 04c6ad20b3edd238612c0c2e66b0eae7ec2183af Mon Sep 17 00:00:00 2001 From: joaoGabriel55 Date: Sun, 18 Aug 2024 19:32:21 -0300 Subject: [PATCH 6/6] build: update Gemfile.lock --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 85543ac..0e2009f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - sinatra-scaffold (0.1.0) + sinatra-scaffold (0.1.1) thor (~> 1.3) GEM