ranicoma 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 +61 -0
- data/.rspec +3 -0
- data/.rubocop.yml +86 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +9 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +35 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/example/create_example.rb +46 -0
- data/exe/ranicoma +6 -0
- data/lib/ranicoma.rb +14 -0
- data/lib/ranicoma/app.rb +27 -0
- data/lib/ranicoma/creator.rb +29 -0
- data/lib/ranicoma/design/base.rb +88 -0
- data/lib/ranicoma/design/geji.rb +249 -0
- data/lib/ranicoma/design/polypoly.rb +89 -0
- data/lib/ranicoma/design/rotobj.rb +103 -0
- data/lib/ranicoma/design/spbox.rb +109 -0
- data/lib/ranicoma/rect.rb +79 -0
- data/lib/ranicoma/util.rb +28 -0
- data/lib/ranicoma/version.rb +3 -0
- data/ranicoma.gemspec +35 -0
- metadata +116 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 32efb50d32ad02c48ba2a63ed8f046c94c940c17c2d3cbbf37c6480866ee754f
|
4
|
+
data.tar.gz: 32df39697cac084cec63ab4cd930f2b84edbdc860a695cf1b043d94cd5f5b077
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1ac072eb670f6431dde8a1f5d7d51ea54d71f5e2842c6775a0f5b922a797ca97b28d3ce659545ae776cfa8eceabb3671d24671cc375fb18539270d36a89415f1
|
7
|
+
data.tar.gz: 2e8d9ba0df682437219e41ecb0d3d380cbdbab445339f4e2e8ecc17a44111d5fa8d3551700dc85a49b4bbdaf4bb02d834f53afad4703b610a9801231625089f1
|
data/.gitignore
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
/.bundle/
|
13
|
+
/.yardoc
|
14
|
+
/_yardoc/
|
15
|
+
/coverage/
|
16
|
+
/doc/
|
17
|
+
/pkg/
|
18
|
+
/spec/reports/
|
19
|
+
/tmp/
|
20
|
+
|
21
|
+
# rspec failure tracking
|
22
|
+
.rspec_status
|
23
|
+
|
24
|
+
# Used by dotenv library to load environment variables.
|
25
|
+
# .env
|
26
|
+
|
27
|
+
## Specific to RubyMotion:
|
28
|
+
.dat*
|
29
|
+
.repl_history
|
30
|
+
build/
|
31
|
+
*.bridgesupport
|
32
|
+
build-iPhoneOS/
|
33
|
+
build-iPhoneSimulator/
|
34
|
+
|
35
|
+
## Specific to RubyMotion (use of CocoaPods):
|
36
|
+
#
|
37
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
38
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
39
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
40
|
+
#
|
41
|
+
# vendor/Pods/
|
42
|
+
|
43
|
+
## Documentation cache and generated files:
|
44
|
+
/.yardoc/
|
45
|
+
/_yardoc/
|
46
|
+
/doc/
|
47
|
+
/rdoc/
|
48
|
+
|
49
|
+
## Environment normalization:
|
50
|
+
/.bundle/
|
51
|
+
/vendor/bundle
|
52
|
+
/lib/bundler/man/
|
53
|
+
|
54
|
+
# for a library or gem, you might want to ignore these files since the code is
|
55
|
+
# intended to run in multiple environments; otherwise, check them in:
|
56
|
+
# Gemfile.lock
|
57
|
+
# .ruby-version
|
58
|
+
# .ruby-gemset
|
59
|
+
|
60
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
61
|
+
.rvmrc
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.6
|
3
|
+
|
4
|
+
Style/YodaCondition:
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
Style/MultilineBlockChain:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Style/IfUnlessModifier:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Style/StringLiterals:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Layout/SpaceAroundOperators:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Layout/SpaceBeforeBlockBraces:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Style/BlockDelimiters:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Layout/SpaceInsideHashLiteralBraces:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Style/StringLiteralsInInterpolation:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Style/MutableConstant:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Style/SpaceInsideArrayLiteralBrackets:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Layout/SpaceInsideParens:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Layout/SpaceAfterComma:
|
41
|
+
Enabled: false
|
42
|
+
|
43
|
+
Style/AsciiComments:
|
44
|
+
Enabled: false
|
45
|
+
|
46
|
+
Style/TrailingCommaInArrayLiteral:
|
47
|
+
Enabled: false
|
48
|
+
|
49
|
+
Layout/SpaceAfterColon:
|
50
|
+
Enabled: false
|
51
|
+
|
52
|
+
Naming/UncommunicativeMethodParamName:
|
53
|
+
Enabled: false
|
54
|
+
|
55
|
+
Layout/EmptyLineAfterGuardClause:
|
56
|
+
Enabled: false
|
57
|
+
|
58
|
+
Style/PercentLiteralDelimiters:
|
59
|
+
Enabled: false
|
60
|
+
|
61
|
+
Style/FormatString:
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
Layout/SpaceAfterNot:
|
65
|
+
Enabled: false
|
66
|
+
|
67
|
+
Layout/AlignHash:
|
68
|
+
Enabled: false
|
69
|
+
|
70
|
+
Layout/AlignParameters:
|
71
|
+
Enabled: false
|
72
|
+
|
73
|
+
Style/DoubleNegation:
|
74
|
+
Enabled: false
|
75
|
+
|
76
|
+
Style/PerlBackrefs:
|
77
|
+
Enabled: false
|
78
|
+
|
79
|
+
Style/ParallelAssignment:
|
80
|
+
Enabled: false
|
81
|
+
|
82
|
+
Style/NumericPredicate:
|
83
|
+
Enabled: false
|
84
|
+
|
85
|
+
Layout/MultilineMethodCallIndentation:
|
86
|
+
Enabled: false
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at takenori@nabetani.sakura.ne.jp. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ranicoma (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.3)
|
10
|
+
rake (10.5.0)
|
11
|
+
rspec (3.8.0)
|
12
|
+
rspec-core (~> 3.8.0)
|
13
|
+
rspec-expectations (~> 3.8.0)
|
14
|
+
rspec-mocks (~> 3.8.0)
|
15
|
+
rspec-core (3.8.2)
|
16
|
+
rspec-support (~> 3.8.0)
|
17
|
+
rspec-expectations (3.8.4)
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
+
rspec-support (~> 3.8.0)
|
20
|
+
rspec-mocks (3.8.1)
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
+
rspec-support (~> 3.8.0)
|
23
|
+
rspec-support (3.8.2)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
bundler (~> 2.0)
|
30
|
+
rake (~> 10.0)
|
31
|
+
ranicoma!
|
32
|
+
rspec (~> 3.0)
|
33
|
+
|
34
|
+
BUNDLED WITH
|
35
|
+
2.0.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Nabetani
|
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
|
+
# Ranicoma - random SVG icon maker
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'ranicoma'
|
9
|
+
```
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install ranicoma
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TBD
|
22
|
+
|
23
|
+
## Development
|
24
|
+
|
25
|
+
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.
|
26
|
+
|
27
|
+
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).
|
28
|
+
|
29
|
+
## Contributing
|
30
|
+
|
31
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ranicoma. 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.
|
32
|
+
|
33
|
+
## License
|
34
|
+
|
35
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
36
|
+
|
37
|
+
## Code of Conduct
|
38
|
+
|
39
|
+
Everyone interacting in the Ranicoma project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/ranicoma/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "ranicoma"
|
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,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ranicoma"
|
4
|
+
require "fileutils"
|
5
|
+
require 'rexml/document'
|
6
|
+
require 'rexml/formatters/pretty'
|
7
|
+
|
8
|
+
HERE = File.split(__FILE__)[0]
|
9
|
+
DIRNAME="icons"
|
10
|
+
ICONS_DIR = File.join(HERE, DIRNAME)
|
11
|
+
|
12
|
+
def main
|
13
|
+
FileUtils.mkdir_p( ICONS_DIR )
|
14
|
+
s=[]
|
15
|
+
formatter = REXML::Formatters::Pretty.new
|
16
|
+
100.times do |ix|
|
17
|
+
body = "#{ix}.svg"
|
18
|
+
s.push({ seed:ix, fn:File.join(DIRNAME, body)})
|
19
|
+
File.open( File.join(ICONS_DIR, body), "w" ) do |f|
|
20
|
+
c=Ranicoma::Creator.new(ix, 100)
|
21
|
+
formatter.write(c.create, f)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
File.open( File.join(HERE, "index.html"), "w" ) do |f|
|
25
|
+
f.puts <<~HTML_HEAD
|
26
|
+
<!DOCTYPE html>
|
27
|
+
<head>
|
28
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
29
|
+
<meta http-equiv="Content-Language" content="ja-JP">
|
30
|
+
<style>
|
31
|
+
body{ background-color: #eee }
|
32
|
+
img{ padding: 4px 4px 4px 4px; }
|
33
|
+
.img{ display: inline-block; background-color:white; margin-bottom:5pt; }
|
34
|
+
</style>
|
35
|
+
</head>
|
36
|
+
HTML_HEAD
|
37
|
+
s.each do |e|
|
38
|
+
f.puts( <<~IMG )
|
39
|
+
<div class="img">seed=#{e[:seed]}<br/><img src='#{e[:fn]}'/></div>
|
40
|
+
IMG
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
main
|
46
|
+
|