gallerize-cli 0.2.2 → 0.3.0

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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -4
  3. data/Gemfile +2 -2
  4. data/{assets/css → app/assets/images}/blank.gif +0 -0
  5. data/{assets/css → app/assets/images}/fancybox_loading.gif +0 -0
  6. data/{assets/css → app/assets/images}/fancybox_loading@2x.gif +0 -0
  7. data/{assets/css → app/assets/images}/fancybox_overlay.png +0 -0
  8. data/{assets/css → app/assets/images}/fancybox_sprite.png +0 -0
  9. data/{assets/css → app/assets/images}/fancybox_sprite@2x.png +0 -0
  10. data/{assets/js → app/assets/javascripts/plugins}/jquery-1.10.1.min.js +0 -0
  11. data/{assets/js → app/assets/javascripts/plugins}/jquery.fancybox.js +0 -0
  12. data/app/assets/javascripts/ready.js +14 -0
  13. data/app/assets/stylesheets/_gallerize.scss +144 -0
  14. data/app/assets/stylesheets/_jquery.fancybox.scss +273 -0
  15. data/app/assets/stylesheets/styles.scss +2 -0
  16. data/app/config/gallerize_cli.yml +28 -0
  17. data/app/templates/layout.html.haml +37 -0
  18. data/bin/{gallerize → gallerize_cli} +5 -2
  19. data/gallerize-cli.gemspec +15 -15
  20. data/lib/gallerize_cli/directory.rb +113 -0
  21. data/lib/gallerize_cli/image/version.rb +99 -0
  22. data/lib/gallerize_cli/image.rb +87 -0
  23. data/lib/gallerize_cli/render.rb +70 -0
  24. data/lib/gallerize_cli.rb +42 -0
  25. data/readme.md +35 -0
  26. metadata +35 -34
  27. data/Gemfile.lock +0 -37
  28. data/README.md +0 -50
  29. data/assets/css/jquery.fancybox.css +0 -274
  30. data/assets/css/styles.css +0 -76
  31. data/assets/js/imagesloaded.js +0 -7
  32. data/assets/js/jquery.masonry.js +0 -9
  33. data/config/global.yml.example +0 -10
  34. data/lib/gallerize/output_dir.rb +0 -44
  35. data/lib/gallerize/source_dir.rb +0 -17
  36. data/lib/gallerize.rb +0 -210
  37. data/templates/layout.html.erb +0 -59
@@ -0,0 +1,42 @@
1
+ require 'gallerize_cli/directory'
2
+ require 'gallerize_cli/render'
3
+ require 'yaml'
4
+ require 'ostruct'
5
+ require 'logger'
6
+
7
+ module GallerizeCli
8
+
9
+ VERSION='0.3.0'
10
+
11
+ class << self
12
+ def perform
13
+ directory = GallerizeCli::Directory.new(File.expand_path('.'))
14
+ directory.process
15
+ GallerizeCli::Render.new(directory).perform
16
+ end
17
+
18
+ def app_source_path
19
+ File.join(root, 'app')
20
+ end
21
+
22
+ def root
23
+ @root ||= File.expand_path(File.join(__FILE__, '../../'))
24
+
25
+ end
26
+
27
+ def logger
28
+ @logger ||= init_logger
29
+ end
30
+
31
+ private
32
+ def init_logger
33
+ l = Logger.new(STDOUT)
34
+ l.formatter = proc do |severity, datetime, progname, msg|
35
+ "#{datetime.strftime("%Y-%m-%d %H:%M:%S")}: #{msg}\n"
36
+ end
37
+ l
38
+ end
39
+
40
+ end
41
+
42
+ end
data/readme.md ADDED
@@ -0,0 +1,35 @@
1
+ ### Example
2
+
3
+ http://examples.hilscher.ca/gallerize/
4
+
5
+
6
+ ### Overview
7
+
8
+ * generate a static gallery from a folder of images
9
+ * responsive layout
10
+ * sass is compiled and compressed
11
+ * javascript is uglified and minified
12
+ * easily customized
13
+
14
+
15
+ ### Installation
16
+
17
+ ```
18
+ gem install gallerize-cli
19
+ ```
20
+
21
+
22
+ ### Usage
23
+
24
+ ```
25
+ $ cd folder-with-pictures
26
+ $ gallerize
27
+ $ open gallerize/index.html
28
+ ```
29
+
30
+
31
+ ### Configuration
32
+
33
+ After you run 'gallerize' it generates a .gallerize-cli folder. You can modify the contents to alter how your gallery is generated.
34
+
35
+ This folder contains scss, js, images, and haml templates.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gallerize-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Hilscher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-02 00:00:00.000000000 Z
11
+ date: 2014-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_magick
@@ -25,47 +25,47 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.7.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: activesupport
28
+ name: parallel
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.1.1
33
+ version: 1.0.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: 4.1.1
40
+ version: 1.0.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: parallel
42
+ name: sass
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 1.0.0
47
+ version: 3.4.7
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 1.0.0
54
+ version: 3.4.7
55
55
  - !ruby/object:Gem::Dependency
56
- name: exifr
56
+ name: uglifier
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.1.3
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.1.3
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -84,33 +84,34 @@ description: https://github.com/blakehilscher/gallerize
84
84
  email:
85
85
  - blake@hilscher.ca
86
86
  executables:
87
- - gallerize
87
+ - gallerize_cli
88
88
  extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
91
  - ".gitignore"
92
92
  - Gemfile
93
- - Gemfile.lock
94
- - README.md
95
- - assets/css/blank.gif
96
- - assets/css/fancybox_loading.gif
97
- - assets/css/fancybox_loading@2x.gif
98
- - assets/css/fancybox_overlay.png
99
- - assets/css/fancybox_sprite.png
100
- - assets/css/fancybox_sprite@2x.png
101
- - assets/css/jquery.fancybox.css
102
- - assets/css/styles.css
103
- - assets/js/imagesloaded.js
104
- - assets/js/jquery-1.10.1.min.js
105
- - assets/js/jquery.fancybox.js
106
- - assets/js/jquery.masonry.js
107
- - bin/gallerize
108
- - config/global.yml.example
93
+ - app/assets/images/blank.gif
94
+ - app/assets/images/fancybox_loading.gif
95
+ - app/assets/images/fancybox_loading@2x.gif
96
+ - app/assets/images/fancybox_overlay.png
97
+ - app/assets/images/fancybox_sprite.png
98
+ - app/assets/images/fancybox_sprite@2x.png
99
+ - app/assets/javascripts/plugins/jquery-1.10.1.min.js
100
+ - app/assets/javascripts/plugins/jquery.fancybox.js
101
+ - app/assets/javascripts/ready.js
102
+ - app/assets/stylesheets/_gallerize.scss
103
+ - app/assets/stylesheets/_jquery.fancybox.scss
104
+ - app/assets/stylesheets/styles.scss
105
+ - app/config/gallerize_cli.yml
106
+ - app/templates/layout.html.haml
107
+ - bin/gallerize_cli
109
108
  - gallerize-cli.gemspec
110
- - lib/gallerize.rb
111
- - lib/gallerize/output_dir.rb
112
- - lib/gallerize/source_dir.rb
113
- - templates/layout.html.erb
109
+ - lib/gallerize_cli.rb
110
+ - lib/gallerize_cli/directory.rb
111
+ - lib/gallerize_cli/image.rb
112
+ - lib/gallerize_cli/image/version.rb
113
+ - lib/gallerize_cli/render.rb
114
+ - readme.md
114
115
  homepage: http://blake.hilscher.ca/
115
116
  licenses:
116
117
  - MIT
data/Gemfile.lock DELETED
@@ -1,37 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- activesupport (4.1.1)
5
- i18n (~> 0.6, >= 0.6.9)
6
- json (~> 1.7, >= 1.7.7)
7
- minitest (~> 5.1)
8
- thread_safe (~> 0.1)
9
- tzinfo (~> 1.1)
10
- coderay (1.1.0)
11
- exifr (1.1.3)
12
- i18n (0.6.9)
13
- json (1.8.1)
14
- method_source (0.8.2)
15
- mini_magick (3.7.0)
16
- subexec (~> 0.2.1)
17
- minitest (5.3.5)
18
- parallel (1.0.0)
19
- pry (0.10.0)
20
- coderay (~> 1.1.0)
21
- method_source (~> 0.8.1)
22
- slop (~> 3.4)
23
- slop (3.5.0)
24
- subexec (0.2.3)
25
- thread_safe (0.3.4)
26
- tzinfo (1.2.1)
27
- thread_safe (~> 0.1)
28
-
29
- PLATFORMS
30
- ruby
31
-
32
- DEPENDENCIES
33
- activesupport
34
- exifr
35
- mini_magick
36
- parallel
37
- pry
data/README.md DELETED
@@ -1,50 +0,0 @@
1
- ### Example
2
-
3
- http://examples.hilscher.ca/gallerize/
4
-
5
-
6
- ### Overview
7
-
8
- * generate a static gallery from a folder of images
9
- * responsive layout
10
- * thumbnails and fullsize are generated automatically
11
- * does not alter existing directory
12
-
13
-
14
- ### Installation
15
-
16
- ```
17
- gem install gallerize-cli
18
- ```
19
-
20
-
21
- ### Usage
22
-
23
- ```
24
- $ cd folder-with-pictures
25
- $ gallerize
26
- $ open gallerize/index.html
27
- ```
28
-
29
-
30
- ### Configuration
31
-
32
- Create .gallerize in the directory that contains your photos with any of these options:
33
-
34
- | Name | Required? | Example Value | Description |
35
- | ------------- |:-------------:| -----------------:| -------------------------------------------------------------:|
36
- | per_page | required | 100 | How many photos per page? |
37
- | image_types | required | jpg,JPG,png,PNG | The image formats to process |
38
- | workers | required | 4 | The number of processes to use when doing CPU intensive work |
39
- | image_width | required | 1200 | The fullsize image width |
40
- | image_height | required | 800 | The fullsize image height |
41
- | thumb_width | required | 400 | The thumbnail image width |
42
- | thumb_height | required | 300 | The thumbnail image height |
43
- | output_name | optional | gallery | Directory name where the gallery will be created |
44
- | tracking | optional | UA-0000000-2 | Enable google analytics by entering a tracking code |
45
-
46
-
47
- ### Future
48
-
49
- * extract the html from generate.rb and put it into source/template.haml
50
- * add scss precompile: source/styles.scss
@@ -1,274 +0,0 @@
1
- /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
2
- .fancybox-wrap,
3
- .fancybox-skin,
4
- .fancybox-outer,
5
- .fancybox-inner,
6
- .fancybox-image,
7
- .fancybox-wrap iframe,
8
- .fancybox-wrap object,
9
- .fancybox-nav,
10
- .fancybox-nav span,
11
- .fancybox-tmp
12
- {
13
- padding: 0;
14
- margin: 0;
15
- border: 0;
16
- outline: none;
17
- vertical-align: top;
18
- }
19
-
20
- .fancybox-wrap {
21
- position: absolute;
22
- top: 0;
23
- left: 0;
24
- z-index: 8020;
25
- }
26
-
27
- .fancybox-skin {
28
- position: relative;
29
- background: #f9f9f9;
30
- color: #444;
31
- text-shadow: none;
32
- -webkit-border-radius: 4px;
33
- -moz-border-radius: 4px;
34
- border-radius: 4px;
35
- }
36
-
37
- .fancybox-opened {
38
- z-index: 8030;
39
- }
40
-
41
- .fancybox-opened .fancybox-skin {
42
- -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
43
- -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
44
- box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
45
- }
46
-
47
- .fancybox-outer, .fancybox-inner {
48
- position: relative;
49
- }
50
-
51
- .fancybox-inner {
52
- overflow: hidden;
53
- }
54
-
55
- .fancybox-type-iframe .fancybox-inner {
56
- -webkit-overflow-scrolling: touch;
57
- }
58
-
59
- .fancybox-error {
60
- color: #444;
61
- font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
62
- margin: 0;
63
- padding: 15px;
64
- white-space: nowrap;
65
- }
66
-
67
- .fancybox-image, .fancybox-iframe {
68
- display: block;
69
- width: 100%;
70
- height: 100%;
71
- }
72
-
73
- .fancybox-image {
74
- max-width: 100%;
75
- max-height: 100%;
76
- }
77
-
78
- #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
79
- background-image: url('fancybox_sprite.png');
80
- }
81
-
82
- #fancybox-loading {
83
- position: fixed;
84
- top: 50%;
85
- left: 50%;
86
- margin-top: -22px;
87
- margin-left: -22px;
88
- background-position: 0 -108px;
89
- opacity: 0.8;
90
- cursor: pointer;
91
- z-index: 8060;
92
- }
93
-
94
- #fancybox-loading div {
95
- width: 44px;
96
- height: 44px;
97
- background: url('fancybox_loading.gif') center center no-repeat;
98
- }
99
-
100
- .fancybox-close {
101
- position: absolute;
102
- top: -18px;
103
- right: -18px;
104
- width: 36px;
105
- height: 36px;
106
- cursor: pointer;
107
- z-index: 8040;
108
- }
109
-
110
- .fancybox-nav {
111
- position: absolute;
112
- top: 0;
113
- width: 40%;
114
- height: 100%;
115
- cursor: pointer;
116
- text-decoration: none;
117
- background: transparent url('blank.gif'); /* helps IE */
118
- -webkit-tap-highlight-color: rgba(0,0,0,0);
119
- z-index: 8040;
120
- }
121
-
122
- .fancybox-prev {
123
- left: 0;
124
- }
125
-
126
- .fancybox-next {
127
- right: 0;
128
- }
129
-
130
- .fancybox-nav span {
131
- position: absolute;
132
- top: 50%;
133
- width: 36px;
134
- height: 34px;
135
- margin-top: -18px;
136
- cursor: pointer;
137
- z-index: 8040;
138
- visibility: hidden;
139
- }
140
-
141
- .fancybox-prev span {
142
- left: 10px;
143
- background-position: 0 -36px;
144
- }
145
-
146
- .fancybox-next span {
147
- right: 10px;
148
- background-position: 0 -72px;
149
- }
150
-
151
- .fancybox-nav:hover span {
152
- visibility: visible;
153
- }
154
-
155
- .fancybox-tmp {
156
- position: absolute;
157
- top: -99999px;
158
- left: -99999px;
159
- visibility: hidden;
160
- max-width: 99999px;
161
- max-height: 99999px;
162
- overflow: visible !important;
163
- }
164
-
165
- /* Overlay helper */
166
-
167
- .fancybox-lock {
168
- overflow: hidden !important;
169
- width: auto;
170
- }
171
-
172
- .fancybox-lock body {
173
- overflow: hidden !important;
174
- }
175
-
176
- .fancybox-lock-test {
177
- overflow-y: hidden !important;
178
- }
179
-
180
- .fancybox-overlay {
181
- position: absolute;
182
- top: 0;
183
- left: 0;
184
- overflow: hidden;
185
- display: none;
186
- z-index: 8010;
187
- background: url('fancybox_overlay.png');
188
- }
189
-
190
- .fancybox-overlay-fixed {
191
- position: fixed;
192
- bottom: 0;
193
- right: 0;
194
- }
195
-
196
- .fancybox-lock .fancybox-overlay {
197
- overflow: auto;
198
- overflow-y: scroll;
199
- }
200
-
201
- /* Title helper */
202
-
203
- .fancybox-title {
204
- visibility: hidden;
205
- font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
206
- position: relative;
207
- text-shadow: none;
208
- z-index: 8050;
209
- }
210
-
211
- .fancybox-opened .fancybox-title {
212
- visibility: visible;
213
- }
214
-
215
- .fancybox-title-float-wrap {
216
- position: absolute;
217
- bottom: 0;
218
- right: 50%;
219
- margin-bottom: -35px;
220
- z-index: 8050;
221
- text-align: center;
222
- }
223
-
224
- .fancybox-title-float-wrap .child {
225
- display: inline-block;
226
- margin-right: -100%;
227
- padding: 2px 20px;
228
- background: transparent; /* Fallback for web browsers that doesn't support RGBa */
229
- background: rgba(0, 0, 0, 0.8);
230
- -webkit-border-radius: 15px;
231
- -moz-border-radius: 15px;
232
- border-radius: 15px;
233
- text-shadow: 0 1px 2px #222;
234
- color: #FFF;
235
- font-weight: bold;
236
- line-height: 24px;
237
- white-space: nowrap;
238
- }
239
-
240
- .fancybox-title-outside-wrap {
241
- position: relative;
242
- margin-top: 10px;
243
- color: #fff;
244
- }
245
-
246
- .fancybox-title-inside-wrap {
247
- padding-top: 10px;
248
- }
249
-
250
- .fancybox-title-over-wrap {
251
- position: absolute;
252
- bottom: 0;
253
- left: 0;
254
- color: #fff;
255
- padding: 10px;
256
- background: #000;
257
- background: rgba(0, 0, 0, .8);
258
- }
259
-
260
- /*Retina graphics!*/
261
- @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
262
- only screen and (min--moz-device-pixel-ratio: 1.5),
263
- only screen and (min-device-pixel-ratio: 1.5){
264
-
265
- #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
266
- background-image: url('fancybox_sprite@2x.png');
267
- background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/
268
- }
269
-
270
- #fancybox-loading div {
271
- background-image: url('fancybox_loading@2x.gif');
272
- background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/
273
- }
274
- }