captured 0.2.6 → 0.2.7
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.
- data/README.markdown +40 -12
 - data/VERSION +1 -0
 - data/bin/captured +5 -2
 - data/etc/captured.yml-example +9 -4
 - data/lib/captured/file_uploader.rb +8 -3
 - data/lib/captured/uploaders/imgur_uploader.rb +12 -0
 - metadata +14 -2
 
    
        data/README.markdown
    CHANGED
    
    | 
         @@ -18,27 +18,55 @@ With that said, once things are installed and configured it really is handy. 
     | 
|
| 
       18 
18 
     | 
    
         
             
            Install
         
     | 
| 
       19 
19 
     | 
    
         
             
            =======
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
      
 21 
     | 
    
         
            +
            To install captured:
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
            	$ open -e ~/.captured.yml
         
     | 
| 
      
 23 
     | 
    
         
            +
                $ sudo gem install captured
         
     | 
| 
      
 24 
     | 
    
         
            +
                $ captured --install
         
     | 
| 
       26 
25 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
      
 26 
     | 
    
         
            +
            When you install an example config file to ~/.captured.yml, which has a few examples of possible configuration types.
         
     | 
| 
       28 
27 
     | 
    
         | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
      
 28 
     | 
    
         
            +
            Using Captured
         
     | 
| 
      
 29 
     | 
    
         
            +
            ==============
         
     | 
| 
       30 
30 
     | 
    
         | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
      
 31 
     | 
    
         
            +
            The main use is to upload a screen shot taken using OS X's built in screen capture.
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
             1. Press ⌘⇧4 to capture
         
     | 
| 
      
 34 
     | 
    
         
            +
             2. Paste the link
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
            Captured can also be used from the command line to easily share files.
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
             1. Run `captured path/to/file`
         
     | 
| 
      
 39 
     | 
    
         
            +
             2. Paste the link
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
            Configuration
         
     | 
| 
      
 42 
     | 
    
         
            +
            =============
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
            By default captured uses Imageshack as the host, but you can configure it to upload and share images by other services.
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
            To edit the configuraiton:
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                $ open -e ~/.captured.yml
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
            Type: Imageshack
         
     | 
| 
      
 51 
     | 
    
         
            +
            ----------------
         
     | 
| 
       33 
52 
     | 
    
         
             
            The easiest way to do this is to use the image shack service. This service is a little slower, but is free and easy.
         
     | 
| 
       34 
53 
     | 
    
         | 
| 
       35 
54 
     | 
    
         
             
            <pre>
         
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
      
 55 
     | 
    
         
            +
                upload:
         
     | 
| 
      
 56 
     | 
    
         
            +
                  type: imageshack
         
     | 
| 
      
 57 
     | 
    
         
            +
            </pre>
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
            Type: Imgur
         
     | 
| 
      
 60 
     | 
    
         
            +
            ----------------
         
     | 
| 
      
 61 
     | 
    
         
            +
            The simple image sharer
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
            <pre>
         
     | 
| 
      
 64 
     | 
    
         
            +
                upload:
         
     | 
| 
      
 65 
     | 
    
         
            +
                  type: imgur
         
     | 
| 
       38 
66 
     | 
    
         
             
            </pre>
         
     | 
| 
       39 
67 
     | 
    
         | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
      
 68 
     | 
    
         
            +
            Type: scp
         
     | 
| 
      
 69 
     | 
    
         
            +
            ---------
         
     | 
| 
       42 
70 
     | 
    
         | 
| 
       43 
71 
     | 
    
         
             
            If you have you own web server scp is a very handy way to host your own captures.
         
     | 
| 
       44 
72 
     | 
    
         | 
    
        data/VERSION
    ADDED
    
    | 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            0.2.7
         
     | 
    
        data/bin/captured
    CHANGED
    
    | 
         @@ -3,8 +3,6 @@ require 'rubygems' 
     | 
|
| 
       3 
3 
     | 
    
         
             
            require 'optparse'
         
     | 
| 
       4 
4 
     | 
    
         
             
            require "#{File.dirname(__FILE__)}/../lib/captured"
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
            puts "YOOOOOO"
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
6 
     | 
    
         
             
            options = {:config_file => "#{ENV['HOME']}/.captured.yml",
         
     | 
| 
       9 
7 
     | 
    
         
             
                       :watch_path => "#{ENV['HOME']}/Desktop/",
         
     | 
| 
       10 
8 
     | 
    
         
             
                       :watch_pattern => Captured.guess_watch_path, 
         
     | 
| 
         @@ -21,6 +19,11 @@ OptionParser.new do |opts| 
     | 
|
| 
       21 
19 
     | 
    
         
             
                exit
         
     | 
| 
       22 
20 
     | 
    
         
             
              end
         
     | 
| 
       23 
21 
     | 
    
         | 
| 
      
 22 
     | 
    
         
            +
              opts.on('--version', "Print the version") do
         
     | 
| 
      
 23 
     | 
    
         
            +
                puts "Captured #{File.open("#{File.dirname(__FILE__)}/../VERSION", "r").read}"
         
     | 
| 
      
 24 
     | 
    
         
            +
                exit
         
     | 
| 
      
 25 
     | 
    
         
            +
              end
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
       24 
27 
     | 
    
         
             
              opts.on('--config-file=FILE', "Config file (Default: #{options[:config_file]})") do |file|
         
     | 
| 
       25 
28 
     | 
    
         
             
                options[:config_file] = file
         
     | 
| 
       26 
29 
     | 
    
         
             
              end
         
     | 
    
        data/etc/captured.yml-example
    CHANGED
    
    | 
         @@ -1,14 +1,19 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Example captured configuration file
         
     | 
| 
       2 
2 
     | 
    
         
             
            #
         
     | 
| 
       3 
     | 
    
         
            -
            #   
     | 
| 
      
 3 
     | 
    
         
            +
            #  Upload type: Image Shack
         
     | 
| 
       4 
4 
     | 
    
         
             
            #  =================================
         
     | 
| 
       5 
     | 
    
         
            -
            #
         
     | 
| 
       6 
     | 
    
         
            -
            #  The default option is to post your images to imageshack.us, if you want to
         
     | 
| 
       7 
     | 
    
         
            -
            #  use one of the more advances and felxable types simply comment this out.
         
     | 
| 
       8 
5 
     | 
    
         | 
| 
       9 
6 
     | 
    
         
             
            upload:
         
     | 
| 
       10 
7 
     | 
    
         
             
              type: imageshack
         
     | 
| 
       11 
8 
     | 
    
         | 
| 
      
 9 
     | 
    
         
            +
            #  Standard upload type: Imgur
         
     | 
| 
      
 10 
     | 
    
         
            +
            #  =================================
         
     | 
| 
      
 11 
     | 
    
         
            +
            #
         
     | 
| 
      
 12 
     | 
    
         
            +
            #  The simple image sharer
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            #upload:
         
     | 
| 
      
 15 
     | 
    
         
            +
            #  type: imgur
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
       12 
17 
     | 
    
         
             
            #
         
     | 
| 
       13 
18 
     | 
    
         
             
            #  Powerful upload type: scp
         
     | 
| 
       14 
19 
     | 
    
         
             
            #  =========================
         
     | 
| 
         @@ -11,13 +11,16 @@ class FileUploader 
     | 
|
| 
       11 
11 
     | 
    
         
             
                @growl_path = options[:growl_path] || "/usr/local/bin/growlnotify"
         
     | 
| 
       12 
12 
     | 
    
         
             
                @config = YAML.load_file(options[:config_file])
         
     | 
| 
       13 
13 
     | 
    
         
             
                case @config['upload']['type']
         
     | 
| 
       14 
     | 
    
         
            -
                when"eval"
         
     | 
| 
      
 14 
     | 
    
         
            +
                when "eval"
         
     | 
| 
       15 
15 
     | 
    
         
             
                  require File.expand_path(File.dirname(__FILE__) + '/uploaders/eval_uploader')
         
     | 
| 
       16 
16 
     | 
    
         
             
                  @uploader = EvalUploader.new(@config)
         
     | 
| 
       17 
     | 
    
         
            -
                when"scp"
         
     | 
| 
      
 17 
     | 
    
         
            +
                when "scp"
         
     | 
| 
       18 
18 
     | 
    
         
             
                  require File.expand_path(File.dirname(__FILE__) + '/uploaders/scp_uploader')
         
     | 
| 
       19 
19 
     | 
    
         
             
                  @uploader = ScpUploader.new(@config)
         
     | 
| 
       20 
     | 
    
         
            -
                when" 
     | 
| 
      
 20 
     | 
    
         
            +
                when "imgur"
         
     | 
| 
      
 21 
     | 
    
         
            +
                  require File.expand_path(File.dirname(__FILE__) + '/uploaders/imgur_uploader')
         
     | 
| 
      
 22 
     | 
    
         
            +
                  @uploader = ImgurUploader.new
         
     | 
| 
      
 23 
     | 
    
         
            +
                when "imageshack"
         
     | 
| 
       21 
24 
     | 
    
         
             
                  require File.expand_path(File.dirname(__FILE__) + '/uploaders/imageshack_uploader')
         
     | 
| 
       22 
25 
     | 
    
         
             
                  @uploader = ImageshackUploader.new(@config)
         
     | 
| 
       23 
26 
     | 
    
         
             
                else
         
     | 
| 
         @@ -58,5 +61,7 @@ class FileUploader 
     | 
|
| 
       58 
61 
     | 
    
         
             
                if File.exists? @growl_path
         
     | 
| 
       59 
62 
     | 
    
         
             
                  raise "Growl Failed" unless system("#{@growl_path} -t 'Captured' -m '#{msg}' --image '#{image}'")
         
     | 
| 
       60 
63 
     | 
    
         
             
                end
         
     | 
| 
      
 64 
     | 
    
         
            +
              rescue
         
     | 
| 
      
 65 
     | 
    
         
            +
                puts "Growl Notify Error"
         
     | 
| 
       61 
66 
     | 
    
         
             
              end
         
     | 
| 
       62 
67 
     | 
    
         
             
            end
         
     | 
| 
         @@ -0,0 +1,12 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'imgur'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            class ImgurUploader
         
     | 
| 
      
 4 
     | 
    
         
            +
              attr_accessor :url
         
     | 
| 
      
 5 
     | 
    
         
            +
              API_KEY = "f4fa5e1e9974405c62117a8a84fbde46"
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
              def upload(file)
         
     | 
| 
      
 8 
     | 
    
         
            +
                puts "Uploading #{file}"
         
     | 
| 
      
 9 
     | 
    
         
            +
                @url = Imgur::API.new('f4fa5e1e9974405c62117a8a84fbde46').upload_file(file)["imgur_page"]
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
            end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.7
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors: 
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Christopher Sexton
         
     | 
| 
         @@ -9,9 +9,19 @@ autorequire: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
            date: 2009-11- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2009-11-24 00:00:00 -05:00
         
     | 
| 
       13 
13 
     | 
    
         
             
            default_executable: captured
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies: 
         
     | 
| 
      
 15 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 16 
     | 
    
         
            +
              name: imgur
         
     | 
| 
      
 17 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 18 
     | 
    
         
            +
              version_requirement: 
         
     | 
| 
      
 19 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement 
         
     | 
| 
      
 20 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 21 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 22 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 23 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 24 
     | 
    
         
            +
                version: 
         
     | 
| 
       15 
25 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       16 
26 
     | 
    
         
             
              name: net-scp
         
     | 
| 
       17 
27 
     | 
    
         
             
              type: :runtime
         
     | 
| 
         @@ -33,6 +43,7 @@ extra_rdoc_files: 
     | 
|
| 
       33 
43 
     | 
    
         
             
            - README.markdown
         
     | 
| 
       34 
44 
     | 
    
         
             
            files: 
         
     | 
| 
       35 
45 
     | 
    
         
             
            - README.markdown
         
     | 
| 
      
 46 
     | 
    
         
            +
            - VERSION
         
     | 
| 
       36 
47 
     | 
    
         
             
            - bin/captured
         
     | 
| 
       37 
48 
     | 
    
         
             
            - etc/captured.yml-example
         
     | 
| 
       38 
49 
     | 
    
         
             
            - etc/launchd.plist.erb
         
     | 
| 
         @@ -42,6 +53,7 @@ files: 
     | 
|
| 
       42 
53 
     | 
    
         
             
            - lib/captured/fs_events.rb
         
     | 
| 
       43 
54 
     | 
    
         
             
            - lib/captured/uploaders/eval_uploader.rb
         
     | 
| 
       44 
55 
     | 
    
         
             
            - lib/captured/uploaders/imageshack_uploader.rb
         
     | 
| 
      
 56 
     | 
    
         
            +
            - lib/captured/uploaders/imgur_uploader.rb
         
     | 
| 
       45 
57 
     | 
    
         
             
            - lib/captured/uploaders/scp_uploader.rb
         
     | 
| 
       46 
58 
     | 
    
         
             
            - resources/2uparrow.png
         
     | 
| 
       47 
59 
     | 
    
         
             
            - resources/action_run.png
         
     |