Module: GemDocs::Skeleton
- Defined in:
- lib/gem_docs/skeleton.rb
Class Method Summary collapse
- .changelog_present? ⇒ Boolean
- .make_changelog? ⇒ Boolean
-
.make_readme? ⇒ Boolean
String The overview from README per config.
- .readme_present? ⇒ Boolean
Class Method Details
.changelog_present? ⇒ Boolean
71 72 73 |
# File 'lib/gem_docs/skeleton.rb', line 71 def self.changelog_present? File.exist?(CHANGELOG_ORG) end |
.make_changelog? ⇒ Boolean
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/gem_docs/skeleton.rb', line 52 def self.make_changelog? return false if changelog_present? content = " * COMMENT CHANGELOG tips:\n 1. Don't dump your git change logs into this file, write them yourself.\n 2. Keep entries short and user-focused,\n 3. Use non-technical language, but do speak in the vocabulary of your gem.\n 4. Don't document changes only of interest to the programmers, just those the\n user would find useful.\n 5. Give each heading a version number and an inactive date (C-c ! is useful here).\n\n * Version 0.3.0 [2025-12-27 Sat]\n - First change\n - Second change\n SKEL\n File.write(CHANGELOG_ORG, content) > 0\nend\n" |
.make_readme? ⇒ Boolean
Returns String The overview from README per config.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/gem_docs/skeleton.rb', line 6 def self.make_readme? return false if readme_present? repo = Repo.from_gemspec content = " #+TITLE: \#{repo.module_name} Guide\n\n * Introduction\n\n * Installation\n\n #+begin_src sh :eval no\n bundle add \#{repo.name}\n #+end_src\n\n If bundler is not being used to manage dependencies, install the gem by executing:\n\n #+begin_src sh :eval no\n gem install \#{repo.name}\n #+end_src\n\n * Usage\n\n * Development\n After checking out the repo, run `bin/setup` to install dependencies. Then,\n run `rake spec` to run the tests. You can also run `bin/console` for an\n interactive prompt that will allow you to experiment.\n\n To install this gem onto your local machine, run `bundle exec rake\n install`.\n\n * Contributing\n Bug reports and pull requests are welcome on GitHub at\n https://github.com/\#{repo.user}/\#{repo.name}.\n\n * License\n The gem is available as open source under the terms of the [MIT\n License](https://opensource.org/licenses/MIT).\n SKEL\n File.write(README_ORG, content) > 0\nend\n" |
.readme_present? ⇒ Boolean
48 49 50 |
# File 'lib/gem_docs/skeleton.rb', line 48 def self.readme_present? File.exist?(README_ORG) end |