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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e8f05fce77e79e7fd3ad25dcc8192db0af21761
4
- data.tar.gz: d75c68f9eec1f268d5af0b2b3062c30dd0cd6b6b
3
+ metadata.gz: de3573529520fb7b7c356724719787126f18bc70
4
+ data.tar.gz: 820f49cdc0aa97852ab3ef69847b2c3f1fe6b92f
5
5
  SHA512:
6
- metadata.gz: 72d490fe33cd2e8d4997ac286c606504a49c641dd8d2487d1fd50769c0e53f3de407206ddf2ba1dcb868bee8112058671844027403edc16813321ab6528e5512
7
- data.tar.gz: 3fe3d7e1dbe52416c6b00bdc7facb2247a5d59451d95e911386883bd384aeafcb9a19b0163ebdfcceeabcb3e52bbd13f1e96aa379c3f2bc868e4d2cf5b538704
6
+ metadata.gz: 0426d3ccc5ff6270dc5e131f345a5c41e019886092d069b3545b26ff43f9014b0670fe6f0b704ff39eec3431dc82084260cde387cd6dbdf2544fc79b38d2ee14
7
+ data.tar.gz: f1818c11d3042f109ac42520538601b31fa23bbfbb86e8fa0f74160912ca86a5d323aeeaabc3ff26efd7618af2091736c745f1d5d2261cc13183615b4e5928fb
data/bin/cs CHANGED
@@ -60,7 +60,7 @@ class App
60
60
 
61
61
  def self.sshify(host, keyname)
62
62
  puts "Installing SSH key to remote server."
63
- sh "cat ~/.ssh/#{keyname} | ssh #{host} 'cat >> ~/.ssh/authorized_keys'"
63
+ Clearsight::SSH.new(host).sshify(keyname)
64
64
  puts "Installed."
65
65
  end
66
66
 
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 'thread'
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
@@ -1,3 +1,3 @@
1
1
  module Clearsight
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0.rc1"
3
3
  end
@@ -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.1.0
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-14 00:00:00.000000000 Z
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: '0'
153
+ version: 1.3.1
154
154
  requirements: []
155
155
  rubyforge_project:
156
- rubygems_version: 2.1.11
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