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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d52731a3845be89ed8ce3d9f866326bf19e030ea
4
- data.tar.gz: 9d0b220dd8c70a34422b2ebd388a627166d03196
3
+ metadata.gz: dfa3701b61de93445e0509cf4ef8db5d1af6cc4f
4
+ data.tar.gz: b43b348d274f2178c4a4092c0e572867be344239
5
5
  SHA512:
6
- metadata.gz: 2d6c4dd24c5b9cb41453da4c2ec698f28ec3cdbbcea09c833277a91b0bb868c9b88631bd580389578a6dacc8f5c51c9e4651d0fb50b67f869c651c9425efc979
7
- data.tar.gz: 785689c6a5a5a568adb9c6abc57e42b6f3694d5594af7a66deeb2b83e9907a9695c2b5a1f50b12e470404da452e4a701e4c788f43fc47241f9335a8b5db83bf9
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
- Custom screenshots:
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
- name:
134
- url: 'github.com'
135
- size: [1280, 720] # W x H
136
- scroll: 100 # Optional
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.
@@ -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 |key|
60
- next unless (work = task[key])
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_#{key}", asset, size, setup_for(opts))
71
+ send(:"compile_#{subtask}", asset, size, setup_for(opts))
64
72
  end
65
73
  end
66
74
  end
@@ -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 = *ss
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 = opts['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
 
@@ -200,41 +200,42 @@ rails:
200
200
  #
201
201
  apple:
202
202
  icon:
203
- 'apple/icon.png': 1024
203
+ 'apple/icon1024.png': 1024
204
204
  'apple/icon16.png': 16
205
205
  splash:
206
- 'apple/splash.png': [1024, 768]
206
+ 'apple/splash1024x768.png': [1024, 768]
207
207
  screenshots:
208
- 'ios/ipad-1024x768-land': [1024, 768]
209
- 'ios/ipad-1024x768-port': [768, 1024]
210
- 'ios/ipadretina-2048x1536-land': [2048, 1536, 2]
211
- 'ios/ipadretina-2048x1536-port': [1536, 2048, 2]
212
- 'ios/iphone4-960x640-land': [960, 640]
213
- 'ios/iphone4-640x960-port': [640, 960]
214
- 'ios/iphone5-1136x640-land': [1136, 640, 2]
215
- 'ios/iphone5-640x1136-port': [640, 1136, 2]
216
- 'ios/iphone6p-1080x1920-port': [1080, 1920, 2]
217
- 'ios/iphone6p-1920x1080-land': [1920, 1080, 2]
218
- 'ios/iphone6-1334x750-land': [1334, 750, 2]
219
- 'ios/iphone6-750x1334-port': [750, 1334, 2]
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/icon.png': 512
224
+ 'google/icon512.png': 512
225
225
  'google/icon1024.png': 1024
226
226
  'google/180.png': 180
227
227
  splash:
228
- 'google/splash.png': [1024, 768]
228
+ 'google/splash1024x500.png': [1024, 500]
229
+ 'google/splash180x120.png': [180, 120]
229
230
  screenshots:
230
- 'android/android-10in-1280x720-land': [1280, 720]
231
- 'android/android-10in-2048x1152-land': [2048, 1152]
232
- 'android/android-10in-1280x720-port': [720, 1280]
233
- 'android/android-10in-2048x1152-port': [1152, 2048]
234
- 'android/android-7in-1280x800-land': [1280, 800]
235
- 'android/android-7in-1280x800-port': [800, 1280]
236
- 'android/android-4in-1280x720-land': [1920, 1080]
237
- 'android/android-4in-1280x720-port': [1080, 1920]
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/icon.png': 256
248
+ 'twitter/icon256.png': 256
248
249
 
249
250
  facebook:
250
251
  icon:
251
- 'fb/icon.png': 1024
252
+ 'fb/icon1024.png': 1024
252
253
  'fb/icon16.png': 16
253
254
  splash:
254
- 'fb/splash.png': [1024, 768]
255
+ 'fb/splash1024x768.png': [1024, 768]
@@ -1,4 +1,4 @@
1
1
  # :nodoc:
2
2
  module YAMG
3
- VERSION = '0.3.5'
3
+ VERSION = '0.3.7'
4
4
  end
@@ -14,9 +14,13 @@ splash:
14
14
  background: '#fff6d5' # nil or color RGBA
15
15
 
16
16
  # Icon + name for instance
17
- media:
18
- path: 'media.png'
19
- background: false
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.5
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-01 00:00:00.000000000 Z
11
+ date: 2015-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_magick