arsenic 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/.gem_release.yml +3 -0
  3. data/.github/CODEOWNERS +1 -0
  4. data/.github/FUNDING.yml +12 -0
  5. data/.github/ISSUE_TEMPLATE/bug_report.md +40 -0
  6. data/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
  7. data/.github/PULL_REQUEST_TEMPLATE.md +23 -0
  8. data/.github/workflows/linters.yml +34 -0
  9. data/.github/workflows/tests.yml +34 -0
  10. data/.gitignore +11 -0
  11. data/.rspec +3 -0
  12. data/.standard.yml +9 -0
  13. data/CODE_OF_CONDUCT.md +74 -0
  14. data/Gemfile +10 -0
  15. data/Gemfile.lock +72 -0
  16. data/LICENSE.txt +21 -0
  17. data/README.md +42 -0
  18. data/Rakefile +6 -0
  19. data/arsenic.gemspec +32 -0
  20. data/bin/console +14 -0
  21. data/bin/format +3 -0
  22. data/bin/rspec +29 -0
  23. data/bin/setup +8 -0
  24. data/bin/standardrb +29 -0
  25. data/exe/arsenic +13 -0
  26. data/lib/arsenic.rb +100 -0
  27. data/lib/arsenic/templates/newgem/.gem_release.yml.tt +3 -0
  28. data/lib/arsenic/templates/newgem/.github/ISSUE_TEMPLATE/bug_report.md.tt +24 -0
  29. data/lib/arsenic/templates/newgem/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
  30. data/lib/arsenic/templates/newgem/.github/PULL_REQUEST_TEMPLATE.md +23 -0
  31. data/lib/arsenic/templates/newgem/.github/workflows/docs-lint.yml.tt +72 -0
  32. data/lib/arsenic/templates/newgem/.github/workflows/rspec-jruby.yml.tt +35 -0
  33. data/lib/arsenic/templates/newgem/.github/workflows/rspec.yml.tt +61 -0
  34. data/lib/arsenic/templates/newgem/.github/workflows/rubocop.yml.tt +21 -0
  35. data/lib/arsenic/templates/newgem/.gitignore +43 -0
  36. data/lib/arsenic/templates/newgem/.mdlrc +1 -0
  37. data/lib/arsenic/templates/newgem/.rubocop-md.yml +16 -0
  38. data/lib/arsenic/templates/newgem/.rubocop.yml +29 -0
  39. data/lib/arsenic/templates/newgem/Gemfile.tt +19 -0
  40. data/lib/arsenic/templates/newgem/LICENSE.txt +22 -0
  41. data/lib/arsenic/templates/newgem/README.md +43 -0
  42. data/lib/arsenic/templates/newgem/RELEASING.md.tt +43 -0
  43. data/lib/arsenic/templates/newgem/Rakefile +20 -0
  44. data/lib/arsenic/templates/newgem/gemfiles/jruby.gemfile +5 -0
  45. data/lib/arsenic/templates/newgem/gemfiles/rails5.gemfile +5 -0
  46. data/lib/arsenic/templates/newgem/gemfiles/rails6.gemfile +5 -0
  47. data/lib/arsenic/templates/newgem/gemfiles/railsmaster.gemfile +6 -0
  48. data/lib/arsenic/templates/newgem/gemfiles/rubocop.gemfile +4 -0
  49. data/lib/arsenic/templates/newgem/lefthook.yml +18 -0
  50. data/lib/arsenic/templates/newgem/lib/dir/railtie.rb.tt +6 -0
  51. data/lib/arsenic/templates/newgem/lib/dir/version.rb.tt +5 -0
  52. data/lib/arsenic/templates/newgem/lib/name.rb.tt +6 -0
  53. data/lib/arsenic/templates/newgem/newgem.gemspec.tt +34 -0
  54. data/lib/arsenic/templates/newgem/spec/spec_helper.rb.tt +30 -0
  55. data/lib/arsenic/version.rb +3 -0
  56. metadata +103 -0
@@ -0,0 +1,21 @@
1
+ name: Lint Ruby
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+
9
+ jobs:
10
+ rubocop:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: 2.7
17
+ - name: Lint Ruby code with RuboCop
18
+ run: |
19
+ gem install bundler
20
+ bundle install --gemfile gemfiles/rubocop.gemfile --jobs 4 --retry 3
21
+ bundle exec --gemfile gemfiles/rubocop.gemfile rubocop
@@ -0,0 +1,43 @@
1
+ # Numerous always-ignore extensions
2
+ *.diff
3
+ *.err
4
+ *.orig
5
+ *.log
6
+ *.rej
7
+ *.swo
8
+ *.swp
9
+ *.vi
10
+ *~
11
+ *.sass-cache
12
+ *.iml
13
+ .idea/
14
+
15
+ # Sublime
16
+ *.sublime-project
17
+ *.sublime-workspace
18
+
19
+ # OS or Editor folders
20
+ .DS_Store
21
+ .cache
22
+ .project
23
+ .settings
24
+ .tmproj
25
+ Thumbs.db
26
+
27
+ .bundle/
28
+ log/*.log
29
+ pkg/
30
+ spec/dummy/db/*.sqlite3
31
+ spec/dummy/db/*.sqlite3-journal
32
+ spec/dummy/tmp/
33
+
34
+ Gemfile.lock
35
+ Gemfile.local
36
+ .rspec
37
+ .ruby-version
38
+ *.gem
39
+
40
+ tmp/
41
+ .rbnext/
42
+
43
+ gemfiles/*.lock
@@ -0,0 +1 @@
1
+ rules "~MD013", "~MD033"
@@ -0,0 +1,16 @@
1
+ inherit_from: ".rubocop.yml"
2
+
3
+ require:
4
+ - rubocop-md
5
+
6
+ AllCops:
7
+ Include:
8
+ - '**/*.md'
9
+
10
+ Lint/Void:
11
+ Exclude:
12
+ - '**/*.md'
13
+
14
+ Lint/DuplicateMethods:
15
+ Exclude:
16
+ - '**/*.md'
@@ -0,0 +1,29 @@
1
+ require:
2
+ - standard/cop/semantic_blocks
3
+
4
+ inherit_gem:
5
+ standard: config/base.yml
6
+
7
+ AllCops:
8
+ Exclude:
9
+ - 'bin/*'
10
+ - 'tmp/**/*'
11
+ - 'Gemfile'
12
+ - 'vendor/**/*'
13
+ - 'gemfiles/**/*'
14
+ - 'lib/.rbnext/**/*'
15
+ - 'lib/generators/**/templates/*.rb'
16
+ DisplayCopNames: true
17
+ TargetRubyVersion: 2.7
18
+
19
+ Standard/SemanticBlocks:
20
+ Enabled: false
21
+
22
+ Style/FrozenStringLiteralComment:
23
+ Enabled: true
24
+
25
+ Style/TrailingCommaInArrayLiteral:
26
+ EnforcedStyleForMultiline: no_comma
27
+
28
+ Style/TrailingCommaInHashLiteral:
29
+ EnforcedStyleForMultiline: no_comma
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'pry-byebug', platform: :mri
6
+
7
+ gemspec
8
+
9
+ eval_gemfile "gemfiles/rubocop.gemfile"
10
+
11
+ local_gemfile = "#{File.dirname(__FILE__)}/Gemfile.local"
12
+
13
+ if File.exist?(local_gemfile)
14
+ eval(File.read(local_gemfile)) # rubocop:disable Security/Eval
15
+ <%- if rails? -%>
16
+ else
17
+ gem 'rails', '~> 6.0'
18
+ <%- end -%>
19
+ end
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2020 Vladimir Dementyev
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,43 @@
1
+ [![Gem Version](https://badge.fury.io/rb/<%= name %>.svg)](https://rubygems.org/gems/<%= name %>) [![Build](https://github.com/andrewmcodes/<%= name %>/workflows/Build/badge.svg)](https://github.com/andrewmcodes/<%= name %>/actions)
2
+ [![JRuby Build](https://github.com/andrewmcodes/<%= name %>/workflows/JRuby%20Build/badge.svg)](https://github.com/andrewmcodes/<%= name %>/actions)
3
+
4
+ # <%= human_name %>
5
+
6
+ TBD
7
+
8
+ ## Installation
9
+
10
+ Adding to a gem:
11
+
12
+ ```ruby
13
+ # my-cool-gem.gemspec
14
+ Gem::Specification.new do |spec|
15
+ # ...
16
+ spec.add_dependency "<%= name %>"
17
+ # ...
18
+ end
19
+ ```
20
+
21
+ Or adding to your project:
22
+
23
+ ```ruby
24
+ # Gemfile
25
+ gem "<%= name %>"
26
+ ```
27
+
28
+ ### Supported Ruby versions
29
+
30
+ - Ruby (MRI) >= 2.5.0
31
+ - JRuby >= 9.2.9
32
+
33
+ ## Usage
34
+
35
+ TBD
36
+
37
+ ## Contributing
38
+
39
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/andrewmcodes/<%= name %>](https://github.com/andrewmcodes/<%= name %>).
40
+
41
+ ## License
42
+
43
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,43 @@
1
+ # How to release a gem
2
+
3
+ This document describes a process of releasing a new version of a gem.
4
+
5
+ 1. Bump version.
6
+
7
+ ```sh
8
+ git commit -m "Bump 1.<x>.<y>"
9
+ ```
10
+
11
+ We're (kinda) using semantic versioning:
12
+
13
+ - Bugfixes should be released as fast as possible as patch versions.
14
+ - New features could be combined and released as minor or patch version upgrades (depending on the _size of the feature_—it's up to maintainers to decide).
15
+ - Breaking API changes should be avoided in minor and patch releases.
16
+ - Breaking dependencies changes (e.g., dropping older Ruby support) could be released in minor versions.
17
+
18
+ How to bump a version:
19
+
20
+ - Change the version number in `lib/<%= name_path %>/version.rb` file.
21
+ - Update the changelog (add new heading with the version name and date).
22
+ - Update the installation documentation if necessary (e.g., during minor and major updates).
23
+
24
+ 2. Push code to GitHub and make sure CI passes.
25
+
26
+ ```sh
27
+ git push
28
+ ```
29
+
30
+ 3. Release a gem.
31
+
32
+ ```sh
33
+ gem release -t
34
+ git push --tags
35
+ ```
36
+
37
+ We use [gem-release](https://github.com/svenfuchs/gem-release) for publishing gems with a single command:
38
+
39
+ ```sh
40
+ gem release -t
41
+ ```
42
+
43
+ Don't forget to push tags and write release notes on GitHub (if necessary).
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ begin
9
+ require "rubocop/rake_task"
10
+ RuboCop::RakeTask.new
11
+
12
+ RuboCop::RakeTask.new("rubocop:md") do |task|
13
+ task.options << %w[-c .rubocop-md.yml]
14
+ end
15
+ rescue LoadError
16
+ task(:rubocop) {}
17
+ task("rubocop:md") {}
18
+ end
19
+
20
+ task default: %w[rubocop rubocop:md spec]
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 5.0"
4
+
5
+ gemspec path: ".."
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 5.0"
4
+
5
+ gemspec path: ".."
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "~> 6.0"
4
+
5
+ gemspec path: ".."
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "arel", github: "rails/arel"
4
+ gem "rails", github: "rails/rails"
5
+
6
+ gemspec path: ".."
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org" do
2
+ gem "rubocop-md", "~> 0.3"
3
+ gem "standard", "~> 0.2.0"
4
+ end
@@ -0,0 +1,18 @@
1
+ pre-commit:
2
+ commands:
3
+ mdl:
4
+ tags: style
5
+ glob: "**/*.md"
6
+ run: mdl {staged_files}
7
+ liche:
8
+ tags: links
9
+ glob: "docs/*.md"
10
+ run: liche -d docs/ -r docs/* && test {staged_files}
11
+ forspell:
12
+ tags: grammar
13
+ glob: "**/*.md"
14
+ run: forspell {staged_files}
15
+ rubocop:
16
+ tags: style
17
+ glob: "**/*.md"
18
+ run: BUNDLE_GEMFILE=gemfiles/rubocop.gemfile bundle exec rubocop {staged_files}
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module <%= module_name %> # :nodoc:
4
+ class Railtie < ::Rails::Railtie # :nodoc:
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module <%= module_name %> # :nodoc:
4
+ VERSION = "0.0.1"
5
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "<%= name_path %>/version"
4
+ <%- if rails? -%>
5
+ require "<%= name_path %>/railtie" if defined?(Rails::Railtie)
6
+ <%- end -%>
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/<%= name_path %>/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "<%= name %>"
7
+ s.version = <%= module_name %>::VERSION
8
+ s.authors = ["Andrew Mason"]
9
+ s.email = ["andrewmcodes@protonmail.com"]
10
+ s.homepage = "http://github.com/andrewmcodes/<%= name %>"
11
+ s.summary = "Welcome mortal"
12
+ s.description = s.summary
13
+
14
+ s.metadata = {
15
+ "bug_tracker_uri" => "http://github.com/andrewmcodes/<%= name %>/issues",
16
+ "changelog_uri" => "https://github.com/andrewmcodes/<%= name %>/blob/master/CHANGELOG.md",
17
+ "documentation_uri" => "http://github.com/andrewmcodes/<%= name %>",
18
+ "homepage_uri" => "http://github.com/andrewmcodes/<%= name %>",
19
+ "source_code_uri" => "http://github.com/andrewmcodes/<%= name %>"
20
+ }
21
+
22
+ s.license = "MIT"
23
+
24
+ s.files = Dir.glob("lib/**/*") + Dir.glob("bin/**/*") + %w[README.md LICENSE.txt CHANGELOG.md]
25
+ s.require_paths = ["lib"]
26
+ s.required_ruby_version = ">= 2.5"
27
+
28
+ s.add_development_dependency "bundler", ">= 1.15"
29
+ <%- if rails? -%>
30
+ s.add_development_dependency "combustion", ">= 1.1"
31
+ <%- end -%>
32
+ s.add_development_dependency "rake", ">= 13.0"
33
+ s.add_development_dependency "rspec", "~> 3.8"
34
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require "pry-byebug"
5
+ rescue LoadError
6
+ end
7
+
8
+ <%- if rails? -%>
9
+ ENV["RAILS_ENV"] = "test"
10
+
11
+ require "combustion"
12
+ require "<%= name %>"
13
+
14
+ Combustion.initialize!
15
+ <%- else -%>
16
+ require "<%= name %>"
17
+ <%- end -%>
18
+
19
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f }
20
+
21
+ RSpec.configure do |config|
22
+ config.mock_with :rspec
23
+
24
+ config.example_status_persistence_file_path = "tmp/rspec_examples.txt"
25
+ config.filter_run :focus
26
+ config.run_all_when_everything_filtered = true
27
+
28
+ config.order = :random
29
+ Kernel.srand config.seed
30
+ end
@@ -0,0 +1,3 @@
1
+ module Arsenic
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: arsenic
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Mason
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-09-09 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: originally forked from Palkan. https://github.com/palkan/new-gem-generator
14
+ email:
15
+ - andrewmcodes@protonmail.com
16
+ executables:
17
+ - arsenic
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - ".gem_release.yml"
22
+ - ".github/CODEOWNERS"
23
+ - ".github/FUNDING.yml"
24
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
25
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
26
+ - ".github/PULL_REQUEST_TEMPLATE.md"
27
+ - ".github/workflows/linters.yml"
28
+ - ".github/workflows/tests.yml"
29
+ - ".gitignore"
30
+ - ".rspec"
31
+ - ".standard.yml"
32
+ - CODE_OF_CONDUCT.md
33
+ - Gemfile
34
+ - Gemfile.lock
35
+ - LICENSE.txt
36
+ - README.md
37
+ - Rakefile
38
+ - arsenic.gemspec
39
+ - bin/console
40
+ - bin/format
41
+ - bin/rspec
42
+ - bin/setup
43
+ - bin/standardrb
44
+ - exe/arsenic
45
+ - lib/arsenic.rb
46
+ - lib/arsenic/templates/newgem/.gem_release.yml.tt
47
+ - lib/arsenic/templates/newgem/.github/ISSUE_TEMPLATE/bug_report.md.tt
48
+ - lib/arsenic/templates/newgem/.github/ISSUE_TEMPLATE/feature_request.md
49
+ - lib/arsenic/templates/newgem/.github/PULL_REQUEST_TEMPLATE.md
50
+ - lib/arsenic/templates/newgem/.github/workflows/docs-lint.yml.tt
51
+ - lib/arsenic/templates/newgem/.github/workflows/rspec-jruby.yml.tt
52
+ - lib/arsenic/templates/newgem/.github/workflows/rspec.yml.tt
53
+ - lib/arsenic/templates/newgem/.github/workflows/rubocop.yml.tt
54
+ - lib/arsenic/templates/newgem/.gitignore
55
+ - lib/arsenic/templates/newgem/.mdlrc
56
+ - lib/arsenic/templates/newgem/.rubocop-md.yml
57
+ - lib/arsenic/templates/newgem/.rubocop.yml
58
+ - lib/arsenic/templates/newgem/Gemfile.tt
59
+ - lib/arsenic/templates/newgem/LICENSE.txt
60
+ - lib/arsenic/templates/newgem/README.md
61
+ - lib/arsenic/templates/newgem/RELEASING.md.tt
62
+ - lib/arsenic/templates/newgem/Rakefile
63
+ - lib/arsenic/templates/newgem/gemfiles/jruby.gemfile
64
+ - lib/arsenic/templates/newgem/gemfiles/rails5.gemfile
65
+ - lib/arsenic/templates/newgem/gemfiles/rails6.gemfile
66
+ - lib/arsenic/templates/newgem/gemfiles/railsmaster.gemfile
67
+ - lib/arsenic/templates/newgem/gemfiles/rubocop.gemfile
68
+ - lib/arsenic/templates/newgem/lefthook.yml
69
+ - lib/arsenic/templates/newgem/lib/dir/railtie.rb.tt
70
+ - lib/arsenic/templates/newgem/lib/dir/version.rb.tt
71
+ - lib/arsenic/templates/newgem/lib/name.rb.tt
72
+ - lib/arsenic/templates/newgem/newgem.gemspec.tt
73
+ - lib/arsenic/templates/newgem/spec/spec_helper.rb.tt
74
+ - lib/arsenic/version.rb
75
+ homepage: https://github.com/andrewmcodes/arsenic
76
+ licenses:
77
+ - MIT
78
+ metadata:
79
+ bug_tracker_uri: https://github.com/andrewmcodes/arsenic/issues
80
+ changelog_uri: https://github.com/andrewmcodes/arsenic/blob/main/CHANGELOG.md
81
+ documentation_uri: https://github.com/andrewmcodes/arsenic
82
+ homepage_uri: https://github.com/andrewmcodes/arsenic
83
+ source_code_uri: https://github.com/andrewmcodes/arsenic
84
+ post_install_message:
85
+ rdoc_options: []
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 2.3.0
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ requirements: []
99
+ rubygems_version: 3.1.2
100
+ signing_key:
101
+ specification_version: 4
102
+ summary: andrewmcodes gem generator
103
+ test_files: []