appstorm_concatenator 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in appstorm_concatenator.gemspec
4
+ gemspec
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "appstorm_concatenator/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "appstorm_concatenator"
7
+ s.version = AppstormConcatenator::VERSION
8
+ s.authors = ["Ian Murray"]
9
+ s.email = ["ianmurrays@gmail.com"]
10
+ s.homepage = "http://twitter.com/Synt4x"
11
+ s.summary = %q{Simply concatenates two iPhone screenshots into a single 620px wide image.}
12
+ s.description = %q{Simply concatenates two iPhone screenshots into a single 620px wide image.}
13
+
14
+ s.rubyforge_project = "appstorm_concatenator"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency "rmagick"
22
+ end
@@ -0,0 +1,5 @@
1
+ #/usr/bin/env ruby
2
+
3
+ require "appstorm_concatenator/concatenator"
4
+
5
+ AppstormConcatenator::Concatenator.concatenate_images(ARGV[0], ARGV[1], ARGV[2])
@@ -0,0 +1,4 @@
1
+ require "appstorm_concatenator/version"
2
+
3
+ module AppstormConcatenator
4
+ end
@@ -0,0 +1,29 @@
1
+ require "RMagick"
2
+
3
+ module AppstormConcatenator
4
+ class Concatenator
5
+ include Magick
6
+
7
+ def self.concatenate_images(image_1, image_2, output)
8
+ # Create the canvas
9
+ canvas = Image.new(620, 465) { self.background_color = "black" }
10
+
11
+ # Images
12
+ puts "--> Loading #{ARGV[0]}"
13
+ img = Image.read(ARGV[0]).first
14
+
15
+ puts "--> Loading #{ARGV[1]}"
16
+ img2 = Image.read(ARGV[1]).first
17
+
18
+ puts "--> Resizing images"
19
+ img.resize! 305, 458
20
+ img2.resize! 305, 458
21
+
22
+ puts "--> Creating final image #{ARGV[2]}"
23
+ canvas.composite(img, 3, 3, OverCompositeOp).composite(img2, 312, 3, OverCompositeOp).write(ARGV[2])
24
+
25
+ puts "--> Done!"
26
+ system "open #{ARGV[2]}" if !!(RUBY_PLATFORM =~ /darwin/)
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,3 @@
1
+ module AppstormConcatenator
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: appstorm_concatenator
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Ian Murray
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-10-24 00:00:00 -03:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rmagick
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ description: Simply concatenates two iPhone screenshots into a single 620px wide image.
28
+ email:
29
+ - ianmurrays@gmail.com
30
+ executables:
31
+ - concatenate
32
+ extensions: []
33
+
34
+ extra_rdoc_files: []
35
+
36
+ files:
37
+ - .gitignore
38
+ - Gemfile
39
+ - Rakefile
40
+ - appstorm_concatenator.gemspec
41
+ - bin/concatenate
42
+ - lib/appstorm_concatenator.rb
43
+ - lib/appstorm_concatenator/concatenator.rb
44
+ - lib/appstorm_concatenator/version.rb
45
+ has_rdoc: true
46
+ homepage: http://twitter.com/Synt4x
47
+ licenses: []
48
+
49
+ post_install_message:
50
+ rdoc_options: []
51
+
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: "0"
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: "0"
66
+ requirements: []
67
+
68
+ rubyforge_project: appstorm_concatenator
69
+ rubygems_version: 1.6.2
70
+ signing_key:
71
+ specification_version: 3
72
+ summary: Simply concatenates two iPhone screenshots into a single 620px wide image.
73
+ test_files: []
74
+