fractal 0.1.3 → 0.1.5
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 +4 -4
- data/bin/fractal +27 -1
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce6ccc1d562e8399fdbd9b5867851075197b1b31
|
4
|
+
data.tar.gz: 708e78c8f8d02810d0376b2185618a55333e974f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48cd8349fe3c1602ee3fd3740765e7dcacecb548116b8347b3ff83cbb0fb719f8a819cfe93837760b1fbd92aa4205849a11a6633f5eae6fc03e6a7b3fae1af42
|
7
|
+
data.tar.gz: 490f199d0ce4326813e4e17c1d82ba638adc56db49a99e2ceff1362fd2428deacef47788ec61e08dbe026a01bac0acc597a36e5847628ba1d0ea2c6ce39a7dc1
|
data/bin/fractal
CHANGED
@@ -1,5 +1,32 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'fractal'
|
3
|
+
args = Hash[ARGV.join(' ').scan(/--?([^=\s]+)(?:=(\S+))?/)]
|
4
|
+
if args.key?('h') || args.key?('help')
|
5
|
+
help = <<EOF
|
6
|
+
|
7
|
+
`fractal` command-line arguments:
|
8
|
+
|
9
|
+
- `-w=`, the pixel width of the output image.
|
10
|
+
(Defaults to 300), e.g. `-w=500`
|
11
|
+
- `-h=`, the pixel height of the output image.
|
12
|
+
(Defaults to 300), e.g. `-h=240`
|
13
|
+
- `--def=`, (optional), the 'definition' of the image,
|
14
|
+
the amount of calculations performed. e.g. `--def=255`
|
15
|
+
- `--scale=`, (optional), the zoom level of the image,
|
16
|
+
a higher value corresponds to a taller imaginary number line
|
17
|
+
thus a smaller fractal is seen. e.g. `--scale=2.25`
|
18
|
+
- Last but not least, (required), the type of fractal drawn.
|
19
|
+
This argument is composed of just the fractal's name,
|
20
|
+
put at any position in your list of arguments.
|
21
|
+
e.g. `mandelbrot`
|
22
|
+
|
23
|
+
An example command is:
|
24
|
+
`fractal -w=400 -h=320 mandelbrot --scale=2 --def=100`
|
25
|
+
|
26
|
+
EOF
|
27
|
+
puts help
|
28
|
+
exit 0
|
29
|
+
end
|
3
30
|
|
4
31
|
fractals = ['mandelbrot']
|
5
32
|
fractalType = String.new
|
@@ -16,7 +43,6 @@ if fractalType.empty?
|
|
16
43
|
end
|
17
44
|
|
18
45
|
width = height = 0
|
19
|
-
args = Hash[ARGV.join(' ').scan(/--?([^=\s]+)(?:=(\S+))?/)]
|
20
46
|
width = args['w'].to_i if args.key? 'w' # -w=2000
|
21
47
|
height = args['h'].to_i if args.key? 'h' # -h=1500
|
22
48
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fractal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Demonstrandum
|
@@ -9,7 +9,27 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2017-06-13 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: chunky_png
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.3.8
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.3'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.3.8
|
13
33
|
description: Creates PNG images of fractals.
|
14
34
|
email: knutsen@jetspace.co
|
15
35
|
executables:
|