ruripara 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.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +37 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/config/idols.yml +88 -0
- data/config/songs.yml +6 -0
- data/lib/ruripara/base.rb +38 -0
- data/lib/ruripara/idol.rb +23 -0
- data/lib/ruripara/song.rb +23 -0
- data/lib/ruripara/version.rb +3 -0
- data/lib/ruripara.rb +9 -0
- data/ruripara.gemspec +27 -0
- metadata +103 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9ca5710d0c676cb1a2ed733e803f35dcdc52b404f97a67e08cd4454901557609
|
4
|
+
data.tar.gz: ee89b56ecd399e0988ff2dc61c76296d23ae71233ea28d7e704e50f56a2ad2e1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 70888a929598160979a8d269fea8130c00ccb7d4603610312f3aaae002ff47f33fae1bad0a8ef5e6739ace7466639c279c7082711541be2ff551fd53a4f3415d
|
7
|
+
data.tar.gz: 1a471529ae133a7cb33929b6a7708fc3c209f26a4eefe643c031ab201d07dfadbec14335b9ba489cee7b52594e5ff2dd75623704c492ceede4d0996fb7ed18c1
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 saki
|
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,37 @@
|
|
1
|
+
# Ruripara
|
2
|
+
|
3
|
+
This gem will be all about Pripara.
|
4
|
+
You can get Pripara data, easily.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'ruripara'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install ruripara
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
require 'ruripara'
|
26
|
+
girl = Pripara::Idol.find_by(name: '南みれぃ')
|
27
|
+
girl.cast_name
|
28
|
+
# => '芹澤優'
|
29
|
+
```
|
30
|
+
|
31
|
+
## Contributing
|
32
|
+
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/yensaki/ruripara.
|
34
|
+
|
35
|
+
## License
|
36
|
+
|
37
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "ruripara"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/config/idols.yml
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
- id: 1
|
2
|
+
slug: laala
|
3
|
+
name: 真中らぁら
|
4
|
+
cast_name: 茜屋日海夏
|
5
|
+
# birthday: 11/20
|
6
|
+
# blood_type: O
|
7
|
+
# favorite_brand: Twinkle Ribbon
|
8
|
+
# charm: ラブリー
|
9
|
+
- id: 2
|
10
|
+
slug: mirei
|
11
|
+
name: 南みれぃ
|
12
|
+
cast_name: 芹澤優
|
13
|
+
- id: 3
|
14
|
+
slug: sophie
|
15
|
+
name: 北条そふぃ
|
16
|
+
cast_name: 久保田未夢
|
17
|
+
- id: 4
|
18
|
+
slug: sion
|
19
|
+
name: 東堂シオン
|
20
|
+
cast_name: 山北早紀
|
21
|
+
- id: 5
|
22
|
+
slug: dorothy
|
23
|
+
name: ドロシー・ウェスト
|
24
|
+
cast_name: 澁谷梓希
|
25
|
+
- id: 6
|
26
|
+
slug: reona
|
27
|
+
name: レオナ・ウェスト
|
28
|
+
cast_name: 若井友希
|
29
|
+
- id: 7
|
30
|
+
slug: falulu
|
31
|
+
name: ファルル
|
32
|
+
cast_name: 赤﨑千夏
|
33
|
+
- id: 8
|
34
|
+
slug: cosmo
|
35
|
+
name: 北条コスモ
|
36
|
+
cast_name: 山本希望
|
37
|
+
- id: 9
|
38
|
+
slug: aroma
|
39
|
+
name: 黒須あろま
|
40
|
+
cast_name: 牧野由依
|
41
|
+
- id: 10
|
42
|
+
slug: mikan
|
43
|
+
name: 白玉みかん
|
44
|
+
cast_name: 渡部優衣
|
45
|
+
- id: 11
|
46
|
+
slug: fuwari
|
47
|
+
name: 緑風ふわり
|
48
|
+
cast_name: 佐藤あずさ
|
49
|
+
- id: 12
|
50
|
+
slug: hibiki
|
51
|
+
name: 紫京院ひびき
|
52
|
+
cast_name: 斎賀みつき
|
53
|
+
- id: 13
|
54
|
+
slug: galulu
|
55
|
+
name: ガァルル
|
56
|
+
cast_name: 真田アサミ
|
57
|
+
- id: 14
|
58
|
+
slug: non
|
59
|
+
name: 真中のん
|
60
|
+
cast_name: 田中美海
|
61
|
+
- id: 15
|
62
|
+
slug: chiri
|
63
|
+
name: 月川ちり
|
64
|
+
cast_name: 大森日雅
|
65
|
+
- id: 16
|
66
|
+
slug: pepper
|
67
|
+
name: 太陽ペッパー
|
68
|
+
cast_name: 山下七海
|
69
|
+
- id: 17
|
70
|
+
slug: ajimi
|
71
|
+
name: 黄木あじみ
|
72
|
+
cast_name: 上田麗奈
|
73
|
+
- id: 18
|
74
|
+
slug: chanko
|
75
|
+
name: 鍋島ちゃん子
|
76
|
+
cast_name: 赤﨑千夏
|
77
|
+
- id: 19
|
78
|
+
slug: jury
|
79
|
+
name: ジュリィ
|
80
|
+
cast_name: 上田麗奈
|
81
|
+
- id: 20
|
82
|
+
slug: janis
|
83
|
+
name: ジャニス
|
84
|
+
cast_name: 豊崎愛生
|
85
|
+
- id: 21
|
86
|
+
slug: meganee
|
87
|
+
name: 赤井めが姉ぇ
|
88
|
+
cast_name: 伊藤かな恵
|
data/config/songs.yml
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
module Pripara
|
2
|
+
class Base
|
3
|
+
def initialize(attributes)
|
4
|
+
@attributes = attributes.map { |k, v| [k.to_sym, v] }.to_h
|
5
|
+
end
|
6
|
+
|
7
|
+
def match?(attrs)
|
8
|
+
attrs.all? { |key, value| @attributes[key.to_sym] == value }
|
9
|
+
end
|
10
|
+
|
11
|
+
class << self
|
12
|
+
def all
|
13
|
+
config.map { |attributes| new(attributes) }
|
14
|
+
end
|
15
|
+
|
16
|
+
def find_by(attributes)
|
17
|
+
raise ArgumentError unless (attributes.keys - attr_keys).empty?
|
18
|
+
all.find { |obj| obj.match?(attributes) }
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def config
|
24
|
+
return @config if @config
|
25
|
+
config_file = File.join(File.dirname(__FILE__), '../../config/', config_file_name)
|
26
|
+
@config = YAML.load_file(config_file)
|
27
|
+
end
|
28
|
+
|
29
|
+
def config_file_name
|
30
|
+
raise NotImplementedError
|
31
|
+
end
|
32
|
+
|
33
|
+
def attr_keys
|
34
|
+
raise NotImplementedError
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Pripara
|
2
|
+
class Idol < Base
|
3
|
+
ATTR_KEYS = %i(slug name cast_name).freeze
|
4
|
+
|
5
|
+
ATTR_KEYS.each do |key|
|
6
|
+
define_method key do
|
7
|
+
@attributes[key.to_s]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class << self
|
12
|
+
def config_file_name
|
13
|
+
'idols.yml'
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def attr_keys
|
19
|
+
ATTR_KEYS
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Pripara
|
2
|
+
class Song < Base
|
3
|
+
ATTR_KEYS = %i(title singer writer composer arranger).freeze
|
4
|
+
|
5
|
+
ATTR_KEYS.each do |key|
|
6
|
+
define_method key do
|
7
|
+
@attributes[key.to_s]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class << self
|
12
|
+
def config_file_name
|
13
|
+
'songs.yml'
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def attr_keys
|
19
|
+
ATTR_KEYS
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/ruripara.rb
ADDED
data/ruripara.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "ruripara/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ruripara"
|
8
|
+
spec.version = Ruripara::VERSION
|
9
|
+
spec.authors = ["yensaki"]
|
10
|
+
spec.email = ["mov.an.double@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{All about Pripara}
|
13
|
+
spec.description = %q{All about Pripara}
|
14
|
+
spec.homepage = "https://github.com/yensaki/ruripara"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ruripara
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- yensaki
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-06-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: All about Pripara
|
56
|
+
email:
|
57
|
+
- mov.an.double@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
|
+
- Gemfile
|
66
|
+
- LICENSE.txt
|
67
|
+
- README.md
|
68
|
+
- Rakefile
|
69
|
+
- bin/console
|
70
|
+
- bin/setup
|
71
|
+
- config/idols.yml
|
72
|
+
- config/songs.yml
|
73
|
+
- lib/ruripara.rb
|
74
|
+
- lib/ruripara/base.rb
|
75
|
+
- lib/ruripara/idol.rb
|
76
|
+
- lib/ruripara/song.rb
|
77
|
+
- lib/ruripara/version.rb
|
78
|
+
- ruripara.gemspec
|
79
|
+
homepage: https://github.com/yensaki/ruripara
|
80
|
+
licenses:
|
81
|
+
- MIT
|
82
|
+
metadata: {}
|
83
|
+
post_install_message:
|
84
|
+
rdoc_options: []
|
85
|
+
require_paths:
|
86
|
+
- lib
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
requirements: []
|
98
|
+
rubyforge_project:
|
99
|
+
rubygems_version: 2.7.6
|
100
|
+
signing_key:
|
101
|
+
specification_version: 4
|
102
|
+
summary: All about Pripara
|
103
|
+
test_files: []
|