dopstick 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +4 -0
  3. data/.rubocop.yml +11 -6
  4. data/CHANGELOG.md +11 -0
  5. data/CONTRIBUTING.md +1 -1
  6. data/README.md +6 -3
  7. data/dopstick.gemspec +2 -1
  8. data/lib/dopstick.rb +7 -1
  9. data/lib/dopstick/cli.rb +40 -11
  10. data/lib/dopstick/generator.rb +3 -208
  11. data/lib/dopstick/{templates → generator/base/templates}/bug_report.erb +1 -1
  12. data/lib/dopstick/{templates/CHANGELOG.md → generator/base/templates/changelog.erb} +0 -0
  13. data/lib/dopstick/{templates → generator/base/templates}/coc.erb +1 -1
  14. data/lib/dopstick/generator/base/templates/codeowners.erb +4 -0
  15. data/lib/dopstick/{templates → generator/base/templates}/contributing.erb +5 -5
  16. data/lib/dopstick/generator/base/templates/dependabot.erb +15 -0
  17. data/lib/dopstick/{templates → generator/base/templates}/feature_request.erb +0 -0
  18. data/lib/dopstick/generator/base/templates/funding.erb +4 -0
  19. data/lib/dopstick/{templates → generator/base/templates}/gitignore.erb +0 -0
  20. data/lib/dopstick/{templates → generator/base/templates}/issue.erb +0 -0
  21. data/lib/dopstick/{templates → generator/base/templates}/license.erb +1 -1
  22. data/lib/dopstick/{templates → generator/base/templates}/pull_request.erb +0 -0
  23. data/lib/dopstick/{templates → generator/base/templates}/setup.erb +0 -0
  24. data/lib/dopstick/generator/gem/generator.rb +160 -0
  25. data/lib/dopstick/generator/gem/options.rb +34 -0
  26. data/lib/dopstick/{templates → generator/gem/templates}/active_record.erb +25 -0
  27. data/lib/dopstick/generator/gem/templates/bin.erb +5 -0
  28. data/lib/dopstick/{templates → generator/gem/templates}/cli.erb +0 -0
  29. data/lib/dopstick/{templates → generator/gem/templates}/cli_class.erb +0 -0
  30. data/lib/dopstick/{templates → generator/gem/templates}/console.erb +1 -1
  31. data/lib/dopstick/generator/gem/templates/entry_file.erb +3 -0
  32. data/lib/dopstick/generator/gem/templates/gem_entry_file.erb +3 -0
  33. data/lib/dopstick/{templates → generator/gem/templates}/gemfile.erb +0 -0
  34. data/lib/dopstick/{templates → generator/gem/templates}/gemspec.erb +14 -14
  35. data/lib/dopstick/{templates → generator/gem/templates}/generator.erb +0 -0
  36. data/lib/dopstick/{templates → generator/gem/templates}/generator_class.erb +0 -0
  37. data/lib/dopstick/{templates → generator/gem/templates}/rakefile.erb +0 -0
  38. data/lib/dopstick/generator/gem/templates/readme.erb +50 -0
  39. data/lib/dopstick/generator/gem/templates/rubocop.erb +12 -0
  40. data/lib/dopstick/{templates → generator/gem/templates}/test_file.erb +1 -1
  41. data/lib/dopstick/{templates → generator/gem/templates}/test_helper.erb +1 -1
  42. data/lib/dopstick/{templates → generator/gem/templates}/tests_workflow.erb +6 -4
  43. data/lib/dopstick/{templates → generator/gem/templates}/version.erb +0 -0
  44. data/lib/dopstick/generator/npm/generator.rb +100 -0
  45. data/lib/dopstick/generator/npm/options.rb +26 -0
  46. data/lib/dopstick/generator/npm/templates/babel.erb +15 -0
  47. data/lib/dopstick/generator/npm/templates/eslint.erb +4 -0
  48. data/lib/dopstick/generator/npm/templates/index.erb +12 -0
  49. data/lib/dopstick/generator/npm/templates/index_test.erb +7 -0
  50. data/lib/dopstick/generator/npm/templates/jest.erb +12 -0
  51. data/lib/dopstick/generator/npm/templates/package.erb +42 -0
  52. data/lib/dopstick/generator/npm/templates/prettier.erb +1 -0
  53. data/lib/dopstick/generator/npm/templates/readme.erb +52 -0
  54. data/lib/dopstick/generator/npm/templates/tests_workflow.erb +46 -0
  55. data/lib/dopstick/generator/npm/templates/tsconfig.erb +14 -0
  56. data/lib/dopstick/generator/npm/templates/webpack.erb +33 -0
  57. data/lib/dopstick/generator/options.rb +65 -0
  58. data/lib/dopstick/version.rb +1 -1
  59. metadata +56 -37
  60. data/lib/dopstick/templates/bin.erb +0 -5
  61. data/lib/dopstick/templates/entry_file.erb +0 -3
  62. data/lib/dopstick/templates/funding.erb +0 -4
  63. data/lib/dopstick/templates/gem_entry_file.erb +0 -3
  64. data/lib/dopstick/templates/readme.erb +0 -50
  65. data/lib/dopstick/templates/rubocop.erb +0 -12
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dopstick
4
+ module Generator
5
+ class Options
6
+ using Refinements
7
+
8
+ def initialize(options)
9
+ @options = options
10
+ end
11
+
12
+ def [](key)
13
+ @options[key]
14
+ end
15
+
16
+ def merge(other)
17
+ @options.merge(other)
18
+ end
19
+
20
+ def respond_to_missing?(name, _include_all)
21
+ options.key?(name) || super
22
+ end
23
+
24
+ def method_missing(name, *args)
25
+ @options.key?(name) ? @options[name] : super
26
+ end
27
+
28
+ def skip_install?
29
+ @options[:skip_install]
30
+ end
31
+
32
+ def bin?
33
+ !@options[:bin].empty?
34
+ end
35
+
36
+ def user_name
37
+ @user_name ||= @options[:author_name].presence ||
38
+ `git config user.name`.chomp.presence ||
39
+ "Your Name"
40
+ end
41
+
42
+ def user_email
43
+ @user_email ||= @options[:author_email].presence ||
44
+ `git config user.email`.chomp.presence ||
45
+ "your@email.com"
46
+ end
47
+
48
+ def github_user
49
+ @github_user ||= @options[:author_github].presence ||
50
+ `git config user.github`.chomp.presence ||
51
+ "[USER]"
52
+ end
53
+
54
+ def paypal_user
55
+ @paypal_user ||= @options[:author_paypal].presence ||
56
+ `git config user.paypal`.chomp.presence ||
57
+ "[USER]"
58
+ end
59
+
60
+ def github_url
61
+ "https://github.com/#{github_user}/#{package_name}"
62
+ end
63
+ end
64
+ end
65
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dopstick
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dopstick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-04 00:00:00.000000000 Z
11
+ date: 2020-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -122,7 +122,7 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- description: Generate a project skeleton for creating a rubygem
125
+ description: Generate a project skeleton for creating a Ruby/Nodepackage.
126
126
  email:
127
127
  - me@fnando.com
128
128
  executables:
@@ -130,6 +130,7 @@ executables:
130
130
  extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
+ - ".github/CODEOWNERS"
133
134
  - ".github/FUNDING.yml"
134
135
  - ".github/ISSUE_TEMPLATE/bug_report.md"
135
136
  - ".github/ISSUE_TEMPLATE/feature_request.md"
@@ -152,36 +153,54 @@ files:
152
153
  - lib/dopstick.rb
153
154
  - lib/dopstick/cli.rb
154
155
  - lib/dopstick/generator.rb
156
+ - lib/dopstick/generator/base/templates/bug_report.erb
157
+ - lib/dopstick/generator/base/templates/changelog.erb
158
+ - lib/dopstick/generator/base/templates/coc.erb
159
+ - lib/dopstick/generator/base/templates/codeowners.erb
160
+ - lib/dopstick/generator/base/templates/contributing.erb
161
+ - lib/dopstick/generator/base/templates/dependabot.erb
162
+ - lib/dopstick/generator/base/templates/feature_request.erb
163
+ - lib/dopstick/generator/base/templates/funding.erb
164
+ - lib/dopstick/generator/base/templates/gitignore.erb
165
+ - lib/dopstick/generator/base/templates/issue.erb
166
+ - lib/dopstick/generator/base/templates/license.erb
167
+ - lib/dopstick/generator/base/templates/pull_request.erb
168
+ - lib/dopstick/generator/base/templates/setup.erb
169
+ - lib/dopstick/generator/gem/generator.rb
170
+ - lib/dopstick/generator/gem/options.rb
171
+ - lib/dopstick/generator/gem/templates/active_record.erb
172
+ - lib/dopstick/generator/gem/templates/bin.erb
173
+ - lib/dopstick/generator/gem/templates/cli.erb
174
+ - lib/dopstick/generator/gem/templates/cli_class.erb
175
+ - lib/dopstick/generator/gem/templates/console.erb
176
+ - lib/dopstick/generator/gem/templates/entry_file.erb
177
+ - lib/dopstick/generator/gem/templates/gem_entry_file.erb
178
+ - lib/dopstick/generator/gem/templates/gemfile.erb
179
+ - lib/dopstick/generator/gem/templates/gemspec.erb
180
+ - lib/dopstick/generator/gem/templates/generator.erb
181
+ - lib/dopstick/generator/gem/templates/generator_class.erb
182
+ - lib/dopstick/generator/gem/templates/rakefile.erb
183
+ - lib/dopstick/generator/gem/templates/readme.erb
184
+ - lib/dopstick/generator/gem/templates/rubocop.erb
185
+ - lib/dopstick/generator/gem/templates/test_file.erb
186
+ - lib/dopstick/generator/gem/templates/test_helper.erb
187
+ - lib/dopstick/generator/gem/templates/tests_workflow.erb
188
+ - lib/dopstick/generator/gem/templates/version.erb
189
+ - lib/dopstick/generator/npm/generator.rb
190
+ - lib/dopstick/generator/npm/options.rb
191
+ - lib/dopstick/generator/npm/templates/babel.erb
192
+ - lib/dopstick/generator/npm/templates/eslint.erb
193
+ - lib/dopstick/generator/npm/templates/index.erb
194
+ - lib/dopstick/generator/npm/templates/index_test.erb
195
+ - lib/dopstick/generator/npm/templates/jest.erb
196
+ - lib/dopstick/generator/npm/templates/package.erb
197
+ - lib/dopstick/generator/npm/templates/prettier.erb
198
+ - lib/dopstick/generator/npm/templates/readme.erb
199
+ - lib/dopstick/generator/npm/templates/tests_workflow.erb
200
+ - lib/dopstick/generator/npm/templates/tsconfig.erb
201
+ - lib/dopstick/generator/npm/templates/webpack.erb
202
+ - lib/dopstick/generator/options.rb
155
203
  - lib/dopstick/refinements.rb
156
- - lib/dopstick/templates/CHANGELOG.md
157
- - lib/dopstick/templates/active_record.erb
158
- - lib/dopstick/templates/bin.erb
159
- - lib/dopstick/templates/bug_report.erb
160
- - lib/dopstick/templates/cli.erb
161
- - lib/dopstick/templates/cli_class.erb
162
- - lib/dopstick/templates/coc.erb
163
- - lib/dopstick/templates/console.erb
164
- - lib/dopstick/templates/contributing.erb
165
- - lib/dopstick/templates/entry_file.erb
166
- - lib/dopstick/templates/feature_request.erb
167
- - lib/dopstick/templates/funding.erb
168
- - lib/dopstick/templates/gem_entry_file.erb
169
- - lib/dopstick/templates/gemfile.erb
170
- - lib/dopstick/templates/gemspec.erb
171
- - lib/dopstick/templates/generator.erb
172
- - lib/dopstick/templates/generator_class.erb
173
- - lib/dopstick/templates/gitignore.erb
174
- - lib/dopstick/templates/issue.erb
175
- - lib/dopstick/templates/license.erb
176
- - lib/dopstick/templates/pull_request.erb
177
- - lib/dopstick/templates/rakefile.erb
178
- - lib/dopstick/templates/readme.erb
179
- - lib/dopstick/templates/rubocop.erb
180
- - lib/dopstick/templates/setup.erb
181
- - lib/dopstick/templates/test_file.erb
182
- - lib/dopstick/templates/test_helper.erb
183
- - lib/dopstick/templates/tests_workflow.erb
184
- - lib/dopstick/templates/version.erb
185
204
  - lib/dopstick/version.rb
186
205
  homepage: https://github.com/fnando/dopstick
187
206
  licenses:
@@ -189,10 +208,10 @@ licenses:
189
208
  metadata:
190
209
  homepage_uri: https://github.com/fnando/dopstick
191
210
  bug_tracker_uri: https://github.com/fnando/dopstick/issues
192
- source_code_uri: https://github.com/fnando/dopstick/tree/v0.0.3
193
- changelog_uri: https://github.com/fnando/dopstick/tree/v0.0.3/CHANGELOG.md
194
- documentation_uri: https://github.com/fnando/dopstick/tree/v0.0.3/README.md
195
- license_uri: https://github.com/fnando/dopstick/tree/v0.0.3/LICENSE.md
211
+ source_code_uri: https://github.com/fnando/dopstick/tree/v0.0.4
212
+ changelog_uri: https://github.com/fnando/dopstick/tree/v0.0.4/CHANGELOG.md
213
+ documentation_uri: https://github.com/fnando/dopstick/tree/v0.0.4/README.md
214
+ license_uri: https://github.com/fnando/dopstick/tree/v0.0.4/LICENSE.md
196
215
  post_install_message:
197
216
  rdoc_options: []
198
217
  require_paths:
@@ -211,5 +230,5 @@ requirements: []
211
230
  rubygems_version: 3.1.4
212
231
  signing_key:
213
232
  specification_version: 4
214
- summary: Generate a project skeleton for creating a rubygem
233
+ summary: Generate a project skeleton for creating a Ruby/Nodepackage.
215
234
  test_files: []
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require_relative "../lib/<%= gem_name %>"
5
- <%= options[:namespace] %>::CLI.start
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- <%= render_tree { %[require "#{entry_path}/version"] } %>
@@ -1,4 +0,0 @@
1
- # These are supported funding model platforms
2
-
3
- github: [<%= github_user %>]
4
- custom: ["https://paypal.me/<%= paypal_user %>/🍕"]
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require <%= entry_path.inspect %>
@@ -1,50 +0,0 @@
1
- # <%= gem_name %>
2
-
3
- [![Tests](<%= github_url %>/workflows/Tests/badge.svg)](https://github.com/fnando/<%= gem_name %>)
4
- [![Code Climate](https://codeclimate.com/github/<%= github_user %>/<%= gem_name %>/badges/gpa.svg)](https://codeclimate.com/github/<%= github_user %>/<%= gem_name %>)
5
- [![Gem](https://img.shields.io/gem/v/<%= gem_name %>.svg)](https://rubygems.org/gems/<%= gem_name %>)
6
- [![Gem](https://img.shields.io/gem/dt/<%= gem_name %>.svg)](https://rubygems.org/gems/<%= gem_name %>)
7
-
8
- TODO: Add project description here
9
-
10
- ## Installation
11
-
12
- ```bash
13
- gem install <%= gem_name %>
14
- ```
15
-
16
- Or add the following line to your project's Gemfile:
17
-
18
- ```ruby
19
- gem "<%= gem_name %>"
20
- ```
21
-
22
- ## Usage
23
-
24
- TODO: Write gem usage
25
-
26
- ## Maintainer
27
-
28
- - [<%= user_name %>](https://github.com/<%= github_user %>)
29
-
30
- ## Contributors
31
-
32
- - <%= github_url %>/contributors
33
-
34
- ## Contributing
35
-
36
- For more details about how to contribute, please read
37
- <%= github_url %>/blob/main/CONTRIBUTING.md.
38
-
39
-
40
- ## License
41
-
42
- The gem is available as open source under the terms of the
43
- [MIT License](https://opensource.org/licenses/MIT). A copy of the license can be
44
- found at <%= github_url %>/blob/main/LICENSE.md.
45
-
46
- ## Code of Conduct
47
-
48
- Everyone interacting in the <%= gem_name %> project's codebases, issue trackers,
49
- chat rooms and mailing lists is expected to follow the
50
- [code of conduct](<%= github_url %>/blob/main/CODE_OF_CONDUCT.md).
@@ -1,12 +0,0 @@
1
- ---
2
- inherit_gem:
3
- rubocop-fnando: .rubocop.yml
4
-
5
- AllCops:
6
- TargetRubyVersion: <%= oldest_ruby_version.split(".").take(2).join(".") %>
7
- NewCops: enable
8
- <%- if gem_name.include?("-") -%>
9
- Naming/FileName:
10
- Exclude:
11
- - lib/<%= gem_name %>.rb
12
- <%- end -%>