motion-rubberstamp 0.0.1 → 0.0.2

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: a6463d3da785ed64e7ec4a0b167045ed429793cc
4
- data.tar.gz: 02ae312158fcb47f975c6c9f79c4aa2d84ab4662
3
+ metadata.gz: 09c94709ac1098ae2c3011e8bca69a81c3f89911
4
+ data.tar.gz: 8e5280e625f2467ebc145c742f9673e23fe42e23
5
5
  SHA512:
6
- metadata.gz: 29dbe15bc3dbba71c7dd96905b75a5538390c797ad643f012ae683aebe5508d4733988800e26e938aa64f43474dfdc3b33210d9886f9eb1c1bf99b8ced906b75
7
- data.tar.gz: ec78f993d75ea585ae43fb8b4f4ed67c91e398f498780bba99ca0f154fbfeef89bdfaebed4f914d39ee7188e59bbb804e17933237805d434589e12aa624735db
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 application's Gemfile:
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 yourself as:
26
+ Or install it manually as:
27
27
 
28
28
  $ gem install motion-rubberstamp
29
29
 
30
- This gem relies on imagemagick and ghostscript, which
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
- First use the provided rake task to rename your Icon files (where * is @2x, -568h etc.) to Icon_base, e.g.
40
- Icon@2x_base.png. This rake task automates it for you if your icons already exist:
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
- $ rake rubberstamp:install
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
- Then run the rake task to apply the overlay to your icons:
50
+ You can also manually invoke motion-rubberstamp at any time with:
45
51
 
46
52
  $ rake rubberstamp:run
47
53
 
48
- Now when you next build your project, build information will be overlayed
49
- as part of your icon.
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
- Unfortunately it doesn't appear that there's a build hook system available for
52
- RubyMotion so this will have to be ran manually before each build, or
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
- # Motion::Project::App.setup do |app|
5
- # app.development do
6
- # app.vendor_project File.join(File.dirname(__FILE__),"..",'..','framework'), :static
7
- # end
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}x40\
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', '_base.png'), :verbose => true)
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'
@@ -1,4 +1,4 @@
1
1
  module Rubberstamp
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
4
4
 
@@ -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/mattsgarrison/motion-rubberstamp"
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.1
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-04 00:00:00.000000000 Z
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/mattsgarrison/motion-rubberstamp
57
+ homepage: http://github.com/iconoclastlabs/motion-rubberstamp
58
58
  licenses:
59
59
  - MIT
60
60
  metadata: {}