mogu 0.8.1 → 0.8.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 269a89adb5358437707573187ca45661b19bde3752d18cda866624c22feffa4b
4
- data.tar.gz: 26189a50fd73c9ceefcbef18a05bf161f1832fe26f6449decad4ee8af094e1bd
3
+ metadata.gz: 7cfcb386f6a8cc2342aaa53e245068f14da126b99eea5ab95786fa7aff0cebc4
4
+ data.tar.gz: 80c1998857f984edde779511cbee168f514830ccaeb838f46f0098ff54b6aa74
5
5
  SHA512:
6
- metadata.gz: bdb9286c8524786c016a556b946a135de8df76cb0be38a6277b9edac6245d6235f3754bdfd4c61e7f7980db9a41a9435d16e90c68caaf6c75f804125bf2d667b
7
- data.tar.gz: '0291883c08d156c983f845408f53eafe57d0576c58b065015ba3c5b7ee937fa3d3eff431367feb73d371a1860b6777cb5aff4d91a609bcbd2f7baabae2e1eaa8'
6
+ metadata.gz: d151e5513c7c34bbdc13b32761eec9fb8dbb031a6c4f14b98d0ec9221493669550446c3de04b573a627d75df415e38f59cd061b0b06534e3058ea48f04e4bb2a
7
+ data.tar.gz: 3214f8aa26b2d7d579f5abed91cbde09dd988cfb83ee08d8ef50a2bbc7bbbb0014362b9dc43d6a8ad594b47ea2638be1cade48e2ea86abfc349c1ee672d42398
@@ -16,5 +16,5 @@ jobs:
16
16
  with:
17
17
  ruby-version: 2.7
18
18
  bundler-cache: true
19
- - name: Run rubocop and spec
20
- run: bundle exec rake rubocop spec
19
+ - name: Run rake task
20
+ run: bundle exec rake
@@ -0,0 +1,35 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ otp-code:
7
+ description: OTP code
8
+ required: true
9
+
10
+ jobs:
11
+ build:
12
+ name: Build + Publish
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: read
16
+ packages: write
17
+
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+ - name: Set up Ruby
21
+ uses: actions/setup-ruby@v1
22
+ with:
23
+ ruby-version: 3.1.x
24
+
25
+ - name: Publish to RubyGems
26
+ run: |
27
+ mkdir -p $HOME/.gem
28
+ touch $HOME/.gem/credentials
29
+ chmod 0600 $HOME/.gem/credentials
30
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
31
+ gem build *.gemspec
32
+ gem push *.gem
33
+ env:
34
+ GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
35
+ GEM_HOST_OTP_CODE: "${{ github.event.inputs.otp-code }}"
data/Rakefile CHANGED
@@ -7,4 +7,13 @@ require 'rubocop/rake_task'
7
7
  RSpec::Core::RakeTask.new(:spec)
8
8
  RuboCop::RakeTask.new(:rubocop)
9
9
 
10
- task default: %i[rubocop spec]
10
+ desc 'Run Steep check'
11
+ task :steep do
12
+ require 'steep'
13
+ require 'steep/cli'
14
+
15
+ result = Steep::CLI.new(argv: ['check'], stdout: $stdout, stderr: $stderr, stdin: $stdin).run
16
+ abort 'Steep check failed' if result.nonzero?
17
+ end
18
+
19
+ task default: %i[rubocop steep spec]
@@ -13,6 +13,7 @@ module Mogu
13
13
  @database = customizes.include?('database') ? ask_database : []
14
14
  @javascript = customizes.include?('javascript') ? ask_javascript : []
15
15
  @css = customizes.include?('css') ? ask_css : []
16
+ @asset_pipeline = customizes.include?('asset_pipeline') ? ask_asset_pipeline : []
16
17
  @skips = customizes.include?('skips') ? ask_skips : []
17
18
 
18
19
  Rails::Command.invoke :application, ['new', *to_opt]
@@ -35,6 +36,7 @@ module Mogu
35
36
  unless @is_api
36
37
  handler.option('javascript (Default: importmap)') { 'javascript' }
37
38
  handler.option('css') { 'css' }
39
+ handler.option('asset pipline (Default: sprokets)') { 'asset_pipeline' }
38
40
  end
39
41
 
40
42
  handler.option('skips') { 'skips' }
@@ -71,6 +73,16 @@ module Mogu
71
73
  end
72
74
  end
73
75
 
76
+ def ask_asset_pipeline
77
+ options = %w[sprokets propshaft]
78
+
79
+ ::CLI::UI::Prompt.ask 'Choose asset pipline' do |handler|
80
+ options.each do |option|
81
+ handler.option(option) { |s| ['-a', s] }
82
+ end
83
+ end
84
+ end
85
+
74
86
  def ask_skips
75
87
  ::CLI::UI::Prompt.ask 'Choose skips', multiple: true do |handler|
76
88
  handler.option('test') { '--skip-test' }
@@ -84,6 +96,7 @@ module Mogu
84
96
  @database,
85
97
  @javascript,
86
98
  @css,
99
+ @asset_pipeline,
87
100
  *@skips
88
101
  ].flatten
89
102
  end
@@ -9,6 +9,10 @@
9
9
 
10
10
  <% if gems.include? 'rubocop' %>
11
11
  gem 'rubocop-rails', group: :development, require: false
12
+
13
+ <% if gems.include? 'rspec' %>
14
+ gem 'rubocop-rspec', group: :development, require: false
15
+ <% end %>
12
16
  <% end %>
13
17
 
14
18
  <% if gems.include? 'solargraph' %>
@@ -19,6 +23,9 @@
19
23
  create_file '.rubocop.yml', <<~YML
20
24
  require:
21
25
  - rubocop-rails
26
+ <% if gems.include? 'rspec' %>
27
+ - rubocop-rspec
28
+ <% end %>
22
29
 
23
30
  AllCops:
24
31
  NewCops: enable
@@ -28,7 +35,7 @@
28
35
  YML
29
36
  <% end %>
30
37
 
31
- run 'bundle install'
38
+ Bundler.original_system 'bundle install'
32
39
 
33
40
  <% if gems.include? 'rspec' %>
34
41
  generate 'rspec:install'
data/lib/mogu/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mogu
4
- VERSION = '0.8.1'
4
+ VERSION = '0.8.4'
5
5
  end
@@ -8,6 +8,7 @@ module Mogu
8
8
  @database: Array[String]
9
9
  @javascript: Array[String]
10
10
  @css: Array[String]
11
+ @asset_pipline: Array[String]
11
12
  @skips: Array[String]
12
13
 
13
14
  def run: -> void
@@ -19,6 +20,7 @@ module Mogu
19
20
  def ask_database: -> Array[String]
20
21
  def ask_javascript: -> Array[String]
21
22
  def ask_css: -> Array[String]
23
+ def ask_asset_pipeline: -> Array[String]
22
24
  def ask_skips: -> Array[String]
23
25
  def to_opt: -> Array[String]
24
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mogu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoguraStore
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-17 00:00:00.000000000 Z
11
+ date: 2022-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cli-ui
@@ -63,6 +63,7 @@ files:
63
63
  - ".devcontainer/devcontainer.json"
64
64
  - ".devcontainer/docker-compose.yml"
65
65
  - ".github/workflows/ci.yml"
66
+ - ".github/workflows/gem-push.yml"
66
67
  - ".gitignore"
67
68
  - ".rspec"
68
69
  - ".rubocop.yml"