Skip to content

Commit 3b4818f

Browse files
yurigitsuMarieGiy
authored andcommitted
add: gem structure
1 parent 6a69535 commit 3b4818f

File tree

8 files changed

+237
-0
lines changed

8 files changed

+237
-0
lines changed

.rspec_status

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
example_id | status | run_time |
2+
---------------------------------------------------------------- | ------ | --------------- |
3+
./spec/integration/hati_command/befehl_spec.rb[1:1:1] | passed | 0.00196 seconds |
4+
./spec/integration/hati_command/befehl_spec.rb[1:1:2:1] | passed | 0.00011 seconds |
5+
./spec/integration/hati_command/befehl_spec.rb[1:1:3:1] | passed | 0.00009 seconds |
6+
./spec/integration/hati_command/callee_spec.rb[1:1:1] | passed | 0.00005 seconds |
7+
./spec/integration/hati_command/cmd_spec.rb[1:1:1:1] | passed | 0.0001 seconds |
8+
./spec/integration/hati_command/cmd_spec.rb[1:1:1:2] | passed | 0.00007 seconds |
9+
./spec/integration/hati_command/cmd_spec.rb[1:1:2:1] | passed | 0.0007 seconds |
10+
./spec/integration/hati_command/cmd_spec.rb[1:1:2:2] | passed | 0.00008 seconds |
11+
./spec/integration/hati_command/cmd_spec.rb[1:1:3:1] | passed | 0.00011 seconds |
12+
./spec/integration/hati_command/cmd_spec.rb[1:1:4:1] | passed | 0.00009 seconds |
13+
./spec/unit/hati_command/befehl_spec.rb[1:1:1] | passed | 0.00004 seconds |
14+
./spec/unit/hati_command/befehl_spec.rb[1:2:1] | passed | 0.00004 seconds |
15+
./spec/unit/hati_command/befehl_spec.rb[1:3:1] | passed | 0.00004 seconds |
16+
./spec/unit/hati_command/befehl_spec.rb[1:4:1] | passed | 0.00004 seconds |
17+
./spec/unit/hati_command/callee_spec.rb[1:1:1] | passed | 0.00003 seconds |
18+
./spec/unit/hati_command/cmd_spec.rb[1:1:1] | passed | 0.00003 seconds |
19+
./spec/unit/hati_command/errors/fail_fast_error_spec.rb[1:1:1:1] | passed | 0.00003 seconds |
20+
./spec/unit/hati_command/errors/fail_fast_error_spec.rb[1:1:1:2] | passed | 0.00003 seconds |
21+
./spec/unit/hati_command/errors/fail_fast_error_spec.rb[1:1:2:1] | passed | 0.00004 seconds |
22+
./spec/unit/hati_command/errors/fail_fast_error_spec.rb[1:1:2:2] | passed | 0.00003 seconds |
23+
./spec/unit/hati_command/errors/fail_fast_error_spec.rb[1:2:1] | passed | 0.00056 seconds |
24+
./spec/unit/hati_command/failure_spec.rb[1:1:1] | passed | 0.00058 seconds |
25+
./spec/unit/hati_command/failure_spec.rb[1:2:1] | passed | 0.00004 seconds |
26+
./spec/unit/hati_command/failure_spec.rb[1:3:1] | passed | 0.00004 seconds |
27+
./spec/unit/hati_command/failure_spec.rb[1:4:1] | passed | 0.00004 seconds |
28+
./spec/unit/hati_command/failure_spec.rb[1:5:1] | passed | 0.00045 seconds |
29+
./spec/unit/hati_command/result_spec.rb[1:1:1] | passed | 0.00004 seconds |
30+
./spec/unit/hati_command/result_spec.rb[1:2:1] | passed | 0.00004 seconds |
31+
./spec/unit/hati_command/result_spec.rb[1:3:1] | passed | 0.00003 seconds |
32+
./spec/unit/hati_command/result_spec.rb[1:4:1] | passed | 0.00006 seconds |
33+
./spec/unit/hati_command/success_spec.rb[1:1:1] | passed | 0.00009 seconds |
34+
./spec/unit/hati_command/success_spec.rb[1:2:1] | passed | 0.00005 seconds |
35+
./spec/unit/hati_command/success_spec.rb[1:3:1] | passed | 0.00004 seconds |
36+
./spec/unit/hati_command/success_spec.rb[1:4:1] | passed | 0.00005 seconds |
37+
./spec/unit/hati_command/success_spec.rb[1:5:1] | passed | 0.00003 seconds |
38+
./spec/unit/hati_command/success_spec.rb[1:6:1] | passed | 0.00004 seconds |

.rubocop.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require:
2+
- rubocop-rspec
3+
- rubocop-rake
4+
5+
AllCops:
6+
NewCops: enable
7+
TargetRubyVersion: 3.0
8+
9+
Style/StringLiteralsInInterpolation:
10+
EnforcedStyle: double_quotes

Gemfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
4+
5+
gemspec
6+
7+
gem 'pry'
8+
gem 'rake'
9+
10+
# Spec
11+
gem 'rspec', '~> 3.0'
12+
13+
# Linter & Static
14+
gem 'fasterer', '~> 0.11.0'
15+
gem 'rubocop', '~> 1.21'
16+
gem 'rubocop-rake'
17+
gem 'rubocop-rspec', require: false

Gemfile.lock

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
PATH
2+
remote: .
3+
specs:
4+
hati-command (0.1.0)
5+
6+
GEM
7+
remote: https://rubygems.org/
8+
specs:
9+
ast (2.4.3)
10+
coderay (1.1.3)
11+
diff-lcs (1.6.2)
12+
fasterer (0.11.0)
13+
ruby_parser (>= 3.19.1)
14+
json (2.12.2)
15+
language_server-protocol (3.17.0.5)
16+
lint_roller (1.1.0)
17+
method_source (1.1.0)
18+
parallel (1.27.0)
19+
parser (3.3.8.0)
20+
ast (~> 2.4.1)
21+
racc
22+
prism (1.4.0)
23+
pry (0.15.2)
24+
coderay (~> 1.1)
25+
method_source (~> 1.0)
26+
racc (1.8.1)
27+
rainbow (3.1.1)
28+
rake (13.2.1)
29+
regexp_parser (2.10.0)
30+
rspec (3.13.1)
31+
rspec-core (~> 3.13.0)
32+
rspec-expectations (~> 3.13.0)
33+
rspec-mocks (~> 3.13.0)
34+
rspec-core (3.13.4)
35+
rspec-support (~> 3.13.0)
36+
rspec-expectations (3.13.5)
37+
diff-lcs (>= 1.2.0, < 2.0)
38+
rspec-support (~> 3.13.0)
39+
rspec-mocks (3.13.5)
40+
diff-lcs (>= 1.2.0, < 2.0)
41+
rspec-support (~> 3.13.0)
42+
rspec-support (3.13.4)
43+
rubocop (1.75.7)
44+
json (~> 2.3)
45+
language_server-protocol (~> 3.17.0.2)
46+
lint_roller (~> 1.1.0)
47+
parallel (~> 1.10)
48+
parser (>= 3.3.0.2)
49+
rainbow (>= 2.2.2, < 4.0)
50+
regexp_parser (>= 2.9.3, < 3.0)
51+
rubocop-ast (>= 1.44.0, < 2.0)
52+
ruby-progressbar (~> 1.7)
53+
unicode-display_width (>= 2.4.0, < 4.0)
54+
rubocop-ast (1.44.1)
55+
parser (>= 3.3.7.2)
56+
prism (~> 1.4)
57+
rubocop-rake (0.7.1)
58+
lint_roller (~> 1.1)
59+
rubocop (>= 1.72.1)
60+
rubocop-rspec (3.6.0)
61+
lint_roller (~> 1.1)
62+
rubocop (~> 1.72, >= 1.72.1)
63+
ruby-progressbar (1.13.0)
64+
ruby_parser (3.21.1)
65+
racc (~> 1.5)
66+
sexp_processor (~> 4.16)
67+
sexp_processor (4.17.3)
68+
unicode-display_width (3.1.4)
69+
unicode-emoji (~> 4.0, >= 4.0.4)
70+
unicode-emoji (4.0.4)
71+
72+
PLATFORMS
73+
arm64-darwin-23
74+
ruby
75+
76+
DEPENDENCIES
77+
fasterer (~> 0.11.0)
78+
hati-command!
79+
pry
80+
rake
81+
rspec (~> 3.0)
82+
rubocop (~> 1.21)
83+
rubocop-rake
84+
rubocop-rspec
85+
86+
BUNDLED WITH
87+
2.5.22

hati-command.gemspec

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# frozen_string_literal: true
2+
3+
lib = File.expand_path('lib', __dir__)
4+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5+
6+
require 'hati_command/version'
7+
8+
Gem::Specification.new do |spec|
9+
spec.name = 'hati-command'
10+
spec.version = HatiCommand::VERSION
11+
spec.authors = %w[yurigitsu mariyagiy]
12+
spec.email = ['hackico.ai@gmail.com']
13+
spec.license = 'MIT'
14+
15+
spec.summary = 'A Ruby gem for creating command objects with result handling.'
16+
spec.description = 'hati-command is a Ruby gem for implementing the Command pattern with result handling.'
17+
spec.homepage = "https://github.com/hackico-ai/#{spec.name}"
18+
19+
spec.required_ruby_version = '>= 3.0.0'
20+
21+
spec.files = Dir['CHANGELOG.md', 'LICENSE', 'README.md', 'hati-command.gemspec', 'lib/**/*']
22+
spec.bindir = 'bin'
23+
spec.executables = []
24+
spec.require_paths = ['lib']
25+
26+
spec.metadata['repo_homepage'] = spec.homepage
27+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
28+
29+
spec.metadata['homepage_uri'] = spec.homepage
30+
spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/main/CHANGELOG.md"
31+
spec.metadata['source_code_uri'] = spec.homepage
32+
spec.metadata['bug_tracker_uri'] = "#{spec.homepage}/issues"
33+
34+
spec.metadata['rubygems_mfa_required'] = 'true'
35+
end

spec/.DS_Store

6 KB
Binary file not shown.

spec/spec_helper.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# frozen_string_literal: true
2+
3+
require 'bundler/setup'
4+
require 'hati_command'
5+
6+
RSpec.configure do |config|
7+
config.example_status_persistence_file_path = '.rspec_status'
8+
config.disable_monkey_patching!
9+
config.expect_with :rspec do |c|
10+
c.syntax = :expect
11+
end
12+
13+
Dir[File.join('./spec/support/**/*.rb')].each { |f| require f }
14+
config.include Dummy
15+
end

spec/support/dummy.rb

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# frozen_string_literal: true
2+
3+
# NOTE: helper names follow convention 'support_<module_name>_<helper_name>'
4+
5+
module Dummy
6+
def support_dummy_befehl(name)
7+
stub_const(name, Class.new do
8+
extend HatiCommand::Befehl
9+
end)
10+
end
11+
12+
def support_dummy_calle(name)
13+
stub_const(name, Class.new do
14+
include HatiCommand::Callee
15+
16+
def call(rez)
17+
HatiCommand::Success.new(rez)
18+
end
19+
end)
20+
end
21+
22+
def support_dummy_cmd(name)
23+
stub_const(name, Class.new do
24+
include HatiCommand::Cmd
25+
26+
command do
27+
fail_fast 'Base Fail Fast Message'
28+
end
29+
end)
30+
end
31+
32+
def support_dummy_error(name)
33+
stub_const(name, Class.new(StandardError))
34+
end
35+
end

0 commit comments

Comments
 (0)