motion-screenshots 0.0.6 → 0.1.0
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/README.md +2 -1
- data/lib/motion-screenshots.rb +18 -7
- data/motion-screenshots.gemspec +3 -2
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da4e8a7c118b9eeff63d851b679a1496f9958312
|
4
|
+
data.tar.gz: a6ccdf5b7078a066e79f55dc6174da0e79a5f2d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce8b5676bd4ec91d6662be4884b3f4de640ac2fc0a9915d40a7b9524da22c921902e3c200bdb54da28e1cbf9f66369d307ad28dc734d0cb93b7080fac8909209
|
7
|
+
data.tar.gz: 9057de92fe94558a51042906f525fbf391b9bd43752e006f42218d47d3577e32f00b8f4f97169a222e194f46f44c823f1f43519b6e22d25ff11e5f2c8319aa59
|
data/README.md
CHANGED
@@ -26,7 +26,8 @@ By default, screenshots will be placed in a `./screenshots/#{timestamp}` directo
|
|
26
26
|
|
27
27
|
- `ENV['SCREENSHOTS_DIR']` - use this environment variable
|
28
28
|
- `app.screenshots_output_path=` - set this value in your Rakefile
|
29
|
-
- `app.
|
29
|
+
- `app.before_screenshots do` - add this block in your Rakefile
|
30
|
+
- `app.after_screenshots do |output_path|` - add this block in your Rakefile
|
30
31
|
|
31
32
|
### Code
|
32
33
|
|
data/lib/motion-screenshots.rb
CHANGED
@@ -13,27 +13,38 @@ Motion::Project::App.setup do |app|
|
|
13
13
|
end
|
14
14
|
|
15
15
|
module Motion; module Project; class Config
|
16
|
-
attr_accessor :screenshot_callback
|
16
|
+
attr_accessor :screenshot_callback, :is_taking_screenshots
|
17
17
|
|
18
18
|
variable :screenshots_output_path
|
19
19
|
|
20
|
-
def
|
20
|
+
def before_screenshots(&block)
|
21
|
+
if is_taking_screenshots
|
22
|
+
block.call
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def after_screenshots(&block)
|
21
27
|
@screenshot_callback = block
|
22
28
|
end
|
29
|
+
|
30
|
+
alias_method :manage_screenshots, :after_screenshots
|
23
31
|
end; end; end
|
24
32
|
|
25
33
|
namespace 'screenshots' do
|
26
34
|
task :start do
|
27
|
-
screenshots_output_path = ENV['SCREENSHOTS_DIR']
|
28
|
-
screenshots_output_path ||= App.config.screenshots_output_path
|
29
|
-
screenshots_output_path ||= File.join(`pwd`.strip, "screenshots", Time.now.to_i.to_s)
|
30
|
-
FileUtils.mkdir_p screenshots_output_path
|
31
|
-
|
32
35
|
app_config = Motion::Project::App.config_without_setup
|
33
36
|
app_config.pods do
|
34
37
|
pod 'KSScreenshotManager'
|
35
38
|
end
|
36
39
|
|
40
|
+
app_config.is_taking_screenshots = true
|
41
|
+
app_config.env['MOTION_SCREENSHOTS_RUNNING'] = true
|
42
|
+
|
43
|
+
screenshots_output_path = ENV['SCREENSHOTS_DIR']
|
44
|
+
screenshots_output_path ||= App.config.screenshots_output_path
|
45
|
+
screenshots_output_path ||= File.join(`pwd`.strip, "screenshots", Time.now.to_i.to_s)
|
46
|
+
FileUtils.mkdir_p screenshots_output_path
|
47
|
+
|
37
48
|
at_exit {
|
38
49
|
# Copy files
|
39
50
|
target = ENV['target'] || app_config.sdk_version
|
data/motion-screenshots.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "motion-screenshots"
|
5
|
-
spec.version = "0.0
|
5
|
+
spec.version = "0.1.0"
|
6
6
|
spec.authors = ["Clay Allsopp"]
|
7
7
|
spec.email = ["clay@usepropeller.com"]
|
8
8
|
spec.description = "Take screenshots with RubyMotion"
|
@@ -19,7 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency "motion-cocoapods", "
|
22
|
+
spec.add_dependency "motion-cocoapods", ">= 1.4.0"
|
23
|
+
spec.add_dependency "motion-env", ">= 0.0.3"
|
23
24
|
|
24
25
|
spec.add_development_dependency "rake"
|
25
26
|
end
|
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-screenshots
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clay Allsopp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: motion-cocoapods
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.4.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.4.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: motion-env
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.0.3
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.0.3
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|