magic_cloud 0.0.3 → 0.0.4
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/README.md +8 -8
- data/lib/magic_cloud/version.rb +1 -1
- data/magic_cloud.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1860d8f71de2e71e7c779d8f9dcd5326787795a
|
4
|
+
data.tar.gz: b76001d4c863abc162f8ae8785706d79e5acb753
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7529be89769587062a2cf904e30f7eca6fa702cebf776ab53e58389602395402389f61c358639fde4f15ad89b0317ee78e4e41bef38d8afbacbc18745804803
|
7
|
+
data.tar.gz: 731dd1fe569a22dbf40aafe3836508bff993b5f6b5ccf39bf342a69d176316780c673a63453897eaba6e2e7b78a4c297bfd1f80eed571b4c3cf1befb4290881b
|
data/README.md
CHANGED
@@ -37,16 +37,16 @@ Installation
|
|
37
37
|
gem install magic_cloud
|
38
38
|
```
|
39
39
|
|
40
|
-
rmagick is requirement, and it
|
40
|
+
rmagick is requirement, and it needs compilation, so you may expect
|
41
41
|
problems in non-compiler-friendly environment (Windows).
|
42
42
|
|
43
43
|
Origins
|
44
44
|
-------
|
45
45
|
|
46
|
-
At first, it was straightforward port of [d3.layout.cloud.js](https://github.com/jasondavies/d3-cloud)
|
46
|
+
At first, it was a straightforward port of [d3.layout.cloud.js](https://github.com/jasondavies/d3-cloud)
|
47
47
|
by Jason Davies, which, I assume, is an implementation of Wordle algorithm.
|
48
48
|
|
49
|
-
Then there was major
|
49
|
+
Then there was major refactoring, to make code correspond to Ruby
|
50
50
|
standards (and be understandable to poor dumb me).
|
51
51
|
|
52
52
|
Then collision algorithm was rewritten from scratch.
|
@@ -69,17 +69,17 @@ The time of cloud making depends on words count, size of image
|
|
69
69
|
(it's faster to find place for all words on larger image) and used rotation
|
70
70
|
algorithm (vertical+horizontal words only is significantly faster - and,
|
71
71
|
on my opinion, better looking - than "cool" free-rotated-words cloud). It
|
72
|
-
even depends on font - dense font like Impact takes
|
73
|
-
|
72
|
+
even depends on font - dense font like Impact takes more time to lay
|
73
|
+
out than sparse Tahoma.
|
74
74
|
|
75
75
|
Major performance eater is perfect collision detection, which Wordle-like
|
76
|
-
cloud needs. MagicCloud for now uses really dumb
|
76
|
+
cloud needs. MagicCloud for now uses really dumb algorithm with some
|
77
77
|
not-so-dumb optimizations. You can look into
|
78
78
|
`lib/magic_cloud/collision_board.rb` - everything can be optimized is
|
79
79
|
there; especially in `CollisionBoard#collides?` method.
|
80
80
|
|
81
81
|
I assume, for example, that naive rewriting of code in there as a C
|
82
|
-
extension
|
82
|
+
extension would help significantly.
|
83
83
|
|
84
84
|
Another possible way is adding some smart tricks, which eliminate as much
|
85
85
|
of pixel-by-pixel comparisons as possible (some of already made are
|
@@ -134,7 +134,7 @@ cloud = MagicCloud.new(words, palette: palette, rotate: rotate)
|
|
134
134
|
Current state
|
135
135
|
-------------
|
136
136
|
|
137
|
-
This library is extracted from real-life project. It should be
|
137
|
+
This library is extracted from a real-life project. It should be
|
138
138
|
pretty stable (apart from bugs introduced during extraction and gemification).
|
139
139
|
|
140
140
|
What it really lacks for now, is thorough (or any) testing, and
|
data/lib/magic_cloud/version.rb
CHANGED
data/magic_cloud.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.rubygems_version = '2.2.2'
|
33
33
|
|
34
34
|
s.add_dependency 'rmagick'
|
35
|
-
s.add_dependency 'slop', '~> 3.0
|
35
|
+
s.add_dependency 'slop', '~> 3.0' # for bin/magic_cloud options parsing
|
36
36
|
|
37
37
|
s.add_development_dependency 'rubocop'
|
38
38
|
s.add_development_dependency 'bundler'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magic_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Shepelev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.0
|
33
|
+
version: '3.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.0
|
40
|
+
version: '3.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rubocop
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
131
|
rubyforge_project:
|
132
|
-
rubygems_version: 2.4.
|
132
|
+
rubygems_version: 2.4.8
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Pretty word cloud maker for Ruby
|