appscreens-io-uploader 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2efb8615be5ccd6b3a921d50c731ef7afa89d7fb
4
- data.tar.gz: c277a537474f3d7cdd081e2832acb66a57c26ab9
3
+ metadata.gz: 08d8e1cf1692ac7b28b31e776ef8ba37ff6d830b
4
+ data.tar.gz: 9026c37cb4a29334b707f74dc1a0a55d46057fcc
5
5
  SHA512:
6
- metadata.gz: e51723d47714b9d091a06830f94b8e6543b24e853eba747d5e186a8413a43329af8ec8317801e319bea0be053bbc34495d280b26899fa7617e8797d36e94db25
7
- data.tar.gz: 8b9a5404ceb57a09a524cc717d901a6a9865e4717b5612ea8ef981c5e20070d52d7e2d09b996f842d597568806194cab7d845705392262898300f957ef6e88b1
6
+ metadata.gz: a55ab5a761a24fd2e119437d8312e66cc7128d248ece43611562c0b1ec55c6d2292f93c0fbd281d05adfeff9c5b425d72547bed534badafa9cb57b7351d77b7c
7
+ data.tar.gz: 24987890bf1c24e3c38f8ece4773d5a4c6cbb2fb18bda7b0d17bc5923ea7b1c0368d2aaa079c0cd715c31d679b45dcdb88fa014f2d793414ce4f95da1524eead
@@ -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.0-in'
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 = Deliver::AppScreenshot::ScreenSize::IOS_55)
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 <= screenshot.screen_size && screenshots_to_upload.count < maxScreens
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
- uploader = Uploader.new
45
- uploader.upload!(project_id, screenshots_to_upload)
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)
@@ -1,3 +1,3 @@
1
1
  module AppscreensIoUploader
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appscreens-io-uploader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Griesser