Repository is archived
No commit activity in last 3 years
No release in over 3 years
Provides facitlities to Assemble together the Vigilem gems
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Vigilem::Assembly

Provides assembling functionality for Vigilem It will dynamically install handlers based on Vigilem::Core::Stat attributes @see vigilem-evdev-stat or vigilem-win32_api-stat

Installation

$ gem install vigilem-assembly

examples

  require 'vigilem/assembly'
  
  Vigilem::Assembly.install_handler

This will load one of the default Stat's @see Vigilem::Win32API::Stat, Vigilem::Evdev::Stat it checks Vigilem::Stat.all to load the Stats. or

  require 'vigilem/assembly'
  
  Vigilem::Assembly.install_handler! # which will error if no handler found

##During Gem install

  #ext/Rakefile
  require 'vigilem/assembly'
  
  task :assemble do
    Vigilem::Assembly.install_handler
  end
  
  task default: :assemble

Creating a new Stat

  require 'ffi'
  
  require 'vigilem/assembly'
  
  class CocoaStat < Vigilem::Core::Stat
    extend FFI::Library
    # by default self.new automatically adds the Stat to 
    # the list of stats
    def initialize(version=nil)
      options = {}
      options[:version] = version
      options[:platforms] = /darwin/
      super('Cocoa', 'my-cocoa-api', options) do 
        begin
          !!ffi_lib('/System/Library/Frameworks/Cocoa.framework/Cocoa')
        rescue LoadError
          false
        end
      end
    end
    
    def self.default
      @default ||= new
    end
    
  end

Contributing

  1. Fork it ( https://github.com/[my-github-username]/vigilem-assembly/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request