tanshuku 4.0.1 → 4.0.2

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: ceb5303a7a452e3b70b9d8c1873b627096804691a11388d59a7e79ed19192111
4
- data.tar.gz: 52d0b5ecb461972537aaa8998d60306a76f85327a8fa72f400fa7376e9fa2877
3
+ metadata.gz: 076e5ce40463d17a9fa6361a0e8a317fb15d1428300921e8527b6765a2f62ee8
4
+ data.tar.gz: bd412ced4ce541d9b4896ea8382caeaf6ec9a4ea7cd8c33e3f4364c643b93538
5
5
  SHA512:
6
- metadata.gz: 5e1906a0852e7e982473a38fce39d49fc0ca8673e39ba17b906afe0bec0e27691f0e62e7f4a755507c4431d0baf9862cca089134ffab8cd3dca714df02af5b9e
7
- data.tar.gz: 9971952c5f6f59e62a8b0a1773297b224447fcf52abdd55ba28a1b64b8a3396bf01e848bf30107e5a1e4f24e1d808ffb06f421ea08acf1d673667dd42ae59d13
6
+ metadata.gz: 1e1f3ad12c2f5d59c9536ea37a11018502391e455693cf75ea54b94cacee202a0247483978e4192be13886c28ccf67db380d528f6467894204db952858d2fbb5
7
+ data.tar.gz: '07801692da343d445145619b9ac9c87895a1c0644c60864ac24bd2721a948558c644ea8354fa4e8ea254fe1b95d4ec8eef0d0fdbc3ab8617c697bebe3e6475d9'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class CreateTanshukuUrls < ActiveRecord::Migration[7.0]
3
+ class CreateTanshukuUrls < ActiveRecord::Migration[Rails::VERSION::STRING.to_f]
4
4
  def change
5
5
  create_table :tanshuku_urls do |t|
6
6
  t.text :url, null: false
@@ -11,7 +11,7 @@ class CreateTanshukuUrls < ActiveRecord::Migration[7.0]
11
11
  # You might adjust the `limit: 20` depending on `.key_length` and `.key_generator` of `Tanshuku.config`.
12
12
  t.string :key, null: false, limit: 20, index: { unique: true }, comment: "cf. Tanshuku::Url.generate_key"
13
13
 
14
- t.datetime :created_at, null: false, precision: nil
14
+ t.datetime :created_at, null: false
15
15
  end
16
16
  end
17
17
  end
@@ -24,8 +24,16 @@ module Tanshuku
24
24
  # rubocop:disable Rails/TimeZone
25
25
  old_filename = "20230220123456_create_tanshuku_urls.rb"
26
26
  new_filename = old_filename.sub("20230220123456", Time.now.strftime("%Y%m%d%H%M%S"))
27
- copy_file "../../../db/migrate/#{old_filename}", "db/migrate/#{new_filename}"
28
27
  # rubocop:enable Rails/TimeZone
28
+
29
+ old_filepath = "../../../db/migrate/#{old_filename}"
30
+ new_filepath = "db/migrate/#{new_filename}"
31
+
32
+ copy_file old_filepath, new_filepath
33
+
34
+ # rubocop:disable Lint/NumberConversion
35
+ gsub_file new_filepath, "Rails::VERSION::STRING.to_f", Rails::VERSION::STRING.to_f.to_s
36
+ # rubocop:enable Lint/NumberConversion
29
37
  end
30
38
  end
31
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tanshuku
4
- VERSION = "4.0.1"
4
+ VERSION = "4.0.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tanshuku
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kg8m
@@ -60,7 +60,6 @@ files:
60
60
  - lib/tanshuku/configuration.rb
61
61
  - lib/tanshuku/engine.rb
62
62
  - lib/tanshuku/version.rb
63
- - lib/tasks/check_all.rb
64
63
  - sig/app/controllers/tanshuku/urls_controller.rbs
65
64
  - sig/app/models/tanshuku/url.rbs
66
65
  - sig/db/migrate/create_tanshuku_urls.rbs
@@ -69,7 +68,6 @@ files:
69
68
  - sig/lib/tanshuku/configuration.rbs
70
69
  - sig/lib/tanshuku/engine.rbs
71
70
  - sig/lib/tanshuku/version.rbs
72
- - sig/lib/tasks/check_all.rbs
73
71
  homepage: https://github.com/kg8m/tanshuku
74
72
  licenses:
75
73
  - MIT
@@ -1,69 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "English"
4
- require "io/console"
5
- require "paint"
6
- require "pty"
7
-
8
- class CheckAll
9
- TASKNAMES = %i[rubocop spec steep:check yard:check].freeze
10
- LINE = Paint["-" * (IO.console or raise).winsize[1], :bold]
11
- TITLE_TEMPLATE = Paint["\n#{LINE}\nExecute: %<command>s\n#{LINE}\n\n", :bold]
12
-
13
- attr_reader :failed_commands
14
-
15
- def self.call
16
- new.call
17
- end
18
-
19
- def initialize
20
- @failed_commands = []
21
- end
22
-
23
- def call
24
- # rubocop:disable ThreadSafety/NewThread
25
- TASKNAMES.map { |taskname| Thread.new(taskname, &executor) }.each(&:join)
26
- # rubocop:enable ThreadSafety/NewThread
27
- output_result
28
- end
29
-
30
- private
31
-
32
- def executor
33
- lambda do |taskname|
34
- command = "bundle exec rake #{taskname}"
35
-
36
- outputs = [] #: Array[String]
37
- outputs << format(TITLE_TEMPLATE, command:)
38
-
39
- # Use `PTY.spawn` to get colorized outputs of each command.
40
- PTY.spawn(command) do |reader, writer, pid|
41
- writer.close
42
-
43
- while (output = reader.gets)
44
- outputs << output
45
- end
46
-
47
- Process.wait(pid)
48
- end
49
- failed_commands << command unless $CHILD_STATUS&.success?
50
-
51
- puts outputs.join
52
- end
53
- end
54
-
55
- def output_result
56
- puts ""
57
- puts LINE
58
- puts Paint["Result", :bold]
59
- puts LINE
60
-
61
- if failed_commands.empty?
62
- puts Paint["\nAll checks are OK.", :green, :bold]
63
- else
64
- puts Paint["\nChecks failed!!\n", :red, :bold]
65
- puts failed_commands.map { |command| " - #{command}" }.join("\n")
66
- abort ""
67
- end
68
- end
69
- end
@@ -1,18 +0,0 @@
1
- class CheckAll
2
- TASKNAMES: Array[Symbol]
3
- LINE: String
4
- TITLE_TEMPLATE: String
5
-
6
- attr_reader failed_commands: Array[String]
7
-
8
- def initialize: () -> void
9
-
10
- def self.call: () -> void
11
-
12
- def call: () -> void
13
-
14
- private
15
-
16
- def executor: () -> ^(*String) -> void
17
- def output_result: () -> void
18
- end