rack-ketai 0.2.3 → 0.2.4
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.
- data/lib/rack/ketai/carrier/abstract.rb +11 -0
- data/lib/rack/ketai/carrier/android.rb +9 -0
- data/lib/rack/ketai/carrier/cidrs/au.rb +1 -12
- data/lib/rack/ketai/carrier/cidrs/docomo.rb +1 -1
- data/lib/rack/ketai/carrier/cidrs/softbank.rb +6 -4
- data/lib/rack/ketai/carrier/iphone.rb +9 -1
- data/lib/rack/ketai/carrier/mobile.rb +4 -0
- data/lib/rack/ketai/carrier/smartphone.rb +1 -1
- metadata +69 -81
- data/VERSION +0 -1
- data/rack-ketai.gemspec +0 -91
- data/spec/spec_helper.rb +0 -11
- data/spec/unit/android_spec.rb +0 -50
- data/spec/unit/au_filter_spec.rb +0 -105
- data/spec/unit/au_spec.rb +0 -248
- data/spec/unit/carrier_spec.rb +0 -30
- data/spec/unit/display_spec.rb +0 -25
- data/spec/unit/docomo_filter_spec.rb +0 -115
- data/spec/unit/docomo_spec.rb +0 -351
- data/spec/unit/emoticon_filter_spec.rb +0 -108
- data/spec/unit/filter_spec.rb +0 -38
- data/spec/unit/general_spec.rb +0 -41
- data/spec/unit/gps_spec.rb +0 -146
- data/spec/unit/iphone_spec.rb +0 -95
- data/spec/unit/middleware_spec.rb +0 -38
- data/spec/unit/position_spec.rb +0 -49
- data/spec/unit/softbank_filter_spec.rb +0 -142
- data/spec/unit/softbank_spec.rb +0 -207
- data/spec/unit/valid_addr_spec.rb +0 -116
- data/test/spec_runner.rb +0 -30
- data/tools/generate_emoji_dic.rb +0 -430
- data/tools/update_speclist.rb +0 -87
data/tools/update_speclist.rb
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
|
4
|
-
# ke-tai.org の携帯端末スペック一覧をダウンロードして加工
|
5
|
-
|
6
|
-
require 'open-uri'
|
7
|
-
require 'nkf'
|
8
|
-
require 'csv'
|
9
|
-
require 'tempfile'
|
10
|
-
|
11
|
-
csvdata = NKF.nkf('-Sw', open('http://ke-tai.org/moblist/csv_down.php').read)
|
12
|
-
lines = csvdata.gsub(/\r?\n/, "\n").split(/\n/).collect{ |str| str.gsub(/([^,])"([^,])/u, '\1"\2') }
|
13
|
-
lines.slice!(0, 2)
|
14
|
-
|
15
|
-
table = {}
|
16
|
-
|
17
|
-
# CSV
|
18
|
-
# [ 0] 連番
|
19
|
-
# [ 1] メーカ名
|
20
|
-
# [ 2] 機種名
|
21
|
-
# [ 3] 機種略名
|
22
|
-
# [ 4] ユーザエージェント
|
23
|
-
# [ 5] タイプ1
|
24
|
-
# [ 6] タイプ2
|
25
|
-
# [ 7] ブラウザ幅(x)
|
26
|
-
# [ 8] ブラウザ高さ(y)
|
27
|
-
# [ 9] 表示カラー数
|
28
|
-
# [10] ブラウザキャッシュ
|
29
|
-
# [11] GIF
|
30
|
-
# [12] JPG
|
31
|
-
# [13] PNG
|
32
|
-
# [14] Flash
|
33
|
-
# [15] Flashバージョン
|
34
|
-
# [16] Flashワークメモリ
|
35
|
-
# [17] Javaアプリ
|
36
|
-
# [18] BREW
|
37
|
-
# [19] HTML
|
38
|
-
# [20] SSL
|
39
|
-
# [21] ログイン
|
40
|
-
# [22] クッキー
|
41
|
-
# [23] CSS
|
42
|
-
# [24] GPS
|
43
|
-
# [25] 発売日
|
44
|
-
|
45
|
-
enable_row_indexes = [1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]
|
46
|
-
# [ 0] メーカ名
|
47
|
-
# [ 1] 機種名
|
48
|
-
# [ 2] ユーザエージェント
|
49
|
-
# [ 3] タイプ1
|
50
|
-
# [ 4] タイプ2
|
51
|
-
# [ 5] ブラウザ幅(x)
|
52
|
-
# [ 6] ブラウザ高さ(y)
|
53
|
-
# [ 7] 表示カラー数
|
54
|
-
# [ 8] ブラウザキャッシュ
|
55
|
-
# [ 9] GIF
|
56
|
-
# [10] JPG
|
57
|
-
# [11] PNG
|
58
|
-
# [12] Flash
|
59
|
-
# [13] Flashバージョン
|
60
|
-
# [14] Flashワークメモリ
|
61
|
-
# [15] Javaアプリ
|
62
|
-
# [16] BREW
|
63
|
-
# [17] HTML
|
64
|
-
# [18] SSL
|
65
|
-
# [19] ログイン
|
66
|
-
# [20] クッキー
|
67
|
-
# [21] CSS
|
68
|
-
# [22] GPS
|
69
|
-
# [23] 発売日
|
70
|
-
|
71
|
-
CSV::Reader.parse(lines.join("\n")).each do |row|
|
72
|
-
row.slice!(26)
|
73
|
-
|
74
|
-
|
75
|
-
table[row[1]] ||= { }
|
76
|
-
table[row[1]][row[3]] ||= row.values_at(*enable_row_indexes)
|
77
|
-
end
|
78
|
-
|
79
|
-
[
|
80
|
-
%w(DoCoMo Docomo docomo.rb),
|
81
|
-
%w(au Au au.rb),
|
82
|
-
%w(SoftBank Softbank softbank.rb)
|
83
|
-
].each do |carrier, classname, filename|
|
84
|
-
File.open(File.join(File.dirname(__FILE__), '../lib/rack/ketai/carrier/specs', filename), 'w') do |f|
|
85
|
-
f.write "Rack::Ketai::Carrier::#{classname}::SPECS = #{ table[carrier].inspect }"
|
86
|
-
end
|
87
|
-
end
|