snapshot 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/snapshot/builder.rb +7 -4
- data/lib/snapshot/snapfile_creator.rb +2 -0
- data/lib/snapshot/snapshot_config.rb +4 -1
- data/lib/snapshot/snapshot_file.rb +3 -0
- data/lib/snapshot/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: acfede0f257f7e7e7ec950ee9ba4818ade0d22db
|
4
|
+
data.tar.gz: a15c43321dc16c4b01ed728dab042c8b825e76b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23f8baf982808b583d7265fd00b8fa806fb1ba2e00f3740338ff81761768fe5de72b2e0e4dfbedf9268aefc292cb0d6b5ef8cfa6bdde677ddb298ec9d7fdf551
|
7
|
+
data.tar.gz: 238fba164839399ef47e4ded7cd16e91aca329f7dd9dff4f4abf84ec48055bdb2ff9e18fd7923b61388a921821c8e15d4cd2196a9a8ce6489adac40bd1ecf2c2
|
data/README.md
CHANGED
@@ -193,6 +193,11 @@ I'll try to keep the script up to date. If you need to change the iOS version, y
|
|
193
193
|
ios_version "9.0"
|
194
194
|
```
|
195
195
|
|
196
|
+
### Custom Build Command
|
197
|
+
If for some reason, the default build command does not work for your project, you can pass your own build script. The script will be executed **once** before the tests are being run.
|
198
|
+
|
199
|
+
**Make sure** you are setting the output path to ```/tmp/snapshot```.
|
200
|
+
|
196
201
|
|
197
202
|
# Tips
|
198
203
|
## Available language codes
|
data/lib/snapshot/builder.rb
CHANGED
@@ -10,8 +10,13 @@ module Snapshot
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def build_app
|
13
|
-
|
14
|
-
|
13
|
+
command = SnapshotConfig.shared_instance.build_command
|
14
|
+
|
15
|
+
if not command
|
16
|
+
# That's the default case, user did not provide a custom build_command
|
17
|
+
raise "Could not find project. Please pass the path to your project using 'project_path'.".red unless SnapshotConfig.shared_instance.project_name
|
18
|
+
command = generate_build_command
|
19
|
+
end
|
15
20
|
|
16
21
|
Helper.log.info "Building project '#{SnapshotConfig.shared_instance.project_name}' - this might take some time...".green
|
17
22
|
Helper.log.debug command.yellow
|
@@ -60,11 +65,9 @@ module Snapshot
|
|
60
65
|
"CONFIGURATION_BUILD_DIR='#{BUILD_DIR}/build'",
|
61
66
|
"-#{proj_key} '#{proj_path}'",
|
62
67
|
"-scheme '#{scheme}'",
|
63
|
-
"-configuration Debug",
|
64
68
|
"DSTROOT='#{BUILD_DIR}'",
|
65
69
|
"OBJROOT='#{BUILD_DIR}'",
|
66
70
|
"SYMROOT='#{BUILD_DIR}'",
|
67
|
-
"ONLY_ACTIVE_ARCH=NO",
|
68
71
|
"clean build"
|
69
72
|
].join(' ')
|
70
73
|
end
|
@@ -10,6 +10,8 @@ module Snapshot
|
|
10
10
|
File.write([path, 'snapshot.js'].join('/'), File.read("#{gem_path}/lib/assets/snapshot.js"))
|
11
11
|
File.write([path, 'SnapshotHelper.js'].join('/'), File.read("#{gem_path}/lib/assets/SnapshotHelper.js"))
|
12
12
|
|
13
|
+
puts "Successfully created SnapshotHelper.js '#{[path, 'SnapshotHelper.js'].join('/')}'".green
|
14
|
+
puts "Successfully created new UI Automation JS file at '#{[path, 'snapshot.js'].join('/')}'".green
|
13
15
|
puts "Successfully created new Snapfile at '#{snapfile_path}'".green
|
14
16
|
end
|
15
17
|
|
@@ -28,6 +28,9 @@ module Snapshot
|
|
28
28
|
# @return (String) The path, in which the HTML file should be exported to
|
29
29
|
attr_accessor :html_path
|
30
30
|
|
31
|
+
# @return (String) The build command, wich should build the app to '/tmp/snapshot'
|
32
|
+
attr_accessor :build_command
|
33
|
+
|
31
34
|
|
32
35
|
# A shared singleton
|
33
36
|
def self.shared_instance
|
@@ -62,7 +65,7 @@ module Snapshot
|
|
62
65
|
|
63
66
|
self.screenshots_path = './screenshots'
|
64
67
|
|
65
|
-
self.project_path = (Dir.glob("./*.xcworkspace").first rescue nil)
|
68
|
+
self.project_path = (Dir.glob("./*.xcworkspace").first rescue nil) # prefer workspaces ofc
|
66
69
|
self.project_path ||= (Dir.glob("./*.xcodeproj").first rescue nil)
|
67
70
|
|
68
71
|
self.html_path = './screenshots.html'
|
@@ -40,6 +40,9 @@ module Snapshot
|
|
40
40
|
raise "html_path has to be an String".red unless value.kind_of?String
|
41
41
|
@config.html_path = value.gsub("~", ENV['HOME'])
|
42
42
|
@config.html_path = @config.html_path + "/screenshots.html" unless @config.html_path.include?".html"
|
43
|
+
when :build_command
|
44
|
+
raise "build_command has to be an String".red unless value.kind_of?String
|
45
|
+
@config.build_command = value
|
43
46
|
when :project_path
|
44
47
|
raise "project_path has to be an String".red unless value.kind_of?String
|
45
48
|
|
data/lib/snapshot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|