gladwrap 1.0.1 → 1.2.0

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: 85019a7508416e991838195b35fa7d980126e044
4
- data.tar.gz: 597cd3c45996c51de407e8d161100cd208f15ec8
3
+ metadata.gz: 0c630a593aac936c8348720b7f691004da240db7
4
+ data.tar.gz: 5f5009dabbc1e9fdcbe97fa31cc1776ffee82cb4
5
5
  SHA512:
6
- metadata.gz: a7a0ad9eb135b15239089ed52bee695e0b9376647bd4fb10241dca9036fe1cc052e52e909b56bf3a034fc00103f6ee40e1554cb6cd29ac07dc6b9a02dce393fb
7
- data.tar.gz: d9c769ec0aee34761b2d22c246391bfe0f789d0912a2b8958f511645e801610199e81202ddaa08cc02483f1e68536d54f7b83cc86d5d901df5197bf646d8b9bc
6
+ metadata.gz: b6e78b2dd513f5e2476cbffe623f6142a22a0701a65758a5af957457a96968141d0f69050c804d737fd7f6fa847b0426939a7f80c47b72562ac68610e56318f6
7
+ data.tar.gz: c58efd7c374355ea21c16c9d8832f81ab920120aacc1dde54d807079dd3173ccc1fc275c4d3a0a6ca2d6c5f65112ac3b3cdd28581ec3c9082bc47882da7f7fc6
data/.DS_Store ADDED
Binary file
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ test.png
3
+ Gemfile.lock
4
+ wraps/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ # A sample Gemfile
2
+ source "https://rubygems.org"
3
+ gem 'rmagick', '~> 2.15'
4
+ gem 'slop'
5
+
6
+ gemspec
data/README.md ADDED
@@ -0,0 +1,22 @@
1
+ #Gladwrap
2
+ Gladwrap is a cli I made that wraps your UI mockups in a device frame. Right now it only supports iphone 6 black & white, and assumes you're designing at 2x. I'll add more devices and options soon. I'm sure there are tools that do this and don't involve the command line. You should use one of those.
3
+
4
+ ### Quick start
5
+ - Install `gem install gladwrap`.
6
+ - Move to your mockups folder `cd /path/to/your/design/mockups/`
7
+ - Run gladwrap `gladwrap`
8
+ - Enjoy
9
+
10
+ You can speicify the device you want to use with
11
+ `gladwrap -d iphone6_white`. iPhone6_black is default.
12
+
13
+ Gladwrap will create a `wraps/` folder in your mockups folder and save a new copy of each mockup, wrapped in the specified device frame.
14
+
15
+ ### Device list
16
+ - iphone6_black (default)
17
+ - iphone6_white
18
+
19
+ ### Coming soon
20
+ iPhone6 gold, iPhone6 plus, Android devices, tablets?... you tell me.
21
+
22
+ ### Welp, see ya later.
data/gladwrap.gemspec ADDED
@@ -0,0 +1,16 @@
1
+ Gem::Specification.new do |gem|
2
+ gem.authors = ["Alan Clark"]
3
+ gem.email = ["alanjosephclark@gmail.com"]
4
+
5
+ gem.description = %q{Ruby cli for wrapping UI mockups in a device frame. Supports iPhone 6 (black & white), more devices coming soon. }
6
+ gem.summary = %q{More info here: https://github.com/aclarkk/gladwrap.}
7
+ gem.homepage = "https://github.com/aclarkk/gladwrap"
8
+
9
+ gem.files = `git ls-files`.split($\)
10
+ # gem.files = ["lib/gladwrap.rb","bin/gladwrap"]
11
+ gem.executables = ["gladwrap"]
12
+ #gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
+ gem.name = "gladwrap"
14
+ gem.require_paths = ["lib"]
15
+ gem.version = "1.2.0"
16
+ end
data/lib/gladwrap.rb CHANGED
@@ -1,15 +1,15 @@
1
1
  require "rubygems"
2
2
  require "bundler/setup"
3
+ require "fileutils"
3
4
  require "rmagick"
4
5
  require "slop"
5
6
 
6
7
  class Gladwrap
7
8
 
8
- output_directory = './wraps/'
9
9
 
10
10
  opts = Slop.parse do |o|
11
- o.string '--device', '-d', 'Which device to use (iphone6_black, iphone6_white, more coming soon)', default: 'iphone6_black'
12
- o.on '--help', '-h' do
11
+ o.string "--device", "-d", "Which device to use (iphone6_black, iphone6_white, more coming soon)", default: "iphone6_black"
12
+ o.on "--help", "-h" do
13
13
  puts o
14
14
  exit
15
15
  end
@@ -19,30 +19,32 @@ class Gladwrap
19
19
 
20
20
  # puts opts.to_hash #show the opts
21
21
 
22
- device = opts[:d]
22
+ device = opts[:device]
23
+ output_directory = "gladwrap/#{device}/"
24
+
23
25
  bgURL = "https://s3.amazonaws.com/gladwrapp-assets/#{device}.png"
24
26
  bg = Magick::Image.read(bgURL).first
25
27
  files = Dir.glob"*.png"
26
28
 
27
29
  if files.count < 1
28
- puts "I don't see any files. What the heck."
30
+ puts "No .png files could be found =("
29
31
  elsif
30
- puts "We bout to wrap bout #{files.count} files."
32
+ puts "Ok, let's do this."
31
33
  end
32
34
 
33
35
  unless File.exist?(output_directory)
34
36
  puts "creating #{output_directory}"
35
- Dir.mkdir(output_directory)
37
+ FileUtils::mkdir_p(output_directory)
36
38
  end
37
39
 
38
- files.each_with_index do |f, index|
40
+ files.each_with_index do |f, index|
39
41
  overlay = Magick::Image.read("#{f}").first
40
42
  bg.composite!(overlay, 51, 217, Magick::OverCompositeOp)
41
- bg.write("./#{output_directory}/#{index}.png")
42
- puts "writing #{index}.png to #{output_directory}"
43
+ bg.write("./#{output_directory}/#{f}")
44
+ puts "writing #{f} to #{output_directory}"
43
45
  end
44
46
 
45
- puts "We all done here."
47
+ puts "All finished."
46
48
 
47
49
  rescue Slop::Error => e
48
50
  puts e.message
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gladwrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Clark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-27 00:00:00.000000000 Z
11
+ date: 2015-12-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Ruby cli for wrapping UI mockups in a device frame. Supports iPhone
14
14
  6 (black & white), more devices coming soon. '
@@ -19,7 +19,12 @@ executables:
19
19
  extensions: []
20
20
  extra_rdoc_files: []
21
21
  files:
22
+ - ".DS_Store"
23
+ - ".gitignore"
24
+ - Gemfile
25
+ - README.md
22
26
  - bin/gladwrap
27
+ - gladwrap.gemspec
23
28
  - lib/gladwrap.rb
24
29
  homepage: https://github.com/aclarkk/gladwrap
25
30
  licenses: []
@@ -40,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
40
45
  version: '0'
41
46
  requirements: []
42
47
  rubyforge_project:
43
- rubygems_version: 2.4.8
48
+ rubygems_version: 2.5.0
44
49
  signing_key:
45
50
  specification_version: 4
46
51
  summary: 'More info here: https://github.com/aclarkk/gladwrap.'