appscreens-io-uploader 0.0.3 → 0.0.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08d8e1cf1692ac7b28b31e776ef8ba37ff6d830b
|
4
|
+
data.tar.gz: 9026c37cb4a29334b707f74dc1a0a55d46057fcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a55ab5a761a24fd2e119437d8312e66cc7128d248ece43611562c0b1ec55c6d2292f93c0fbd281d05adfeff9c5b425d72547bed534badafa9cb57b7351d77b7c
|
7
|
+
data.tar.gz: 24987890bf1c24e3c38f8ece4773d5a4c6cbb2fb18bda7b0d17bc5923ea7b1c0368d2aaa079c0cd715c31d679b45dcdb88fa014f2d793414ce4f95da1524eead
|
data/bin/appscreens-io-uploader
CHANGED
@@ -25,7 +25,7 @@ class AppscreensIoUploaderApplication
|
|
25
25
|
command :existing_project do |c|
|
26
26
|
c.syntax = 'appscreensIoUploader existing_project'
|
27
27
|
c.description = "uploads the screenshots to your project on appscreens.io"
|
28
|
-
c.option '--screenSize STRING', String, 'screensize to upload iOS-5.5-in | iOS-4.7-in | iOS-4
|
28
|
+
c.option '--screenSize STRING', String, 'screensize to upload iOS-5.5-in | iOS-4.7-in | iOS-4-in'
|
29
29
|
|
30
30
|
c.action do |args, options|
|
31
31
|
options.default :screenSize => Deliver::AppScreenshot::ScreenSize::IOS_55
|
@@ -5,7 +5,7 @@ require 'httmultiparty'
|
|
5
5
|
module AppscreensIoUploader
|
6
6
|
class Runner
|
7
7
|
|
8
|
-
def run(path, project_id, screensSize
|
8
|
+
def run(path, project_id, screensSize)
|
9
9
|
screenshots = Dir.glob("#{path}/**/*.{png,PNG}")
|
10
10
|
|
11
11
|
screenshots_to_upload = Array.new
|
@@ -27,12 +27,12 @@ module AppscreensIoUploader
|
|
27
27
|
|
28
28
|
begin
|
29
29
|
screenshot = Screenshot.new(full_path)
|
30
|
-
if screensSize
|
30
|
+
if screensSize == screenshot.screen_size && screenshots_to_upload.count < maxScreens
|
31
31
|
if !screenshot.is_portrait?
|
32
|
-
raise "appscreens.io only supports PORTRAIT Orientation for now"
|
32
|
+
raise "appscreens.io only supports PORTRAIT Orientation for now".red
|
33
33
|
end
|
34
34
|
if !screenshot.is_supported_screen_size?
|
35
|
-
raise "appscreens.io only supports 4.7inch,5inch and 5.5inch screen sizes"
|
35
|
+
raise "appscreens.io only supports 4.7inch,5inch and 5.5inch screen sizes".red
|
36
36
|
end
|
37
37
|
screenshots_to_upload << screenshot
|
38
38
|
end
|
@@ -41,10 +41,14 @@ module AppscreensIoUploader
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
if screenshots_to_upload.count == 0
|
45
|
+
Helper.log.error "Could not find any screensshots that fit the spec, please check again".red
|
46
|
+
else
|
47
|
+
uploader = Uploader.new
|
48
|
+
uploader.upload!(project_id, screenshots_to_upload)
|
49
|
+
end
|
46
50
|
else
|
47
|
-
Helper.log.error "Could not find screenshots"
|
51
|
+
Helper.log.error "Could not find screenshots".red
|
48
52
|
end
|
49
53
|
end
|
50
54
|
end
|
@@ -47,13 +47,5 @@ module AppscreensIoUploader
|
|
47
47
|
self.path
|
48
48
|
end
|
49
49
|
|
50
|
-
# Add the device frame, this will also call the method that adds the background + title
|
51
|
-
def frame!
|
52
|
-
if self.is_mac?
|
53
|
-
MacEditor.new.frame!(self)
|
54
|
-
else
|
55
|
-
Editor.new.frame!(self)
|
56
|
-
end
|
57
|
-
end
|
58
50
|
end
|
59
51
|
end
|
@@ -10,9 +10,17 @@ module AppscreensIoUploader
|
|
10
10
|
response = HTTParty.get(api_base_uri + screens_uri)
|
11
11
|
if response.code == 200
|
12
12
|
screens = JSON.parse(response.body)
|
13
|
+
|
14
|
+
# TODO add multilang support
|
15
|
+
if screens.count > 5
|
16
|
+
Helper.log.error "your appscreens.io projects seems to have more than one language - support for this will be shortly :) - sorry".red
|
17
|
+
return
|
18
|
+
end
|
19
|
+
|
13
20
|
screens.each_with_index do |screen, index|
|
21
|
+
|
14
22
|
screenshot_path = screenshots[index].path
|
15
|
-
Helper.log.info "uploading screenshot #{screenshot_path}"
|
23
|
+
Helper.log.info "uploading screenshot #{screenshot_path} screen nr: #{screen['order']} lang: #{screen['language']}"
|
16
24
|
# POST /projects/{project_id}/screens/{screen_id}/image
|
17
25
|
upload_response = HTTMultiParty.post(api_base_uri + screens_uri + '/' + screen['id'] + '/image', :query => {
|
18
26
|
:image => File.new(screenshot_path)
|