faker-indian 0.1.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.
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "faker"
4
+
5
+ module Faker
6
+ module Indian
7
+ class Phone
8
+ class << self
9
+ def mobile_number
10
+ first_digit = random.rand(6..9)
11
+ remaining = random.rand(0..999_999_999)
12
+ "+91 #{first_digit}#{format("%09d", remaining)}"
13
+ end
14
+
15
+ private
16
+
17
+ def random
18
+ Faker::Config.random
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "faker"
4
+
5
+ module Faker
6
+ module Indian
7
+ class Vehicle
8
+ STATE_CODES = Data.load(:vehicle).fetch(:state_codes).freeze
9
+ LETTERS = ("A".."Z").to_a.freeze
10
+
11
+ class << self
12
+ def registration_number
13
+ "#{state_code}#{rto_code}#{series}#{number}"
14
+ end
15
+
16
+ def state_code
17
+ STATE_CODES.sample(random: random)
18
+ end
19
+
20
+ private
21
+
22
+ def random
23
+ Faker::Config.random
24
+ end
25
+
26
+ def rto_code
27
+ format("%02d", random.rand(1..99))
28
+ end
29
+
30
+ def series
31
+ Array.new(2) { LETTERS.sample(random: random) }.join
32
+ end
33
+
34
+ def number
35
+ format("%04d", random.rand(1..9999))
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Faker
4
+ module Indian
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "faker"
4
+
5
+ require_relative "indian/version"
6
+ require_relative "indian/data"
7
+ require_relative "indian/name"
8
+ require_relative "indian/identity"
9
+ require_relative "indian/payment"
10
+ require_relative "indian/vehicle"
11
+ require_relative "indian/address"
12
+ require_relative "indian/phone"
13
+ require_relative "indian/food"
14
+ require_relative "indian/languages"
15
+
16
+ module Faker
17
+ module Indian
18
+ class Error < StandardError; end
19
+ end
20
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "faker/indian"
@@ -0,0 +1,6 @@
1
+ module Faker
2
+ module Indian
3
+ VERSION: String
4
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: faker-indian
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jyoti Sharma
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2026-05-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faker
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Generate fake Indian identity, payment, languages, food and address data
28
+ for testing and development.
29
+ email:
30
+ - jyoti.sharma.ror@gmail.com
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - ".rspec"
36
+ - ".rubocop.yml"
37
+ - CHANGELOG.md
38
+ - CODE_OF_CONDUCT.md
39
+ - LICENSE.txt
40
+ - README.md
41
+ - Rakefile
42
+ - lib/faker-indian.rb
43
+ - lib/faker/indian.rb
44
+ - lib/faker/indian/address.rb
45
+ - lib/faker/indian/data.rb
46
+ - lib/faker/indian/data/address.yml
47
+ - lib/faker/indian/data/food.yml
48
+ - lib/faker/indian/data/identity.yml
49
+ - lib/faker/indian/data/languages.yml
50
+ - lib/faker/indian/data/name.yml
51
+ - lib/faker/indian/data/payment.yml
52
+ - lib/faker/indian/data/vehicle.yml
53
+ - lib/faker/indian/food.rb
54
+ - lib/faker/indian/identity.rb
55
+ - lib/faker/indian/languages.rb
56
+ - lib/faker/indian/name.rb
57
+ - lib/faker/indian/payment.rb
58
+ - lib/faker/indian/phone.rb
59
+ - lib/faker/indian/vehicle.rb
60
+ - lib/faker/indian/version.rb
61
+ - sig/faker/indian.rbs
62
+ homepage: https://github.com/JyotiSharma1234/faker-indian
63
+ licenses:
64
+ - MIT
65
+ metadata:
66
+ allowed_push_host: https://rubygems.org
67
+ homepage_uri: https://github.com/JyotiSharma1234/faker-indian
68
+ source_code_uri: https://github.com/JyotiSharma1234/faker-indian
69
+ changelog_uri: https://github.com/JyotiSharma1234/faker-indian/CHANGELOG.md
70
+ post_install_message:
71
+ rdoc_options: []
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 3.1.0
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ requirements: []
85
+ rubygems_version: 3.3.27
86
+ signing_key:
87
+ specification_version: 4
88
+ summary: Fake Indian data generators for Ruby
89
+ test_files: []