shout-metal 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 300bff4cc0620e4d90c729131413fa759906ac5b7b24aefb91fb76039fe1fcc8
4
+ data.tar.gz: 7bcba780c86a82e7583624c4efe0ee9e4fac1e58db32213cce8b5a7be18970da
5
+ SHA512:
6
+ metadata.gz: 6962f15637352b9f546e41068ff6638be8e908268511fcf756e4f2c4138e2f0a1e43592322d78c2f0c628cf8f47c52b5e6afad1a96e8355ab21bb898a369b681
7
+ data.tar.gz: 28cd3d3b8179aa7e318ab9bbe9b63fd11cd931d49a3a1bbb25447e121fbe7dd865987178d48fd2c0a4bb97510bcb9887e83c3a78bc3b90f99035fa959eddad3b
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2023-10-15
4
+
5
+ - Initial release
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Shout::Metal
2
+
3
+ TODO: Delete this and the text below, and describe your gem
4
+
5
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/shout/metal`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ ## Installation
8
+
9
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
+
11
+ Install the gem and add to the application's Gemfile by executing:
12
+
13
+ $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
14
+
15
+ If bundler is not being used to manage dependencies, install the gem by executing:
16
+
17
+ $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
+
27
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
+
29
+ ## Contributing
30
+
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/shout-metal.
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
data/bin/ma-calc ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../lib/shout_metal'
3
+
4
+ arg_limit = ARGV[0] || 100
5
+ arg_time = ARGV[1] || 3
6
+ ShoutMetal.shout
7
+ ShoutMetal.calc(limit: arg_limit.to_i, time: arg_time.to_i)
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ShoutMetal
4
+ VERSION = "0.2.2"
5
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "shout_metal/version"
4
+
5
+ module ShoutMetal
6
+ class Error < StandardError; end
7
+ # Your code goes here...
8
+ def self.shout
9
+ puts 'Are you metal?'
10
+ end
11
+
12
+ def self.continue_break
13
+ puts "\n続けますか?(y/n)"
14
+ user_will = STDIN.gets.chomp
15
+ if user_will == 'y'
16
+ puts ''
17
+ return true
18
+ elsif user_will == 'n'
19
+ puts ''
20
+ return false
21
+ else
22
+ puts 'yまたはnの一文字の形式で入力してください'
23
+ continue_break
24
+ end
25
+ end
26
+
27
+ def self.calc(limit: 100, time: 3)
28
+ time.times{
29
+ base1 = rand(1..limit.to_i)
30
+ base2 = rand(1..limit.to_i)
31
+
32
+ puts '暗算してください'
33
+ puts "#{base1.to_s} + #{base2.to_s}"
34
+ ans = base1 + base2
35
+
36
+ user_ans = STDIN.gets
37
+ puts "解答は#{base1 + base2}です"
38
+
39
+ puts "あなたの解答は#{user_ans}です"
40
+
41
+ if ans != user_ans.to_i
42
+ print "\e[31m間違いです\e[0m"
43
+ else
44
+ print "\e[32m正解です\e[0m"
45
+ end
46
+
47
+ break if !continue_break
48
+ }
49
+ puts "お疲れ様でした"
50
+ end
51
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/shout_metal/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "shout-metal"
7
+ spec.version = ShoutMetal::VERSION
8
+ spec.authors = ["reisuta"]
9
+ spec.email = ["in345vain@gmail.com"]
10
+
11
+ spec.summary = "Metalにします"
12
+ spec.description = "M/E/T/A/L"
13
+ spec.homepage = "https://github.com/reisuta/shout-metal"
14
+ spec.required_ruby_version = ">= 2.6.0"
15
+
16
+ # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
17
+
18
+ spec.metadata["homepage_uri"] = spec.homepage
19
+ # spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
20
+ # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
21
+
22
+ # Specify which files should be added to the gem when it is released.
23
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
+ spec.files = Dir.chdir(__dir__) do
25
+ `git ls-files -z`.split("\x0").reject do |f|
26
+ (File.expand_path(f) == __FILE__) ||
27
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
28
+ end
29
+ end
30
+ spec.bindir = "bin"
31
+ # spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
+ spec.executables = ['ma-calc']
33
+ spec.require_paths = ["lib"]
34
+
35
+ # Uncomment to register a new dependency of your gem
36
+ # spec.add_dependency "example-gem", "~> 1.0"
37
+
38
+ # For more information and examples about making a new gem, check out our
39
+ # guide at: https://bundler.io/guides/creating_gem.html
40
+ end
@@ -0,0 +1,4 @@
1
+ module ShoutMetal
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,53 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shout-metal
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.2
5
+ platform: ruby
6
+ authors:
7
+ - reisuta
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-10-15 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: M/E/T/A/L
14
+ email:
15
+ - in345vain@gmail.com
16
+ executables:
17
+ - ma-calc
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - ".rspec"
22
+ - CHANGELOG.md
23
+ - README.md
24
+ - Rakefile
25
+ - bin/ma-calc
26
+ - lib/shout_metal.rb
27
+ - lib/shout_metal/version.rb
28
+ - shout-metal.gemspec
29
+ - sig/shout_metal.rbs
30
+ homepage: https://github.com/reisuta/shout-metal
31
+ licenses: []
32
+ metadata:
33
+ homepage_uri: https://github.com/reisuta/shout-metal
34
+ post_install_message:
35
+ rdoc_options: []
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 2.6.0
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ requirements: []
49
+ rubygems_version: 3.4.14
50
+ signing_key:
51
+ specification_version: 4
52
+ summary: Metalにします
53
+ test_files: []