gladwrap 1.0.0.pre → 1.0.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.
- checksums.yaml +4 -4
- data/lib/gladwrap.rb +17 -3
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 351aa26a36bf483709659160949814e7a49cbfff
|
4
|
+
data.tar.gz: 6c98f9492a61a3edc9a2ce7c9b44f9a32f560116
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1a8d99d59f7b9e0f7dbb8c080e988d6ca5c0cec1b0b5cf3c0e22884283ebfff53738c3b463973ad6ff03659f5210f94579caa66d1d0e8f3e6937a6f5f631d50
|
7
|
+
data.tar.gz: d6bd35a0e950571cded220b2106b50319ec186086f12ca6c4e1bb7c911125a3c29a6d94a15e639537345a17dc983780dc0cdcce9266d5fe30e6ef77c65b9021d
|
data/lib/gladwrap.rb
CHANGED
@@ -5,6 +5,8 @@ require "slop"
|
|
5
5
|
|
6
6
|
class Gladwrap
|
7
7
|
|
8
|
+
output_directory = './wraps/'
|
9
|
+
|
8
10
|
opts = Slop.parse do |o|
|
9
11
|
o.string '--device', '-d', 'Which device to use (iphone6_black, iphone6_white, more coming soon)', default: 'iphone6_black'
|
10
12
|
o.on '--help', '-h' do
|
@@ -21,15 +23,27 @@ class Gladwrap
|
|
21
23
|
bgURL = "https://s3.amazonaws.com/gladwrapp-assets/#{device}.png"
|
22
24
|
bg = Magick::Image.read(bgURL).first
|
23
25
|
files = Dir.glob"*.png"
|
24
|
-
|
26
|
+
|
27
|
+
if files.count < 1
|
28
|
+
puts "I don't see any files. What the heck."
|
29
|
+
elsif
|
30
|
+
puts "We bout to wrap bout #{files.count} files."
|
31
|
+
end
|
32
|
+
|
33
|
+
unless File.exist?(output_directory)
|
34
|
+
puts "creating #{output_directory}"
|
35
|
+
Dir.mkdir(output_directory)
|
36
|
+
end
|
25
37
|
|
26
38
|
files.each_with_index do |f, index|
|
27
39
|
overlay = Magick::Image.read("#{f}").first
|
28
40
|
bg.composite!(overlay, 51, 217, Magick::OverCompositeOp)
|
29
|
-
bg.write("
|
30
|
-
puts "writing #{index}.png"
|
41
|
+
bg.write("./#{output_directory}/#{index}.png")
|
42
|
+
puts "writing #{index}.png to #{output_directory}"
|
31
43
|
end
|
32
44
|
|
45
|
+
puts "We all done here."
|
46
|
+
|
33
47
|
rescue Slop::Error => e
|
34
48
|
puts e.message
|
35
49
|
puts opts
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gladwrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alan Clark
|
@@ -10,7 +10,8 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2015-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Take
|
13
|
+
description: 'Take UI mock ups, and wrap them in an iphone frame. Supports iPhone
|
14
|
+
6, more devices coming soon. '
|
14
15
|
email:
|
15
16
|
- alanjosephclark@gmail.com
|
16
17
|
executables:
|
@@ -34,9 +35,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
34
35
|
version: '0'
|
35
36
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
37
|
requirements:
|
37
|
-
- - "
|
38
|
+
- - ">="
|
38
39
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
40
|
+
version: '0'
|
40
41
|
requirements: []
|
41
42
|
rubyforge_project:
|
42
43
|
rubygems_version: 2.4.8
|