snapshot 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61213c3f96c8204607fbf018d40e57c4c4499a7a
4
- data.tar.gz: 82488176f7d6e23c45392d2fd424da1929605ee3
3
+ metadata.gz: c1657aac81439fe19362e073f189c137b841c194
4
+ data.tar.gz: 486885b3dc7e0a4e9917be796d9a4a9b834e5472
5
5
  SHA512:
6
- metadata.gz: f02b63a85ef1840d80ca11f0498aae358e6b94b86d5df05a2800b293dda4f38124388a203343ef3f523b4dfc608847da547b8a0a1437baae559319e1f8d2b084
7
- data.tar.gz: c5ecae81b1c0f848b3605436b95e58718b74e5b23798aad679feafa99d832f393fffecd4b9a0518c3cb5635235acd5a8a31077464bb1825b6c1ef1f010d1e680
6
+ metadata.gz: cb7ceeb2cebc1d40066f1da16c2ee655ed65ca1df41ac3a0df6f0ba3abbddaaccc30484262521d223592fbc2da5c005f54158e33d75c301c4df04002ebb9299a
7
+ data.tar.gz: bc4b7a77f96d64113ad0ecf9104a8335e9b463eae5cc7fd195170b5a49b97899284f67d397c9dc3f37b0b779a10a5a0cffe6527961c5cdac805c8faec5c20a61
data/README.md CHANGED
@@ -141,7 +141,8 @@ devices([
141
141
  "iPhone 6",
142
142
  "iPhone 6 Plus",
143
143
  "iPhone 5",
144
- "iPhone 4s"
144
+ "iPhone 4s",
145
+ "iPad Air"
145
146
  ])
146
147
  ```
147
148
 
@@ -5,7 +5,8 @@ devices([
5
5
  "iPhone 6",
6
6
  "iPhone 6 Plus",
7
7
  "iPhone 5",
8
- "iPhone 4s"
8
+ "iPhone 4s",
9
+ "iPad Air"
9
10
  ])
10
11
 
11
12
  languages([
data/lib/snapshot.rb CHANGED
@@ -8,6 +8,7 @@ require 'snapshot/snapshot_file'
8
8
  require 'snapshot/languages'
9
9
  require 'snapshot/reports_generator'
10
10
  require 'snapshot/screenshot_flatten'
11
+ require 'snapshot/simulators'
11
12
 
12
13
  # Third Party code
13
14
  require 'colored'
@@ -19,8 +19,8 @@ module Snapshot
19
19
  end
20
20
 
21
21
  def self.check_simulators
22
- Helper.log.debug "Found #{SnapshotFile.available_devices.count} simulators."
23
- if SnapshotFile.available_devices.count < 1
22
+ Helper.log.debug "Found #{Simulators.available_devices.count} simulators."
23
+ if Simulators.available_devices.count < 1
24
24
  Helper.log.fatal '#############################################################'
25
25
  Helper.log.fatal "# You have to add new simulators using Xcode"
26
26
  Helper.log.fatal "# Xcode => Window => Devices"
@@ -38,6 +38,7 @@
38
38
  </th>
39
39
  <tr>
40
40
  <% screens.each do |screen_path| %>
41
+ <% next if screen_path.include?"_framed.png" %>
41
42
  <td>
42
43
  <% screen_size = FastImage.size(screen_path) %>
43
44
  <a href="<%= screen_path %>" target="_blank">
@@ -1,5 +1,5 @@
1
1
  require 'erb'
2
- require "fastimage"
2
+ require 'fastimage'
3
3
 
4
4
  module Snapshot
5
5
  class ReportsGenerator
@@ -52,6 +52,7 @@ module Snapshot
52
52
  'iPhone6' => "iPhone 6",
53
53
  'iPhone5' => "iPhone 5",
54
54
  'iPhone4' => "iPhone 4",
55
+ 'iOS-iPad' => "iPad"
55
56
  }
56
57
  end
57
58
  end
@@ -0,0 +1,14 @@
1
+ module Snapshot
2
+ class Simulators
3
+ def self.available_devices
4
+ if not @result
5
+ @result = []
6
+ `instruments -s`.split("\n").each do |current|
7
+ # Example: "iPhone 5 (8.1 Simulator) [C49ECC4A-5A3D-44B6-B9BF-4E25BC326400]"
8
+ @result << current.split(' [').first if current.include?"Simulator"
9
+ end
10
+ end
11
+ return @result
12
+ end
13
+ end
14
+ end
@@ -71,8 +71,8 @@ module Snapshot
71
71
  value.each do |current|
72
72
  current += " (#{@config.ios_version} Simulator)" unless current.include?"Simulator"
73
73
 
74
- unless SnapshotFile.available_devices.include?current
75
- raise "Device '#{current}' not found. Available device types: #{SnapshotFile.available_devices}".red
74
+ unless Simulators.available_devices.include?current
75
+ raise "Device '#{current}' not found. Available device types: #{Simulators.available_devices}".red
76
76
  else
77
77
  @config.devices << current
78
78
  end
@@ -88,16 +88,5 @@ module Snapshot
88
88
  end
89
89
  @config.languages = value
90
90
  end
91
-
92
- def self.available_devices
93
- if not @result
94
- @result = []
95
- `instruments -s`.split("\n").each do |current|
96
- # Example: "iPhone 5 (8.1 Simulator) [C49ECC4A-5A3D-44B6-B9BF-4E25BC326400]"
97
- @result << current.split(' [').first if current.include?"Simulator"
98
- end
99
- end
100
- return @result
101
- end
102
91
  end
103
92
  end
@@ -1,3 +1,3 @@
1
1
  module Snapshot
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -187,6 +187,7 @@ files:
187
187
  - lib/snapshot/reports_generator.rb
188
188
  - lib/snapshot/runner.rb
189
189
  - lib/snapshot/screenshot_flatten.rb
190
+ - lib/snapshot/simulators.rb
190
191
  - lib/snapshot/snapfile_creator.rb
191
192
  - lib/snapshot/snapshot_config.rb
192
193
  - lib/snapshot/snapshot_file.rb