poe_filter_generator 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.rubocop.yml +62 -0
- data/.rubocop_todo.yml +0 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +139 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/poe_filter_generator +5 -0
- data/lib/poe_filter_generator.rb +10 -0
- data/lib/poe_filter_generator/cli.rb +16 -0
- data/lib/poe_filter_generator/element.rb +72 -0
- data/lib/poe_filter_generator/filter.rb +43 -0
- data/lib/poe_filter_generator/generator.rb +28 -0
- data/lib/poe_filter_generator/group.rb +38 -0
- data/lib/poe_filter_generator/mixin.rb +14 -0
- data/lib/poe_filter_generator/version.rb +3 -0
- data/poe_filter_generator.gemspec +28 -0
- metadata +150 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 80f264fae713ccbd54ca2ebdd4aa669f36842775
|
4
|
+
data.tar.gz: c0cab450f84212a079fdef3e49b4e4f75a6a486f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2ed185ae2dad327a17af142dc9db23722ee840f81c3319b37ba24c15a97f653ac24b2bedb79ceb668300f9aac26b33b0ef268a2f08a55356be530f0caa06bda6
|
7
|
+
data.tar.gz: cb1116035dc828f86defd175576e0f916c96e7623e8c2dce75f57464794de1569fbf91fdc342a7b16afa5d54f7dc1de24ef15ccc0d84b24a9f554c71c58fc30e
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
# ver: 0.8.0
|
2
|
+
|
3
|
+
inherit_from:
|
4
|
+
- .rubocop_todo.yml
|
5
|
+
AllCops:
|
6
|
+
Exclude:
|
7
|
+
- 'bin/**/*'
|
8
|
+
- 'db/schema.rb'
|
9
|
+
- 'db/migrate/*'
|
10
|
+
- 'Rakefile'
|
11
|
+
- 'vendor/**/*'
|
12
|
+
DisplayCopNames: true
|
13
|
+
Metrics/LineLength:
|
14
|
+
Max: 160
|
15
|
+
Metrics/MethodLength:
|
16
|
+
Max: 20
|
17
|
+
Metrics/AbcSize:
|
18
|
+
Max: 20
|
19
|
+
Style/StringLiterals:
|
20
|
+
Enabled: false
|
21
|
+
Style/AccessModifierIndentation:
|
22
|
+
EnforcedStyle: outdent
|
23
|
+
Style/AlignParameters:
|
24
|
+
EnforcedStyle: with_first_parameter
|
25
|
+
Style/Documentation:
|
26
|
+
Enabled: false
|
27
|
+
Style/EmptyLinesAroundBlockBody:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
# for the following case.
|
31
|
+
# validates :project , presence: true
|
32
|
+
# validates :title , presence: true
|
33
|
+
# validates :status , presence: true
|
34
|
+
Style/SpaceBeforeComma:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
# for the following case.
|
38
|
+
# expect(json['title']).to eq 'implement hoge'
|
39
|
+
# expect(json['status']).to eq 'todo'
|
40
|
+
# expect(json['priority']).to eq 1
|
41
|
+
# expect(json['point']).to eq 1
|
42
|
+
Style/SpaceBeforeFirstArg:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
# for the following case.
|
46
|
+
# db = ENV['db'] || 'apollo'
|
47
|
+
# user = ENV['user'] || 'postgres'
|
48
|
+
# password = ENV['password'] || ''
|
49
|
+
Style/SpaceAroundOperators:
|
50
|
+
Enabled: false
|
51
|
+
|
52
|
+
Style/TrailingCommaInLiteral:
|
53
|
+
EnforcedStyleForMultiline: comma
|
54
|
+
Style/TrailingCommaInArguments:
|
55
|
+
EnforcedStyleForMultiline: comma
|
56
|
+
Style/ExtraSpacing:
|
57
|
+
Enabled: false
|
58
|
+
Style/ClassAndModuleChildren:
|
59
|
+
Enabled: false
|
60
|
+
|
61
|
+
Style/AsciiComments:
|
62
|
+
Enabled: false
|
data/.rubocop_todo.yml
ADDED
File without changes
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at isuke770@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 isuke
|
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,139 @@
|
|
1
|
+
# Path Of Exile Filter Generator
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'poe_filter_generator'
|
9
|
+
```
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install poe_filter_generator
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Write to filter.ru as follows.
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
filter 'sample' do |f|
|
25
|
+
f.group 'Gems' do |g|
|
26
|
+
g.element 'Gems' do |e|
|
27
|
+
e.showable = true
|
28
|
+
e.klass = 'Gems'
|
29
|
+
end
|
30
|
+
|
31
|
+
g.mixin do |m|
|
32
|
+
m.element 'Drop Only' do |e|
|
33
|
+
e.base_type = 'DropOnlyGems'
|
34
|
+
e.set_font_size = 38
|
35
|
+
e.set_border_color = '175 96 37'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
g.mixin do |m|
|
39
|
+
m.element 'High Quality' do |e|
|
40
|
+
e.quality = '>= 10'
|
41
|
+
e.set_background_color = ' 70 0 0'
|
42
|
+
end
|
43
|
+
m.element 'Middle Quality' do |e|
|
44
|
+
e.quality = '> 0'
|
45
|
+
e.set_background_color = ' 70 70 0'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
f.group 'Default' do |g|
|
51
|
+
g.element do |e|
|
52
|
+
e.showable = true
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
```
|
57
|
+
|
58
|
+
And aliases.yml as follows.
|
59
|
+
|
60
|
+
```yml
|
61
|
+
DropOnlyGems:
|
62
|
+
- Vaal
|
63
|
+
- Added Chaos Damage
|
64
|
+
- Enhance
|
65
|
+
- Enlighten
|
66
|
+
- Empower
|
67
|
+
- Detonate Mines
|
68
|
+
- Portal
|
69
|
+
```
|
70
|
+
|
71
|
+
Then, execute command
|
72
|
+
|
73
|
+
```sh
|
74
|
+
poe_filter_generator source="sample.ru" export="." aliases="aliases.yml"
|
75
|
+
```
|
76
|
+
|
77
|
+
export file is sample.filter as follows.
|
78
|
+
|
79
|
+
```
|
80
|
+
################################################################################
|
81
|
+
# Gems
|
82
|
+
################################################################################
|
83
|
+
# Gems Drop Only High Quality
|
84
|
+
Show
|
85
|
+
Quality >= 10
|
86
|
+
Class Gems
|
87
|
+
BaseType "Vaal" "Added Chaos Damage" "Enhance" "Enlighten" "Empower" "Detonate Mines" "Portal"
|
88
|
+
SetBorderColor 175 96 37
|
89
|
+
SetBackgroundColor 70 0 0
|
90
|
+
SetFontSize 38
|
91
|
+
# Gems Drop Only Middle Quality
|
92
|
+
Show
|
93
|
+
Quality > 0
|
94
|
+
Class Gems
|
95
|
+
BaseType "Vaal" "Added Chaos Damage" "Enhance" "Enlighten" "Empower" "Detonate Mines" "Portal"
|
96
|
+
SetBorderColor 175 96 37
|
97
|
+
SetBackgroundColor 70 70 0
|
98
|
+
SetFontSize 38
|
99
|
+
# Gems Drop Only
|
100
|
+
Show
|
101
|
+
Class Gems
|
102
|
+
BaseType "Vaal" "Added Chaos Damage" "Enhance" "Enlighten" "Empower" "Detonate Mines" "Portal"
|
103
|
+
SetBorderColor 175 96 37
|
104
|
+
SetFontSize 38
|
105
|
+
# Gems High Quality
|
106
|
+
Show
|
107
|
+
Quality >= 10
|
108
|
+
Class Gems
|
109
|
+
SetBackgroundColor 70 0 0
|
110
|
+
# Gems Middle Quality
|
111
|
+
Show
|
112
|
+
Quality > 0
|
113
|
+
Class Gems
|
114
|
+
SetBackgroundColor 70 70 0
|
115
|
+
# Gems
|
116
|
+
Show
|
117
|
+
Class Gems
|
118
|
+
|
119
|
+
################################################################################
|
120
|
+
# Default
|
121
|
+
################################################################################
|
122
|
+
Show
|
123
|
+
```
|
124
|
+
|
125
|
+
## Development
|
126
|
+
|
127
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
128
|
+
|
129
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
130
|
+
|
131
|
+
## Contributing
|
132
|
+
|
133
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/poe_filter_generator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
134
|
+
|
135
|
+
|
136
|
+
## License
|
137
|
+
|
138
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
139
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "poe_filter_generator"
|
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
|
data/bin/setup
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'poe_filter_generator/cli'
|
2
|
+
require 'poe_filter_generator/element'
|
3
|
+
require 'poe_filter_generator/filter'
|
4
|
+
require 'poe_filter_generator/generator'
|
5
|
+
require 'poe_filter_generator/group'
|
6
|
+
require 'poe_filter_generator/mixin'
|
7
|
+
require 'poe_filter_generator/version'
|
8
|
+
|
9
|
+
module PoeFilterGenerator
|
10
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'active_support'
|
3
|
+
require 'active_support/core_ext'
|
4
|
+
require 'thor'
|
5
|
+
require 'poe_filter_generator'
|
6
|
+
|
7
|
+
module PoeFilterGenerator
|
8
|
+
class CLI < Thor
|
9
|
+
default_command :generate
|
10
|
+
|
11
|
+
desc "generate sample.ru /foo/bar/export/ aliases.yml", "generate filter."
|
12
|
+
def generate(source = './filter.ru', export = '.', aliases = nil)
|
13
|
+
PoeFilterGenerator::Generator.new(source, export, aliases).generate
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
class PoeFilterGenerator::Element
|
2
|
+
ATTRS = %i(
|
3
|
+
item_level
|
4
|
+
drop_level
|
5
|
+
quality
|
6
|
+
rarity
|
7
|
+
klass
|
8
|
+
base_type
|
9
|
+
sockets
|
10
|
+
linked_sockets
|
11
|
+
socket_group
|
12
|
+
height
|
13
|
+
width
|
14
|
+
identified
|
15
|
+
corrupted
|
16
|
+
elder_item
|
17
|
+
shaper_item
|
18
|
+
shaped_map
|
19
|
+
|
20
|
+
set_border_color
|
21
|
+
set_background_color
|
22
|
+
set_text_color
|
23
|
+
set_font_size
|
24
|
+
play_alert_sound
|
25
|
+
play_alert_sound_positional
|
26
|
+
).freeze
|
27
|
+
|
28
|
+
attr_accessor :name
|
29
|
+
attr_accessor :showable
|
30
|
+
ATTRS.each do |attr|
|
31
|
+
attr_accessor attr
|
32
|
+
end
|
33
|
+
|
34
|
+
def initialize(name, aliases)
|
35
|
+
@name = name
|
36
|
+
@aliases = aliases
|
37
|
+
@showable = true
|
38
|
+
end
|
39
|
+
|
40
|
+
def generate(file)
|
41
|
+
file.puts "# #{@name}" if @name.present?
|
42
|
+
file.puts showable ? 'Show' : 'Hide'
|
43
|
+
put_attr(file)
|
44
|
+
end
|
45
|
+
|
46
|
+
def merge(other)
|
47
|
+
return self if other.nil?
|
48
|
+
new_element = PoeFilterGenerator::Element.new("#{name} #{other.name}", @aliases)
|
49
|
+
new_element.showable = other.showable
|
50
|
+
ATTRS.each do |attr|
|
51
|
+
new_element.send("#{attr}=", other.send(attr) || send(attr))
|
52
|
+
end
|
53
|
+
new_element
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def put_attr(file)
|
59
|
+
ATTRS.each do |attr|
|
60
|
+
key = attr == :klass ? 'Class' : attr.to_s.camelize
|
61
|
+
value = send(attr)
|
62
|
+
|
63
|
+
next unless value.present?
|
64
|
+
|
65
|
+
@aliases.each do |alias_key, alias_value|
|
66
|
+
value.gsub!(alias_key, alias_value) if value.respond_to?(:gsub!)
|
67
|
+
end
|
68
|
+
|
69
|
+
file.puts " #{key} #{value}"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
class PoeFilterGenerator::Filter
|
2
|
+
attr_accessor :name
|
3
|
+
|
4
|
+
def initialize(name, export_path, aliases)
|
5
|
+
@name = name
|
6
|
+
@comments = []
|
7
|
+
@export_path = export_path
|
8
|
+
@aliases = aliases
|
9
|
+
@groups = []
|
10
|
+
end
|
11
|
+
|
12
|
+
def generate
|
13
|
+
File.open(File.join(@export_path, "#{@name}.filter"), 'w') do |file|
|
14
|
+
file.puts "# generate by poe_filter_generator ver #{PoeFilterGenerator::VERSION}"
|
15
|
+
file.puts "# https://github.com/isuke/poe_filter_generator"
|
16
|
+
file.puts ''
|
17
|
+
if @comments.any?
|
18
|
+
file.puts '#' * 80
|
19
|
+
file.puts '#'
|
20
|
+
@comments.each do |comment|
|
21
|
+
file.puts "# #{comment}"
|
22
|
+
end
|
23
|
+
file.puts '#'
|
24
|
+
file.puts '#' * 80
|
25
|
+
file.puts ''
|
26
|
+
end
|
27
|
+
|
28
|
+
@groups.each do |group|
|
29
|
+
group.generate(file)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def comment(str)
|
35
|
+
@comments << str
|
36
|
+
end
|
37
|
+
|
38
|
+
def group(name)
|
39
|
+
group = PoeFilterGenerator::Group.new(name, @aliases)
|
40
|
+
yield group
|
41
|
+
@groups << group
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class PoeFilterGenerator::Generator
|
2
|
+
ROOT_PATH = File.expand_path('../../', __FILE__)
|
3
|
+
|
4
|
+
def initialize(source_path, export_path, aliases_path)
|
5
|
+
@source_path = source_path
|
6
|
+
@export_path = export_path
|
7
|
+
|
8
|
+
@aliases = {}
|
9
|
+
return unless aliases_path
|
10
|
+
YAML.load(File.open(aliases_path).read).each do |k, v|
|
11
|
+
@aliases[k] = v.flatten.map { |a| %("#{a}") }.join(' ')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def generate
|
16
|
+
# rubocop:disable Lint/Eval
|
17
|
+
eval(File.read(@source_path))
|
18
|
+
# rubocop:enable Lint/Eval
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def filter(name)
|
24
|
+
filter = PoeFilterGenerator::Filter.new(name, @export_path, @aliases)
|
25
|
+
yield filter
|
26
|
+
filter.generate
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
class PoeFilterGenerator::Group
|
2
|
+
def initialize(name, aliases)
|
3
|
+
@name = name
|
4
|
+
@aliases = aliases
|
5
|
+
@elements = []
|
6
|
+
@mixins = []
|
7
|
+
end
|
8
|
+
|
9
|
+
def generate(file)
|
10
|
+
file.puts '#' * 80
|
11
|
+
file.puts "# #{@name}"
|
12
|
+
file.puts '#' * 80
|
13
|
+
|
14
|
+
mixins_elements = @mixins.map { |m| m.elements << nil }
|
15
|
+
@elements.product(*mixins_elements).map(&:compact).each do |producted_elements|
|
16
|
+
element = producted_elements.delete_at(0)
|
17
|
+
producted_elements.each do |producted_element|
|
18
|
+
element = element.merge(producted_element)
|
19
|
+
end
|
20
|
+
|
21
|
+
element.generate(file)
|
22
|
+
end
|
23
|
+
|
24
|
+
file.puts
|
25
|
+
end
|
26
|
+
|
27
|
+
def element(name = nil)
|
28
|
+
element = PoeFilterGenerator::Element.new(name, @aliases)
|
29
|
+
yield element
|
30
|
+
@elements << element
|
31
|
+
end
|
32
|
+
|
33
|
+
def mixin
|
34
|
+
mixin = PoeFilterGenerator::Mixin.new(@aliases)
|
35
|
+
yield mixin
|
36
|
+
@mixins << mixin
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class PoeFilterGenerator::Mixin
|
2
|
+
attr_accessor :elements
|
3
|
+
|
4
|
+
def initialize(aliases)
|
5
|
+
@aliases = aliases
|
6
|
+
@elements = []
|
7
|
+
end
|
8
|
+
|
9
|
+
def element(name = nil)
|
10
|
+
element = PoeFilterGenerator::Element.new(name, @aliases)
|
11
|
+
yield element
|
12
|
+
@elements << element
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'poe_filter_generator/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "poe_filter_generator"
|
8
|
+
spec.version = PoeFilterGenerator::VERSION
|
9
|
+
spec.authors = ["isuke"]
|
10
|
+
spec.email = ["isuke770@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q(Generate "Path Of Exile"'s filter.)
|
13
|
+
spec.description = %q(Generate "Path Of Exile"'s filter.)
|
14
|
+
spec.homepage = "https://github.com/isuke/poe_filter_generator"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_dependency 'thor', '~> 0.19'
|
23
|
+
spec.add_dependency "activesupport", "> 3.0"
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
+
spec.add_development_dependency "rubocop", "~> 0.40"
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: poe_filter_generator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.5
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- isuke
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-12-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.19'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.19'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.12'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.40'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.40'
|
97
|
+
description: Generate "Path Of Exile"'s filter.
|
98
|
+
email:
|
99
|
+
- isuke770@gmail.com
|
100
|
+
executables:
|
101
|
+
- poe_filter_generator
|
102
|
+
extensions: []
|
103
|
+
extra_rdoc_files: []
|
104
|
+
files:
|
105
|
+
- ".gitignore"
|
106
|
+
- ".rspec"
|
107
|
+
- ".rubocop.yml"
|
108
|
+
- ".rubocop_todo.yml"
|
109
|
+
- CODE_OF_CONDUCT.md
|
110
|
+
- Gemfile
|
111
|
+
- LICENSE.txt
|
112
|
+
- README.md
|
113
|
+
- Rakefile
|
114
|
+
- bin/console
|
115
|
+
- bin/setup
|
116
|
+
- exe/poe_filter_generator
|
117
|
+
- lib/poe_filter_generator.rb
|
118
|
+
- lib/poe_filter_generator/cli.rb
|
119
|
+
- lib/poe_filter_generator/element.rb
|
120
|
+
- lib/poe_filter_generator/filter.rb
|
121
|
+
- lib/poe_filter_generator/generator.rb
|
122
|
+
- lib/poe_filter_generator/group.rb
|
123
|
+
- lib/poe_filter_generator/mixin.rb
|
124
|
+
- lib/poe_filter_generator/version.rb
|
125
|
+
- poe_filter_generator.gemspec
|
126
|
+
homepage: https://github.com/isuke/poe_filter_generator
|
127
|
+
licenses:
|
128
|
+
- MIT
|
129
|
+
metadata: {}
|
130
|
+
post_install_message:
|
131
|
+
rdoc_options: []
|
132
|
+
require_paths:
|
133
|
+
- lib
|
134
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - ">="
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
144
|
+
requirements: []
|
145
|
+
rubyforge_project:
|
146
|
+
rubygems_version: 2.6.11
|
147
|
+
signing_key:
|
148
|
+
specification_version: 4
|
149
|
+
summary: Generate "Path Of Exile"'s filter.
|
150
|
+
test_files: []
|