greeting-hxy 0.0.2 → 0.0.3

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: 75fc29d5078f2640a60d12531c9832013fb469cab5b19c0da1369219bfd20aba
4
- data.tar.gz: '018748a8c5572ca270e30ffcf9df6ac4978218f3fa68eaaad3d7d3d440c08140'
3
+ metadata.gz: aed68f271f1c84d888d2965718c3fced8a7a7dc78008fd42a0332fdd432ddb9f
4
+ data.tar.gz: 522d4a05f7a24d15988a0dc26f0ad92225a60939cd36e88852c9fa11500df240
5
5
  SHA512:
6
- metadata.gz: 8cb7f3894dfb8f3f16ff7c744b9d4abc1705311d65aad349a5111a9eed289a2272925386ab49bd81546ec0513468e404475d5c3be6ca413a22ebc23a147dda1a
7
- data.tar.gz: 8a52f3ad92ab9ee3b300cfa14d23247af397726f1f14a82871f6f082b8dfa96c1039ef6280d879efacaec033df6e20ec0fab4fb4f38246d5f6305f7d8d47f9fc
6
+ metadata.gz: 7a632e7f4f89177dde091cccf3df0d1910c168edbf02525d35de15a7121d21c64e29d6496213a2cb3a8df094309d5015b3a2c40ed003707095736a96e6eb2169
7
+ data.tar.gz: c87cb3f45f873e8f7909802471c2037c23b51ee2981e5e6f4d7f577f4ad5e4329d2e53505370ddc58b84ac5aae65c395a9d3cbe0dfc7c2d186895deb630ca144
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in greeting.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Greeting
2
+
3
+ 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/greeting`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'greeting'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install greeting
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ 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).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/greeting.
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ task default: %i[]
data/greeting.gemspec CHANGED
@@ -1,15 +1,31 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = 'greeting-hxy'
5
- s.version = "0.0.2"
6
- s.authors = ['hxxyyang']
7
- s.description = 'My first gem.'
8
- s.license = 'MIT'
9
- s.executables = ['greeting']
10
- s.files = `git ls-files -z`.split("\0")
11
- s.homepage = 'https://github.com/hxxyyyang/greeting'
12
- s.summary = 'My first gem.'
13
-
14
- s.required_ruby_version = '>= 2.0.0'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/greeting/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "greeting-hxy"
7
+ spec.version = Greeting::VERSION
8
+ spec.authors = ["hxxyyyang"]
9
+ spec.email = ["hxxyyyang@163.com"]
10
+
11
+ spec.license = 'MIT'
12
+ spec.summary = "My first gem."
13
+ spec.homepage = "https://github.com/hxxyyyang/greeting.git"
14
+ spec.required_ruby_version = ">= 2.4.0"
15
+
16
+ spec.metadata["homepage_uri"] = spec.homepage
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
21
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
22
+ end
23
+ spec.executables = ["greeting"]
24
+ spec.require_paths = ["lib"]
25
+
26
+ # Uncomment to register a new dependency of your gem
27
+ # spec.add_dependency "example-gem", "~> 1.0"
28
+
29
+ # For more information and examples about making a new gem, checkout our
30
+ # guide at: https://bundler.io/guides/creating_gem.html
15
31
  end
@@ -0,0 +1,8 @@
1
+ module Greeting
2
+ class Color
3
+ def self.with_color(s)
4
+ color = (30..37).to_a.shuffle.first
5
+ "\033[#{color}m#{s}\033[0m"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Greeting
4
+ VERSION = "0.0.3"
5
+ end
data/lib/greeting.rb CHANGED
@@ -1,5 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "greeting/version"
4
+ require_relative "greeting/color"
5
+
1
6
  module Greeting
2
7
  def self.say_hello(name)
3
- puts "Hello, #{name}"
8
+ puts Color.with_color("Hello, #{name}!")
4
9
  end
5
- end
10
+ end
metadata CHANGED
@@ -1,29 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: greeting-hxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
- - hxxyyang
7
+ - hxxyyyang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-14 00:00:00.000000000 Z
11
+ date: 2022-05-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: My first gem.
13
+ description:
14
14
  email:
15
+ - hxxyyyang@163.com
15
16
  executables:
16
17
  - greeting
17
18
  extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
21
+ - ".gitignore"
22
+ - Gemfile
23
+ - README.md
24
+ - Rakefile
20
25
  - bin/greeting
21
26
  - greeting.gemspec
22
27
  - lib/greeting.rb
23
- homepage: https://github.com/hxxyyyang/greeting
28
+ - lib/greeting/color.rb
29
+ - lib/greeting/version.rb
30
+ homepage: https://github.com/hxxyyyang/greeting.git
24
31
  licenses:
25
32
  - MIT
26
- metadata: {}
33
+ metadata:
34
+ homepage_uri: https://github.com/hxxyyyang/greeting.git
27
35
  post_install_message:
28
36
  rdoc_options: []
29
37
  require_paths:
@@ -32,7 +40,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
32
40
  requirements:
33
41
  - - ">="
34
42
  - !ruby/object:Gem::Version
35
- version: 2.0.0
43
+ version: 2.4.0
36
44
  required_rubygems_version: !ruby/object:Gem::Requirement
37
45
  requirements:
38
46
  - - ">="