motion-rubberstamp 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -16
- data/lib/motion/project/rubberstamp.rb +13 -6
- data/lib/rubberstamp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e73596661dda135a369015be51b33506ee2b7315
|
4
|
+
data.tar.gz: a03d5fb671385ad48b8f39b208579e0e556a0935
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42c3ad2a8fba5cf48df1017c78c11b538a9bcd3664dbb5f79b5cc90deb5cb8d915408c0208fc82383e08502da49d977678649571eeca18fd5c2b0807e38c11ba
|
7
|
+
data.tar.gz: 10a53c9418f69698f20e336819bb728aea3fade3faf231e2ec6d32a4ad70e3369956c38d30ef542980bcbc9ff89576db9248413b7c90fb1f69bdb594dc7917c7
|
data/README.md
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
# Motion-Rubberstamp
|
2
2
|
|
3
|
+
![motion-rubberstamp](https://s3.amazonaws.com/iconoclastweb/github/motion-rubberstamp/logo_200.png "motion-rubberstamp")
|
4
|
+
App Icon _Before_:
|
5
|
+
![Before motion-rubberstamp](https://s3.amazonaws.com/iconoclastweb/github/icon_before.png "Before motion-rubberstamp")
|
6
|
+
App Icon _After:_
|
7
|
+
![After motion-rubberstamp](https://s3.amazonaws.com/iconoclastweb/github/icon_after.png "After motion-rubberstamp")
|
8
|
+
|
3
9
|
This is aimed at being a development tool, it will create an
|
4
10
|
overlay for your iOS app icon that includes your version, commit
|
5
11
|
and branch information so you can know exactly what version of
|
6
12
|
your app is running on your device, or so that beta testers can
|
7
13
|
easily report which version they are running.
|
8
14
|
|
9
|
-
Here's what it does:
|
10
|
-
|
11
|
-
Before:
|
12
|
-
![Before motion-rubberstamp](https://s3.amazonaws.com/iconoclastweb/github/icon_before.png "Before motion-rubberstamp")
|
13
|
-
After:
|
14
|
-
![After motion-rubberstamp](https://s3.amazonaws.com/iconoclastweb/github/icon_after.png "After motion-rubberstamp")
|
15
|
-
|
16
15
|
## Installation
|
17
16
|
|
18
|
-
|
17
|
+
### Gemfile Install
|
18
|
+
Add this line to your RubyMotion app's [Gemfile](http://gembundler.com/v1.3/rubymotion.html):
|
19
19
|
|
20
20
|
gem 'motion-rubberstamp'
|
21
21
|
|
@@ -23,6 +23,7 @@ And then execute:
|
|
23
23
|
|
24
24
|
$ bundle
|
25
25
|
|
26
|
+
### Manual Install
|
26
27
|
Or install it manually as:
|
27
28
|
|
28
29
|
$ gem install motion-rubberstamp
|
@@ -31,6 +32,7 @@ and add to your RubyMotion app's Rakefile
|
|
31
32
|
|
32
33
|
require 'motion-rubberstamp'
|
33
34
|
|
35
|
+
### Dependencies
|
34
36
|
This gem also relies on imagemagick and ghostscript, which
|
35
37
|
can easily be installed via [Homebrew](http://mxcl.github.io/homebrew/):
|
36
38
|
|
@@ -40,13 +42,16 @@ can easily be installed via [Homebrew](http://mxcl.github.io/homebrew/):
|
|
40
42
|
|
41
43
|
## Usage
|
42
44
|
|
45
|
+
#### Installing the Gem is all that's needed to get started.
|
43
46
|
Motion-rubberstamp adds itself to the build process, so whenever you run `rake` or `rake device` it will
|
44
47
|
automatically invoke `rake rubberstamp:run` beforehand.
|
45
48
|
|
46
|
-
When you run `rake archive` or `rake archive:distribution`, motion-rubberstamp will automatically invoke
|
49
|
+
_Smart Cleanup:_ When you run `rake archive` or `rake archive:distribution`, motion-rubberstamp will automatically invoke
|
47
50
|
`rake rubberstamp:revert`. This means that development builds will now automatically receive overlays and
|
48
51
|
release builds will use your original icons.
|
49
52
|
|
53
|
+
## Rake Tasks
|
54
|
+
|
50
55
|
You can also manually invoke motion-rubberstamp at any time with:
|
51
56
|
|
52
57
|
$ rake rubberstamp:run
|
@@ -57,16 +62,22 @@ Or to remove the overlays and restore your original icons, you can run
|
|
57
62
|
|
58
63
|
## Notes
|
59
64
|
|
60
|
-
The iOS Simulator
|
61
|
-
build
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
+
The iOS Simulator will appear to cache your app icons when you run a
|
66
|
+
build because RubyMotion's deployer apparently only looks for new resource
|
67
|
+
files when deploying (it copies resource files to a simulator directory on
|
68
|
+
your local filesystem). Motion-rubberstamp is still invoked, but it won't
|
69
|
+
appear to update on your simulator. Deleting the app on your simulator
|
70
|
+
before building will invoke the refresh but is a non-optimal solution. I
|
71
|
+
hope to have this solved in the next release.
|
72
|
+
|
73
|
+
Motion-rubberstamp also currently only checks for app icons in the `/resources`
|
74
|
+
path, regardless of what your Rakefile is configured for.
|
65
75
|
|
66
76
|
## Uninstalling
|
67
77
|
|
68
|
-
Motion-rubberstamp duplicates your original icon files with `_base`
|
69
|
-
|
78
|
+
Motion-rubberstamp duplicates your original icon files with `_base` suffixed counterparts.
|
79
|
+
To uninstall, simply run `rake rubberstamp:revert` to restore your original icons, then
|
80
|
+
delete motion-rubberstamp from your gemfile or rakefile.
|
70
81
|
|
71
82
|
## Contributing
|
72
83
|
|
@@ -81,6 +92,10 @@ clue how to write tests for this. But I'll gladly accept any help that's offered
|
|
81
92
|
|
82
93
|
## Thanks
|
83
94
|
|
95
|
+
As brought to our attention, this was also done by [Clay's Allsopp!](https://github.com/clayallsopp/motion-smarticons), in a most
|
96
|
+
elegant solution! We're hoping to continue progressing this gem to make sure it is useful and provides a wide array of
|
97
|
+
utility regardless :)
|
98
|
+
|
84
99
|
Many thanks to Krzysztof Zabłocki and Evan Doll for the idea and
|
85
100
|
implementation
|
86
101
|
[details](http://www.merowing.info/2013/03/overlaying-application-version-on-top-of-your-icon/).
|
@@ -19,14 +19,23 @@ namespace :rubberstamp do
|
|
19
19
|
width= `identify -format '%w' #{filename}`.to_i
|
20
20
|
new_filename = filename.gsub('_base', '')
|
21
21
|
status = `convert -background '#0008' -fill white -gravity center -size #{width}x30\
|
22
|
-
|
22
|
+
caption:"#{caption}"\
|
23
23
|
#{filename} +swap -gravity south -composite #{new_filename}`
|
24
24
|
else
|
25
25
|
puts "File does not exist, you broke it."
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
def installed?
|
30
|
+
icons = Dir.glob('resources/Icon*')
|
31
|
+
prexisting_base_icons = icons.map{|icon| icon.include?("base") }
|
32
|
+
prexisting_base_icons.include?(true)
|
33
|
+
end
|
34
|
+
|
29
35
|
task :run do
|
36
|
+
# Automatically run install on first run
|
37
|
+
Rake::Task["rubberstamp:install"].execute unless installed?
|
38
|
+
|
30
39
|
# piggyback on RubyMotion's own app config tool
|
31
40
|
project_config_vars = Motion::Project::App.config.variables
|
32
41
|
app_version = project_config_vars['version']
|
@@ -47,13 +56,11 @@ namespace :rubberstamp do
|
|
47
56
|
|
48
57
|
desc "Copy your current app icons to `_base` equivalent backups."
|
49
58
|
task :install do
|
50
|
-
App.info "motion-rubberstamp", "Installing: Copying original icons"
|
51
|
-
|
52
|
-
prexisting_base_icons = icons.map{|icon| icon.include?("base") }
|
53
|
-
if prexisting_base_icons.include?(true)
|
59
|
+
App.info "motion-rubberstamp", "First Run Installing: Copying original icons"
|
60
|
+
if installed?
|
54
61
|
raise("Error: It appears that motion-rubberstamp is already installed.")
|
55
62
|
else
|
56
|
-
|
63
|
+
Dir.glob('resources/Icon*').each do |icon|
|
57
64
|
FileUtils.cp(icon, icon.gsub('.png', '_base.png'), :verbose => true)
|
58
65
|
end
|
59
66
|
end
|
data/lib/rubberstamp/version.rb
CHANGED