rshot 0.0.3 → 0.0.4
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/ext/rshot/ruby.m +17 -17
 - metadata +37 -18
 
    
        data/ext/rshot/ruby.m
    CHANGED
    
    | 
         @@ -1,5 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            #import <AppKit/AppKit.h>
         
     | 
| 
       2 
     | 
    
         
            -
            #include  
     | 
| 
      
 2 
     | 
    
         
            +
            #include <ruby/ruby.h>
         
     | 
| 
       3 
3 
     | 
    
         
             
            #import "rshot.h"
         
     | 
| 
       4 
4 
     | 
    
         
             
            #import "app_delegate.h"
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
         @@ -16,36 +16,36 @@ static AppDelegate* app_delegate; 
     | 
|
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
            void Init_rshot()
         
     | 
| 
       18 
18 
     | 
    
         
             
            {
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
      
 19 
     | 
    
         
            +
                pool = [[NSAutoreleasePool alloc] init];
         
     | 
| 
      
 20 
     | 
    
         
            +
                [NSApplication sharedApplication];
         
     | 
| 
       21 
21 
     | 
    
         
             
                app_delegate = [[AppDelegate alloc] init];
         
     | 
| 
       22 
22 
     | 
    
         
             
                [NSApp setDelegate: app_delegate];
         
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                rb_cRShot = rb_define_class("RShot", rb_cObject);
         
     | 
| 
      
 25 
     | 
    
         
            +
                rb_define_alloc_func(rb_cRShot, RShot_alloc);
         
     | 
| 
      
 26 
     | 
    
         
            +
                rb_define_method(rb_cRShot, "render_url", RShot_render_url, 2);
         
     | 
| 
       27 
27 
     | 
    
         
             
            }
         
     | 
| 
       28 
28 
     | 
    
         | 
| 
       29 
29 
     | 
    
         
             
            static void RShot_free(void* rshot)
         
     | 
| 
       30 
30 
     | 
    
         
             
            {
         
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
      
 31 
     | 
    
         
            +
                [(RShot*)rshot release];
         
     | 
| 
      
 32 
     | 
    
         
            +
                [pool drain];
         
     | 
| 
       33 
33 
     | 
    
         
             
            }
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
35 
     | 
    
         
             
            static VALUE RShot_alloc(VALUE class)
         
     | 
| 
       36 
36 
     | 
    
         
             
            {
         
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
      
 37 
     | 
    
         
            +
                RShot* rshot = [[RShot alloc] init];
         
     | 
| 
      
 38 
     | 
    
         
            +
                return Data_Wrap_Struct(class, 0, RShot_free, rshot);
         
     | 
| 
       39 
39 
     | 
    
         
             
            }
         
     | 
| 
       40 
40 
     | 
    
         | 
| 
       41 
41 
     | 
    
         
             
            static VALUE RShot_render_url(VALUE self, VALUE url, VALUE png)
         
     | 
| 
       42 
42 
     | 
    
         
             
            {
         
     | 
| 
       43 
     | 
    
         
            -
             
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
      
 43 
     | 
    
         
            +
                RShot* rshot;
         
     | 
| 
      
 44 
     | 
    
         
            +
                NSString* nsurl = [NSString stringWithUTF8String: rb_string_value_cstr(&url)];
         
     | 
| 
      
 45 
     | 
    
         
            +
                NSString* nspng = [NSString stringWithUTF8String: rb_string_value_cstr(&png)];
         
     | 
| 
      
 46 
     | 
    
         
            +
                Data_Get_Struct(self, RShot, rshot);
         
     | 
| 
      
 47 
     | 
    
         
            +
                [rshot renderUrl: nsurl toFile: nspng];
         
     | 
| 
      
 48 
     | 
    
         
            +
                if(!setjmp(RShot_finishedEnv)) {
         
     | 
| 
       49 
49 
     | 
    
         
             
                    [NSApp run];
         
     | 
| 
       50 
50 
     | 
    
         
             
                }
         
     | 
| 
       51 
51 
     | 
    
         
             
                return Qtrue;
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,23 +1,32 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: rshot
         
     | 
| 
       3 
     | 
    
         
            -
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
               
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version 
         
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 23
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
      
 6 
     | 
    
         
            +
              segments: 
         
     | 
| 
      
 7 
     | 
    
         
            +
              - 0
         
     | 
| 
      
 8 
     | 
    
         
            +
              - 0
         
     | 
| 
      
 9 
     | 
    
         
            +
              - 4
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 0.0.4
         
     | 
| 
       6 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
     | 
    
         
            -
            authors:
         
     | 
| 
      
 12 
     | 
    
         
            +
            authors: 
         
     | 
| 
       8 
13 
     | 
    
         
             
            - Charlie Somerville
         
     | 
| 
       9 
14 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
15 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
16 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            date: 2011-11-27 00:00:00 Z
         
     | 
| 
       13 
19 
     | 
    
         
             
            dependencies: []
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
       14 
21 
     | 
    
         
             
            description: 
         
     | 
| 
       15 
22 
     | 
    
         
             
            email: charlie@charliesomerville.com
         
     | 
| 
       16 
23 
     | 
    
         
             
            executables: []
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            extensions: 
         
     | 
| 
       18 
26 
     | 
    
         
             
            - ext/rshot/extconf.rb
         
     | 
| 
       19 
27 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            files: 
         
     | 
| 
       21 
30 
     | 
    
         
             
            - ext/rshot/app_delegate.m
         
     | 
| 
       22 
31 
     | 
    
         
             
            - ext/rshot/rshot.m
         
     | 
| 
       23 
32 
     | 
    
         
             
            - ext/rshot/ruby.m
         
     | 
| 
         @@ -27,26 +36,36 @@ files: 
     | 
|
| 
       27 
36 
     | 
    
         
             
            - lib/rshot.rb
         
     | 
| 
       28 
37 
     | 
    
         
             
            homepage: https://github.com/charliesome/RShot
         
     | 
| 
       29 
38 
     | 
    
         
             
            licenses: []
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
       30 
40 
     | 
    
         
             
            post_install_message: 
         
     | 
| 
       31 
41 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
            require_paths: 
         
     | 
| 
       33 
44 
     | 
    
         
             
            - lib
         
     | 
| 
       34 
     | 
    
         
            -
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 45 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement 
         
     | 
| 
       35 
46 
     | 
    
         
             
              none: false
         
     | 
| 
       36 
     | 
    
         
            -
              requirements:
         
     | 
| 
       37 
     | 
    
         
            -
              - -  
     | 
| 
       38 
     | 
    
         
            -
                - !ruby/object:Gem::Version
         
     | 
| 
       39 
     | 
    
         
            -
                   
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
      
 47 
     | 
    
         
            +
              requirements: 
         
     | 
| 
      
 48 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 49 
     | 
    
         
            +
                - !ruby/object:Gem::Version 
         
     | 
| 
      
 50 
     | 
    
         
            +
                  hash: 3
         
     | 
| 
      
 51 
     | 
    
         
            +
                  segments: 
         
     | 
| 
      
 52 
     | 
    
         
            +
                  - 0
         
     | 
| 
      
 53 
     | 
    
         
            +
                  version: "0"
         
     | 
| 
      
 54 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement 
         
     | 
| 
       41 
55 
     | 
    
         
             
              none: false
         
     | 
| 
       42 
     | 
    
         
            -
              requirements:
         
     | 
| 
       43 
     | 
    
         
            -
              - -  
     | 
| 
       44 
     | 
    
         
            -
                - !ruby/object:Gem::Version
         
     | 
| 
       45 
     | 
    
         
            -
                   
     | 
| 
      
 56 
     | 
    
         
            +
              requirements: 
         
     | 
| 
      
 57 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 58 
     | 
    
         
            +
                - !ruby/object:Gem::Version 
         
     | 
| 
      
 59 
     | 
    
         
            +
                  hash: 3
         
     | 
| 
      
 60 
     | 
    
         
            +
                  segments: 
         
     | 
| 
      
 61 
     | 
    
         
            +
                  - 0
         
     | 
| 
      
 62 
     | 
    
         
            +
                  version: "0"
         
     | 
| 
       46 
63 
     | 
    
         
             
            requirements: []
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
       47 
65 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       48 
66 
     | 
    
         
             
            rubygems_version: 1.8.10
         
     | 
| 
       49 
67 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       50 
68 
     | 
    
         
             
            specification_version: 3
         
     | 
| 
       51 
69 
     | 
    
         
             
            summary: Takes screenshots of web pages
         
     | 
| 
       52 
70 
     | 
    
         
             
            test_files: []
         
     | 
| 
      
 71 
     | 
    
         
            +
             
     |