yamg 0.3.5 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -7
- data/lib/yamg/cli.rb +11 -3
- data/lib/yamg/screenshot.rb +5 -4
- data/lib/yamg/templates.yaml +28 -27
- data/lib/yamg/version.rb +1 -1
- data/lib/yamg/yamg.yml +7 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfa3701b61de93445e0509cf4ef8db5d1af6cc4f
|
4
|
+
data.tar.gz: b43b348d274f2178c4a4092c0e572867be344239
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 295afc335dc5fd7b6863264343008e0a09440a042e627ed08887bab80eec24e5e104c71ec2264ba60cd617ff00f54be590a927ad2954f7f0eccc1e45a43b3536
|
7
|
+
data.tar.gz: 64b361d63ed1e27970a9e82db5258e7230529b7306a0beb82c0b5945255f815471f784996f3e1f308ae7eabc14a71c6005ec80694db2cba183573c51f84c134b
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# YAMG
|
2
2
|
|
3
|
-
┏
|
3
|
+
┏ ┓
|
4
4
|
|
5
5
|
_____ _____ _____ ______ _______ _____
|
6
6
|
|\ \ / /| ___|\ \ | \/ \ ___|\ \
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|____|/ |____| |____| \|____| |____|/ \|___| | /
|
15
15
|
|____|/
|
16
16
|
|
17
|
-
┗
|
17
|
+
┗ ┛
|
18
18
|
|
19
19
|
|
20
20
|
[![Gem Version](https://badge.fury.io/rb/yamg.png)](http://badge.fury.io/rb/yamg)
|
@@ -127,13 +127,24 @@ There's also media generator for app stores.
|
|
127
127
|
|
128
128
|
## Screenshots (phantomjs)
|
129
129
|
|
130
|
-
|
130
|
+
To generate default screenshots (stores and whatnot) provide the url:
|
131
|
+
|
132
|
+
```
|
133
|
+
screenshot:
|
134
|
+
url: 'localhost:7000'
|
135
|
+
```
|
131
136
|
|
132
137
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
138
|
+
Custom screenshots (notice the plural):
|
139
|
+
|
140
|
+
```
|
141
|
+
screenshots:
|
142
|
+
another-one:
|
143
|
+
url: 'github.com'
|
144
|
+
size: [1280, 720] # W x H
|
145
|
+
scroll: 100 # Optional
|
146
|
+
dpi: 2 # Optional, 2 for HiDPI
|
147
|
+
```
|
137
148
|
|
138
149
|
|
139
150
|
Note: Waiting for a pull-request on screencap for hidpi.
|
data/lib/yamg/cli.rb
CHANGED
@@ -33,6 +33,13 @@ module YAMG
|
|
33
33
|
File.join(path, asset)
|
34
34
|
end
|
35
35
|
|
36
|
+
def compile_screenshots(ss, size, setup)
|
37
|
+
return unless YAMG.config['screenshot'].respond_to?(:[])
|
38
|
+
fail 'No url provided' unless url = YAMG.config['screenshot']['url']
|
39
|
+
Screenshot.new(ss, { 'size' => size, 'url' => url } ).work(setup['path'])
|
40
|
+
puts Rainbow("[o]SS #{ss}").black
|
41
|
+
end
|
42
|
+
|
36
43
|
def compile_media(i, size, setup)
|
37
44
|
end
|
38
45
|
|
@@ -56,11 +63,12 @@ module YAMG
|
|
56
63
|
|
57
64
|
def compile_work(job, opts)
|
58
65
|
task = YAMG::TEMPLATES[job] || (works[job] && works[job]['export'])
|
59
|
-
%w(icon splash media).each do |
|
60
|
-
next unless (work = task[
|
66
|
+
%w(icon logo splash media screenshots).each do |subtask|
|
67
|
+
next unless (work = task[subtask])
|
68
|
+
|
61
69
|
work.each do |asset, size|
|
62
70
|
Thread.new do # 500% speed up with 8 cores
|
63
|
-
send(:"compile_#{
|
71
|
+
send(:"compile_#{subtask}", asset, size, setup_for(opts))
|
64
72
|
end
|
65
73
|
end
|
66
74
|
end
|
data/lib/yamg/screenshot.rb
CHANGED
@@ -6,14 +6,15 @@ module YAMG
|
|
6
6
|
attr_accessor :url, :size, :command
|
7
7
|
|
8
8
|
# Uses PhantomJS
|
9
|
-
def initialize(ss)
|
10
|
-
@name, opts =
|
11
|
-
fail 'No screen size provided' unless opts['size']
|
9
|
+
def initialize(*ss)
|
10
|
+
@name, opts = ss
|
11
|
+
fail 'No screen size provided' unless opts && opts['size']
|
12
12
|
uri = URI.parse(opts['url'])
|
13
13
|
@url = "http://#{uri}"
|
14
14
|
@size = opts['size']
|
15
15
|
@size = @size.split(/\s?,\s?/) if @size.respond_to?(:split)
|
16
|
-
@dpi =
|
16
|
+
@dpi = @size.pop if @size.length > 2
|
17
|
+
@dpi ||= opts['dpi']
|
17
18
|
@fetcher = Screencap::Fetcher.new(@url)
|
18
19
|
end
|
19
20
|
|
data/lib/yamg/templates.yaml
CHANGED
@@ -200,41 +200,42 @@ rails:
|
|
200
200
|
#
|
201
201
|
apple:
|
202
202
|
icon:
|
203
|
-
'apple/
|
203
|
+
'apple/icon1024.png': 1024
|
204
204
|
'apple/icon16.png': 16
|
205
205
|
splash:
|
206
|
-
'apple/
|
206
|
+
'apple/splash1024x768.png': [1024, 768]
|
207
207
|
screenshots:
|
208
|
-
'
|
209
|
-
'
|
210
|
-
'
|
211
|
-
'
|
212
|
-
'
|
213
|
-
'
|
214
|
-
'
|
215
|
-
'
|
216
|
-
'
|
217
|
-
'
|
218
|
-
'
|
219
|
-
'
|
208
|
+
'apple/ipad-1024x768-land': [1024, 768]
|
209
|
+
'apple/ipad-1024x768-port': [768, 1024]
|
210
|
+
'apple/ipadretina-2048x1536-land': [2048, 1536, 2]
|
211
|
+
'apple/ipadretina-2048x1536-port': [1536, 2048, 2]
|
212
|
+
'apple/iphone4-960x640-land': [960, 640]
|
213
|
+
'apple/iphone4-640x960-port': [640, 960]
|
214
|
+
'apple/iphone5-1136x640-land': [1136, 640, 2]
|
215
|
+
'apple/iphone5-640x1136-port': [640, 1136, 2]
|
216
|
+
'apple/iphone6p-1080x1920-port': [1080, 1920, 2]
|
217
|
+
'apple/iphone6p-1920x1080-land': [1920, 1080, 2]
|
218
|
+
'apple/iphone6-1334x750-land': [1334, 750, 2]
|
219
|
+
'apple/iphone6-750x1334-port': [750, 1334, 2]
|
220
220
|
|
221
221
|
|
222
222
|
google:
|
223
223
|
icon:
|
224
|
-
'google/
|
224
|
+
'google/icon512.png': 512
|
225
225
|
'google/icon1024.png': 1024
|
226
226
|
'google/180.png': 180
|
227
227
|
splash:
|
228
|
-
'google/
|
228
|
+
'google/splash1024x500.png': [1024, 500]
|
229
|
+
'google/splash180x120.png': [180, 120]
|
229
230
|
screenshots:
|
230
|
-
'
|
231
|
-
'
|
232
|
-
'
|
233
|
-
'
|
234
|
-
'
|
235
|
-
'
|
236
|
-
'
|
237
|
-
'
|
231
|
+
'google/android-10in-1280x720-land': [1280, 720]
|
232
|
+
'google/android-10in-1280x720-port': [720, 1280]
|
233
|
+
'google/android-10in-2048x1152-land': [2048, 1152, 2]
|
234
|
+
'google/android-10in-2048x1152-port': [1152, 2048, 2]
|
235
|
+
'google/android-7in-1280x800-land': [1280, 800]
|
236
|
+
'google/android-7in-1280x800-port': [800, 1280]
|
237
|
+
'google/android-4in-1280x720-land': [1920, 1080, 2]
|
238
|
+
'google/android-4in-1280x720-port': [1080, 1920, 2]
|
238
239
|
|
239
240
|
|
240
241
|
#
|
@@ -244,11 +245,11 @@ google:
|
|
244
245
|
#
|
245
246
|
twitter:
|
246
247
|
icon:
|
247
|
-
'twitter/
|
248
|
+
'twitter/icon256.png': 256
|
248
249
|
|
249
250
|
facebook:
|
250
251
|
icon:
|
251
|
-
'fb/
|
252
|
+
'fb/icon1024.png': 1024
|
252
253
|
'fb/icon16.png': 16
|
253
254
|
splash:
|
254
|
-
'fb/
|
255
|
+
'fb/splash1024x768.png': [1024, 768]
|
data/lib/yamg/version.rb
CHANGED
data/lib/yamg/yamg.yml
CHANGED
@@ -14,9 +14,13 @@ splash:
|
|
14
14
|
background: '#fff6d5' # nil or color RGBA
|
15
15
|
|
16
16
|
# Icon + name for instance
|
17
|
-
media:
|
18
|
-
|
19
|
-
|
17
|
+
# media:
|
18
|
+
# path: 'media.png'
|
19
|
+
# background: false
|
20
|
+
|
21
|
+
# Uncomment to use screenshot feature!
|
22
|
+
# screenshot:
|
23
|
+
# url: 'localhost:3000'
|
20
24
|
|
21
25
|
#
|
22
26
|
# What to do?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yamg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Piccinini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mini_magick
|