faker-japanese-name 0.2.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 39d0a9f7ffef6efb3a268fb16285098f862cca2cbf970d4f8e01dc4ee6ea235e
4
+ data.tar.gz: 45f498a2df1a84a4de0f5a5ff4b97ea29d213efa2532911c3803a1900d410b6a
5
+ SHA512:
6
+ metadata.gz: 66bf2d80d151bb1ade07f3f01d52dc2afa8c25c6b0aba77b04bce084a5e80207ffb312be637de18382c279b003f0501495ad5e6dbd78153ba1b3863ea9d4bd11
7
+ data.tar.gz: 6d15bc4d58235ffc71e559df583a18516f73c13a55702e0418c4eba88cbe01811a12f87a6527ad4231ab64005c833c4e1d9adbce15e166ec761247e4958cef57
@@ -0,0 +1,22 @@
1
+ FROM mcr.microsoft.com/devcontainers/base:1-bookworm
2
+
3
+ RUN apt-get update && \
4
+ export DEBIAN_FRONTEND=noninteractive && \
5
+ apt-get -y install --no-install-recommends \
6
+ fish \
7
+ build-essential autoconf libssl-dev libyaml-dev zlib1g-dev libffi-dev libgmp-dev rustc && \
8
+ rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
9
+
10
+ # Install asdf
11
+ RUN curl -L 'https://github.com/asdf-vm/asdf/releases/download/v0.18.0/asdf-v0.18.0-linux-amd64.tar.gz' | tar -xz -C /usr/local/bin && \
12
+ mkdir -p /home/vscode/.config/fish/conf.d && \
13
+ curl -L 'https://raw.githubusercontent.com/asdf-vm/asdf/refs/tags/v0.18.0/asdf.fish' > /home/vscode/.config/fish/conf.d/asdf.fish && \
14
+ chown -R vscode:vscode /home/vscode/.config
15
+
16
+ # Install asdf plugins and specified runtimes
17
+ USER vscode
18
+ WORKDIR /home/vscode
19
+ COPY --chown=vscode:vscode .tool-versions /home/vscode/.tool-versions
20
+ RUN asdf plugin add ruby && \
21
+ asdf install && \
22
+ asdf reshim
@@ -0,0 +1,18 @@
1
+ name: "faker-japanese-name"
2
+
3
+ services:
4
+ faker-japanese-name:
5
+ build:
6
+ context: ..
7
+ dockerfile: .devcontainer/Dockerfile
8
+
9
+ volumes:
10
+ - ../..:/workspaces:cached
11
+ - ./fish/conf.d/abbrs.fish:/home/vscode/.config/fish/conf.d/abbrs.fish
12
+ - ./fish/functions/git.fish:/home/vscode/.config/fish/conf.d/git.fish
13
+
14
+ # Overrides default command so things don't shut down after the process ends.
15
+ command: sleep infinity
16
+
17
+ # Uncomment the next line to use a non-root user for all processes.
18
+ user: vscode
@@ -0,0 +1,37 @@
1
+ // For format details, see https://containers.dev/implementors/json_reference/.
2
+ // For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3
+ {
4
+ "name": "faker-japanese-name",
5
+ "dockerComposeFile": "compose.yaml",
6
+ "service": "faker-japanese-name",
7
+ "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
8
+
9
+ // Features to add to the dev container. More info: https://containers.dev/features.
10
+ "features": {
11
+ "ghcr.io/devcontainers/features/github-cli:1": {}
12
+ },
13
+
14
+ "containerEnv": {},
15
+
16
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
17
+ "forwardPorts": [],
18
+
19
+ // Configure tool-specific properties.
20
+ "customizations": {
21
+ "vscode": {
22
+ "settings": {
23
+ "terminal.integrated.defaultProfile.linux": "fish"
24
+ },
25
+ "extensions": [
26
+ "EditorConfig.EditorConfig",
27
+ "Shopify.ruby-lsp",
28
+ ]
29
+ }
30
+ },
31
+
32
+ // Uncomment to connect as root instead. More info: https://containers.dev/implementors/json_reference/#remoteUser.
33
+ // "remoteUser": "root",
34
+
35
+ // Use 'postCreateCommand' to run commands after the container is created.
36
+ "postCreateCommand": "./.devcontainer/post_create.fish"
37
+ }
@@ -0,0 +1,3 @@
1
+ if type -q git
2
+ abbr -a g git
3
+ end
@@ -0,0 +1,12 @@
1
+ if type -q git
2
+ function git
3
+ if test (count $argv) -eq 0
4
+ git status
5
+ else if test $argv[1] = "up"
6
+ git rev-parse --is-inside-work-tree > /dev/null 2>&1 && \
7
+ cd (pwd)/(git rev-parse --show-cdup)
8
+ else
9
+ command git $argv
10
+ end
11
+ end
12
+ end
@@ -0,0 +1 @@
1
+ #!/bin/fish
data/.editorconfig ADDED
@@ -0,0 +1,12 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+
11
+ [*.{md,markdown}]
12
+ trim_trailing_whitespace = false
data/.standard.yml ADDED
@@ -0,0 +1,2 @@
1
+ # For available configuration options, see:
2
+ # https://github.com/standardrb/standard
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.1.6
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Shuhei YOSHIDA
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # Faker::JapaneseName
2
+
3
+ A Faker gem that provides Japanese family names and gender-specific given names, along with their kana (reading).
4
+
5
+ ## Features
6
+ - Random generation of Japanese family and given names (male/female)
7
+ - All names include kana (reading) information
8
+ - Data sourced from Wikidata (CC0-1.0 license)
9
+
10
+ ## Installation
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ ```ruby
15
+ gem 'faker-japanese-name'
16
+ ```
17
+
18
+ And then execute:
19
+
20
+ ```sh
21
+ bundle install
22
+ ```
23
+
24
+ Or install it yourself as:
25
+
26
+ ```sh
27
+ gem install faker-japanese-name
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ First, require the gem:
33
+
34
+ ```ruby
35
+ require 'faker-japanese-name'
36
+ ```
37
+
38
+ ### Generate a Full Name
39
+
40
+ ```ruby
41
+ name = Faker::JapaneseName.name
42
+ puts name[:name] #=> "佐藤 太郎"
43
+ puts name[:kana] #=> "さとう たろう"
44
+ ```
45
+
46
+ ### Generate Male or Female Full Name
47
+
48
+ ```ruby
49
+ male_name = Faker::JapaneseName.male_name
50
+ puts male_name[:name] #=> "佐藤 太郎"
51
+ puts male_name[:kana] #=> "さとう たろう"
52
+
53
+ female_name = Faker::JapaneseName.female_name
54
+ puts female_name[:name] #=> "佐藤 花子"
55
+ puts female_name[:kana] #=> "さとう はなこ"
56
+ ```
57
+
58
+ ### Generate Family Name Only
59
+
60
+ ```ruby
61
+ family = Faker::JapaneseName.family_name
62
+ puts family[:name] #=> "佐藤"
63
+ puts family[:kana] #=> "さとう"
64
+ ```
65
+
66
+ ### Generate Given Name Only
67
+
68
+ ```ruby
69
+ given = Faker::JapaneseName.given_name
70
+ puts given[:name] #=> "太郎"
71
+ puts given[:kana] #=> "たろう"
72
+ ```
73
+
74
+ ### Generate Male or Female Given Name
75
+
76
+ ```ruby
77
+ male = Faker::JapaneseName.male_given_name
78
+ puts male[:name] #=> "太郎"
79
+ puts male[:kana] #=> "たろう"
80
+
81
+ female = Faker::JapaneseName.female_given_name
82
+ puts female[:name] #=> "花子"
83
+ puts female[:kana] #=> "はなこ"
84
+ ```
85
+
86
+ ### About the Return Value
87
+
88
+ Each method returns a hash with `:name` and `:kana` keys, containing the Japanese name and its reading in kana.
89
+
90
+ ## Data
91
+
92
+ - Data source: Wikidata (CC0-1.0)
93
+ - Data files: Data files in the `data/` directory
94
+
95
+ ## License
96
+
97
+ - Code: MIT License
98
+ - Name data: Wikidata, CC0-1.0 License
99
+
100
+ ## Acknowledgements
101
+
102
+ This gem was created with reference to [tily/ruby-faker-japanese](https://github.com/tily/ruby-faker-japanese). Many thanks to the original author for inspiration.
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create
7
+
8
+ require "standard/rake"
9
+
10
+ task default: %i[test standard]