nugem 0.8.1 → 0.9.0

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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -6
  3. data/CHANGELOG.md +34 -0
  4. data/Gemfile +26 -0
  5. data/README.md +49 -27
  6. data/exe/nugem +3 -3
  7. data/lib/nugem/cli/cli_gem.rb +15 -15
  8. data/lib/nugem/cli/cli_jekyll.rb +38 -34
  9. data/lib/nugem/cli/cli_rails.rb +7 -7
  10. data/lib/nugem/cli.rb +65 -44
  11. data/lib/nugem/git.rb +62 -59
  12. data/lib/nugem/repository.rb +4 -3
  13. data/lib/nugem/version.rb +1 -1
  14. data/lib/nugem.rb +10 -23
  15. data/lib/util.rb +27 -0
  16. data/nugem.gemspec +33 -12
  17. data/spec/spec_helper.rb +1 -4
  18. data/templates/common/executable_scaffold/exe/%gem_name%.tt +2 -2
  19. data/templates/common/executable_scaffold/lib/%gem_name%/cli.rb.tt +17 -9
  20. data/templates/common/executable_scaffold/lib/%gem_name%/options.rb.tt +31 -0
  21. data/templates/common/gem_scaffold/%gem_name%.gemspec.tt +4 -4
  22. data/templates/common/gem_scaffold/.bundle/config +2 -0
  23. data/templates/common/gem_scaffold/.gitignore.tt +27 -0
  24. data/templates/common/gem_scaffold/.markdownlint.json +8 -0
  25. data/templates/common/gem_scaffold/.rspec +2 -0
  26. data/templates/common/gem_scaffold/.rubocop.yml.tt +78 -0
  27. data/templates/common/gem_scaffold/.shellcheckrc +5 -0
  28. data/templates/common/gem_scaffold/.vscode/%gem_name%.json.code-snippets.tt +19 -0
  29. data/templates/common/gem_scaffold/.vscode/extensions.json +22 -0
  30. data/templates/common/gem_scaffold/.vscode/launch.json +68 -0
  31. data/templates/common/gem_scaffold/.vscode/settings.json +5 -0
  32. data/templates/common/gem_scaffold/CHANGELOG.md.tt +4 -1
  33. data/templates/common/gem_scaffold/Gemfile.tt +16 -26
  34. data/templates/common/gem_scaffold/README.md.tt +53 -13
  35. data/templates/common/gem_scaffold/bin/attach +2 -1
  36. data/templates/common/gem_scaffold/bin/build +7 -0
  37. data/templates/common/gem_scaffold/bin/reset +4 -0
  38. data/templates/common/gem_scaffold/bin/setup.tt +6 -3
  39. data/templates/common/gem_scaffold/lib/%gem_name%.rb.tt +2 -0
  40. data/templates/common/gem_scaffold/test/test_helper.rb.tt +3 -3
  41. data/templates/jekyll/block_no_arg_scaffold/lib/%block_name%.rb.tt +1 -1
  42. data/templates/jekyll/block_scaffold/lib/%block_name%.rb.tt +32 -10
  43. data/templates/jekyll/common_scaffold/spec/spec_helper.rb +1 -1
  44. data/templates/jekyll/demo/demo/Gemfile.tt +6 -5
  45. data/templates/jekyll/demo/demo/_bin/debug +7 -16
  46. data/templates/jekyll/demo/demo/_layouts/default.html.tt +1 -1
  47. data/templates/jekyll/hooks_scaffold/lib/dumpers.rb +1 -1
  48. data/templates/jekyll/tag_no_arg_scaffold/lib/%tag_name%.rb.tt +1 -1
  49. data/templates/jekyll/tag_scaffold/lib/%tag_name%.rb.tt +38 -11
  50. data/templates/rails/engine_scaffold/app/assets/images/%gem_name%/.keep +0 -0
  51. data/templates/rails/engine_scaffold/app/assets/javascripts/%gem_name%/.keep +0 -0
  52. data/templates/rails/engine_scaffold/app/assets/stylesheets/%gem_name%/.keep +0 -0
  53. data/templates/rails/engine_scaffold/app/controllers/.keep +0 -0
  54. data/templates/rails/engine_scaffold/app/helpers/.keep +0 -0
  55. data/templates/rails/engine_scaffold/app/mailers/.keep +0 -0
  56. data/templates/rails/engine_scaffold/app/models/.keep +0 -0
  57. data/templates/rails/engine_scaffold/app/views/.keep +0 -0
  58. data/templates/rails/plugin_scaffold/.envrc +1 -0
  59. data/templates/rails/plugin_scaffold/.simplecov.tt +18 -0
  60. data/templates/rails/plugin_scaffold/.travis.yml +4 -0
  61. data/templates/rails/plugin_scaffold/test/dummy/.envrc +1 -0
  62. data/templates/rails/plugin_scaffold/test/dummy/app/assets/images/.keep +0 -0
  63. data/templates/rails/plugin_scaffold/test/dummy/app/controllers/concerns/.keep +0 -0
  64. data/templates/rails/plugin_scaffold/test/dummy/app/models/.keep +0 -0
  65. data/templates/rails/plugin_scaffold/test/dummy/app/models/concerns/.keep +0 -0
  66. data/templates/rails/plugin_scaffold/test/dummy/bin/setup +1 -1
  67. data/templates/rails/plugin_scaffold/test/dummy/lib/assets/.keep +0 -0
  68. data/templates/rails/plugin_scaffold/test/dummy/log/.keep +0 -0
  69. data/templates/rails/rails_scaffold/test/dummy/.envrc +1 -0
  70. data/templates/rails/rails_scaffold/test/dummy/app/assets/images/.keep +0 -0
  71. data/templates/rails/rails_scaffold/test/dummy/app/controllers/concerns/.keep +0 -0
  72. data/templates/rails/rails_scaffold/test/dummy/app/models/.keep +0 -0
  73. data/templates/rails/rails_scaffold/test/dummy/app/models/concerns/.keep +0 -0
  74. data/templates/rails/rails_scaffold/test/dummy/bin/setup +1 -1
  75. data/templates/rails/rails_scaffold/test/dummy/lib/assets/.keep +0 -0
  76. data/templates/rails/rails_scaffold/test/dummy/log/.keep +0 -0
  77. metadata +62 -7
@@ -0,0 +1,78 @@
1
+ require:
2
+ <%- if @jekyll -%>
3
+ # - rubocop-jekyll
4
+ <%- end -%>
5
+ - rubocop-md
6
+ - rubocop-performance
7
+ <%- if @test_framework == 'minitest' -%>
8
+ - rubocop-minitest
9
+ <%- end -%>
10
+ - rubocop-rake
11
+ <%- if @test_framework == 'rspec' -%>
12
+ - rubocop-rspec
13
+ <%- end -%>
14
+
15
+ AllCops:
16
+ Exclude:
17
+ - binstub/**/*
18
+ - exe/**/*
19
+ - vendor/**/*
20
+ - Gemfile*
21
+ NewCops: enable
22
+
23
+ Gemspec/DeprecatedAttributeAssignment:
24
+ Enabled: false
25
+
26
+ Gemspec/RequireMFA:
27
+ Enabled: false
28
+
29
+ Layout/HashAlignment:
30
+ EnforcedColonStyle: table
31
+ EnforcedHashRocketStyle: table
32
+
33
+ Layout/LineLength:
34
+ Max: 150
35
+
36
+ Metrics/AbcSize:
37
+ Max: 35
38
+
39
+ Metrics/BlockLength:
40
+ Exclude:
41
+ - <%= @gem_name %>.gemspec
42
+ Max: 30
43
+
44
+ Metrics/CyclomaticComplexity:
45
+ Max: 15
46
+
47
+ Metrics/MethodLength:
48
+ Max: 40
49
+
50
+ Metrics/ModuleLength:
51
+ Enabled: false
52
+
53
+ Metrics/PerceivedComplexity:
54
+ Max: 15
55
+
56
+ Naming/FileName:
57
+ Exclude:
58
+ - Rakefile
59
+
60
+ Style/Documentation:
61
+ Enabled: false
62
+
63
+ Style/FrozenStringLiteralComment:
64
+ Enabled: false
65
+
66
+ Style/TrailingCommaInHashLiteral:
67
+ EnforcedStyleForMultiline: comma
68
+ <%- if @test_framework == 'rspec' -%>
69
+
70
+ RSpec/SpecFilePathFormat:
71
+ IgnoreMethods: true
72
+
73
+ RSpec/ExampleLength:
74
+ Max: 30
75
+
76
+ RSpec/MultipleExpectations:
77
+ Max: 15
78
+ <%- end -%>
@@ -0,0 +1,5 @@
1
+ disable=SC1091
2
+ disable=SC2059
3
+ disable=SC2086
4
+ disable=SC2155
5
+ disable=SC2181
@@ -0,0 +1,19 @@
1
+ {
2
+ // Place your workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3
+ // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4
+ // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5
+ // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6
+ // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7
+ // Placeholders with the same ids are connected.
8
+ // Example:
9
+ // "Print to console": {
10
+ // "scope": "javascript,typescript",
11
+ // "prefix": "log",
12
+ // "body": [
13
+ // "console.log('$1');",
14
+ // "$2"
15
+ // ],
16
+ // "description": "Log output to console"
17
+ // }
18
+ //
19
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3
+ // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4
+
5
+ // List of extensions which should be recommended for users of this workspace.
6
+ "recommendations": [
7
+ "DavidAnson.vscode-markdownlint",
8
+ "devonray.snippet",
9
+ "KoichiSasada.vscode-rdbg",
10
+ "misogi.ruby-rubocop",
11
+ "redhat.vscode-yaml",
12
+ "shd101wyy.markdown-preview-enhanced",
13
+ "Shopify.ruby-lsp",
14
+ "timonwong.shellcheck",
15
+ ],
16
+ // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
17
+ "unwantedRecommendations": [
18
+ "castwide.solargraph",
19
+ "rebornix.Ruby",
20
+ "wingrunr21.vscode-ruby",
21
+ ]
22
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ <%- if @jekyll -%>
8
+ {
9
+ "args": [
10
+ "serve",
11
+ "--livereload_port", "35721",
12
+ "--force_polling",
13
+ "--host", "0.0.0.0",
14
+ "--port", "4001",
15
+ "--future",
16
+ "--incremental",
17
+ "--livereload",
18
+ "--drafts",
19
+ "--unpublished"
20
+ ],
21
+ "cwd": "${workspaceRoot}/demo",
22
+ "debugPort": "0",
23
+ "name": "Debug Demo",
24
+ "request": "launch",
25
+ "script": "${workspaceRoot}/binstub/jekyll",
26
+ "type": "rdbg",
27
+ },
28
+ <%- end -%>
29
+ {
30
+ "args": [],
31
+ "debugPort": "0",
32
+ "name": "Debug current file with rdbg",
33
+ "script": "${file}",
34
+ "request": "launch",
35
+ "type": "rdbg",
36
+ "useBundler": true,
37
+ },
38
+ {
39
+ "name": "Run selected Ruby file with ruby_lsp",
40
+ "program": "ruby ${file}",
41
+ "request": "launch",
42
+ "type": "ruby_lsp"
43
+ },
44
+ {
45
+ "debugPort": "0",
46
+ "name": "Attach with rdbg",
47
+ "request": "attach",
48
+ "type": "rdbg",
49
+ },
50
+ {
51
+ "name": "Attach with ruby_lsp",
52
+ "request": "attach",
53
+ "type": "ruby_lsp",
54
+ },
55
+ {
56
+ "name": "RSpec - active spec file only",
57
+ "program": "binstub/rspec -I ${workspaceRoot} ${file}",
58
+ "request": "launch",
59
+ "type": "ruby_lsp",
60
+ },
61
+ {
62
+ "name": "RSpec - all",
63
+ "program": "${workspaceRoot}/binstub/rspec -I ${workspaceRoot}",
64
+ "request": "launch",
65
+ "type": "ruby_lsp",
66
+ }
67
+ ]
68
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "ruby.rubocop.configFilePath": ".rubocop.yml",
3
+ "ruby.rubocop.useBundler": true,
4
+ "ruby.rubocop.executePath": "./binstub/"
5
+ }
@@ -1,2 +1,5 @@
1
+ # Change Log
2
+
1
3
  ## 0.1.0
2
- * Initial release.
4
+
5
+ * Initial release.
@@ -3,23 +3,11 @@ source 'https://rubygems.org'
3
3
  # The <%= @gem_name %> gem dependencies are defined in <%= @gem_name %>.gemspec
4
4
  gemspec
5
5
 
6
- <%- if @jekyll -%>
7
6
  group :test, :development do
8
- gem 'bundler', '>= 2.4.6', require: false
9
- <%- if @repository.public? -%>
10
- gem 'coveralls', require: false
11
- <%- end -%>
12
- gem 'debase', '0.2.5.beta2', require: false
7
+ gem 'debug', '>= 1.0.0', require: false
13
8
  gem 'gem-release', '>= 2.2.2', require: false
14
- <%- if @minitest -%>
15
- gem 'minitest', '>= 5.18.0', require: false
16
- gem 'minitest-reporters', '>= 1.6.0', require: false
17
- gem 'minitest-screenshot-reporter', '~> 0.0.6', require: false
18
- <%- end -%>
19
9
  gem 'rake', require: false
20
- <%- if @rspec -%>
21
10
  gem 'rspec', require: false
22
- <%- end -%>
23
11
  gem 'rubocop', require: false
24
12
  gem 'rubocop-md', require: false
25
13
  <%- if @minitest -%>
@@ -27,30 +15,32 @@ group :test, :development do
27
15
  <%- end -%>
28
16
  gem 'rubocop-performance', require: false
29
17
  gem 'rubocop-rake', require: false
18
+ <%- if @rspec -%>
30
19
  gem 'rubocop-rspec', require: false
31
- gem 'ruby-debug-ide', require: false
20
+ <%- end -%>
32
21
  end
33
- <%- end -%>
34
- <%- if @plugin -%>
22
+ <%- if @rails -%>
23
+
35
24
  group :test, :development do
36
- gem 'bundler', '>= 2.4.6', require: false
37
25
  gem 'capybara', '~> 3.39.1', require: false
38
26
  gem 'capybara_minitest_spec', '~> 1.0.7', require: false
39
27
  <%- if @repository.public? -%>
40
28
  gem 'coveralls', require: false
41
29
  <%- end -%>
42
30
  gem 'database_cleaner', '~> 2.0.2', require: false
43
- gem 'gem-release', '>= 2.2.2', require: false
31
+ gem 'erb_lint', require: false
32
+ <%- if @minitest -%>
33
+ gem 'minitest', '>= 5.18.0', require: false
34
+ gem 'minitest-reporters', '>= 1.6.0', require: false
35
+ gem 'minitest-screenshot-reporter', '~> 0.0.6', require: false
36
+ <%- end -%>
44
37
  gem 'poltergeist', '~> 1.10.1', require: false
45
38
  gem 'quiet_assets'
46
- gem 'rubocop', require: false
47
- gem 'rubocop-md', require: false
48
- gem 'rubocop-performance', require: false
49
- gem 'rubocop-rake', require: false
50
- <%- if @rspec -%>
51
- gem 'rubocop-rspec', require: false
52
- <%- end -%>
53
39
  gem 'selenium-webdriver', '~> 4.9.1', require: false
54
40
  gem 'sqlite3'
55
- end
41
+ end
56
42
  <%- end -%>
43
+
44
+ group :test do
45
+ gem 'rspec-match_ignoring_whitespace'
46
+ end
@@ -1,5 +1,3 @@
1
- # <%= @class_name %>
2
-
3
1
  <%- if @repository.public? -%>
4
2
  # `<%= gem_name.capitalize %>` [![Gem Version](https://badge.fury.io/rb/<%= gem_name %>.svg)](https://badge.fury.io/rb/<%= gem_name %>)
5
3
  <%- else -%>
@@ -12,21 +10,30 @@
12
10
  ## Installation
13
11
 
14
12
  <%- if @jekyll -%>
15
- Add this line to your Jekyll website's Gemfile, within the jekyll_plugins group:
13
+ Add the following to your Jekyll website's `Gemfile`:
16
14
 
15
+ ```ruby
17
16
  group :jekyll_plugins do
18
17
  gem '<%= @gem_name %>'
19
18
  end
19
+ ```
20
20
  <%- end -%>
21
21
  <%- unless @jekyll -%>
22
- Add this line to your application's Gemfile:
22
+ Either add this line to your application&rsquo;s `Gemfile`:
23
23
 
24
24
  ```ruby
25
25
  gem '<%= @gem_name %>'
26
26
  ```
27
+
28
+ ... or add the following to your application&rsquo;s `.gemspec`:
29
+
30
+ ```ruby
31
+ spec.add_dependency '<%= @gem_name %>'
32
+ ```
27
33
  <%- end -%>
28
34
 
29
35
  And then execute:
36
+
30
37
  ```shell
31
38
  $ bundle
32
39
  ```
@@ -39,24 +46,57 @@ $ bundle
39
46
 
40
47
  ## Development
41
48
 
42
- After checking out the repo, run `bin/setup` to install dependencies.
43
- Then, run `rake test` to run the tests.
44
- You can also run `bin/console` for an interactive prompt that will allow you to experiment.
49
+ After checking out this git repository, install dependencies by typing:
50
+
51
+ ```shell
52
+ $ bin/setup
53
+ ```
54
+
55
+ You should do the above before running Visual Studio Code.
56
+
57
+
58
+ ### Run the Tests
59
+
60
+ ```shell
61
+ $ bundle exec rake test
62
+ ```
45
63
 
46
- To install this gem onto your local machine, run `bundle exec rake install`.
47
64
 
48
- To release a new version, run `bundle exec rake release`,
49
- which will create a git tag for the version, push git commits and tags,
50
- and push the `.gem` file to <%= @repository.gem_server_url -%>.
65
+ ### Interactive Session
66
+
67
+ The following will allow you to experiment:
68
+
69
+ ```shell
70
+ $ bin/console
71
+ ```
72
+
73
+
74
+ ### Local Installation
75
+
76
+ To install this gem onto your local machine, type:
77
+
78
+ ```shell
79
+ $ bundle exec rake install
80
+ ```
81
+
82
+
83
+ ### To Release A New Version
84
+
85
+ To create a git tag for the new version, push git commits and tags,
86
+ and push the new version of the gem to <%= @repository.gem_server_url -%>, type:
87
+
88
+ ```shell
89
+ $ bundle exec rake release
90
+ ```
51
91
 
52
92
 
53
93
  ## Contributing
54
94
 
55
- Bug reports and pull requests are welcome on <%= @repository.host %> at <%= @repository.url %>.
95
+ Bug reports and pull requests are welcome at <%= @repository.url %>.
56
96
 
57
97
 
58
98
  <%- if @repository.public? -%>
59
99
  ## License
60
100
 
61
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
101
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
62
102
  <%- end -%>
@@ -31,4 +31,5 @@ bin/build
31
31
  set -e
32
32
 
33
33
  cd "$1" > /dev/null || exit 1
34
- _bin/debug
34
+ shift
35
+ _bin/debug "$@"
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+
3
+ NAME="$( basename -s .git "$( git remote get-url origin )" )"
4
+
5
+ gem uninstall "$NAME" -aIx --user-install --force
6
+
7
+ bundle exec rake install
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+
3
+ git checkout . # restores project
4
+ git clean -fd # Nukes untracked files and directories
@@ -10,15 +10,18 @@ done
10
10
  DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
11
11
  cd "$DIR/.." || exit
12
12
 
13
+ if [[ $(which apt) ]]; then
14
+ if [[ ! -f /usr/lib/x86_64-linux-gnu/libyaml.so ]]; then sudo apt install libyaml-dev; fi
15
+ fi
16
+
13
17
  rm -f Gemfile.lock
14
- bundle
18
+ if [[ -z "$( which bundle )" ]]; then gem install bundler; fi
19
+ BUNDLE_WITH="development" bundle
15
20
 
16
- bundle binstubs debase --force --path binstub
17
21
  <%- if @jekyll -%>
18
22
  bundle binstubs jekyll --force --path binstub
19
23
  <%- end -%>
20
24
  bundle binstubs rspec-core --force --path binstub
21
25
  bundle binstubs rubocop --force --path binstub
22
- bundle binstubs ruby-debug-ide --force --path binstub
23
26
 
24
27
  # Do any other automated setup that you need to do here
@@ -10,3 +10,5 @@ require_relative '<%= @gem_name %>/version'
10
10
  Dir[File.join(__dir__, '*.rb')].each do |file|
11
11
  require file unless file.end_with?('/<%= @gem_name %>.rb')
12
12
  end
13
+
14
+ # Write the code for your gem here
@@ -3,7 +3,7 @@ require 'coveralls'
3
3
  Coveralls.wear!
4
4
  <%- end -%>
5
5
 
6
- <%- unless @plugin -%>
6
+ <%- unless @rails -%>
7
7
  $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
8
8
  require '<%= @gem_name %>'
9
9
  <%- end -%>
@@ -11,7 +11,7 @@ require '<%= @gem_name %>'
11
11
  require 'minitest/autorun'
12
12
 
13
13
  require 'minitest/reporters'
14
- <%- if @plugin -%>
14
+ <%- if @rails -%>
15
15
  require 'minitest/reporters/screenshot_reporter'
16
16
  Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new,
17
17
  Minitest::Reporters::JUnitReporter.new,
@@ -23,7 +23,7 @@ Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
23
23
  # Filter out Minitest backtrace while allowing backtrace from other libraries to be shown.
24
24
  Minitest.backtrace_filter = Minitest::BacktraceFilter.new
25
25
 
26
- <%- if @plugin -%>
26
+ <%- if @rails -%>
27
27
  require File.expand_path('../test/dummy/config/environment.rb', __dir__)
28
28
  ActiveRecord::Migrator.migrations_paths = [File.expand_path('../test/dummy/db/migrate', __dir__)]
29
29
  <%- if @mountable -%>
@@ -1,5 +1,5 @@
1
1
  require 'jekyll_plugin_support'
2
- require_relative '<%= @gem_name %>/version.rb'
2
+ require_relative '<%= @gem_name %>/version'
3
3
 
4
4
  module <%= @class_name %>
5
5
  PLUGIN_NAME = '<%= @block_name %>'.freeze unless defined? PLUGIN_NAME
@@ -1,8 +1,7 @@
1
1
  require 'jekyll_plugin_support'
2
- require_relative '<%= @gem_name %>/version.rb'
2
+ require 'helper/jekyll_plugin_helper'
3
+ require_relative '<%= @gem_name %>/version'
3
4
 
4
- # This Jekyll block tag plugin is a minimal example.
5
- #
6
5
  # See https://www.mslinn.com/jekyll/10200-jekyll-plugin-background.html
7
6
  # See https://www.mslinn.com/jekyll/10400-jekyll-plugin-template-collection.html
8
7
  #
@@ -16,23 +15,46 @@ require_relative '<%= @gem_name %>/version.rb'
16
15
  # You can control the log level when you start Jekyll.
17
16
  # To set the log level to :debug, write an entery into _config.yml, like this:
18
17
  # plugin_loggers:
19
- # MyBlockTag: debug
18
+ # <%= @jekyll_class_name %>: debug
20
19
 
21
20
  module <%= @class_name %>
22
- # This class implements the Jekyll block tag functionality
21
+ # This class implements the Jekyll <%= @tag_name %> functionality
23
22
  class <%= @jekyll_class_name %> < JekyllSupport::JekyllBlock
24
23
  PLUGIN_NAME = '<%= @block_name %>'.freeze
25
24
  VERSION = <%= @class_name %>::VERSION
26
25
 
27
- # Put your plugin logic here.
26
+ # See https://github.com/mslinn/jekyll_plugin_support#argument-parsing
27
+ #
28
28
  # The following variables are predefined:
29
- # @argument_string, @block_name, @config, @envs, @helper, @layout, @logger, @mode, @page, @paginator, @site and @theme
29
+ # @argument_string, @config, @envs, @helper, @layout, @logger, @mode, @page, @paginator, @site and @theme
30
+ # @tag_name [String] is the name of the tag, which we already know.
31
+ # @argument_string [String] the arguments from the web page.
32
+ # @tokens [Liquid::ParseContext] tokenized command line
30
33
  #
31
- # @return [String]
34
+ # @helper provides these read-only attributes:
35
+ # argv, attribution, keys_values, liquid_context, logger, markup, no_arg_parsing, params, tag_name,
36
+ # argv_original, excerpt_caller, keys_values_original, params_original
37
+ # @helper provides these class methods:
38
+ # expand_env, register, remove_quotes
39
+ # @helper provides these instance methods:
40
+ # attribution_string
41
+ # default_attribution
42
+ # delete_parameter
43
+ # dereference_include_variable
44
+ # dereference_variable
45
+ # lookup_variable
46
+ # parameter_specified?('option/keyword name') || 'default value' # parse option value/keyword
47
+ # gem_file __FILE__ # Enables attribution
48
+ # remaining_markup # unparsed markup passed to this plugin
49
+ # reinitialize # Returns markup remaining after `parameter_specified?` has been invoked.
50
+ # remaining_markup_original
51
+ #
52
+ # @return [string] markup to be rendered on web page
32
53
  def render_impl(content)
33
54
  <%= parse_jekyll_parameters %>
34
55
 
35
- # Compute the return value of this Jekyll tag
56
+ # Put your plugin logic here and modify the following return value.
57
+
36
58
  <<~HEREDOC
37
59
  <pre class="example">
38
60
  content = '#{content}'
@@ -45,6 +67,6 @@ module <%= @class_name %>
45
67
  exit 3
46
68
  end
47
69
 
48
- JekyllPluginHelper.register(self, PLUGIN_NAME)
70
+ ::JekyllSupport::JekyllPluginHelper.register(self, PLUGIN_NAME)
49
71
  end
50
72
  end
@@ -30,7 +30,7 @@ class SiteMock
30
30
  attr_reader :config
31
31
 
32
32
  def initialize
33
- @config = YAML.safe_load(File.read('../demo/_config.yml'))
33
+ @config = YAML.safe_load_file(File.read('../demo/_config.yml'))
34
34
  @config['env'] = { 'JEKYLL_ENV' => 'development' }
35
35
  end
36
36
 
@@ -14,8 +14,9 @@ group :jekyll_plugins do
14
14
  gem 'jekyll-tagging'
15
15
  end
16
16
 
17
- gem 'debase', '0.2.5.beta2', require: false
18
- gem 'rspec-core', require: false
19
- gem 'rubocop', require: false
20
- gem 'rubocop-rspec', require: false
21
- gem 'ruby-debug-ide', require: false
17
+ group :test, :development do
18
+ gem 'debug', '>= 1.0.0', require: false
19
+ gem 'rspec-core', require: false
20
+ gem 'rubocop', require: false
21
+ gem 'rubocop-rspec', require: false
22
+ end
@@ -1,12 +1,10 @@
1
1
  #!/bin/bash
2
2
 
3
- # shellcheck disable=SC2086,SC2155,SC2059
4
-
5
3
  function help {
6
4
  echo "
7
5
  $(basename $0) - Run the demo Jekyll website.
8
- By default the demo Jekyll website runs without restriction under ruby-debug-ide and debase,
9
- and listens on 0.0.0.0:1234.
6
+ By default the demo Jekyll website runs without restriction under debug,
7
+ and listens on 0.0.0.0.
10
8
  Options:
11
9
  -h Show this error message
12
10
  -r Run freely, without a debugger
@@ -38,12 +36,10 @@ while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
38
36
  [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
39
37
  done
40
38
  DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
41
- cd "$DIR/.."
42
-
43
- # dispatcher-port and dispatcher-port are arbitrarily chosen to prevent conflicts with other instances.
39
+ cd "$DIR/.." || exit
44
40
 
45
41
  run="serve \
46
- --livereload_port 25721 \
42
+ --livereload-port 25721 \
47
43
  --force_polling \
48
44
  --host 0.0.0.0 \
49
45
  --port 4444 \
@@ -53,19 +49,14 @@ run="serve \
53
49
  --drafts \
54
50
  --unpublished"
55
51
 
56
- ../bin/setup
57
-
52
+ export BUNDLE_WITH=development
58
53
  rm -f Gemfile.lock
59
54
  bundle
60
55
  bundle exec ../binstub/jekyll clean # Ensure all hooks get called
61
56
 
62
57
  if [ "$RUN_FREE" ]; then
63
- bundle exec ../binstub/jekyll $run
58
+ bundle exec jekyll $run
64
59
  else
65
- bundle exec ../binstub/rdebug-ide \
66
- --host 0.0.0.0 \
67
- --port 1234 \
68
- --dispatcher-port 26162 \
69
- -- \
60
+ bundle exec rdbg -O --port=0 -- \
70
61
  ../binstub/jekyll $run
71
62
  fi
@@ -49,7 +49,7 @@ layout: compress
49
49
  <p class="copyright" id="copyright" xmlns:dct="http://purl.org/dc/terms/" xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#">
50
50
  <a rel="license" style="float: left; margin-right: 1em; padding-top: 9px; padding-bottom: 2em;"
51
51
  href="http://creativecommons.org/publicdomain/zero/1.0/">
52
- <img src="http://i.creativecommons.org/p/zero/1.0/88x31.png" style="border-style: none;" alt="CC0" />
52
+ <img src="/assets/images/favicon.png" style="border-style: none;" alt="CC0" />
53
53
  </a>
54
54
  To the extent possible under law,
55
55
  <a rel="dct:publisher"
@@ -117,7 +117,7 @@ module Dumpers
117
117
  # :unpublished
118
118
  # attr_reader :cache_dir, :config, :dest, :filter_cache, :includes_load_paths,
119
119
  # :liquid_renderer, :profiler, :regenerator, :source
120
- def dump_site(logger, msg, site) # rubocop:disable Metrics/AbcSize
120
+ def dump_site(logger, msg, site)
121
121
  logger.info do
122
122
  <<~END_INFO
123
123
  #{msg} site
@@ -1,5 +1,5 @@
1
1
  require 'jekyll_plugin_support'
2
- require_relative '<%= @gem_name %>/version.rb'
2
+ require_relative '<%= @gem_name %>/version'
3
3
 
4
4
  module <%= @class_name %>
5
5
  class <%= @jekyll_class_name %> < JekyllTag