nakal 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 +4 -4
- data/lib/nakal/ios/screen.rb +17 -10
- data/lib/nakal/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61e2153b886871d6dd540d5c9112f7b6d69b4c5e
|
4
|
+
data.tar.gz: 053513692e7e6a63ebf539b48e1177328c8c28f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7dc1b1a46e61eedd7f195ce54c502d60b2ead67deee771ac8a6b04008dc246f4fa80a3f24eba4a8a7781f39b555f4009d90ade0f6e70b02335ca2a4675d0aa4
|
7
|
+
data.tar.gz: 18f8f682b4ebe0ffcbd09985f30f7c48280dd3f7488debbfbefe5d16826760bb40abe73e901baf4ba205d6b575704896944ff4d5ce22e305308cdb3479898c9d
|
data/lib/nakal/ios/screen.rb
CHANGED
@@ -4,20 +4,27 @@ module Nakal
|
|
4
4
|
|
5
5
|
private
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
def capture_script
|
8
|
+
xcode_7 = !(%x(instruments -s devices ; echo)).match(' Simulator\)')
|
9
|
+
simulator_app_name = xcode_7 ? "Simulator" : "iOS Simulator"
|
10
|
+
"osascript <<EOF
|
11
|
+
tell application \"#{simulator_app_name}\"
|
12
|
+
activate
|
13
|
+
delay 0.5
|
14
|
+
tell application \"System Events\" to keystroke \"1\" using {command down}
|
15
|
+
delay 0.5
|
16
|
+
tell application \"System Events\" to keystroke \"s\" using {command down}
|
17
|
+
end tell
|
18
|
+
EOF"
|
19
|
+
end
|
20
|
+
|
14
21
|
|
15
22
|
def capture
|
16
|
-
`#{
|
23
|
+
`#{capture_script}`
|
17
24
|
sleep 1
|
18
|
-
Dir.glob(File.expand_path('~/Desktop/iOS\\ Simulator\\ Screen\\ Shot - Apple\\ Watch*')).each{|f| FileUtils.rm(f)}
|
25
|
+
Dir.glob(File.expand_path('~/Desktop/iOS\\ Simulator\\ Screen\\ Shot - Apple\\ Watch*')).each { |f| FileUtils.rm(f) }
|
19
26
|
latest_file = Dir.glob(File.expand_path('~/Desktop/iOS\\ Simulator\\ Screen\\ Shot*')).max_by { |f| File.mtime(f) }
|
20
|
-
File.rename(latest_file,"#{Nakal.image_location}/#{@name}.png")
|
27
|
+
File.rename(latest_file, "#{Nakal.image_location}/#{@name}.png")
|
21
28
|
end
|
22
29
|
|
23
30
|
end
|
data/lib/nakal/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nakal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajdeep
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|