rundoc 1.1.3 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/check_changelog.yml +16 -7
  3. data/.github/workflows/ci.yml +48 -0
  4. data/.standard.yml +6 -0
  5. data/CHANGELOG.md +12 -0
  6. data/Gemfile +1 -1
  7. data/README.md +98 -5
  8. data/Rakefile +9 -10
  9. data/lib/rundoc/cli.rb +15 -17
  10. data/lib/rundoc/code_command/background/log/clear.rb +1 -1
  11. data/lib/rundoc/code_command/background/log/read.rb +1 -1
  12. data/lib/rundoc/code_command/background/process_spawn.rb +8 -9
  13. data/lib/rundoc/code_command/background/start.rb +7 -7
  14. data/lib/rundoc/code_command/background/stop.rb +1 -1
  15. data/lib/rundoc/code_command/background/wait.rb +2 -2
  16. data/lib/rundoc/code_command/background.rb +6 -6
  17. data/lib/rundoc/code_command/bash/cd.rb +6 -7
  18. data/lib/rundoc/code_command/bash.rb +10 -12
  19. data/lib/rundoc/code_command/file_command/append.rb +12 -16
  20. data/lib/rundoc/code_command/file_command/remove.rb +6 -9
  21. data/lib/rundoc/code_command/no_such_command.rb +0 -1
  22. data/lib/rundoc/code_command/pipe.rb +2 -5
  23. data/lib/rundoc/code_command/print/erb.rb +48 -0
  24. data/lib/rundoc/code_command/print/text.rb +33 -0
  25. data/lib/rundoc/code_command/raw.rb +1 -1
  26. data/lib/rundoc/code_command/rundoc/depend_on.rb +0 -1
  27. data/lib/rundoc/code_command/rundoc/require.rb +2 -3
  28. data/lib/rundoc/code_command/rundoc_command.rb +3 -4
  29. data/lib/rundoc/code_command/website/driver.rb +17 -17
  30. data/lib/rundoc/code_command/website/navigate.rb +2 -2
  31. data/lib/rundoc/code_command/website/screenshot.rb +1 -1
  32. data/lib/rundoc/code_command/website/visit.rb +4 -5
  33. data/lib/rundoc/code_command/website.rb +4 -4
  34. data/lib/rundoc/code_command/write.rb +10 -11
  35. data/lib/rundoc/code_command.rb +28 -17
  36. data/lib/rundoc/code_section.rb +42 -25
  37. data/lib/rundoc/parser.rb +17 -19
  38. data/lib/rundoc/peg_parser.rb +57 -59
  39. data/lib/rundoc/version.rb +1 -1
  40. data/lib/rundoc.rb +10 -14
  41. data/rundoc.gemspec +19 -21
  42. data/test/fixtures/rails_4/rundoc.md +92 -30
  43. data/test/fixtures/rails_5/rundoc.md +69 -10
  44. data/test/fixtures/rails_6/rundoc.md +226 -165
  45. data/test/fixtures/rails_7/rundoc.md +477 -0
  46. data/test/integration/print_test.rb +194 -0
  47. data/test/rundoc/code_commands/append_file_test.rb +5 -8
  48. data/test/rundoc/code_commands/background_test.rb +3 -6
  49. data/test/rundoc/code_commands/bash_test.rb +7 -9
  50. data/test/rundoc/code_commands/pipe_test.rb +9 -9
  51. data/test/rundoc/code_commands/print_test.rb +94 -0
  52. data/test/rundoc/code_commands/remove_contents_test.rb +4 -5
  53. data/test/rundoc/code_section_test.rb +50 -56
  54. data/test/rundoc/parser_test.rb +28 -61
  55. data/test/rundoc/peg_parser_test.rb +49 -53
  56. data/test/rundoc/regex_test.rb +141 -126
  57. data/test/rundoc/test_parse_java.rb +1 -3
  58. data/test/test_helper.rb +4 -6
  59. metadata +39 -42
  60. data/.travis.yml +0 -8
  61. data/lib/rundoc/code_command/repl.rb +0 -37
@@ -1,5 +1,5 @@
1
1
  ```
2
- :::- rundoc
2
+ :::-- rundoc
3
3
  email = ENV['HEROKU_EMAIL'] || `heroku auth:whoami`
4
4
 
5
5
  Rundoc.configure do |config|
@@ -13,7 +13,15 @@ end
13
13
  -->
14
14
 
15
15
  > warning
16
- > The latest version of Rails available is [Rails 5](https://devcenter.heroku.com/articles/getting-started-with-rails5). If you are starting a new application we recommend you use the most recently released version.
16
+ > This article is archived. It is no longer receiving updates. It is presented here for historical reference only.
17
+ > We cannot guarantee that any statements made are correct or that the instructions will still work.
18
+ > This version of Rails is [no longer supported by Ruby core](https://guides.rubyonrails.org/maintenance_policy.html).
19
+ > If you are starting a new application, we recommend you use the most recently released version of Rails.
20
+
21
+ >warning
22
+ >As of November 28th, 2022, free Heroku dynos, free Heroku Postgres and free Heroku Data for Redis plans are [no longer available](https://blog.heroku.com/next-chapter).
23
+ >
24
+ >We recommend using our [low-cost plans](https://blog.heroku.com/new-low-cost-plans) to complete this tutorial. Eligible students can apply for platform credits through our new [Heroku for GitHub Students program](https://blog.heroku.com/github-student-developer-program).
17
25
 
18
26
  Ruby on Rails is a popular web framework written in [Ruby](http://www.ruby-lang.org/). This guide covers using Rails 4 on Heroku. For information about running previous versions of Rails on Heroku, see [Getting Started with Rails 3.x on Heroku](getting-started-with-rails3).
19
27
 
@@ -24,7 +32,8 @@ For this guide you will need:
24
32
  - Basic Ruby/Rails knowledge
25
33
  - Locally installed version of Ruby 2.0.0+, Rubygems, Bundler, and Rails 4+
26
34
  - Basic Git knowledge
27
- - A Heroku user account: [Signup is free and instant](https://signup.heroku.com/devcenter)
35
+ - A [verified Heroku Account](https://devcenter.heroku.com/articles/account-verification)
36
+ - A subscription to the [Eco dynos plan](eco-dyno-hours) (recommended)
28
37
 
29
38
  ## Local Workstation Setup
30
39
 
@@ -71,14 +80,14 @@ Then create a new app:
71
80
  -->
72
81
 
73
82
  ```term
74
- $ rails new myapp --database=postgresql
75
- :::- $ rails _4.2.9_ new myapp --database=postgresql
83
+ $ rails _4.2.9_ new myapp --database=postgresql
84
+ :::-- $ rails _4.2.9_ new myapp --database=postgresql
76
85
  ```
77
86
 
78
87
  Then move into your application directory.
79
88
 
80
89
  ```term
81
- :::> $ cd myapp
90
+ :::>- $ cd myapp
82
91
  ```
83
92
 
84
93
  > callout If you experience problems or get stuck with this tutorial, your questions may be answered in a later part of this document. Once you experience a problem try reading through the entire document and then going back to your issue. It can also be useful to review your previous steps to ensure they all executed correctly.
@@ -110,7 +119,7 @@ In addition to using the `pg` gem, you'll also need to ensure the `config/databa
110
119
  The development section of your `config/database.yml` file should look something like this:
111
120
 
112
121
  ```term
113
- :::> $ cat config/database.yml
122
+ :::>- $ cat config/database.yml
114
123
  :::>> | $ head -n 23
115
124
  ```
116
125
 
@@ -122,7 +131,7 @@ Rails 4 no longer has a static index page in production. When you're using a new
122
131
 
123
132
 
124
133
  ```term
125
- :::> $ rails generate controller welcome
134
+ :::>- $ rails generate controller welcome
126
135
  ```
127
136
 
128
137
  Next we'll add an index page.
@@ -162,7 +171,7 @@ gem 'rails_12factor', group: :production
162
171
  Then run:
163
172
 
164
173
  ```term
165
- :::> $ bundle install
174
+ :::>- $ bundle install
166
175
  ```
167
176
 
168
177
  We talk more about Rails integration on our [Ruby Support page](https://devcenter.heroku.com/articles/ruby-support#injected-plugins).
@@ -183,7 +192,7 @@ You should also be running the same version of Ruby locally. You can verify by r
183
192
  Heroku relies on [git](http://git-scm.com/), a distributed source control managment tool, for deploying your project. If your project is not already in git first verify that `git` is on your system:
184
193
 
185
194
  ```term
186
- :::> $ git --help
195
+ :::>- $ git --help
187
196
  :::-> | $ head -n 5
188
197
  ```
189
198
 
@@ -200,9 +209,9 @@ The output should look like this:
200
209
  Now run these commands in your Rails app directory to initialize and commit your code to git:
201
210
 
202
211
  ```term
203
- :::> $ git init
204
- :::> $ git add .
205
- :::> $ git commit -m "init"
212
+ :::>- $ git init
213
+ :::>- $ git add .
214
+ :::>- $ git commit -m "init"
206
215
  ```
207
216
 
208
217
  You can verify everything was committed correctly by running:
@@ -213,12 +222,15 @@ You can verify everything was committed correctly by running:
213
222
 
214
223
  Now that your application is committed to git you can deploy to Heroku.
215
224
 
216
- ## Deploy your application to Heroku
225
+ ## Create a Heroku app
226
+
227
+ >warning
228
+ >Using a dyno and a database to complete this tutorial counts towards your usage. [Delete your app](https://devcenter.heroku.com/articles/heroku-cli-commands#heroku-apps-destroy), and [database](https://devcenter.heroku.com/articles/heroku-postgresql#removing-the-add-on) as soon as you're done to control costs.
217
229
 
218
230
  Make sure you are in the directory that contains your Rails app, then create an app on Heroku:
219
231
 
220
232
  ```term
221
- :::>> $ heroku create
233
+ :::>> $ heroku create --stack heroku-20
222
234
  ```
223
235
 
224
236
  You can verify that the remote was added to your project by running
@@ -232,6 +244,26 @@ If you see `fatal: not in a git directory` then you are likely not in the correc
232
244
  >note
233
245
  >Following changes in the industry, Heroku has updated our default git branch name to `main`. If the project you’re deploying uses `master` as its default branch name, use `git push heroku master`.
234
246
 
247
+ ## Provision a Database
248
+
249
+ Provision a Postgresql database using Add-ons.
250
+
251
+ >note
252
+ >A `mini` Postgres size costs [$5 a month, prorated to the minute](https://elements.heroku.com/addons/heroku-postgresql). At the end of this tutorial, you will be prompted to [delete your database](https://devcenter.heroku.com/articles/heroku-postgresql#removing-the-add-on) to minimize costs.
253
+
254
+ ```term
255
+ $ heroku addons:create heroku-postgresql:essential-0
256
+ Creating heroku-postgresql:essential-0 on ⬢ shrouded-anchorage-34700... ~$0.007/hour (max $5/month)
257
+ Database should be available soon
258
+ postgresql-encircled-75487 is being created in the background. The app will restart when complete...
259
+ Use heroku addons:info postgresql-encircled-75487 to check creation progress
260
+ Use heroku addons:docs heroku-postgresql to view documentation
261
+ ```
262
+
263
+ Your Heroku app now has access to a Postgresql database. The credentials are stored in the `DATABASE_URL` environment variable, which Rails will connect to by convention.
264
+
265
+ ## Deploy your application to Heroku
266
+
235
267
  Deploy your code:
236
268
 
237
269
  ```term
@@ -242,7 +274,7 @@ It is always a good idea to check to see if there are any warnings or errors in
242
274
 
243
275
  ## Migrate your database
244
276
 
245
- If you are using the database in your application you need to manually migrate the database by running:
277
+ If you are using the database in your application, trigger a migration by using the Heroku CLI to start a one-off [dyno](dynos), which is a lightweight container that is the basic unit of composition on Heroku, and run `db:migrate`:
246
278
 
247
279
  ```term
248
280
  $ heroku run rake db:migrate
@@ -258,7 +290,7 @@ You've deployed your code to Heroku. You can now instruct Heroku to execute a pr
258
290
  Let's ensure we have one dyno running the `web` process type:
259
291
 
260
292
  ```term
261
- :::> $ heroku ps:scale web=1
293
+ :::>- $ heroku ps:scale web=1
262
294
  ```
263
295
 
264
296
  You can check the state of the app's dynos. The `heroku ps` command lists the running dynos of your application:
@@ -297,13 +329,13 @@ $ heroku logs --tail
297
329
 
298
330
  ## Dyno sleeping and scaling
299
331
 
300
- By default, your app is deployed on a free dyno. Free dynos will sleep after a half hour of inactivity and they can be active (receiving traffic) for no more than 18 hours a day before [going to sleep](dynos#dyno-sleeping). If a free dyno is sleeping, and it hasn't exceeded the 18 hours, any web request will wake it. This causes a delay of a few seconds for the first request upon waking. Subsequent requests will perform normally.
332
+ By default, your app is deployed on an eco dyno. Eco dynos will sleep after a half hour of inactivity and they can be active (receiving traffic) for no more than 18 hours a day before [going to sleep](dynos#dyno-sleeping). If an eco dyno is sleeping, and it hasn't exceeded the 18 hours, any web request will wake it. This causes a delay of a few seconds for the first request upon waking. Subsequent requests will perform normally.
301
333
 
302
334
  ```term
303
335
  $ heroku ps:scale web=1
304
336
  ```
305
337
 
306
- To avoid dyno sleeping, you can upgrade to a hobby or professional dyno type as described in the [Dyno Types](dyno-types) article. For example, if you migrate your app to a professional dyno, you can easily scale it by running a command telling Heroku to execute a specific number of dynos, each running your web process type.
338
+ To avoid dyno sleeping, you can upgrade to a Basic or Professional dyno type as described in the [Dyno Types](dyno-types) article. For example, if you migrate your app to a professional dyno, you can easily scale it by running a command telling Heroku to execute a specific number of dynos, each running your web process type.
307
339
 
308
340
  ## Console
309
341
 
@@ -331,13 +363,13 @@ First, add Puma to your application `Gemfile`:
331
363
 
332
364
  ```ruby
333
365
  :::>> file.append Gemfile
334
- gem 'puma'
366
+ #gem 'puma'
335
367
  ```
336
368
 
337
369
  Then run
338
370
 
339
371
  ```term
340
- :::> $ bundle install
372
+ :::>- $ bundle install
341
373
  ```
342
374
 
343
375
  Now you are ready to configure your app to use Puma. For this tutorial we will use the default settings of Puma, but we recommend generating a `config/puma.rb` file and reading more about configuring your application for maximum performance by [reading the Puma documentation](https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server)
@@ -369,15 +401,15 @@ Set the `RACK_ENV` to development in your environment and a `PORT` to connect to
369
401
  You'll also want to add `.env` to your `.gitignore` since this is for local enviroment setup.
370
402
 
371
403
  ```term
372
- :::> $ echo ".env" >> .gitignore
373
- :::> $ git add .gitignore
374
- :::> $ git commit -m "add .env to .gitignore"
404
+ :::>- $ echo ".env" >> .gitignore
405
+ :::>- $ git add .gitignore
406
+ :::>- $ git commit -m "add .env to .gitignore"
375
407
  ```
376
408
 
377
409
  Test your Procfile locally using Foreman:
378
410
 
379
411
  ```term
380
- :::> $ gem install foreman
412
+ :::>- $ gem install foreman
381
413
  ```
382
414
 
383
415
  You can now start your web server by running
@@ -395,9 +427,9 @@ $ foreman start
395
427
  Looks good, so press Ctrl-C to exit and you can deploy your changes to Heroku:
396
428
 
397
429
  ```term
398
- :::> $ git add .
399
- :::> $ git commit -m "use puma via procfile"
400
- :::> $ git push heroku main
430
+ :::>- $ git add .
431
+ :::>- $ git commit -m "use puma via procfile"
432
+ :::>- $ git push heroku main
401
433
  ```
402
434
 
403
435
  Check `ps`, you'll see the web process uses your new command specifying Puma as the web server
@@ -465,6 +497,36 @@ end
465
497
 
466
498
  Confirm it works locally, then push to Heroku.
467
499
 
468
- ## Done
500
+ ## Next Steps
501
+
502
+ Congratulations on deploying a Rails 5 application! To continue exploring, review the following articles next:
503
+
504
+ * Visit the [Ruby support category](/categories/ruby-support) to learn more about using Ruby and Rails on Heroku.
505
+ * The [Deployment category](/categories/deployment) provides a variety of powerful integrations and features to help streamline and simplify your deployments.
506
+
507
+ ## Deleting your app and Add-on
508
+
509
+ If you don't need this application and database, you can now remove them from your account. You'll only be charged for the resources you used.
510
+
511
+ >warning
512
+ >This will remove your add-on you'll lose any data saved in the database.
513
+
514
+ ```term
515
+ $ heroku addons:destroy heroku-postgresql
516
+ ```
517
+
518
+ >warning
519
+ >This will delete your application
520
+
521
+ ```term
522
+ $ heroku apps:destroy
523
+ ```
524
+
525
+ You can confirm that your add-on and app are gone with the commands:
526
+
527
+ ```term
528
+ $ heroku addons --all
529
+ $ heroku apps -all
530
+ ```
469
531
 
470
- You now have your first application deployed to Heroku. The next step is to deploy your own application. If you're interested in reading more you can read more about [Ruby on Heroku at the Devcenter](https://devcenter.heroku.com/categories/ruby).
532
+ You're now ready to <a href= "https://devcenter.heroku.com/articles/preparing-a-codebase-for-heroku-deployment" target= "_blank">deploy your app</a>.
@@ -15,17 +15,29 @@ end
15
15
  $ bin/rundoc build --path test/fixtures/rails_5/rundoc.md
16
16
  -->
17
17
 
18
+ > warning
19
+ > This article is archived. It is no longer receiving updates. It is presented here for historical reference only.
20
+ > We cannot guarantee that any statements made are correct or that the instructions will still work.
21
+ > This version of Rails is [no longer supported by Ruby core](https://guides.rubyonrails.org/maintenance_policy.html).
22
+ > If you are starting a new application, we recommend you use the most recently released version of Rails.
23
+
24
+ >warning
25
+ >As of November 28th, 2022, free Heroku dynos, free Heroku Postgres and free Heroku Data for Redis plans are [no longer available](https://blog.heroku.com/next-chapter).
26
+ >
27
+ >We recommend using our [low-cost plans](https://blog.heroku.com/new-low-cost-plans) to complete this tutorial. Eligible students can apply for platform credits through our new [Heroku for GitHub Students program](https://blog.heroku.com/github-student-developer-program).
28
+
18
29
  Ruby on Rails is a popular web framework written in [Ruby](http://www.ruby-lang.org/). This guide covers using Rails 5 on Heroku. For information on running previous versions of Rails on Heroku, see the tutorial for [Rails 4.x](getting-started-with-rails4) or [Rails 3.x](getting-started-with-rails3).
19
30
 
20
31
  ```
21
- :::-- $ ruby -e "exit 1 unless RUBY_VERSION == '2.6.3'"
32
+ :::-- $ ruby -e "exit 1 unless RUBY_VERSION == '2.7.8'"
22
33
  ```
23
34
 
24
35
  For this guide you will need:
25
36
 
26
37
  - Basic familiarity with Ruby/Rails and Git
27
38
  - A locally installed version of Ruby 2.2.0+, Rubygems, Bundler, and Rails 5+
28
- - A Heroku user account: [Signup is free and instant](https://signup.heroku.com/devcenter).
39
+ - A [verified Heroku Account](https://devcenter.heroku.com/articles/account-verification)
40
+ - A subscription to the [Eco dynos plan](eco-dyno-hours) (recommended)
29
41
 
30
42
  ## Local setup
31
43
 
@@ -66,6 +78,8 @@ Then move into your application directory.
66
78
 
67
79
  ```term
68
80
  :::>- $ cd myapp
81
+ :::>> $ bundle lock --add-platform x86_64-linux --add-platform ruby
82
+ :::>- $ bundle install
69
83
  ```
70
84
 
71
85
  Create a database locally:
@@ -164,7 +178,7 @@ Rails 5 requires Ruby 2.2.0 or above. Heroku has a recent version of Ruby instal
164
178
  ```ruby
165
179
  :::-- $ sed -i'' -e '/^ruby/d' ./Gemfile
166
180
  :::-> file.append Gemfile#4
167
- ruby "2.6.3"
181
+ ruby "2.7.8"
168
182
  ```
169
183
 
170
184
  You should also be running the same version of Ruby locally. You can check this by running `$ ruby -v`. You can get more information on [specifying your Ruby version on Heroku here](https://devcenter.heroku.com/articles/ruby-versions).
@@ -204,12 +218,15 @@ You can verify everything was committed correctly by running:
204
218
 
205
219
  Now that your application is committed to Git you can deploy to Heroku.
206
220
 
207
- ## Deploy your application to Heroku
221
+ ## Create a Heroku app
222
+
223
+ >warning
224
+ >Using a dyno and a database to complete this tutorial counts towards your usage. [Delete your app](https://devcenter.heroku.com/articles/heroku-cli-commands#heroku-apps-destroy), and [database](https://devcenter.heroku.com/articles/heroku-postgresql#removing-the-add-on) as soon as you're done to control costs.
208
225
 
209
226
  Make sure you are in the directory that contains your Rails app, then create an app on Heroku:
210
227
 
211
228
  ```term
212
- :::>> $ heroku create
229
+ :::>> $ heroku create --stack heroku-20
213
230
  ```
214
231
 
215
232
  You can verify that the remote was added to your project by running:
@@ -224,6 +241,21 @@ If you see `fatal: not in a git directory` then you are likely not in the correc
224
241
  >note
225
242
  >Following changes in the industry, Heroku has updated our default git branch name to `main`. If the project you’re deploying uses `master` as its default branch name, use `git push heroku master`.
226
243
 
244
+ ## Provision a Database
245
+
246
+ Provision a Postgresql database using Add-ons.
247
+
248
+ >note
249
+ >A `mini` Postgres size costs [$5 a month, prorated to the minute](https://elements.heroku.com/addons/heroku-postgresql). At the end of this tutorial, you will be prompted to [delete your database](https://devcenter.heroku.com/articles/heroku-postgresql#removing-the-add-on) to minimize costs.
250
+
251
+ ```term
252
+ :::>> $ heroku addons:create heroku-postgresql:essential-0
253
+ ```
254
+
255
+ Your Heroku app now has access to a Postgresql database. The credentials are stored in the `DATABASE_URL` environment variable, which Rails will connect to by convention.
256
+
257
+ ## Deploy your application to Heroku
258
+
227
259
  Deploy your code:
228
260
 
229
261
  ```term
@@ -234,7 +266,7 @@ It is always a good idea to check to see if there are any warnings or errors in
234
266
 
235
267
  ## Migrate your database
236
268
 
237
- If you are using the database in your application, you need to manually migrate the database by running:
269
+ If you are using the database in your application, trigger a migration by using the Heroku CLI to start a one-off [dyno](dynos), which is a lightweight container that is the basic unit of composition on Heroku, and run `db:migrate`:
238
270
 
239
271
  ```term
240
272
  $ heroku run rake db:migrate
@@ -288,9 +320,9 @@ $ heroku logs --tail
288
320
 
289
321
  ## Dyno sleeping and scaling
290
322
 
291
- By default, new applications are deployed to a free dyno. Free apps will "sleep" to conserve resources. You can find more information about this behavior by reading about [free dyno behavior](free-dyno-hours).
323
+ By default, new applications are deployed to an eco dyno. Eco apps will "sleep" to conserve resources. You can find more information about this behavior by reading about [eco dyno behavior](eco-dyno-hours).
292
324
 
293
- To avoid dyno sleeping, you can upgrade to a hobby or professional dyno type as described in the [Dyno Types](dyno-types) article. For example, if you migrate your app to a professional dyno, you can easily scale it by running a command telling Heroku to execute a specific number of dynos, each running your web process type.
325
+ To avoid dyno sleeping, you can upgrade to a Basic or Professional dyno type as described in the [Dyno Types](dyno-types) article. For example, if you migrate your app to a Professional dyno, you can easily scale it by running a command telling Heroku to execute a specific number of dynos, each running your web process type.
294
326
 
295
327
  ## Run the Rails console
296
328
 
@@ -441,9 +473,36 @@ end
441
473
 
442
474
  Confirm it works locally, then push to Heroku.
443
475
 
444
- ## Next steps
476
+ ## Next Steps
445
477
 
446
- Congratulations! You have deployed your first Rails 5 application to Heroku. Here's some recommended reading:
478
+ Congratulations on deploying a Rails 5 application! To continue exploring, review the following articles next:
447
479
 
448
480
  * Visit the [Ruby support category](/categories/ruby-support) to learn more about using Ruby and Rails on Heroku.
449
481
  * The [Deployment category](/categories/deployment) provides a variety of powerful integrations and features to help streamline and simplify your deployments.
482
+
483
+ ## Deleting your app and Add-on
484
+
485
+ If you don't need this application and database, you can now remove them from your account. You'll only be charged for the resources you used.
486
+
487
+ >warning
488
+ >This will remove your add-on you'll lose any data saved in the database.
489
+
490
+ ```term
491
+ $ heroku addons:destroy heroku-postgresql
492
+ ```
493
+
494
+ >warning
495
+ >This will delete your application
496
+
497
+ ```term
498
+ $ heroku apps:destroy
499
+ ```
500
+
501
+ You can confirm that your add-on and app are gone with the commands:
502
+
503
+ ```term
504
+ $ heroku addons --all
505
+ $ heroku apps -all
506
+ ```
507
+
508
+ You're now ready to <a href= "https://devcenter.heroku.com/articles/preparing-a-codebase-for-heroku-deployment" target= "_blank">deploy your app</a>.