dopstick 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.github/FUNDING.yml +4 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +41 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
  5. data/.github/PULL_REQUEST_TEMPLATE.md +38 -0
  6. data/.github/workflows/tests.yml +55 -0
  7. data/.gitignore +11 -0
  8. data/.rubocop.yml +21 -0
  9. data/CHANGELOG.md +16 -0
  10. data/CODE_OF_CONDUCT.md +74 -0
  11. data/CONTRIBUTING.md +79 -0
  12. data/Gemfile +5 -0
  13. data/LICENSE.md +20 -0
  14. data/README.md +56 -0
  15. data/Rakefile +15 -0
  16. data/bin/console +16 -0
  17. data/bin/setup +10 -0
  18. data/dopstick.gemspec +45 -0
  19. data/exe/dopstick +5 -0
  20. data/lib/dopstick.rb +12 -0
  21. data/lib/dopstick/cli.rb +89 -0
  22. data/lib/dopstick/generator.rb +214 -0
  23. data/lib/dopstick/refinements.rb +24 -0
  24. data/lib/dopstick/templates/CHANGELOG.md +16 -0
  25. data/lib/dopstick/templates/active_record.erb +23 -0
  26. data/lib/dopstick/templates/bin.erb +5 -0
  27. data/lib/dopstick/templates/bug_report.erb +41 -0
  28. data/lib/dopstick/templates/cli.erb +3 -0
  29. data/lib/dopstick/templates/cli_class.erb +19 -0
  30. data/lib/dopstick/templates/coc.erb +74 -0
  31. data/lib/dopstick/templates/console.erb +16 -0
  32. data/lib/dopstick/templates/contributing.erb +80 -0
  33. data/lib/dopstick/templates/entry_file.erb +3 -0
  34. data/lib/dopstick/templates/feature_request.erb +23 -0
  35. data/lib/dopstick/templates/funding.erb +4 -0
  36. data/lib/dopstick/templates/gem_entry_file.erb +3 -0
  37. data/lib/dopstick/templates/gemfile.erb +5 -0
  38. data/lib/dopstick/templates/gemspec.erb +53 -0
  39. data/lib/dopstick/templates/generator.erb +3 -0
  40. data/lib/dopstick/templates/generator_class.erb +13 -0
  41. data/lib/dopstick/templates/gitignore.erb +11 -0
  42. data/lib/dopstick/templates/issue.erb +26 -0
  43. data/lib/dopstick/templates/license.erb +20 -0
  44. data/lib/dopstick/templates/pull_request.erb +38 -0
  45. data/lib/dopstick/templates/rakefile.erb +15 -0
  46. data/lib/dopstick/templates/readme.erb +50 -0
  47. data/lib/dopstick/templates/rubocop.erb +12 -0
  48. data/lib/dopstick/templates/setup.erb +10 -0
  49. data/lib/dopstick/templates/test_file.erb +9 -0
  50. data/lib/dopstick/templates/test_helper.erb +14 -0
  51. data/lib/dopstick/templates/tests_workflow.erb +73 -0
  52. data/lib/dopstick/templates/version.erb +3 -0
  53. data/lib/dopstick/version.rb +5 -0
  54. metadata +214 -0
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_record"
4
+
5
+ ActiveRecord::Base.establish_connection "postgres:///test"
6
+ ActiveRecord::Migration.verbose = false
7
+ ActiveRecord::Base.logger = nil
8
+
9
+ # Apply a migration directly from your tests:
10
+ #
11
+ # test "do something" do
12
+ # schema do
13
+ # drop_table :users if table_exists?(:users)
14
+ #
15
+ # create_table :users do |t|
16
+ # t.text :name, null: false
17
+ # end
18
+ # end
19
+ # end
20
+ #
21
+ def schema(&block)
22
+ ActiveRecord::Schema.define(version: 0, &block)
23
+ end
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative "../lib/<%= gem_name %>"
5
+ <%= options[:namespace] %>::CLI.start
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: "🐛 Bug Report"
3
+ about: Report a reproducible bug or regression.
4
+ title: 'Bug: '
5
+ labels: 'Status: Unconfirmed'
6
+
7
+ ---
8
+
9
+ <!--
10
+ - Please provide a clear and concise description of what the bug is.
11
+ - If possible, add an example reproducing your issue.
12
+ - Please test using the latest version of <%= gem_name %>
13
+ to make sure your issue has not already been fixed.
14
+ -->
15
+
16
+ ## Description
17
+
18
+ [Add bug description here]
19
+
20
+ ## How to reproduce
21
+
22
+ [Add steps on how to reproduce this issue]
23
+
24
+ ## What do you expect
25
+
26
+ [Describe what do you expect to happen]
27
+
28
+ ## What happened instead
29
+
30
+ [Describe the actual results]
31
+
32
+ ## Software:
33
+
34
+ - Gem version: [Add gem version here]
35
+ - Ruby version: [Add version here]
36
+
37
+ ## Full backtrace
38
+
39
+ ```text
40
+ [Paste full backtrace here]
41
+ ```
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ <%= render_cli %>
@@ -0,0 +1,19 @@
1
+ class CLI < Thor
2
+ check_unknown_options!
3
+
4
+ def self.exit_on_failure?
5
+ true
6
+ end
7
+
8
+ desc "new PATH", "Create a new gem"
9
+ def new(path)
10
+ generator = Generator.new
11
+ generator.destination_root = File.expand_path(path)
12
+ generator.options = options
13
+ generator.invoke_all
14
+ end
15
+
16
+ no_commands do
17
+ # Add helper methods here
18
+ end
19
+ end
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at <%= user_email %>. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require <%= gem_name.inspect %>
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ begin
11
+ require "pry"
12
+ Pry.start
13
+ rescue LoadError
14
+ require "irb"
15
+ IRB.start(__FILE__)
16
+ end
@@ -0,0 +1,80 @@
1
+ # Contributing to <%= gem_name %>
2
+
3
+ 👍🎉 First off, thanks for taking the time to contribute! 🎉👍
4
+
5
+ The following is a set of guidelines for contributing to this project. These are
6
+ mostly guidelines, not rules. Use your best judgment, and feel free to propose
7
+ changes to this document in a pull request.
8
+
9
+ ## Code of Conduct
10
+
11
+ Everyone interacting in this project's codebases, issue trackers, chat rooms and
12
+ mailing lists is expected to follow the [code of conduct](<%= github_url
13
+ %>/blob/main/CODE_OF_CONDUCT.md).
14
+
15
+ ## Reporting bugs
16
+
17
+ This section guides you through submitting a bug report. Following these
18
+ guidelines helps maintainers and the community understand your report, reproduce
19
+ the behavior, and find related reports.
20
+
21
+ - Before creating bug reports, please check the open issues; somebody may
22
+ already have submitted something similar, and you may not need to create a new
23
+ one.
24
+ - When you are creating a bug report, please include as many details as
25
+ possible, with an example reproducing the issue.
26
+
27
+ ## Contributing with code
28
+
29
+ Before making any radicals changes, please make sure you discuss your intention
30
+ by [opening an issue on Github](<%= github_url %>/issues).
31
+
32
+ When you're ready to make your pull request, follow checklist below to make sure
33
+ your contribution is according to how this project works.
34
+
35
+ 1. [Fork](https://help.github.com/forking/) <%= gem_name %>
36
+ 2. Create a topic branch - `git checkout -b my_branch`
37
+ 3. Make your changes using [descriptive commit messages](#commit-messages)
38
+ 4. Update CHANGELOG.md describing your changes by adding an entry to the
39
+ "Unreleased" section. If this section is not available, create one right
40
+ before the last version.
41
+ 5. Push to your branch - `git push origin my_branch`
42
+ 6. [Create a pull request](https://docs.github.com/articles/creating-a-pull-request)
43
+ 7. That's it!
44
+
45
+ ## Styleguides
46
+
47
+ ### Commit messages
48
+
49
+ - Use the present tense ("Add feature" not "Added feature")
50
+ - Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
51
+ - Limit the first line to 72 characters or less
52
+ - Reference issues and pull requests liberally after the first line
53
+
54
+ ### Changelog
55
+
56
+ - Add a message describing your changes to the "Unreleased" section. The
57
+ changelog message should follow the same style as the commit message.
58
+ - Prefix your message with one of the following:
59
+ - `[Added]` for new features.
60
+ - `[Changed]` for changes in existing functionality.
61
+ - `[Deprecated]` for soon-to-be removed features.
62
+ - `[Removed]` for now removed features.
63
+ - `[Fixed]` for any bug fixes.
64
+ - `[Security]` in case of vulnerabilities.
65
+
66
+ ### Ruby code
67
+
68
+ - This project uses [Rubocop](https://rubocop.org) to enforce code style. Before
69
+ submitting your changes, make sure your tests are passing and code conforms to
70
+ the expected style by running `rake`.
71
+ - Do not change the library version. This will be done by the maintainer
72
+ whenever a new version is about to be released.
73
+
74
+ ### JavaScript code
75
+
76
+ - This project uses [ESLint](https://eslint.org) to enforce code style. Before
77
+ submitting your changes, make sure your tests are passing and code conforms to
78
+ the expected style by running `yarn test:ci`.
79
+ - Do not change the library version. This will be done by the maintainer
80
+ whenever a new version is about to be released.
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ <%= render_tree { %[require "#{entry_path}/version"] } %>
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: "💡 Feature request"
3
+ about: Have an idea that may be useful? Make a suggestion!
4
+ title: 'Feature Request: '
5
+ labels: 'Feature request'
6
+
7
+ ---
8
+
9
+ ## Description
10
+
11
+ _A clear and concise description of what the problem is._
12
+
13
+ ## Describe the solution
14
+
15
+ _A clear and concise description of what you want to happen._
16
+
17
+ ## Alternatives you considered
18
+
19
+ _A clear and concise description of any alternative solutions or features you've considered._
20
+
21
+ ## Additional context
22
+
23
+ _Add any other context, screenshots, links, etc about the feature request here._
@@ -0,0 +1,4 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: [<%= github_user %>]
4
+ other: https://paypal.me/<%= paypal_user %>/🍕
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require <%= entry_path.inspect %>
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "./lib/<%= entry_path %>/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "<%= gem_name %>"
7
+ spec.version = <%= options[:namespace] %>::VERSION
8
+ spec.authors = [<%= user_name.inspect %>]
9
+ spec.email = [<%= user_email.inspect %>]
10
+
11
+ spec.summary = "Add some description"
12
+ spec.description = spec.summary
13
+ spec.license = "MIT"
14
+ spec.required_ruby_version = Gem::Requirement.new(">= <%= oldest_ruby_version %>")
15
+
16
+ github_url = <%= github_url.inspect %>
17
+ github_tree_url = "#{github_url}/blob/v#{spec.version}"
18
+
19
+ spec.homepage = github_url
20
+ spec.metadata["homepage_uri"] = spec.homepage
21
+ spec.metadata["bug_tracker_uri"] = "#{github_url}/issues"
22
+ spec.metadata["source_code_uri"] = github_tree_url
23
+ spec.metadata["changelog_uri"] = "#{github_tree_url}/CHANGELOG.md"
24
+ spec.metadata["documentation_uri"] = "#{github_tree_url}/README.md"
25
+ spec.metadata["license_uri"] = "#{github_tree_url}/LICENSE.md"
26
+
27
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
28
+ `git ls-files -z`
29
+ .split("\x0")
30
+ .reject {|f| f.match(%r{^(test|spec|features)/}) }
31
+ end
32
+
33
+ spec.bindir = "exe"
34
+ spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
35
+ spec.require_paths = ["lib"]
36
+
37
+ <%- if options[:active_record] -%>
38
+ spec.add_dependency "activerecord"
39
+ <%- end -%>
40
+ <%- unless options[:bin].empty? -%>
41
+ spec.add_dependency "thor"
42
+ <%- end -%>
43
+ spec.add_development_dependency "minitest"
44
+ spec.add_development_dependency "minitest-utils"
45
+ spec.add_development_dependency "pry-meta"
46
+ spec.add_development_dependency "rake"
47
+ spec.add_development_dependency "rubocop"
48
+ spec.add_development_dependency "rubocop-fnando"
49
+ spec.add_development_dependency "simplecov"
50
+ <%- if options[:active_record] -%>
51
+ spec.add_development_dependency "pg"
52
+ <%- end -%>
53
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ <%= render_generator %>
@@ -0,0 +1,13 @@
1
+ class Generator < Thor::Group
2
+ include Thor::Actions
3
+
4
+ attr_accessor :options
5
+
6
+ def self.source_root
7
+ File.join(__dir__, "templates")
8
+ end
9
+
10
+ no_commands do
11
+ # Add helper methods here
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /vendor/
10
+ *.log
11
+ *.lock
@@ -0,0 +1,26 @@
1
+ ## Description
2
+
3
+ [Add feature/bug description here]
4
+
5
+ ## How to reproduce
6
+
7
+ [Add steps on how to reproduce this issue]
8
+
9
+ ## What do you expect
10
+
11
+ [Describe what do you expect to happen]
12
+
13
+ ## What happened instead
14
+
15
+ [Describe the actual results]
16
+
17
+ ## Software:
18
+
19
+ - Gem version: [Add gem version here]
20
+ - Ruby version: [Add version here]
21
+
22
+ ## Full backtrace
23
+
24
+ ```text
25
+ [Paste full backtrace here]
26
+ ```
@@ -0,0 +1,20 @@
1
+ # The MIT License (MIT)
2
+
3
+ Copyright (c) <%= Date.today.year %> <%= user_name %>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.