gladwrap 1.0.0.pre
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 +7 -0
- data/bin/gladwrap +3 -0
- data/lib/gladwrap.rb +38 -0
- metadata +46 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5e259dc9278cb475f44b2d60ff73db4c7332964c
|
4
|
+
data.tar.gz: c950c4b683c53381b43e0eb57abd1deac683d8b4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 91aa96125e7355c783abe460b190b1a0f3c1b232aef409dba8a8d729275af001bdbd17880ac6d06a049c155d45db5012772ae4cdd6e8b6bb25f701868000e421
|
7
|
+
data.tar.gz: 14bc7bed8ca5caf4a68cfc468ae67259d72fcf58500b3c5f3f6b6f00d60f16591e3ccc092b844afe0726885e34118df451d156e68e0924a916b48d00b8a78b8f
|
data/bin/gladwrap
ADDED
data/lib/gladwrap.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "bundler/setup"
|
3
|
+
require "rmagick"
|
4
|
+
require "slop"
|
5
|
+
|
6
|
+
class Gladwrap
|
7
|
+
|
8
|
+
opts = Slop.parse do |o|
|
9
|
+
o.string '--device', '-d', 'Which device to use (iphone6_black, iphone6_white, more coming soon)', default: 'iphone6_black'
|
10
|
+
o.on '--help', '-h' do
|
11
|
+
puts o
|
12
|
+
exit
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
begin
|
17
|
+
|
18
|
+
# puts opts.to_hash #show the opts
|
19
|
+
|
20
|
+
device = opts[:d]
|
21
|
+
bgURL = "https://s3.amazonaws.com/gladwrapp-assets/#{device}.png"
|
22
|
+
bg = Magick::Image.read(bgURL).first
|
23
|
+
files = Dir.glob"*.png"
|
24
|
+
puts "We bout to wrap bout #{files.count} files."
|
25
|
+
|
26
|
+
files.each_with_index do |f, index|
|
27
|
+
overlay = Magick::Image.read("#{f}").first
|
28
|
+
bg.composite!(overlay, 51, 217, Magick::OverCompositeOp)
|
29
|
+
bg.write("#{index}.png")
|
30
|
+
puts "writing #{index}.png"
|
31
|
+
end
|
32
|
+
|
33
|
+
rescue Slop::Error => e
|
34
|
+
puts e.message
|
35
|
+
puts opts
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gladwrap
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0.pre
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alan Clark
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-16 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Take sketch exports, and wrap them in an iphone frame
|
14
|
+
email:
|
15
|
+
- alanjosephclark@gmail.com
|
16
|
+
executables:
|
17
|
+
- gladwrap
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- bin/gladwrap
|
22
|
+
- lib/gladwrap.rb
|
23
|
+
homepage: http://alanclark.biz
|
24
|
+
licenses: []
|
25
|
+
metadata: {}
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 1.3.1
|
40
|
+
requirements: []
|
41
|
+
rubyforge_project:
|
42
|
+
rubygems_version: 2.4.8
|
43
|
+
signing_key:
|
44
|
+
specification_version: 4
|
45
|
+
summary: ''
|
46
|
+
test_files: []
|