gyomu_ruby 0.0.1

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,186 @@
1
+ きみまろ@きみまろ
2
+ さんま@さんま
3
+ たかお@たかお
4
+ だん吉@だんきち
5
+ はじめ@はじめ
6
+ ひとり@ひとり
7
+ まさし@まさし
8
+ ケンイチ@けんいち
9
+ サダヲ@さだお
10
+ サンタマリア@さんたまりあ
11
+ ジョージ@じょーじ
12
+ ジローラモ@じろーらも
13
+ ノブヒコ@のぶひこ
14
+ ヒロ@ひろ
15
+ フミヤ@ふみや
16
+ マサカズ@まさかず
17
+ 一@はじめ
18
+ 一哉@かずや
19
+ 一徳@いっとく
20
+ 一樹@かずき
21
+ 一輝@かずき
22
+ 丈史@たけし
23
+ 丈雄@たけお
24
+ 三省@さんせい
25
+ 三郎@さぶろう
26
+ 了@りょう
27
+ 亮@りょう
28
+ 亮介@りょうすけ
29
+ 人志@ひとし
30
+ 仁@じん
31
+ 仁晶@ひろあき
32
+ 佑@たすく
33
+ 俊二@しゅんじ
34
+ 俊介@しゅんすけ
35
+ 信吾@しんご
36
+ 信輔@しんすけ
37
+ 健@けん
38
+ 優@ゆう
39
+ 優一@ゆういち
40
+ 充則@みつのり
41
+ 光@ひかる
42
+ 光博@みつひろ
43
+ 光洋@みつひろ
44
+ 光臣@みつおみ
45
+ 光良@てるよし
46
+ 克実@かつみ
47
+ 公顕@きみあき
48
+ 六郎@ろくろう
49
+ 兼@けん
50
+ 利夫@としお
51
+ 剛基@よしき
52
+ 功補@こうすけ
53
+ 努@つとむ
54
+ 勇一@ゆういち
55
+ 勇介@ゆうすけ
56
+ 勇太@ゆうた
57
+ 勝久@かつひさ
58
+ 勤@つとむ
59
+ 博之@ひろゆき
60
+ 博明@ひろあき
61
+ 友也@ともや
62
+ 右京@うきょう
63
+ 和久@かずひさ
64
+ 和之@かずゆき
65
+ 哲平@てっぺい
66
+ 啓介@けいすけ
67
+ 圭@けい
68
+ 基祐@きすけ
69
+ 大@まさる
70
+ 大五郎@だいごろう
71
+ 大樹@ひろき
72
+ 太朗@たろう
73
+ 孝太郎@こうたろう
74
+ 守@まもる
75
+ 完爾@かんじ
76
+ 宏@ひろし
77
+ 宏行@ひろゆき
78
+ 寛@ひろし
79
+ 寛治@かんじ
80
+ 寿明@としあき
81
+ 将也@まさや
82
+ 小雁@こがん
83
+ 崇史@たかし
84
+ 幸平@こうへい
85
+ 広之@ひろゆき
86
+ 広司@こうじ
87
+ 康文@やすふみ
88
+ 建@けん
89
+ 弘也@ひろなり
90
+ 徹@とおる
91
+ 徹平@てっぺい
92
+ 悟志@さとし
93
+ 惇@あつし
94
+ 惇@じゅん
95
+ 慎之介@しんのすけ
96
+ 慢太郎@まんたろう
97
+ 慶二@けいじ
98
+ 慶太@けいた
99
+ 憲一@けんいち
100
+ 憲史@のりひと
101
+ 扶樹@もとき
102
+ 拓郎@たくろう
103
+ 敏也@としや
104
+ 敏和@としかず
105
+ 敦@あつし
106
+ 新太@あらた
107
+ 明@あきら
108
+ 明宏@あきひろ
109
+ 明慶@あきよし
110
+ 昴@すばる
111
+ 晃司@こうじ
112
+ 晋也@しんや
113
+ 晴臣@はるおみ
114
+ 有起哉@ゆきや
115
+ 未來@みらい
116
+ 染五郎@そめごろう
117
+ 栄一@えいいち
118
+ 正敏@まさとし
119
+ 正義@まさよし
120
+ 法嗣@ほうし
121
+ 洋@よう
122
+ 洋介@ようすけ
123
+ 浩介@こうすけ
124
+ 浩太郎@こうたろう
125
+ 浩正@ひろまさ
126
+ 淳@あつし
127
+ 満@みつる
128
+ 照生@てるお
129
+ 獅童@しどう
130
+ 直人@なおと
131
+ 真一@しんいち
132
+ 真吾@しんご
133
+ 瞬@しゅん
134
+ 知史@ともふみ
135
+ 研二@けんじ
136
+ 碧海@おうが
137
+ 祐一@ゆういち
138
+ 祐基@ゆうき
139
+ 禄郎@ろくろう
140
+ 秀樹@ひでき
141
+ 秀隆@ひでたか
142
+ 竜也@たつや
143
+ 竜次@りゅうじ
144
+ 米蔵@よねぞう
145
+ 精児@せいじ
146
+ 翔@しょう
147
+ 翔太@しょうた
148
+ 耕司@こうじ
149
+ 聖陽@まさあき
150
+ 聡@さとし
151
+ 育二@いくじ
152
+ 良介@りょうすけ
153
+ 花緑@かろく
154
+ 芳正@よしまさ
155
+ 英嗣@ひでつぐ
156
+ 茂樹@しげき
157
+ 草太@そうた
158
+ 菊生@きくお
159
+ 蒼甫@そうすけ
160
+ 薫@かおる
161
+ 裕司@ゆうじ
162
+ 裕次郎@ゆうじろう
163
+ 誠一@せいいち
164
+ 誠治@せいじ
165
+ 豊@ゆたか
166
+ 貴嶺@たかね
167
+ 賢二@けんじ
168
+ 賢治@けんじ
169
+ 輝信@あきのぶ
170
+ 進@すすむ
171
+ 達士@たつひと
172
+ 鉄二@てつじ
173
+ 鉄洋@てつひろ
174
+ 長利@ながとし
175
+ 陽介@ようすけ
176
+ 隆@たかし
177
+ 隆之介@りゅうのすけ
178
+ 隆博@たかひろ
179
+ 隆太@りゅうた
180
+ 隼士@しゅんじ
181
+ 雄太@ゆうた
182
+ 雅之@まさゆき
183
+ 雅功@まさとし
184
+ 雅彦@まさひこ
185
+ 高史@たかし
186
+ 龍吉@りゅうきち
@@ -0,0 +1,40 @@
1
+ # coding: us-ascii
2
+ require 'forgery'
3
+
4
+ Forgery.load_from!(File.dirname(__FILE__) + '/..')
5
+
6
+ class Forgery::JaName < Forgery
7
+ def self.full_name
8
+ full_name_with_kana.split('@').last
9
+ end
10
+
11
+ def self.full_name_with_kana
12
+ fn, fnk = first_name_with_kana.split('@')
13
+ ln, lnk = last_name_with_kana.split('@')
14
+ "#{ln} #{fn}@#{lnk} #{fnk}"
15
+ end
16
+
17
+ def self.last_name
18
+ last_name_with_kana.split('@').first
19
+ end
20
+
21
+ def self.last_name_with_kana
22
+ dictionaries[:ja_last_names].random
23
+ end
24
+
25
+ def self.first_name
26
+ first_name_with_kana.split('@').first
27
+ end
28
+
29
+ def self.first_name_with_kana
30
+ [dictionaries[:ja_male_first_names], dictionaries[:ja_female_first_names]].random.random
31
+ end
32
+
33
+ def self.male_first_name_with_kana
34
+ dictionaries[:ja_male_first_names].random
35
+ end
36
+
37
+ def self.female_first_name_with_kana
38
+ dictionaries[:ja_female_first_names].random
39
+ end
40
+ end
@@ -0,0 +1,10 @@
1
+ # coding: us-ascii
2
+
3
+ module GyomuRuby
4
+ module OrdinarySystemDevelopment
5
+ osd_dir = 'gyomu_ruby/ordinary_system_development/'
6
+ autoload 'AllYourSiteAreBelongToSsl', osd_dir + 'all_your_site_are_belong_to_ssl'
7
+ autoload 'Translation', osd_dir + 'translated_from'
8
+ end
9
+ OSD = OrdinarySystemDevelopment
10
+ end
@@ -0,0 +1,36 @@
1
+ # coding: utf-8
2
+ module GyomuRuby
3
+ module OrdinarySystemDevelopment
4
+ module AddressFormatter
5
+ PREFS = File.read(
6
+ File.expand_path('../../../config/prefectures.csv', File.dirname(__FILE__))
7
+ ).lines.map(&:strip).freeze
8
+
9
+ ext_tel_numbers = File.read(
10
+ File.expand_path('../../../config/ext_tel_numbers.csv', File.dirname(__FILE__))
11
+ ).lines.map{|n| "0#{n.strip}" }
12
+
13
+ EXT_TEL_NUMBERS = (ext_tel_numbers + %w[050 070 080 090 0120]).sort.reverse.freeze
14
+ EXT_TEL_NUMBERS_RE = /\A(#{EXT_TEL_NUMBERS.sort.reverse.join('|')})/uo
15
+
16
+ module_function
17
+
18
+ def format_zipcode(zipcode_string, blank = '')
19
+ return blank if zipcode_string.blank?
20
+ zipcode_string.sub(/\A(\d{3})(\d{4})\Z/){ "#{$1}-#{$2}" }
21
+ end
22
+
23
+ def format_tel_no(telno_numeric_string, blank = '')
24
+ return blank if telno_numeric_string.blank?
25
+ telno_numeric_string.to_s.
26
+ sub(EXT_TEL_NUMBERS_RE){ "#{$1}-" }.
27
+ sub(/(\d{4})\Z/) { "-#{$1}" }
28
+ end
29
+
30
+ def prefecture_name(prefecture_code, blank = '')
31
+ return blank if prefecture_code.blank?
32
+ PREFS[prefecture_code.to_i - 1]
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,22 @@
1
+ # coding:us-ascii
2
+ require 'rack'
3
+
4
+ module GyomuRuby
5
+ module OrdinarySystemDevelopment
6
+ class AllYourSiteAreBelongToSsl
7
+ def initialize(app)
8
+ @app = app
9
+ end
10
+
11
+ def call(env)
12
+ if env['HTTPS'] == 'on' || env['HTTP_X_FORWARDED_PROTO'] == 'https'
13
+ @app.call(env)
14
+ else
15
+ url = Rack::Request.new(env).url.sub(/^http:/, 'https:')
16
+ body = "<html><body>You are being <a href=\"#{url}\">redirected</a>.</body></html>"
17
+ [301, {'Location' => url, 'Content-Type' => 'text/html'}, [body]]
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,16 @@
1
+ # coding: utf-8
2
+ module GyomuRuby::OrdinarySystemDevelopment
3
+ class Translation
4
+ def self.source(word, scope)
5
+ new('ja').source(word, scope)
6
+ end
7
+
8
+ def initialize(locale = I18n.locale)
9
+ @locale = locale
10
+ end
11
+
12
+ def source(word, scope)
13
+ I18n.t!(scope, locale: @locale).key(word.to_s).try(:to_s)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,3 @@
1
+ module GyomuRuby
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gyomu_ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Eiwa System Management, Inc.
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-04-22 00:00:00.000000000 +09:00
13
+ default_executable:
14
+ dependencies: []
15
+ description: GyomuRuby
16
+ email:
17
+ - rubyagile@qwik.tky.esm.co.jp
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - .gitignore
23
+ - Gemfile
24
+ - Rakefile
25
+ - gyomu_ruby.gemspec
26
+ - lib/gyomu_ruby.rb
27
+ - lib/gyomu_ruby/core_ext/time.rb
28
+ - lib/gyomu_ruby/core_ext/time/biz_year.rb
29
+ - lib/gyomu_ruby/forgery/dictionaries/ja_female_first_names
30
+ - lib/gyomu_ruby/forgery/dictionaries/ja_last_names
31
+ - lib/gyomu_ruby/forgery/dictionaries/ja_male_first_names
32
+ - lib/gyomu_ruby/forgery/forgeries/ja_name.rb
33
+ - lib/gyomu_ruby/ordinary_system_development.rb
34
+ - lib/gyomu_ruby/ordinary_system_development/address_formatter.rb
35
+ - lib/gyomu_ruby/ordinary_system_development/all_your_site_are_belong_to_ssl.rb
36
+ - lib/gyomu_ruby/ordinary_system_development/translated_from.rb
37
+ - lib/gyomu_ruby/version.rb
38
+ has_rdoc: true
39
+ homepage: http://www.esm.co.jp/
40
+ licenses: []
41
+ post_install_message:
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ none: false
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubyforge_project:
59
+ rubygems_version: 1.6.2
60
+ signing_key:
61
+ specification_version: 3
62
+ summary: GyomuRuby
63
+ test_files: []