11# frozen_string_literal: true
22
3- require ' thor'
4- require ' pathname'
3+ require " thor"
4+ require " pathname"
55
6- require ' solidus_dev_support/version'
6+ require " solidus_dev_support/version"
77
88module SolidusDevSupport
99 class Extension < Thor
1010 include Thor ::Actions
11- PREFIX = ' solidus_'
11+ PREFIX = " solidus_"
1212
1313 default_command :generate
1414
15- desc ' generate PATH' , ' Generates a new Solidus extension'
16- def generate ( raw_path = '.' )
15+ desc " generate PATH" , " Generates a new Solidus extension"
16+ def generate ( raw_path = "." )
1717 self . path = raw_path
1818
1919 empty_directory path
2020
21- directory ' app' , "#{ path } /app"
22- directory ' lib' , "#{ path } /lib"
23- directory ' bin' , "#{ path } /bin"
24- directory ' .circleci' , "#{ path } /.circleci"
25- directory ' .github' , "#{ path } /.github"
21+ directory " app" , "#{ path } /app"
22+ directory " lib" , "#{ path } /lib"
23+ directory " bin" , "#{ path } /bin"
24+ directory " .circleci" , "#{ path } /.circleci"
25+ directory " .github" , "#{ path } /.github"
2626
2727 Dir [ "#{ path } /bin/*" ] . each do |bin |
2828 make_executable bin
2929 end
3030
31- template ' CHANGELOG.md' , "#{ path } /CHANGELOG.md"
32- template ' extension.gemspec' , "#{ path } /#{ file_name } .gemspec"
33- template ' Gemfile' , "#{ path } /Gemfile"
34- template ' gitignore' , "#{ path } /.gitignore"
35- template ' gem_release.yml.tt' , "#{ path } /.gem_release.yml"
36- template ' LICENSE' , "#{ path } /LICENSE"
37- template ' Rakefile' , "#{ path } /Rakefile"
38- template ' README.md' , "#{ path } /README.md"
39- template ' config/routes.rb' , "#{ path } /config/routes.rb"
40- template ' config/locales/en.yml' , "#{ path } /config/locales/en.yml"
41- template ' rspec' , "#{ path } /.rspec"
42- template ' spec/spec_helper.rb.tt' , "#{ path } /spec/spec_helper.rb"
43- template ' rubocop.yml' , "#{ path } /.rubocop.yml"
44- template ' github_changelog_generator' , "#{ path } /.github_changelog_generator"
31+ template " CHANGELOG.md" , "#{ path } /CHANGELOG.md"
32+ template " extension.gemspec" , "#{ path } /#{ file_name } .gemspec"
33+ template " Gemfile" , "#{ path } /Gemfile"
34+ template " gitignore" , "#{ path } /.gitignore"
35+ template " gem_release.yml.tt" , "#{ path } /.gem_release.yml"
36+ template " LICENSE" , "#{ path } /LICENSE"
37+ template " Rakefile" , "#{ path } /Rakefile"
38+ template " README.md" , "#{ path } /README.md"
39+ template " config/routes.rb" , "#{ path } /config/routes.rb"
40+ template " config/locales/en.yml" , "#{ path } /config/locales/en.yml"
41+ template " rspec" , "#{ path } /.rspec"
42+ template " spec/spec_helper.rb.tt" , "#{ path } /spec/spec_helper.rb"
43+ template " rubocop.yml" , "#{ path } /.rubocop.yml"
44+ template " github_changelog_generator" , "#{ path } /.github_changelog_generator"
4545 end
4646
4747 no_tasks do
@@ -70,17 +70,17 @@ def gemspec_path
7070 end
7171
7272 def default_gemspec
73- @default_gemspec ||= Gem ::Specification . new ( file_name , ' 0.0.1' ) do |gem |
74- gem . author = git ( ' config user.name' , ' TODO: Write your name' )
75- gem . email = git ( ' config user.email' , ' TODO: Write your email address' )
73+ @default_gemspec ||= Gem ::Specification . new ( file_name , " 0.0.1" ) do |gem |
74+ gem . author = git ( " config user.name" , " TODO: Write your name" )
75+ gem . email = git ( " config user.email" , " TODO: Write your email address" )
7676
77- gem . summary = ' TODO: Write a short summary, because RubyGems requires one.'
78- gem . description = ' TODO: Write a longer description or delete this line.'
79- gem . license = ' BSD-3-Clause'
77+ gem . summary = " TODO: Write a short summary, because RubyGems requires one."
78+ gem . description = " TODO: Write a longer description or delete this line."
79+ gem . license = " BSD-3-Clause"
8080
81- gem . metadata [ ' homepage_uri' ] = gem . homepage = "https://github.com/#{ repo } #readme"
82- gem . metadata [ ' changelog_uri' ] = "https://github.com/#{ repo } /blob/main/CHANGELOG.md"
83- gem . metadata [ ' source_code_uri' ] = "https://github.com/#{ repo } "
81+ gem . metadata [ " homepage_uri" ] = gem . homepage = "https://github.com/#{ repo } #readme"
82+ gem . metadata [ " changelog_uri" ] = "https://github.com/#{ repo } /blob/main/CHANGELOG.md"
83+ gem . metadata [ " source_code_uri" ] = "https://github.com/#{ repo } "
8484 end
8585 end
8686
@@ -95,9 +95,9 @@ def existing_gemspec
9595 spec . license ||= default_gemspec . license
9696
9797 spec . homepage ||= default_gemspec . homepage
98- spec . metadata [ ' source_code_uri' ] ||= default_gemspec . metadata [ ' source_code_uri' ]
99- spec . metadata [ ' changelog_uri' ] ||= default_gemspec . metadata [ ' changelog_uri' ]
100- spec . metadata [ ' source_code_uri' ] ||= default_gemspec . metadata [ ' source_code_uri' ]
98+ spec . metadata [ " source_code_uri" ] ||= default_gemspec . metadata [ " source_code_uri" ]
99+ spec . metadata [ " changelog_uri" ] ||= default_gemspec . metadata [ " changelog_uri" ]
100+ spec . metadata [ " source_code_uri" ] ||= default_gemspec . metadata [ " source_code_uri" ]
101101 end
102102 end
103103
@@ -106,7 +106,7 @@ def default_repo
106106 end
107107
108108 def existing_repo
109- git ( ' remote get-url origin' ) &.sub ( %r{^.*github\. com.([^/]+)/([^/.]+).*$} , '\1/\2' )
109+ git ( " remote get-url origin" ) &.sub ( %r{^.*github\. com.([^/]+)/([^/.]+).*$} , '\1/\2' )
110110 end
111111
112112 def git ( command , default = nil )
0 commit comments