soby 0.0.6 → 0.0.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.
- checksums.yaml +4 -4
 - data/lib/soby/launcher.rb +70 -0
 - data/lib/soby.rb +1 -1
 - metadata +2 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: b9c5baaea85cf085e890d5a6187cf5f9280338a1
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f1202b568891873ad7739297d8eab9af98dc42e0
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: cf86d2c228bd79243d1e427324a82dee3fe660be9e0d298d6d4aebcb7db4e43c318746635e6da1dffeae300be1eecfbb41b8dc667376be385750db30c12cdbd2
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 0c0d6e75ca8c2ae4c2c696589aefa3b3586135f529ae9a5e987c18f5bc4c5700ab395f07ebbccec0d01a2584dc14988e1b06a544002d5d18cd3bd40e6ba8bce6
         
     | 
| 
         @@ -0,0 +1,70 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
             
     | 
| 
      
 2 
     | 
    
         
            +
            module Soby
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
              SLEEP_TIME = 1
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
              ## used outside
         
     | 
| 
      
 7 
     | 
    
         
            +
              
         
     | 
| 
      
 8 
     | 
    
         
            +
              def Soby.load_presentation (program_name, svg_name)
         
     | 
| 
      
 9 
     | 
    
         
            +
                puts "Loading program"
         
     | 
| 
      
 10 
     | 
    
         
            +
                load program_name
         
     | 
| 
      
 11 
     | 
    
         
            +
                puts "Loading prez"
         
     | 
| 
      
 12 
     | 
    
         
            +
                Presentation.new($app, $app.sketchPath(svg_name), program_name)
         
     | 
| 
      
 13 
     | 
    
         
            +
              end
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
              def Soby.auto_update (presentation, file_not_updated)
         
     | 
| 
      
 16 
     | 
    
         
            +
                
         
     | 
| 
      
 17 
     | 
    
         
            +
                if $app != nil 
         
     | 
| 
      
 18 
     | 
    
         
            +
                  
         
     | 
| 
      
 19 
     | 
    
         
            +
                  files = find_files_except file_not_updated
         
     | 
| 
      
 20 
     | 
    
         
            +
                  start_presentation presentation
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                  program_name = presentation.program
         
     | 
| 
      
 23 
     | 
    
         
            +
                  svg_name = presentation.url
         
     | 
| 
      
 24 
     | 
    
         
            +
                  
         
     | 
| 
      
 25 
     | 
    
         
            +
                  time = Time.now 
         
     | 
| 
      
 26 
     | 
    
         
            +
                  
         
     | 
| 
      
 27 
     | 
    
         
            +
                  t = Thread.new {
         
     | 
| 
      
 28 
     | 
    
         
            +
                    loop do
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                      if files.find { |file| FileTest.exist?(file) && File.stat(file).mtime > time }
         
     | 
| 
      
 31 
     | 
    
         
            +
                        puts 'reloading sketch...'
         
     | 
| 
      
 32 
     | 
    
         
            +
                        
         
     | 
| 
      
 33 
     | 
    
         
            +
                        time = Time.now
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                        load program_name
         
     | 
| 
      
 36 
     | 
    
         
            +
                        presentation = Presentation.new($app, $app.sketchPath(svg_name), program_name)
         
     | 
| 
      
 37 
     | 
    
         
            +
                        start_presentation presentation
         
     | 
| 
      
 38 
     | 
    
         
            +
                      end
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                      sleep SLEEP_TIME
         
     | 
| 
      
 41 
     | 
    
         
            +
                      return if $app == nil
         
     | 
| 
      
 42 
     | 
    
         
            +
                    end
         
     | 
| 
      
 43 
     | 
    
         
            +
                  }
         
     | 
| 
      
 44 
     | 
    
         
            +
                end
         
     | 
| 
      
 45 
     | 
    
         
            +
              end
         
     | 
| 
      
 46 
     | 
    
         
            +
              
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
             ## local use
         
     | 
| 
      
 49 
     | 
    
         
            +
              
         
     | 
| 
      
 50 
     | 
    
         
            +
              def Soby.reload_presentation (presentation)
         
     | 
| 
      
 51 
     | 
    
         
            +
            #    load presentation.program
         
     | 
| 
      
 52 
     | 
    
         
            +
            #    presentation.reset
         
     | 
| 
      
 53 
     | 
    
         
            +
                presentation =  Soby::load_presentation(presentation.program, presentation.url)
         
     | 
| 
      
 54 
     | 
    
         
            +
              end
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
              def Soby.start_presentation (presentation)
         
     | 
| 
      
 57 
     | 
    
         
            +
                $app.set_prez presentation  
         
     | 
| 
      
 58 
     | 
    
         
            +
              end
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
              def Soby.find_files_except (name)
         
     | 
| 
      
 61 
     | 
    
         
            +
                find_files.select { |file_name| not file_name.end_with? name }
         
     | 
| 
      
 62 
     | 
    
         
            +
              end
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
              def Soby.find_files
         
     | 
| 
      
 65 
     | 
    
         
            +
                Dir.glob(File.join(SKETCH_ROOT, "**/*.{svg,glsl,rb}"))
         
     | 
| 
      
 66 
     | 
    
         
            +
              end
         
     | 
| 
      
 67 
     | 
    
         
            +
              
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
              
         
     | 
| 
      
 70 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/soby.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: soby
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.7
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Jeremy Laviole
         
     | 
| 
         @@ -46,6 +46,7 @@ extra_rdoc_files: [] 
     | 
|
| 
       46 
46 
     | 
    
         
             
            files:
         
     | 
| 
       47 
47 
     | 
    
         
             
            - lib/soby.rb
         
     | 
| 
       48 
48 
     | 
    
         
             
            - lib/soby/cam.rb
         
     | 
| 
      
 49 
     | 
    
         
            +
            - lib/soby/launcher.rb
         
     | 
| 
       49 
50 
     | 
    
         
             
            - lib/soby/presentation.rb
         
     | 
| 
       50 
51 
     | 
    
         
             
            - lib/soby/slide.rb
         
     | 
| 
       51 
52 
     | 
    
         
             
            - lib/soby/transforms.rb
         
     |