motion-rubberstamp 0.0.1 → 0.0.2
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/README.md +28 -13
- data/lib/motion/project/rubberstamp.rb +32 -8
- data/lib/rubberstamp/version.rb +1 -1
- data/motion-rubberstamp.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09c94709ac1098ae2c3011e8bca69a81c3f89911
|
4
|
+
data.tar.gz: 8e5280e625f2467ebc145c742f9673e23fe42e23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea25bf0b321357c579ab0f2e41c8e6eae666e6045787407af2b90240dc284ed35926995d02a83f4647234c44abd7656329dfb2471ad2c4eedc34bd7dea45de88
|
7
|
+
data.tar.gz: 2bbe6f25f68c2906f18d897aad01fc6c8914e5efa30c0811c6b2a968dc387d586c26320195f2e20cf359c9c65e068c7a19d337ed45db3fdba6f07411d8c816f7
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ After:
|
|
15
15
|
|
16
16
|
## Installation
|
17
17
|
|
18
|
-
Add this line to your
|
18
|
+
Add this line to your RubyMotion app's Gemfile:
|
19
19
|
|
20
20
|
gem 'motion-rubberstamp'
|
21
21
|
|
@@ -23,11 +23,15 @@ And then execute:
|
|
23
23
|
|
24
24
|
$ bundle
|
25
25
|
|
26
|
-
Or install it
|
26
|
+
Or install it manually as:
|
27
27
|
|
28
28
|
$ gem install motion-rubberstamp
|
29
29
|
|
30
|
-
|
30
|
+
and add to your RubyMotion app's Rakefile
|
31
|
+
|
32
|
+
require 'motion-rubberstamp'
|
33
|
+
|
34
|
+
This gem also relies on imagemagick and ghostscript, which
|
31
35
|
can easily be installed via [Homebrew](http://mxcl.github.io/homebrew/):
|
32
36
|
|
33
37
|
$ brew install imagemagick
|
@@ -36,22 +40,33 @@ can easily be installed via [Homebrew](http://mxcl.github.io/homebrew/):
|
|
36
40
|
|
37
41
|
## Usage
|
38
42
|
|
39
|
-
|
40
|
-
|
43
|
+
Motion-rubberstamp adds itself to the build process, so whenever you run `rake` or `rake device` it will
|
44
|
+
automatically invoke `rake rubberstamp:run` beforehand.
|
41
45
|
|
42
|
-
|
46
|
+
When you run `rake archive` or `rake archive:distribution`, motion-rubberstamp will automatically invoke
|
47
|
+
`rake rubberstamp:revert`. This means that development builds will now automatically receive overlays and
|
48
|
+
release builds will use your original icons.
|
43
49
|
|
44
|
-
|
50
|
+
You can also manually invoke motion-rubberstamp at any time with:
|
45
51
|
|
46
52
|
$ rake rubberstamp:run
|
47
53
|
|
48
|
-
|
49
|
-
|
54
|
+
Or to remove the overlays and restore your original icons, you can run
|
55
|
+
|
56
|
+
$ rake rubberstamp:revert
|
57
|
+
|
58
|
+
## Notes
|
59
|
+
|
60
|
+
The iOS Simulator seems to cache or store your app icons when you run a
|
61
|
+
build. Motion-rubberstamp is still invoked, but it doesn't appear to
|
62
|
+
update on your device. Deleting the app on your device before building
|
63
|
+
seems to invoke the refresh, but if anyone knows of a more automated
|
64
|
+
solution to invoking an icon refresh, that would be better.
|
65
|
+
|
66
|
+
## Uninstalling
|
50
67
|
|
51
|
-
|
52
|
-
|
53
|
-
you'll need to write a custom rake task to Rubberstamp your icons and
|
54
|
-
then invoke the build sequentially.
|
68
|
+
Motion-rubberstamp duplicates your original icon files with `_base` suffixes. To uninstall, simply remove
|
69
|
+
motion-rubberstamp from your gemfile
|
55
70
|
|
56
71
|
## Contributing
|
57
72
|
|
@@ -1,11 +1,10 @@
|
|
1
1
|
require 'pathname'
|
2
2
|
require 'fileutils'
|
3
3
|
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
# end
|
4
|
+
# Gratuitously lifted from Laurent Sansonetti's motion-testflight.
|
5
|
+
unless defined?(Motion::Project::Config)
|
6
|
+
raise "This file must be required within a RubyMotion project Rakefile."
|
7
|
+
end
|
9
8
|
|
10
9
|
namespace :rubberstamp do
|
11
10
|
desc "Stamp iOS app icons with version and git information"
|
@@ -19,8 +18,8 @@ namespace :rubberstamp do
|
|
19
18
|
if File.exist? filename
|
20
19
|
width= `identify -format '%w' #{filename}`.to_i
|
21
20
|
new_filename = filename.gsub('_base', '')
|
22
|
-
status = `convert -background '#0008' -fill white -gravity center -size #{width}
|
23
|
-
caption:"#{caption}"\
|
21
|
+
status = `convert -background '#0008' -fill white -gravity center -size #{width}x30\
|
22
|
+
-stroke black caption:"#{caption}"\
|
24
23
|
#{filename} +swap -gravity south -composite #{new_filename}`
|
25
24
|
else
|
26
25
|
puts "File does not exist, you broke it."
|
@@ -40,6 +39,7 @@ namespace :rubberstamp do
|
|
40
39
|
# process_icon("Icon@2x_base.png", caption)
|
41
40
|
# process_icon("Icon-72_base.png", caption)
|
42
41
|
# process_icon("Icon-72@2x_base.png", caption)
|
42
|
+
App.info "motion-rubberstamp", "Rubberstamping icons..."
|
43
43
|
Dir.glob('resources/*_base.png').each do |icon|
|
44
44
|
process_icon(icon, caption)
|
45
45
|
end
|
@@ -47,10 +47,34 @@ namespace :rubberstamp do
|
|
47
47
|
|
48
48
|
desc "Copy your current app icons to `_base` equivalent backups."
|
49
49
|
task :install do
|
50
|
+
App.info "motion-rubberstamp", "Installing: Copying original icons"
|
50
51
|
icons = Dir.glob('resources/Icon*')
|
52
|
+
prexisting_base_icons = icons.map{|icon| icon.include?("base") }
|
53
|
+
if prexisting_base_icons.include?(true)
|
54
|
+
raise("Error: It appears that motion-rubberstamp is already installed.")
|
55
|
+
else
|
56
|
+
icons.each do |icon|
|
57
|
+
FileUtils.cp(icon, icon.gsub('.png', '_base.png'), :verbose => true)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "Reverts your icons to their original versions."
|
63
|
+
task :revert do
|
64
|
+
App.info "motion-rubberstamp", "Reverting icons to their original versions."
|
65
|
+
icons = Dir.glob('resources/Icon*_base.png')
|
51
66
|
icons.each do |icon|
|
52
|
-
FileUtils.cp(icon, icon.gsub('.png', '
|
67
|
+
FileUtils.cp(icon, icon.gsub('_base.png', '.png'), :verbose => true)
|
68
|
+
p "Restored #{icon.gsub('_base.png', '.png')})"
|
53
69
|
end
|
54
70
|
end
|
55
71
|
|
56
72
|
end
|
73
|
+
|
74
|
+
# Make rubberstamp run before any build
|
75
|
+
task 'build:simulator' => 'rubberstamp:run'
|
76
|
+
task 'build:device' => 'rubberstamp:run'
|
77
|
+
|
78
|
+
# Revert rubberstamp before any archive build
|
79
|
+
task 'archive' => 'rubberstamp:revert'
|
80
|
+
task 'archive:distribution' => 'rubberstamp:revert'
|
data/lib/rubberstamp/version.rb
CHANGED
data/motion-rubberstamp.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["mattsgarrison@iconoclastlabs.com"]
|
11
11
|
spec.description = %q{Adds version and git information overlays to your iOS app icon}
|
12
12
|
spec.summary = %q{Adds version and git information overlays to your iOS app icon}
|
13
|
-
spec.homepage = "http://github.com/
|
13
|
+
spec.homepage = "http://github.com/iconoclastlabs/motion-rubberstamp"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-rubberstamp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Garrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -54,7 +54,7 @@ files:
|
|
54
54
|
- lib/motion/project/rubberstamp.rb
|
55
55
|
- lib/rubberstamp/version.rb
|
56
56
|
- motion-rubberstamp.gemspec
|
57
|
-
homepage: http://github.com/
|
57
|
+
homepage: http://github.com/iconoclastlabs/motion-rubberstamp
|
58
58
|
licenses:
|
59
59
|
- MIT
|
60
60
|
metadata: {}
|