masked_ape_club 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: aaeb474572ff56ab3da3cd20bb56d3d2904bcea7cd17c4751299ada8bd2ac9c7
4
+ data.tar.gz: 0735d4d6a893fd2fe2ca18e2b34aadb7e36e5f969b765a3123597e143a95359a
5
+ SHA512:
6
+ metadata.gz: 82167602a82f5f71e8a8d3c9d0a272c97f88f57d3abb89e006cc17a9683ba3c4bfcc8717c47f37f9c668e4be17d83f287e2cfb325377a44fe013f0ee3dc043a0
7
+ data.tar.gz: 12fd2266d9b41075f1b7548ad74f828e1fb930f1c8d7f6856412544f08bfa8d71360b2b4b8c33de4fe87f2d9f5c88cbc9f7f051f41e1282abff986da3d53d51d
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2021-12-28
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at hello13plus4.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in masked_ape_club.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rubocop", "~> 1.21"
data/Gemfile.lock ADDED
@@ -0,0 +1,53 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ masked_ape_club (0.0.1)
5
+ net-http (~> 0.1.1)
6
+ rmagick (~> 4.2.3)
7
+ uri (~> 0.10.1)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ ast (2.4.2)
13
+ io-wait (0.2.1)
14
+ net-http (0.1.1)
15
+ net-protocol
16
+ uri
17
+ net-protocol (0.1.2)
18
+ io-wait
19
+ timeout
20
+ parallel (1.21.0)
21
+ parser (3.0.3.2)
22
+ ast (~> 2.4.1)
23
+ rainbow (3.0.0)
24
+ rake (13.0.6)
25
+ regexp_parser (2.2.0)
26
+ rexml (3.2.5)
27
+ rmagick (4.2.4)
28
+ rubocop (1.24.0)
29
+ parallel (~> 1.10)
30
+ parser (>= 3.0.0.0)
31
+ rainbow (>= 2.2.2, < 4.0)
32
+ regexp_parser (>= 1.8, < 3.0)
33
+ rexml
34
+ rubocop-ast (>= 1.15.0, < 2.0)
35
+ ruby-progressbar (~> 1.7)
36
+ unicode-display_width (>= 1.4.0, < 3.0)
37
+ rubocop-ast (1.15.1)
38
+ parser (>= 3.0.1.1)
39
+ ruby-progressbar (1.11.0)
40
+ timeout (0.2.0)
41
+ unicode-display_width (2.1.0)
42
+ uri (0.10.1)
43
+
44
+ PLATFORMS
45
+ x86_64-darwin-20
46
+
47
+ DEPENDENCIES
48
+ masked_ape_club!
49
+ rake (~> 13.0)
50
+ rubocop (~> 1.21)
51
+
52
+ BUNDLED WITH
53
+ 2.2.33
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 a6b8
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,224 @@
1
+ <a href="#table-of-contents">
2
+ <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/masked-ape-club-for-ruby/readme/headlines/Headline.svg" height="55px" name="headline" alt="# Headline">
3
+ </a>
4
+
5
+ Let the apes out and free them from backgrounds. With the goal to bring them to context.
6
+ <br>
7
+ <br>
8
+ <br>
9
+ <a href="#table-of-contents">
10
+ <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/masked-ape-club-for-ruby/readme/headlines/examples.svg" height="55px" name="examples" alt="Examples">
11
+ </a>
12
+
13
+
14
+
15
+ <br>
16
+ <br>
17
+ <br>
18
+ <a href="#table-of-contents">
19
+ <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/masked-ape-club-for-ruby/readme/headlines/table-of-contents.svg" height="55px" name="table-of-contents" alt="Table of Contents">
20
+ </a>
21
+ <br>
22
+
23
+ 1. [Quickstart](#quickstart)<br>
24
+ 2. [Setup](#setup)<br>
25
+ 3. [Methods](#methods)<br>
26
+ 4. [Contributing](#contributing)<br>
27
+ 5. [Limitations](#limitations)<br>
28
+ 6. [Credits](#credits)<br>
29
+ 7. [License](#license)<br>
30
+ 8. [Code of Conduct](#code-of-conduct)<br>
31
+ 9. [Support my Work](#support-my-work)<br>
32
+
33
+ <br>
34
+ <br>
35
+ <a href="#table-of-contents">
36
+ <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/masked-ape-club-for-ruby/readme/headlines/quickstart.svg" height="55px" name="quickstart" alt="Quickstart">
37
+ </a>
38
+
39
+ ```bash
40
+ gem install masked_ape_club
41
+ ```
42
+
43
+ ``` ruby
44
+ require 'masked_ape_club'
45
+
46
+ id = 1711
47
+ a = MaskedApeClub::Load.new()
48
+ a.load( id: id )
49
+ a.mask_ape( id: id)
50
+ a.write( path: 'your_ape.png' )
51
+ ```
52
+ <br>
53
+ <br>
54
+ <a href="#table-of-contents">
55
+ <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/local-path-builder-for-ruby/readme/headlines/setup.svg" height="55px" name="setup" alt="Setup">
56
+ </a>
57
+
58
+ Add this line to your application's Gemfile:
59
+
60
+ ```ruby
61
+ gem 'masked_ape_club'
62
+ ```
63
+
64
+ And then execute:
65
+
66
+ $ bundle install
67
+
68
+ Or install it yourself as:
69
+
70
+ $ gem install masked_ape_club
71
+
72
+
73
+ On Rubygems:
74
+ - Gem: https://rubygems.org/gems/masked_ape_club
75
+ - Profile: https://rubygems.org/profiles/a6b8
76
+
77
+ <br>
78
+ <br>
79
+ <a href="#table-of-contents">
80
+ <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/masked-ape-club-for-ruby/readme/headlines/methods.svg" height="55px" name="methods" alt="Methods">
81
+ </a>
82
+
83
+ ### .load( id: )
84
+ ```ruby
85
+ require 'masked_ape_club'
86
+
87
+ a = MaskedApeClub::Load.new()
88
+ a.load( id: 1711 )
89
+ a.write( path: 'test.png' )
90
+ ```
91
+
92
+
93
+ **Input**
94
+ | **Key** | **Type** | **Required** | **Example** | **Description** |
95
+ |------:|:------|:------|:------|:------|
96
+ | **id** | ```String``` | Yes | 1711 | Choose your ape. |
97
+
98
+ **Return**<br>
99
+ True
100
+ <br>
101
+
102
+ ### .mask( fuzz: '1%', position: 1500, radius: 25 )
103
+ ```ruby
104
+ require 'masked_ape_club'
105
+
106
+ a = MaskedApeClub::Load.new()
107
+ a.load( id: 1711 )
108
+ a.mask()
109
+ a.write( path: 'test.png' )
110
+ ```
111
+
112
+
113
+ **Input**
114
+ | **Key** | **Type** | **Required** | **Example** | **Description** |
115
+ |------:|:------|:------|:------|:------|
116
+ | **fuzz** | ```String``` | No | "1%" | Choose threshold for erasing background, dont forget "%" |
117
+ | **position** | ```Integer``` | No | 1500 | Set pixel index which represent the background color. Every Image has 631x631 Pixels, 1500 should be near on the left right in row 3. |
118
+ | **size** | ```Integer``` | No | 2 | Draws a small frame arround the image, for better result on keying the background. |
119
+
120
+ **Return**<br>
121
+ True
122
+ <br>
123
+
124
+ ### .censored( upper_left_x: 240, upper_left_y: 210, lower_right_x: 460, lower_right_y: 270, color: 'black' )
125
+ ```ruby
126
+ require 'masked_ape_club'
127
+
128
+ a = MaskedApeClub::Load.new()
129
+ a.load( id: 1711 )
130
+ a.censored()
131
+ a.write( path: 'test.png' )
132
+ ```
133
+
134
+
135
+ **Input**
136
+ | **Key** | **Type** | **Required** | **Example** | **Description** |
137
+ |------:|:------|:------|:------|:------|
138
+ | **upper_left_x** | ```Integer``` | No | 240 | Set rectangle coordinate. |
139
+ | **upper_left_y** | ```Integer``` | No | 210 | Set rectangle coordinate. |
140
+ | **lower_right_x** | ```Integer``` | No | 460 | Set rectangle coordinate. |
141
+ | **lower_right_y** | ```Integer``` | No | 270 | Set rectangle coordinate. |
142
+ | **color** | ```Integer``` | No | 'black' | Set background color of rectangle |
143
+
144
+ **Return**<br>
145
+ True
146
+ <br>
147
+
148
+ ### .background( blob:, gravity: Magick::CenterGravity, offset_x: 0, offset_y: 0, width: 631, height: 631)
149
+
150
+ ```ruby
151
+ require 'masked_ape_club'
152
+
153
+ a = MaskedApeClub::Load.new()
154
+ a.load( id: 1711 )
155
+ a.mask()
156
+
157
+ background = 'background.png'
158
+ blob = open( background ).read()
159
+ a.background( blob: blob )
160
+ a.write( path: 'test.png' )
161
+ ```
162
+
163
+
164
+ **Input**
165
+ | **Key** | **Type** | **Required** | **Example** | **Description** |
166
+ |------:|:------|:------|:------|:------|
167
+ | **blob** | ```String``` | Yes | | Set rectangle coordinate. |
168
+ | **gravity** | ```RMagick Constant``` | No | 210 | See RMagick documentation for details: [RMagick Gravity](https://rmagick.github.io/constants.html)|
169
+ | **offset_x** | ```Integer``` | No | 0 | Offset ape on the x axes. |
170
+ | **offset_y** | ```Integer``` | No | 0 | Offset ape on the y axes. |
171
+ | **width** | ```Integer``` | No | 631 | Set default canvas width |
172
+ | **height** | ```Integer``` | No | 631 | Set default canvas height |
173
+
174
+ **Return**<br>
175
+ True
176
+ <br>
177
+ <br>
178
+ <br>
179
+
180
+ <a href="#table-of-contents">
181
+ <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/masked-ape-club-for-ruby/readme/headlines/contributing.svg" height="55px" name="contributing" alt="Contributing">
182
+ </a>
183
+
184
+ Bug reports and pull requests are welcome on GitHub at https://github.com/a6b8/masked-ape-club-for-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/a6b8/masked-ape-club-for-ruby/blob/master/CODE_OF_CONDUCT.md).
185
+ <br>
186
+ <br>
187
+ <br>
188
+ <a href="#table-of-contents">
189
+ <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/masked-ape-club-for-ruby/readme/headlines/limitations.svg" height="55px" name="limitations" alt="Limitations">
190
+ </a>
191
+ - Only tested with some ape
192
+ <br>
193
+ <br>
194
+ <br>
195
+
196
+ <a href="#table-of-contents">
197
+ <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/masked-ape-club-for-ruby/readme/headlines/credits.svg" height="55px" name="credits" alt="Credits">
198
+ </a>
199
+
200
+ <br>
201
+ <br>
202
+ <br>
203
+
204
+ <a href="#table-of-contents">
205
+ <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/masked-ape-club-for-ruby/readme/headlines/license.svg" height="55px" name="license" alt="License">
206
+ </a>
207
+
208
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
209
+ <br>
210
+ <br>
211
+ <br>
212
+ <a href="#table-of-contents">
213
+ <img src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/masked-ape-club-for-ruby/readme/headlines/code-of-conduct.svg" height="55px" name="code-of-conduct" alt="Code of Conduct">
214
+ </a>
215
+
216
+ Everyone interacting in the masked-ape-club-for-ruby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/a6b8/masked-ape-club-for-ruby/blob/master/CODE_OF_CONDUCT.md).
217
+ <br>
218
+ <br>
219
+ <br>
220
+ <a href="#table-of-contents">
221
+ <img href="#table-of-contents" src="https://raw.githubusercontent.com/a6b8/a6b8/main/docs/masked-ape-club-for-ruby/readme/headlines/support-my-work.svg" height="55px" name="support-my-work" alt="Support my Work">
222
+ </a>
223
+
224
+ Donate by [https://www.paypal.com](https://www.paypal.com/donate?hosted_button_id=XKYLQ9FBGC4RG)
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rubocop/rake_task"
5
+
6
+ RuboCop::RakeTask.new
7
+
8
+ task default: :rubocop
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "masked_ape_club"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here