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/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/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 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 diff --git a/lib/sinatra_scaffold/cli.rb b/lib/sinatra_scaffold/cli.rb index 80f398b..392b72e 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" @@ -140,6 +141,7 @@ def app group :development, :test do gem "pry" gem "standard" + gem "rerun" end RUBY @@ -159,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: 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 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