clearsight 1.1.0 → 1.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cs +1 -1
- data/lib/clearsight.rb +2 -30
- data/lib/clearsight/version.rb +1 -1
- data/lib/clearsight/xcode.rb +42 -15
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de3573529520fb7b7c356724719787126f18bc70
|
4
|
+
data.tar.gz: 820f49cdc0aa97852ab3ef69847b2c3f1fe6b92f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0426d3ccc5ff6270dc5e131f345a5c41e019886092d069b3545b26ff43f9014b0670fe6f0b704ff39eec3431dc82084260cde387cd6dbdf2544fc79b38d2ee14
|
7
|
+
data.tar.gz: f1818c11d3042f109ac42520538601b31fa23bbfbb86e8fa0f74160912ca86a5d323aeeaabc3ff26efd7618af2091736c745f1d5d2261cc13183615b4e5928fb
|
data/bin/cs
CHANGED
data/lib/clearsight.rb
CHANGED
@@ -2,37 +2,9 @@ require "clearsight/version"
|
|
2
2
|
require "clearsight/deploy"
|
3
3
|
require "clearsight/middleman"
|
4
4
|
require "clearsight/xcode"
|
5
|
-
require
|
5
|
+
require "clearsight/ssh"
|
6
|
+
require "clearsight/timer"
|
6
7
|
|
7
8
|
module Clearsight
|
8
|
-
class Timer
|
9
|
-
def initialize(interval, &handler)
|
10
|
-
@run = true
|
11
|
-
@semaphore = Mutex.new
|
12
|
-
|
13
|
-
@th = Thread.new do
|
14
|
-
t = Time.now
|
15
|
-
while run?
|
16
|
-
t += interval
|
17
|
-
(sleep(t - Time.now) rescue nil) and handler.call rescue nil
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def stop
|
23
|
-
@semaphore.synchronize do
|
24
|
-
@run = false
|
25
|
-
end
|
26
|
-
@th.join
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
def run?
|
32
|
-
@semaphore.synchronize do
|
33
|
-
@run
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
9
|
end
|
38
10
|
::CS = ::Clearsight
|
data/lib/clearsight/version.rb
CHANGED
data/lib/clearsight/xcode.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# fix-xcode
|
2
2
|
# Mark Rickert <mjar81@gmail.com>
|
3
|
-
|
3
|
+
|
4
4
|
# Symlinks all your old SDKs to Xcode.app every time it is updated.
|
5
5
|
# Create a directory called /SDKs and run this script.
|
6
6
|
#
|
7
7
|
# Each time you upgrade Xcode, run fix-xcode.
|
8
8
|
|
9
9
|
# NOTE FROM JAMON: run `cs symlink_xcode_sdks` instead.
|
10
|
-
|
10
|
+
|
11
11
|
module Clearsight
|
12
12
|
class Xcode
|
13
13
|
def initialize(args)
|
@@ -15,10 +15,21 @@ module Clearsight
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def run
|
18
|
+
if @args.count == 2
|
19
|
+
if @args[0] == "remove"
|
20
|
+
abort "Please pass another parameter specifying what SDK to remove." unless @args[1]
|
21
|
+
run_remove_sdk "#{@args[1]}"
|
22
|
+
end
|
23
|
+
else
|
24
|
+
run_fix
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def run_fix
|
18
29
|
display_banner
|
19
|
-
|
30
|
+
|
20
31
|
require 'FileUtils'
|
21
|
-
|
32
|
+
|
22
33
|
# Find all the SDKs in Xcode.app that aren't symlinks.
|
23
34
|
Dir.glob("#{xcode_path}/Platforms/*.platform/Developer/SDKs/*.sdk") do |sdk|
|
24
35
|
basename = sdk.split('/').last
|
@@ -26,43 +37,59 @@ module Clearsight
|
|
26
37
|
puts "#{basename} is already symlinked... skipping.\n"
|
27
38
|
next
|
28
39
|
end
|
29
|
-
|
40
|
+
|
30
41
|
puts "Processing: #{basename}\n"
|
31
|
-
|
42
|
+
|
32
43
|
# Remove the old version if it exists
|
33
44
|
destination = "#{sdk_path}/#{basename}"
|
34
45
|
if File.directory?(destination)
|
35
46
|
puts " - Removing existing SDK: #{destination}.\n"
|
36
47
|
FileUtils.rm_rf destination
|
37
48
|
end
|
38
|
-
|
49
|
+
|
39
50
|
puts " - Moving the Xcode version into place in #{sdk_path}.\n"
|
40
51
|
FileUtils.mv sdk, sdk_path
|
41
52
|
end
|
42
|
-
|
53
|
+
|
43
54
|
Dir.glob("#{sdk_path}/*.sdk") do |sdk|
|
44
55
|
sdk_name = sdk.split("/").last
|
45
56
|
sdk_platform = sdk_name.match(/[a-zA-Z]{3,}/)[0]
|
46
|
-
|
57
|
+
|
47
58
|
ln_dest = "#{xcode_path}/Platforms/#{sdk_platform}.platform/Developer/SDKs/#{sdk_name}"
|
48
59
|
puts " - Symlinking #{sdk_platform}.\n"
|
49
|
-
|
60
|
+
|
50
61
|
FileUtils.ln_sf sdk, ln_dest
|
51
62
|
end
|
52
|
-
|
63
|
+
|
53
64
|
puts "\nDone! Your SDKs now live in #{sdk_path} and are symlinked properly into the Xcode.app.\n\n"
|
54
65
|
end
|
55
|
-
|
66
|
+
|
56
67
|
def xcode_path
|
57
68
|
`xcode-select --print-path`.chomp
|
58
69
|
end
|
59
|
-
|
70
|
+
|
60
71
|
def sdk_path
|
61
72
|
"/SDKs"
|
62
73
|
end
|
63
|
-
|
74
|
+
|
75
|
+
def run_remove_sdk(version)
|
76
|
+
# Remove the iOS SDK from xcode.
|
77
|
+
version = version.to_s << ".0" if version.to_s.length == 1
|
78
|
+
|
79
|
+
puts "-" * 29
|
80
|
+
puts "Removing the iOS #{version} SDK from the Xcode Bundle."
|
81
|
+
puts "-" * 29
|
82
|
+
|
83
|
+
removing = "#{xcode_path}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS#{version}.sdk"
|
84
|
+
if File.exist? removing
|
85
|
+
FileUtils.rm_rf removing
|
86
|
+
puts "SDK successfully removed. Please restart Xcode."
|
87
|
+
else
|
88
|
+
puts "Couldn't find that SDK at path: #{removing}"
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
64
92
|
def display_banner
|
65
|
-
# Nice little banner
|
66
93
|
puts "-" * 29
|
67
94
|
puts "Running Fixing Xcode.app SDK Paths."
|
68
95
|
puts "-" * 29
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clearsight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamon Holmgren
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11
|
11
|
+
date: 2013-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -148,12 +148,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
148
|
version: '0'
|
149
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
|
-
- - '
|
151
|
+
- - '>'
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version:
|
153
|
+
version: 1.3.1
|
154
154
|
requirements: []
|
155
155
|
rubyforge_project:
|
156
|
-
rubygems_version: 2.
|
156
|
+
rubygems_version: 2.0.14
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
159
|
summary: Common utilities for ClearSight Studio, a web and mobile app development
|