frameit 2.6.1 → 2.6.2

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: 32952cb239015de93e58ac8009c60a89f1bbd258
4
- data.tar.gz: 0e0acf5884ca2258e2aabd59c29e6a0bdc6d7b78
3
+ metadata.gz: ae5b2a61b61d15ef95e284805becd33d3065083a
4
+ data.tar.gz: 3fbf7039b8199813d8a6ee553eb87d3759ced1d6
5
5
  SHA512:
6
- metadata.gz: aa7abbdf75902a1eae255281cf539c8206eb537a73cc2a738abeb7bfcb10686f45387e59981d3a2768b9cddaaee98ea03820197b47ad9d473c5fd853e67e2b5f
7
- data.tar.gz: 3520a641590f43d6824482fa9388bec5017d2b1c0994bf5a309bbf5f8d4462dd0faf5a680d5830eb6b0583d32a1892c8adfd5402e214ad80ac0078ce75bb5e06
6
+ metadata.gz: d75de50c72ad4ae38c93897140d1f334c567c25a585f1f82ec2ed44fc370d6f046a3da0a8c03aa578917f4934a66493776fe98fc011169af98d0201038f7f686
7
+ data.tar.gz: cd98080626e3d436cc3e916fd585f1928d25d2d00b35a57291ec58816b483dd1d0334686ae8d4a2cc41c79ce94f1f644b26e7dc0dae6461930dfe64012baf30a
@@ -21,15 +21,15 @@ class FrameItApplication
21
21
  global_option('--verbose') { $verbose = true }
22
22
  FastlaneCore::CommanderGenerator.new.generate(Frameit::Options.available_options)
23
23
 
24
- default_command :black
24
+ default_command :run
25
25
 
26
- command :black do |c|
26
+ command :run do |c|
27
27
  c.syntax = 'frameit black'
28
28
  c.description = "Adds a black frame around all screenshots."
29
29
 
30
30
  c.action do |args, options|
31
31
  load_config(options)
32
- Frameit::Runner.new.run('.', Frameit::Color::BLACK)
32
+ Frameit::Runner.new.run('.', nil)
33
33
  end
34
34
  end
35
35
 
@@ -2,12 +2,32 @@ module Frameit
2
2
  class Options
3
3
  def self.available_options
4
4
  @options ||= [
5
- FastlaneCore::ConfigItem.new(key: :use_legacy_iphone5s,
6
- env_name: "FRAMEIT_USE_LEGACY_IPHONE_5_S",
5
+
6
+ FastlaneCore::ConfigItem.new(key: :white,
7
+ env_name: "FRAMEIT_WHITE_FRAME",
8
+ description: "Use white device frames",
9
+ optional: true,
10
+ is_string: false),
11
+ FastlaneCore::ConfigItem.new(key: :silver,
12
+ description: "Use white device frames. Alias for :white",
13
+ optional: true,
14
+ is_string: false),
15
+ FastlaneCore::ConfigItem.new(key: :force_device_type,
16
+ env_name: "FRAMEIT_FORCE_DEVICE_TYPE",
17
+ description: "Forces a given device type, useful for Mac screenshots, as their sizes vary",
7
18
  optional: true,
8
- is_string: false,
9
- description: "use iPhone 5s instead of iPhone SE frames",
10
- default_value: false)
19
+ verify_block: proc do |value|
20
+ available = ['iPhone_6_Plus', 'iPhone_5s', 'iPhone_4', 'iPad_mini', 'Mac']
21
+ unless available.include? value
22
+ UI.user_error!("Invalid device type '#{value}'. Available values: #{available}")
23
+ end
24
+ end),
25
+ FastlaneCore::ConfigItem.new(key: :use_legacy_iphone5s,
26
+ env_name: "FRAMEIT_USE_LEGACY_IPHONE_5_S",
27
+ optional: true,
28
+ is_string: false,
29
+ description: "use iPhone 5s instead of iPhone SE frames",
30
+ default_value: false)
11
31
  ]
12
32
  end
13
33
  end
@@ -14,7 +14,12 @@ module Frameit
14
14
  end
15
15
  end
16
16
 
17
- def run(path, color = Color::BLACK)
17
+ def run(path, color = nil)
18
+ unless color
19
+ color = Frameit::Color::BLACK
20
+ color = Frameit::Color::SILVER if Frameit.config[:white] || Frameit.config[:silver]
21
+ end
22
+
18
23
  screenshots = Dir.glob("#{path}/**/*.{png,PNG}").uniq # uniq because thanks to {png,PNG} there are duplicates
19
24
 
20
25
  if screenshots.count > 0
@@ -1,3 +1,3 @@
1
1
  module Frameit
2
- VERSION = "2.6.1"
2
+ VERSION = "2.6.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frameit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-03 00:00:00.000000000 Z
11
+ date: 2016-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -258,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
258
  version: '0'
259
259
  requirements: []
260
260
  rubyforge_project:
261
- rubygems_version: 2.4.8
261
+ rubygems_version: 2.6.2
262
262
  signing_key:
263
263
  specification_version: 4
264
264
  summary: Quickly put your screenshots into the right device frames