vid2gif 0.0.2 → 0.0.3

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/vid2gif +14 -1
  3. data/lib/vid2gif/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be579738febf2f7ab5d60c481d9d3d527216317f
4
- data.tar.gz: 25e16e8c47fdf10f7fc807aad13e5e5fb3efbd20
3
+ metadata.gz: 40b03ce5c4e664b72e6fd6da721dcbe6cf1e28c6
4
+ data.tar.gz: d711af0cd3b15dafe386771ddf63f2421cd1f803
5
5
  SHA512:
6
- metadata.gz: 964607d72eb99dcabf92b833d68b50f89ba0b4f854219ebf32c9bd94f090c3008fd14be2ecafcd94502250a0aed5a5841e3cffadf925d5de7a1d375abf05defa
7
- data.tar.gz: 909867829b7eca2e15e065141d631c4d9380157bfef372d34f086ea74521772d895bd4a5de1baafd4238f662d14fc3664a7ec0e0cc95923c77c6122ca411793d
6
+ metadata.gz: 0349ce85fee963ac0fb69bc774d9975252a935a4f3991067b40f780351643188aabcdb915c80819b7e4bfb0004f3e8f05ed56ee9aa78e22338446033b2589235
7
+ data.tar.gz: b739461cc21ccbdf7d2d25c27df69be7a1e6c6d95a4e09573b27e8867bc15b88b1f65daac1458a0631e80aec9e2c03cf6658c795543ceca48e8231ee9e2a375c
@@ -3,6 +3,7 @@
3
3
  require 'optparse'
4
4
  require 'chronic_duration'
5
5
  require 'open3'
6
+ require 'tempfile'
6
7
 
7
8
  options = {}
8
9
 
@@ -70,6 +71,12 @@ OptionParser.new do |opts|
70
71
  opts.separator ''
71
72
  opts.separator 'Other stuff:'
72
73
 
74
+ if RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
75
+ opts.on '-p', '--preview', 'Open the image in quicklook' do |ql|
76
+ options[:quicklook] = ql
77
+ end
78
+ end
79
+
73
80
  opts.on_tail('-h', '--help', 'Show this message') do
74
81
  puts opts
75
82
  exit
@@ -102,7 +109,7 @@ palettegen_filters << '=stats_mode=diff' if options[:diff]
102
109
  arguments = []
103
110
  arguments << "-ss #{options[:start]}" if options[:start]
104
111
  arguments << "-t #{options[:duration]}" if options[:duration]
105
- arguments << "-i #{ARGV[0]}"
112
+ arguments << "-i \"#{ARGV[0]}\""
106
113
 
107
114
  puts "Generating palette\n"
108
115
  Open3.popen2e(['ffmpeg', *arguments, "-vf #{filters.dup.push(palettegen_filters).join(',')}", "-y #{palette.path}"].join(' ')) do |_, output, _|
@@ -130,3 +137,9 @@ end
130
137
  palette.unlink
131
138
 
132
139
  puts "Gif created at #{filename}"
140
+
141
+ exit unless options[:quicklook]
142
+
143
+ Open3.popen3('qlmanage', '-p', filename) do |_, _, _, thread|
144
+ thread.join
145
+ end
@@ -1,3 +1,3 @@
1
1
  module Vid2gif
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vid2gif
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Sandberg