moscow_metro 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +32 -3
- data/lib/db/lines.yml +20 -1
- data/lib/moscow_metro/line.rb +1 -1
- data/lib/moscow_metro/version.rb +1 -1
- data/moscow_metro.gemspec +1 -1
- metadata +2 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42d417178c6695f365f461707aaa532586a4760614d1c30ecc7ceeab4f2e5787
|
4
|
+
data.tar.gz: b14756979f5b405f229ab3fb9a03612d23be3749a4a2081428d1f50a961b033f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 323a2b4d058fbe2e3fb48e797406b00e5b490bee067529f871dbcdfa711731c8e46cedf1ab6eb1f866942c09f68e20ea199b878e4c8d7c1fa0cd0d1897900789
|
7
|
+
data.tar.gz: f034eb94d42d118e52fc26637ddc680de0765ff0969d5721f58f56791e800ebbd032f20cb36b508bead8f9442c9025d598cac6569ac5965564bc72950a7ec2cb
|
data/Changelog.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -53,6 +53,8 @@ ul
|
|
53
53
|
Тесты гарантируют, что:
|
54
54
|
|
55
55
|
- у всех линий заполнен `name`
|
56
|
+
- у всех линий заполнен `name_en`
|
57
|
+
- у всех линий заполнен `name_prepositional` (название в предложном падеже)
|
56
58
|
- у всех линий заполнен `color`
|
57
59
|
- у всех линий заполнен `uid`
|
58
60
|
- у всех станций заполнен `name`
|
@@ -69,6 +71,20 @@ ul
|
|
69
71
|
gem "moscow_metro"
|
70
72
|
```
|
71
73
|
|
74
|
+
## Play / debug
|
75
|
+
|
76
|
+
```sh
|
77
|
+
gem install moscow_metro
|
78
|
+
cd $(bundle info moscow_metro --path) # open the folder where the gem was installed
|
79
|
+
bin/console # load the gem and Pry
|
80
|
+
```
|
81
|
+
|
82
|
+
now all gem methods are accessible:
|
83
|
+
|
84
|
+
```ruby
|
85
|
+
MoscowMetro::Station.all
|
86
|
+
```
|
87
|
+
|
72
88
|
## Usage
|
73
89
|
|
74
90
|
Предполагается 3 варианта использования этого джема:
|
@@ -104,9 +120,11 @@ MoscowMetro::Line.monorail #=> Array of lines
|
|
104
120
|
|
105
121
|
```ruby
|
106
122
|
line = MoscowMetro::Line.all.first #=> #<struct MoscowMetro::Line::Record...>
|
107
|
-
line.color
|
108
|
-
line.name
|
109
|
-
line.
|
123
|
+
line.color #=> "#f91f22"
|
124
|
+
line.name #=> "Сокольническая"
|
125
|
+
line.name_en #=> "Сокольническая"
|
126
|
+
line.name_prepositional #=> "Сокольнической"
|
127
|
+
line.uid #=> "1"
|
110
128
|
```
|
111
129
|
|
112
130
|
```ruby
|
@@ -151,6 +169,7 @@ end
|
|
151
169
|
|
152
170
|
## Источники данных
|
153
171
|
|
172
|
+
- https://stroi.mos.ru/metro
|
154
173
|
- https://transport.mos.ru
|
155
174
|
- https://transport.mos.ru/metro/map
|
156
175
|
- http://mcd.mosmetro.ru/map/desktop/
|
@@ -198,3 +217,13 @@ console.table(station_objects)
|
|
198
217
|
#adacac | Алтуфьево | 9 | 1
|
199
218
|
|
200
219
|
Жалко только, в названиях они не ставят букву «ё».
|
220
|
+
|
221
|
+
|
222
|
+
## Roadmap
|
223
|
+
|
224
|
+
- UIDs для станций
|
225
|
+
- предложный падеж для линий («на Кольцевой», «на Сокольнической»)
|
226
|
+
- предложный падеж для станций («на Охотном ряду», «на Университете», «на Ленинском проспекте»)
|
227
|
+
- работает ли станция
|
228
|
+
- работает ли линия
|
229
|
+
- автоматизировать проверку актуальности информации от каких-нибудь более-менее официальных источников
|
data/lib/db/lines.yml
CHANGED
@@ -1,114 +1,133 @@
|
|
1
1
|
-
|
2
2
|
name: Сокольническая
|
3
3
|
name_en: Sokolnicheskaya
|
4
|
+
name_prepositional: Сокольнической
|
4
5
|
uid: "1"
|
5
6
|
color: "#f91f22"
|
6
7
|
open_year: 1935
|
7
8
|
-
|
8
9
|
name: Замоскворецкая
|
9
10
|
name_en: Zamoskvoretskaya
|
11
|
+
name_prepositional: Замоскворецкой
|
10
12
|
uid: "2"
|
11
13
|
color: "#05ff16"
|
12
14
|
open_year: 1938
|
13
15
|
-
|
14
16
|
name: Арбатско-Покровская
|
15
17
|
name_en: Arbatsko-Pokrovskaya
|
18
|
+
name_prepositional: Арбатско-Покровской
|
16
19
|
uid: "3"
|
17
20
|
color: "#2075b1"
|
18
21
|
open_year: 1938
|
19
22
|
-
|
20
23
|
name: Филёвская
|
21
24
|
name_en: Filyovskaya
|
25
|
+
name_prepositional: Филёвской
|
22
26
|
uid: "4"
|
23
27
|
color: "#52d2f4"
|
24
28
|
open_year: 1958
|
25
29
|
-
|
26
30
|
name: Кольцевая
|
27
31
|
name_en: Koltsevaya
|
32
|
+
name_prepositional: Кольцевой
|
28
33
|
uid: "5"
|
29
34
|
color: "#75573e"
|
30
35
|
open_year: 1950
|
31
36
|
-
|
32
37
|
name: Калужско-Рижская
|
33
38
|
name_en: Kaluzhsko-Rizhskaya
|
39
|
+
name_prepositional: Калужско-Рижской
|
34
40
|
uid: "6"
|
35
41
|
color: "#f6990e"
|
36
42
|
open_year: 1958
|
37
43
|
-
|
38
44
|
name: Таганско-Краснопресненская
|
39
45
|
name_en: Tagansko-Krasnopresnenskaya
|
46
|
+
name_prepositional: Таганско-Краснопресненской
|
40
47
|
uid: "7"
|
41
48
|
color: "#821c71"
|
42
49
|
open_year: 1966
|
43
50
|
-
|
44
51
|
name: Калининская
|
45
52
|
name_en: Kalininskaya
|
53
|
+
name_prepositional: Калининской
|
46
54
|
uid: "8"
|
47
55
|
color: "#efc943"
|
48
56
|
open_year: 1979
|
49
57
|
-
|
50
58
|
name: Солнцевская
|
51
59
|
name_en: Solntsevskaya
|
60
|
+
name_prepositional: Солнцевской
|
52
61
|
uid: "8A"
|
53
62
|
color: "#efc943"
|
54
63
|
open_year: 2014
|
55
64
|
-
|
56
65
|
name: Серпуховско-Тимирязевская
|
57
66
|
name_en: Serpukhovsko-Timiryazevskaya
|
67
|
+
name_prepositional: Серпуховско-Тимирязевской
|
58
68
|
uid: "9"
|
59
69
|
color: "#bdbcbc"
|
60
70
|
open_year: 1983
|
61
71
|
-
|
62
72
|
name: Люблинско-Дмитровская
|
63
73
|
name_en: Lyublinsko-Dmitrovskaya
|
74
|
+
name_prepositional: Люблинско-Дмитровской
|
64
75
|
uid: "10"
|
65
76
|
color: "#b1d87d"
|
66
77
|
open_year: 1995
|
67
78
|
-
|
68
79
|
name: Большая кольцевая
|
69
80
|
name_en: Bolshaya Koltsevaya
|
81
|
+
name_prepositional: Большой кольцевой
|
70
82
|
uid: "11"
|
71
83
|
color: "#a6ded2"
|
72
84
|
open_year: 2018
|
73
85
|
-
|
74
86
|
name: Каховская
|
75
|
-
name_en:
|
87
|
+
name_en: Kakhovskaya
|
88
|
+
name_prepositional: Каховской
|
76
89
|
uid: "11A"
|
77
90
|
color: "#a6ded2"
|
78
91
|
open_year:
|
79
92
|
-
|
80
93
|
name: Бутовская
|
81
94
|
name_en: Butovskaya
|
95
|
+
name_prepositional: Бутовской
|
82
96
|
uid: "12"
|
83
97
|
color: "#c8bcd2"
|
84
98
|
open_year: 2003
|
85
99
|
-
|
86
100
|
name: Монорельс
|
87
101
|
name_en: Monorail
|
102
|
+
name_prepositional: Монорельсе
|
88
103
|
uid: "13"
|
89
104
|
color: "#0A72B9"
|
90
105
|
open_year: 2004
|
91
106
|
-
|
92
107
|
name: МЦК
|
93
108
|
name_en: Moscow Central Circle
|
109
|
+
name_prepositional: МЦК
|
94
110
|
uid: "14"
|
95
111
|
color: "#ffcec6"
|
96
112
|
open_year: 2016
|
97
113
|
-
|
98
114
|
name: Некрасовская
|
99
115
|
name_en: Nekrasovskaya
|
116
|
+
name_prepositional: Некрасовской
|
100
117
|
uid: "15"
|
101
118
|
color: "#e363b3"
|
102
119
|
open_year: 2019
|
103
120
|
-
|
104
121
|
name: Белорусско-Савёловский диаметр
|
105
122
|
name_en: Belorussko-Savyolovsky diameter
|
123
|
+
name_prepositional: Белорусско-Савёловском диаметре
|
106
124
|
uid: "D1"
|
107
125
|
color: "#ed9f2d"
|
108
126
|
open_year: 2019
|
109
127
|
-
|
110
128
|
name: Калужско-Рижский диаметр
|
111
129
|
name_en: Kursko-Rizhsky diameter
|
130
|
+
name_prepositional: Калужско-Рижском диаметре
|
112
131
|
uid: "D2"
|
113
132
|
color: "#df477c"
|
114
133
|
open_year: 2019
|
data/lib/moscow_metro/line.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module MoscowMetro
|
4
4
|
class Line < RecordFromYaml
|
5
5
|
|
6
|
-
COLUMNS = [:color, :name, :open_year, :uid]
|
6
|
+
COLUMNS = [:color, :name, :name_en, :name_prepositional, :open_year, :uid]
|
7
7
|
RECORDS = YAML.load_file(DB_DIR.join("lines.yml"))
|
8
8
|
Record = Struct.new(*COLUMNS)
|
9
9
|
UIDS = {
|
data/lib/moscow_metro/version.rb
CHANGED
data/moscow_metro.gemspec
CHANGED
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
28
28
|
end
|
29
29
|
spec.bindir = "bin"
|
30
|
-
spec.executables = spec.files.grep(%r{^#{spec.bindir}/}) { |f| File.basename(f) }
|
30
|
+
# spec.executables = spec.files.grep(%r{^#{spec.bindir}/}) { |f| File.basename(f) }
|
31
31
|
spec.require_paths = ["lib"]
|
32
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moscow_metro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Pedan
|
@@ -15,9 +15,7 @@ description: Database of lines and stations metro & metro-like train transport o
|
|
15
15
|
for further import into your database.
|
16
16
|
email:
|
17
17
|
- sergey.pedan@gmail.com
|
18
|
-
executables:
|
19
|
-
- console
|
20
|
-
- setup
|
18
|
+
executables: []
|
21
19
|
extensions: []
|
22
20
|
extra_rdoc_files: []
|
23
21
|
files:
|