motion-rubberstamp 0.0.5 → 0.0.6

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: bd56b3b1cf2ca1f77318cc1639b5d979f16240aa
4
- data.tar.gz: 10d307b54c21fb1362d0a7210246afc909d95551
3
+ metadata.gz: d6dc94fd91ba0ca3e27559b7fd96094b13ea48f5
4
+ data.tar.gz: 2db17a292a461768899a022c8889cce64218fe85
5
5
  SHA512:
6
- metadata.gz: 023c17feb568fd4fcf238c71ba7e71d1a0d8f7db2c7afe32a628d2a85549d0c0f7c54a7771d7683232d175ade99d2139d5de5320e88aace0fce4eef63b765b99
7
- data.tar.gz: b2a3fa27d5caf6c50f55ed42185c55e9819d62141732d17bcfa3ef6488025a091d8a562183f0bc5a2f9b03a5098d1f547866c1674f390f18914bdbc579056cd7
6
+ metadata.gz: 88c1d87cf156b4be801fdd2fb15b81f8712340fbc03e7893dd93e80df2b1590b7675cb8e5e5ac8bd00ba3b94cc4a5c8a8d4d14f34fe7a9793ac7078890a653e8
7
+ data.tar.gz: d98d52cb6bf0b7e5ce25d2c1fcbbb5c36ba43fdbb62eb3305146326285fc78db6537b01666a75b0b4113c70a20120fb024b6307e6c7d6c687fce53f2e7244848
data/README.md CHANGED
@@ -18,7 +18,8 @@ This is aimed at being a development tool, it will create an
18
18
  overlay for your iOS app icon that includes your version, commit
19
19
  and branch information so you can know exactly what version of
20
20
  your app is running on your device, or so that beta testers can
21
- easily report which version they are running.
21
+ easily report which version they are running. If your icons don't
22
+ need to be updated, the motion-rubberstamp won't do anything.
22
23
 
23
24
  ## Installation
24
25
 
@@ -50,12 +51,12 @@ can easily be installed via [Homebrew](http://mxcl.github.io/homebrew/):
50
51
 
51
52
  ## Usage
52
53
 
53
- #### Installing the Gem is all that's needed to get started.
54
- Motion-rubberstamp adds itself to the build process, so whenever you run `rake` or `rake device` it will
55
- automatically invoke `rake rubberstamp:run` beforehand.
54
+ #### Installing the Gem is all that's needed to get started.
55
+ Motion-rubberstamp adds itself to the build process, so whenever you run `rake` or `rake device` it will
56
+ automatically invoke `rake rubberstamp:run` beforehand.
56
57
 
57
- _Smart Cleanup:_ When you run `rake archive` or `rake archive:distribution`, motion-rubberstamp will automatically invoke
58
- `rake rubberstamp:revert`. This means that development builds will now automatically receive overlays and
58
+ _Smart Cleanup:_ When you run `rake archive` or `rake archive:distribution`, motion-rubberstamp will automatically invoke
59
+ `rake rubberstamp:revert`. This means that development builds will now automatically receive overlays and
59
60
  release builds will use your original icons.
60
61
 
61
62
  ## Rake Tasks
@@ -70,12 +71,16 @@ Or to remove the overlays and restore your original icons, you can run
70
71
 
71
72
  ## Notes
72
73
 
73
- The iOS Simulator is trying to cache your app icons. For this reason we've put in a significant refresh step!
74
- Your app data and simulator are restarted to refresh the icon to the latest version, which means your simulator will restart each time you build. It's a small but notable necessary evil.
74
+ The iOS Simulator is trying to cache your app icons. For this reason we've put in a significant step that
75
+ will refresh your simulator automatically by closing it, should the stamps be updated. This is a small but notable necessary evil.
76
+ our build detects that it needs to restamp. It's a small but notable necessary evil.
75
77
 
76
78
  Motion-rubberstamp _currently_ only checks for app icons in the `/resources`
77
79
  path, regardless of what your Rakefile is configured for.
78
-
80
+
81
+ Motion-rubberstamp will only run if your version or git information has changed to prevent invoking
82
+ ImageMagick and pals more than necessary.
83
+
79
84
  ## Uninstall
80
85
  #### Bye?
81
86
  Rubberstamp will not stamp your archive/production apps. No need to leave us like that! But if you must...
@@ -42,9 +42,28 @@ namespace :rubberstamp do
42
42
  Dir.glob('resources/Icon*').size > 0
43
43
  end
44
44
 
45
+ def create_caption
46
+ project_config_vars = Motion::Project::App.config.variables
47
+ app_version = project_config_vars['version']
48
+ # execute shell commands to get git info
49
+ git_commit = `git rev-parse --short HEAD`
50
+ git_branch = `git rev-parse --abbrev-ref HEAD`
51
+ caption = "v#{app_version} #{git_commit.strip} #{git_branch.strip}"
52
+ end
53
+
45
54
  # stub to check if the app needs to be restamped or not.
46
- def updated?
47
- true
55
+ def updated?(caption)
56
+ previous_caption = `xattr -p com.iconoclastlabs.motion-rubberstamp Rakefile`
57
+ previous_caption.strip!
58
+ if (previous_caption == "") # first run or something is amiss
59
+ return true
60
+ elsif (caption != previous_caption)
61
+ App.info "motion-rubberstamp", "Rubberstamp caption has changed."
62
+ return true
63
+ else
64
+ #App.info "motion-rubberstamp", "No Caption difference detected"
65
+ return false
66
+ end
48
67
  end
49
68
 
50
69
  # copy over rubberstamp icons to use!
@@ -60,27 +79,21 @@ namespace :rubberstamp do
60
79
 
61
80
  task :run do
62
81
 
63
- if updated?
82
+ caption = create_caption
83
+
84
+ if updated?(caption)
85
+ App.info "motion-rubberstamp", "Rubberstamping icons..."
86
+ # Let's abuse the fact that we *know* we're on OSX and have xattr available
87
+ # The Rakefile seems like a constant file to store data in:
88
+ attribute = `xattr -w com.iconoclastlabs.motion-rubberstamp "#{caption}" Rakefile`
64
89
  # Clean old out the simulator
65
90
  Rake::Task["rubberstamp:sim_clean"].execute
66
91
  # Automatically run install on first run
67
92
  Rake::Task["rubberstamp:install"].execute unless installed?
68
-
69
93
  # piggyback on RubyMotion's own app config tool
70
- project_config_vars = Motion::Project::App.config.variables
71
- app_version = project_config_vars['version']
72
- # execute shell commands to get git info
73
- git_commit = `git rev-parse --short HEAD`
74
- git_branch = `git rev-parse --abbrev-ref HEAD`
75
-
76
- caption = "v#{app_version} #{git_commit.strip} #{git_branch.strip}"
77
- App.info "motion-rubberstamp", "Rubberstamping icons..."
78
94
  Dir.glob('resources/*_base.png').each do |icon|
79
95
  process_icon(icon, caption)
80
96
  end
81
-
82
- else
83
- App.info "motion-rubberstamp", "No change detected"
84
97
  end
85
98
  end
86
99
 
@@ -1,4 +1,4 @@
1
1
  module Rubberstamp
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
4
4
 
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.5
4
+ version: 0.0.6
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-13 00:00:00.000000000 Z
11
+ date: 2013-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler