histock-filter 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/.rspec +2 -0
- data/.travis.yml +6 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +39 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/histock-filter.gemspec +35 -0
- data/lib/histock/filter/version.rb +5 -0
- data/lib/histock/filter.rb +20 -0
- metadata +129 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 569130bd4a0fb4b411287aaf64663e66dbeb1d611f7e8232bf47ecb3a6409c99
|
4
|
+
data.tar.gz: a7041ef22c8b10cfbb7b673b746488446b71e84fd6c1db80ebb729ed2b331af3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2c6172344fc416e8be9a41b970a2fd7cc05957645558159c8d38f52bbfe5822049c53ce0ad196884eb2ae62c3f2945512ebdf439b0684280f02875ec74e971dc
|
7
|
+
data.tar.gz: e4e962073d339ca73803ffa80281d25a95db50b1d226ac569f3f2f9aff821be6c478c8d7c88c20f453646ed0c5866b3eb7d7bbddb165ef01d10b50dc79425af0
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Yuya Sato
|
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,39 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/histock-filter.svg)](https://badge.fury.io/rb/histock-filter)
|
2
|
+
[![Build Status](https://travis-ci.org/ysato5654/histock-filter.svg?branch=master)](https://travis-ci.org/ysato5654/histock-filter)
|
3
|
+
|
4
|
+
# Histock::Filter
|
5
|
+
|
6
|
+
[HiStock嗨投資理財社群](https://histock.tw/) filter by Ruby
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'histock-filter'
|
14
|
+
```
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
```
|
19
|
+
$ bundle install
|
20
|
+
```
|
21
|
+
|
22
|
+
Or install it yourself as:
|
23
|
+
|
24
|
+
```
|
25
|
+
$ gem install histock-filter
|
26
|
+
```
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
```rb
|
31
|
+
histock = Histock::Filter.new
|
32
|
+
histock.dividend_policy('1234')
|
33
|
+
# [
|
34
|
+
# {"所屬年度" => "2019", "發放年度" => "2020", "除權日" => "", "除息日" => "06/18", "除權息前股價" => "297.5", "股票股利" => "0", "現金股利" => "2.5", EPS" => "13.32", "配息率" => "18.77%", "現金殖利率" => "0.84%", "扣抵稅率" => "0.00%", "增資配股率" => "0", "增資認購價" => "0"},
|
35
|
+
# {"所屬年度" => "2019", "發放年度" => "2020", "除權日" => "", "除息日" => "03/19", "除權息前股價" => "260", "股票股利" => "0", "現金股利" => "2.5", "EPS" => "13.32", "配息率" => "18.77%", "現金殖利率" => "0.96%", "扣抵稅率" => "0.00%", "增資配股率" => "0", "增資認購價" => "0"},
|
36
|
+
# {"所屬年度" => "2018", "發放年度" => "2019", "除權日" => "", "除息日" => "12/19", "除權息前股價" => "344.5", "股票股利" => "0", "現金股利" => "2.5", "EPS" => "13.54", "配息率" => "18.46%", "現金殖利率" => "0.73%", "扣抵稅率" => "0.00%", "增資配股率" => "0", "增資認購價" => "0"},
|
37
|
+
# {"所屬年度" => "2018", "發放年度" => "2019", "除權日" => "", "除息日" => "09/19", "除權息前股價" => "267", "股票股利" => "0", "現金股利" => "2", "EPS" => "13.54", "配息率" => "14.77%", "現金殖利率" => "0.75%", "扣抵稅率" => "0.00%", "增資配股率" => "0", "增資認購價" => "0"},
|
38
|
+
# ]
|
39
|
+
```
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'histock/filter'
|
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
@@ -0,0 +1,35 @@
|
|
1
|
+
require_relative 'lib/histock/filter/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'histock-filter'
|
5
|
+
spec.version = Histock::Filter::VERSION
|
6
|
+
spec.authors = ['Yuya Sato']
|
7
|
+
spec.email = ['ysato.5654@gmail.com']
|
8
|
+
|
9
|
+
spec.summary = 'HiStock (https://histock.tw/) filter'
|
10
|
+
spec.homepage = 'https://github.com/ysato5654/histock-filter'
|
11
|
+
spec.license = 'MIT'
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
|
+
|
14
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
15
|
+
spec.metadata['source_code_uri'] = 'https://github.com/ysato5654/histock-filter'
|
16
|
+
spec.metadata['changelog_uri'] = 'https://github.com/ysato5654/histock-filter/blob/master/CHANGELOG.md'
|
17
|
+
|
18
|
+
# Specify which files should be added to the gem when it is released.
|
19
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
20
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
21
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
end
|
23
|
+
spec.bindir = 'exe'
|
24
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
|
+
spec.require_paths = ['lib']
|
26
|
+
|
27
|
+
spec.required_ruby_version = '~> 2.5'
|
28
|
+
|
29
|
+
spec.add_runtime_dependency 'histock-simplefilter', '= 0.1.2'
|
30
|
+
|
31
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
32
|
+
spec.add_development_dependency 'rake', '>= 12.3.3'
|
33
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
34
|
+
spec.add_development_dependency 'travis', '>= 1.9.0'
|
35
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'histock/simplefilter'
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/filter/version'
|
3
|
+
|
4
|
+
module Histock
|
5
|
+
class Filter
|
6
|
+
CONFIG = ['dividend_policy']
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
end
|
10
|
+
|
11
|
+
CONFIG.each do |method_name|
|
12
|
+
define_method method_name do |param|
|
13
|
+
histock = Histock::Simplefilter.new
|
14
|
+
table = histock.send(method_name, param)
|
15
|
+
|
16
|
+
table[1..-1].map { |e| table.first.zip(e).to_h }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: histock-filter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yuya Sato
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-05-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: histock-simplefilter
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 12.3.3
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 12.3.3
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: travis
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.9.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.9.0
|
83
|
+
description:
|
84
|
+
email:
|
85
|
+
- ysato.5654@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- ".travis.yml"
|
93
|
+
- CHANGELOG.md
|
94
|
+
- Gemfile
|
95
|
+
- LICENSE
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- bin/console
|
99
|
+
- bin/setup
|
100
|
+
- histock-filter.gemspec
|
101
|
+
- lib/histock/filter.rb
|
102
|
+
- lib/histock/filter/version.rb
|
103
|
+
homepage: https://github.com/ysato5654/histock-filter
|
104
|
+
licenses:
|
105
|
+
- MIT
|
106
|
+
metadata:
|
107
|
+
homepage_uri: https://github.com/ysato5654/histock-filter
|
108
|
+
source_code_uri: https://github.com/ysato5654/histock-filter
|
109
|
+
changelog_uri: https://github.com/ysato5654/histock-filter/blob/master/CHANGELOG.md
|
110
|
+
post_install_message:
|
111
|
+
rdoc_options: []
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '2.5'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
requirements: []
|
125
|
+
rubygems_version: 3.1.2
|
126
|
+
signing_key:
|
127
|
+
specification_version: 4
|
128
|
+
summary: HiStock (https://histock.tw/) filter
|
129
|
+
test_files: []
|