captured 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/captured/file_uploader.rb +9 -1
  2. metadata +2 -2
@@ -48,12 +48,20 @@ class FileUploader
48
48
  end
49
49
  end
50
50
 
51
+ def pbcopy(str)
52
+ pbcopy = IO.popen('pbcopy','w+')
53
+ pbcopy.print str
54
+ pbcopy.close_write
55
+ rescue
56
+ raise "Copy to clipboard failed"
57
+ end
58
+
51
59
  def process_upload(file)
52
60
  remote_name = Digest::MD5.hexdigest(file+Time.now.to_i.to_s) + File.extname(file)
53
61
  growl("Processing Upload", "#{File.dirname(File.expand_path(__FILE__))}/../../resources/action_run.png")
54
62
  remote_path = @upload_proc.call(file, remote_name)
55
63
  puts "Uploaded '#{file}' to '#{remote_path}'"
56
- raise "Copy Failed" unless system("echo -n '#{remote_path}' | /usr/bin/pbcopy")
64
+ pbcopy remote_path
57
65
  growl("Upload Succeeded", "#{File.dirname(File.expand_path(__FILE__))}/../../resources/green_check.png")
58
66
  rescue => e
59
67
  puts e
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: captured
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Sexton
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-23 00:00:00 -04:00
12
+ date: 2009-10-26 00:00:00 -04:00
13
13
  default_executable: captured
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency