chairs 1.0.2 → 1.0.3

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 46f26fae363f6ab1e45bee1b386604c17e432f9a
4
+ data.tar.gz: 09266d8d3551d571ad0aa78c94a90142c30e0dba
5
+ SHA512:
6
+ metadata.gz: 2bf4ffdf43d88cdb0ebe4e42cbe84bd842a04f263cf7b529ab98c46106a1d37d2bc8dc633b2d2f596403c0a551c3c301bc6ab2fc0a4f6e897b3ed8fb1eb22d57
7
+ data.tar.gz: beb05e93b995491879f42d03c505fb287f72afaa529e619ca660328bb935fb5cf7f381f1a90ab131d8b5b9ceaa6029baa2e68578008905d8d6f3ae543f1a9c7e
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Musical Chairs
2
2
 
3
- A gem for swapping iOS simulator states. Saves all the documents, library and cache for the most recently user iOS app into the current folder with a named version. Commands are modelled after git. There's a writeup on the motivations for this: [artsy.github.com](http://artsy.github.com/blog/2013/03/29/musical-chairs/)
3
+ A gem for swapping iOS simulator states. Saves all the documents, library and cache for the most recently used iOS app into the current folder with a named version. Commands are modeled after git. There's a writeup on the motivations for this: [artsy.github.com](http://artsy.github.com/blog/2013/03/29/musical-chairs/)
4
4
 
5
5
  ## Setup
6
6
 
@@ -30,4 +30,4 @@ You can [open a new issue](/orta/chairs/issues). I'm usually very responsive to
30
30
  See the [LICENSE.txt](/orta/chairs/blob/master/LICENSE.txt) file included in the distribution.
31
31
 
32
32
  ## Copyright
33
- Copyright (c) 2013 Art.sy
33
+ Copyright (c) 2014 Orta Therox & Art.sy
data/bin/chairs CHANGED
File without changes
data/chairs.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.homepage = "http://github.com/orta/muscialchairs"
11
11
  s.summary = %q{A gem for swapping in/out document folders in iOS Sims}
12
12
  s.description = %q{Switch the documents directory for the iOS app you're currently working on using named tags. }
13
-
13
+ s.licenses = ['MIT']
14
14
  s.rubyforge_project = "chairs"
15
15
 
16
16
  s.files = `git ls-files`.split("\n")
@@ -1,3 +1,3 @@
1
1
  module Chairs
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
data/lib/musician.rb CHANGED
@@ -36,12 +36,12 @@ module Chairs
36
36
 
37
37
  def pull
38
38
  unless @params[1]
39
- puts "Chairs needs a name for the target."
39
+ puts "Chairs needs a name for the target."
40
40
  return
41
41
  end
42
-
42
+
43
43
  setup
44
-
44
+
45
45
  # validate
46
46
  if Pow("chairs/#{@target_folder}").exists?
47
47
  print "This chair already exists, do you want to overwrite? [Yn] "
@@ -55,7 +55,7 @@ module Chairs
55
55
 
56
56
  puts "Pulling files for #{ @app_name }"
57
57
  puts "From #{@app_folder} to chairs/#{@target_folder}"
58
-
58
+
59
59
  Pow("chairs/#{@target_folder}/").create_directory do
60
60
  copy(Pow("#{@app_folder}/*"), Pow())
61
61
  end
@@ -71,7 +71,7 @@ module Chairs
71
71
 
72
72
  setup
73
73
 
74
- unless Pow("chairs/#{@target_folder}").exists?
74
+ unless Pow("chairs/#{@target_folder}").exists?
75
75
  puts "You don't have a folder for #{@target_folder}."
76
76
  list
77
77
  return
@@ -88,9 +88,9 @@ module Chairs
88
88
  puts "Done!"
89
89
  end
90
90
 
91
- def list
91
+ def list
92
92
  unless Pow("chairs/").exists?
93
- puts "You haven't used chairs yet."
93
+ puts "You haven't used chairs yet."
94
94
  return
95
95
  end
96
96
 
@@ -128,22 +128,22 @@ module Chairs
128
128
  if Pow("chairs/#{@target_folder}/").exists?
129
129
  FileUtils.rm_r( Pow().to_s + "/chairs/#{@target_folder}/")
130
130
  puts "Deleted #{@target_folder}/"
131
- else
131
+ else
132
132
  puts "That chair does not exist."
133
133
  list
134
134
  end
135
135
  end
136
-
137
- def clean
136
+
137
+ def clean
138
138
  setup
139
-
139
+
140
140
  puts "Deleting App directory"
141
141
  target_path = Pow(@app_folder).to_s.gsub(" ", "\\ ")
142
-
142
+
143
143
  command = "rm -r #{target_path}"
144
144
  puts command
145
145
  system command
146
-
146
+
147
147
  puts "Cleaned"
148
148
  end
149
149
 
@@ -166,7 +166,7 @@ module Chairs
166
166
  gitignore_line = "\nchairs/\n"
167
167
  file = File.open(gitignore, "a")
168
168
  reader = File.read(gitignore)
169
-
169
+
170
170
  unless reader.include?(gitignore_line)
171
171
  print "You don't have chairs/ in your .gitignore would you like chairs to add it? [Yn] "
172
172
  confirm = STDIN.gets.chomp
@@ -183,7 +183,7 @@ module Chairs
183
183
  # look through all the installed sims
184
184
  sims = Pow( Pow("~/Library/Application Support/iPhone Simulator") )
185
185
 
186
- sims.each do |simulator_folder|
186
+ sims.each do |simulator_folder|
187
187
  next if simulator_folder.class != Pow::Directory
188
188
 
189
189
  apps = Pow( "#{simulator_folder}/Applications/" )
@@ -193,24 +193,22 @@ module Chairs
193
193
  apps.each do |maybe_app_folder|
194
194
  next unless maybe_app_folder.directory?
195
195
 
196
- # first run
197
- app_folder = maybe_app_folder if !app_folder
198
-
199
196
  # find the app in the folder and compare their modified dates
200
197
  # remember .apps are folders
201
- maybe_app = maybe_app_folder.directories.reject {|p| p.extension != "app"}
202
- # it returns as an array
203
- maybe_app = maybe_app[0]
198
+ maybe_app = maybe_app_folder.directories.select{|p|
199
+ p.extension == "app" && p.exists?
200
+ }.first
201
+ next unless maybe_app
204
202
 
205
- if maybe_app && app
203
+ if app
206
204
  if maybe_app.modified_at > app.modified_at
207
205
  app_folder = maybe_app_folder
208
206
  app = maybe_app
209
- end
207
+ end
210
208
  else
211
- # make the first one the thing to beat
212
- app_folder = maybe_app_folder
213
- app = maybe_app
209
+ # make the first one the thing to beat
210
+ app_folder = maybe_app_folder
211
+ app = maybe_app
214
212
  end
215
213
  end
216
214
 
@@ -232,9 +230,9 @@ module Chairs
232
230
  end
233
231
  end
234
232
  end
235
-
233
+
236
234
  return ""
237
- end
235
+ end
238
236
 
239
237
  def copy(source, dest)
240
238
  source = source.to_s.gsub(" ", "\\ ")
@@ -247,6 +245,6 @@ module Chairs
247
245
 
248
246
  def commands
249
247
  (public_methods - Object.public_methods).sort.map{ |c| c.to_sym}
250
- end
248
+ end
251
249
  end
252
- end
250
+ end
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chairs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
5
- prerelease:
4
+ version: 1.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - orta
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-08 00:00:00.000000000 Z
11
+ date: 2014-04-01 00:00:00.000000000 Z
13
12
  dependencies: []
14
- description: ! 'Switch the documents directory for the iOS app you''re currently working
13
+ description: 'Switch the documents directory for the iOS app you''re currently working
15
14
  on using named tags. '
16
15
  email:
17
16
  - orta.therox@gmail.com
@@ -20,7 +19,7 @@ executables:
20
19
  extensions: []
21
20
  extra_rdoc_files: []
22
21
  files:
23
- - .gitignore
22
+ - ".gitignore"
24
23
  - Gemfile
25
24
  - LICENSE.txt
26
25
  - README.md
@@ -35,28 +34,28 @@ files:
35
34
  - lib/pow/file.rb
36
35
  - lib/pow/pow.rb
37
36
  homepage: http://github.com/orta/muscialchairs
38
- licenses: []
37
+ licenses:
38
+ - MIT
39
+ metadata: {}
39
40
  post_install_message:
40
41
  rdoc_options: []
41
42
  require_paths:
42
43
  - lib
43
44
  required_ruby_version: !ruby/object:Gem::Requirement
44
- none: false
45
45
  requirements:
46
- - - ! '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  required_rubygems_version: !ruby/object:Gem::Requirement
50
- none: false
51
50
  requirements:
52
- - - ! '>='
51
+ - - ">="
53
52
  - !ruby/object:Gem::Version
54
53
  version: '0'
55
54
  requirements: []
56
55
  rubyforge_project: chairs
57
- rubygems_version: 1.8.25
56
+ rubygems_version: 2.2.2
58
57
  signing_key:
59
- specification_version: 3
58
+ specification_version: 4
60
59
  summary: A gem for swapping in/out document folders in iOS Sims
61
60
  test_files: []
62
61
  has_rdoc: