jared 0.0.7a4 → 1.0.0
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 +7 -0
 - data/Gemfile.lock +18 -0
 - data/jared.gemspec +21 -36
 - data/lib/jared/cli.rb +19 -0
 - data/lib/jared/logg.rb +14 -15
 - data/lib/jared/plugin.rb +61 -35
 - data/lib/jared/plugin_list.rb +16 -0
 - data/lib/jared/setup.rb +5 -0
 - data/lib/jared/setup_generator.rb +42 -0
 - data/lib/jared/version.rb +2 -2
 - data/lib/jared.rb +11 -86
 - data/license.md +7 -0
 - data/pkg/jared-0.1.0.gem +0 -0
 - data/readme.md +9 -79
 - metadata +24 -275
 - data/.gitignore +0 -10
 - data/Gemfile +0 -4
 - data/Rakefile +0 -1
 - data/lib/jared/core/clock/init.rb +0 -15
 - data/lib/jared/core/clock/lib/clock.rb +0 -23
 - data/lib/jared/core/configure/init.rb +0 -15
 - data/lib/jared/core/configure/lib/config.rb +0 -60
 - data/lib/jared/core/create/init.rb +0 -16
 - data/lib/jared/core/create/lib/create.rb +0 -33
 - data/lib/jared/core/daemon/daemon.rb +0 -104
 - data/lib/jared/core/daemon/init.rb +0 -15
 - data/lib/jared/core/date/init.rb +0 -15
 - data/lib/jared/core/date/lib/date.rb +0 -45
 - data/lib/jared/core/greeter/init.rb +0 -15
 - data/lib/jared/core/greeter/lib/greeting.rb +0 -26
 - data/lib/jared/core/jamendo/init.rb +0 -17
 - data/lib/jared/core/jamendo/lib/jamendo.rb +0 -88
 - data/lib/jared/core/mail/init.rb +0 -15
 - data/lib/jared/core/mail/lib/mail.rb +0 -45
 - data/lib/jared/core/map/New File +0 -0
 - data/lib/jared/core/map/init.rb +0 -15
 - data/lib/jared/core/map/lib/map.rb +0 -12
 - data/lib/jared/core/player/init.rb +0 -15
 - data/lib/jared/core/player/lib/player.rb +0 -33
 - data/lib/jared/core/stock/init.rb +0 -17
 - data/lib/jared/core/stock/lib/stock.rb +0 -34
 - data/lib/jared/core/tasks/init.rb +0 -15
 - data/lib/jared/core/tasks/lib/task.rb +0 -42
 - data/lib/jared/core/weather/init.rb +0 -17
 - data/lib/jared/core/weather/lib/weather.rb +0 -70
 - data/lib/jared/database.rb +0 -59
 - data/lib/jared/jared.rb +0 -22
 - data/lib/jared/models/music.rb +0 -2
 - data/lib/jared/models/task.rb +0 -5
 - data/lib/jared/models/user.rb +0 -5
 - data/lib/jared/plugins.rb +0 -92
 - data/spec/spec_helper.rb +0 -4
 - data/spec/template.rb +0 -10
 - data/spec/tests/date_spec.rb +0 -9
 - data/spec/tests/greeting_spec.rb +0 -10
 - data/spec/tests/jamendo_spec.rb +0 -10
 - data/spec/tests/mail_spec.rb +0 -10
 - data/spec/tests/map_spec.rb +0 -12
 - data/spec/tests/player_spec.rb +0 -10
 - data/spec/tests/stock_spec.rb +0 -10
 
    
        data/lib/jared/plugins.rb
    DELETED
    
    | 
         @@ -1,92 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require 'set'
         
     | 
| 
       2 
     | 
    
         
            -
            require_relative "plugin"
         
     | 
| 
       3 
     | 
    
         
            -
            # require 'jared/version'
         
     | 
| 
       4 
     | 
    
         
            -
            class Plugins
         
     | 
| 
       5 
     | 
    
         
            -
              PLUGINS=Set.new
         
     | 
| 
       6 
     | 
    
         
            -
              PATH="#{Dir.home}/.jared/plugins"
         
     | 
| 
       7 
     | 
    
         
            -
              class Load
         
     | 
| 
       8 
     | 
    
         
            -
                include Logg
         
     | 
| 
       9 
     | 
    
         
            -
                def initialize(path='')
         
     | 
| 
       10 
     | 
    
         
            -
                  @path=path
         
     | 
| 
       11 
     | 
    
         
            -
                end
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
                def load(path)
         
     | 
| 
       14 
     | 
    
         
            -
                  count=0
         
     | 
| 
       15 
     | 
    
         
            -
                  Dir.glob("#{path}/*").select do |file|
         
     | 
| 
       16 
     | 
    
         
            -
                    if File.directory?(file)
         
     | 
| 
       17 
     | 
    
         
            -
                      next
         
     | 
| 
       18 
     | 
    
         
            -
                    elsif file.include?("init.rb")
         
     | 
| 
       19 
     | 
    
         
            -
                      require_relative "#{file}"
         
     | 
| 
       20 
     | 
    
         
            -
                    else
         
     | 
| 
       21 
     | 
    
         
            -
                      next
         
     | 
| 
       22 
     | 
    
         
            -
                    end
         
     | 
| 
       23 
     | 
    
         
            -
                    plugin=Jared::Plugin.configuration
         
     | 
| 
       24 
     | 
    
         
            -
                    log.info "Plugin path: #{file}"
         
     | 
| 
       25 
     | 
    
         
            -
                    begin
         
     | 
| 
       26 
     | 
    
         
            -
                      if plugin.name.nil? or plugin.name == ""
         
     | 
| 
       27 
     | 
    
         
            -
                        raise raise ArgumentError, "Plugin Name for #{file.gsub("#{path}", '')} is not defined or is blank!"
         
     | 
| 
       28 
     | 
    
         
            -
                      elsif plugin.command.nil? or plugin.command == ""
         
     | 
| 
       29 
     | 
    
         
            -
                        raise ArgumentError, "Plugin Command for #{file.gsub("#{path}", '')} is not defined or is blank!"
         
     | 
| 
       30 
     | 
    
         
            -
                      elsif plugin.platform.nil? or plugin.platform == ""
         
     | 
| 
       31 
     | 
    
         
            -
                        raise ArgumentError, "Plugin Platform for #{file.gsub("#{path}", '')} is not defined or is blank!"
         
     | 
| 
       32 
     | 
    
         
            -
                      elsif plugin.main_require.nil? or plugin.main_require == ""
         
     | 
| 
       33 
     | 
    
         
            -
                        raise ArgumentError, "Plugin Main_Require for #{file.gsub("#{path}", '')} is not defined or is blank!"
         
     | 
| 
       34 
     | 
    
         
            -
                      end
         
     | 
| 
       35 
     | 
    
         
            -
                    rescue => e
         
     | 
| 
       36 
     | 
    
         
            -
                      log.error e
         
     | 
| 
       37 
     | 
    
         
            -
                      next
         
     | 
| 
       38 
     | 
    
         
            -
                    end
         
     | 
| 
       39 
     | 
    
         
            -
                    count+=1
         
     | 
| 
       40 
     | 
    
         
            -
                    data={
         
     | 
| 
       41 
     | 
    
         
            -
                      dir: file.sub("init.rb",''),
         
     | 
| 
       42 
     | 
    
         
            -
                      name: plugin.name,
         
     | 
| 
       43 
     | 
    
         
            -
                      description: plugin.description,
         
     | 
| 
       44 
     | 
    
         
            -
                      author: plugin.author,
         
     | 
| 
       45 
     | 
    
         
            -
                      author_email: plugin.author_email,
         
     | 
| 
       46 
     | 
    
         
            -
                      homepage: plugin.homepage,
         
     | 
| 
       47 
     | 
    
         
            -
                      sourcecode: plugin.sourcecode,
         
     | 
| 
       48 
     | 
    
         
            -
                      command: plugin.command,
         
     | 
| 
       49 
     | 
    
         
            -
                      arguments: plugin.arguments,
         
     | 
| 
       50 
     | 
    
         
            -
                      usage: plugin.usage,
         
     | 
| 
       51 
     | 
    
         
            -
                      main_require: plugin.main_require,
         
     | 
| 
       52 
     | 
    
         
            -
                      jared_version: plugin.jared_version
         
     | 
| 
       53 
     | 
    
         
            -
                    }
         
     | 
| 
       54 
     | 
    
         
            -
                    if plugin.jared_version == Jared::VERSION && plugin.platform == :ruby
         
     | 
| 
       55 
     | 
    
         
            -
                      a=PLUGINS.add?(data)
         
     | 
| 
       56 
     | 
    
         
            -
                      if a
         
     | 
| 
       57 
     | 
    
         
            -
                        log.info "Loaded: #{plugin.name}"
         
     | 
| 
       58 
     | 
    
         
            -
                      end
         
     | 
| 
       59 
     | 
    
         
            -
                    elsif RUBY_PLATFORM.include?(plugin.platform.to_s)
         
     | 
| 
       60 
     | 
    
         
            -
                      a=PLUGINS.add?(data)
         
     | 
| 
       61 
     | 
    
         
            -
                      if a
         
     | 
| 
       62 
     | 
    
         
            -
                        log.info "Loaded: #{plugin.name}"
         
     | 
| 
       63 
     | 
    
         
            -
                      end
         
     | 
| 
       64 
     | 
    
         
            -
                    else
         
     | 
| 
       65 
     | 
    
         
            -
                      log.warn "Could not load plugin: #{plugin.name}. Reason: Version mismatch."
         
     | 
| 
       66 
     | 
    
         
            -
                    end
         
     | 
| 
       67 
     | 
    
         
            -
                  end
         
     | 
| 
       68 
     | 
    
         
            -
                end
         
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
                def load_core
         
     | 
| 
       71 
     | 
    
         
            -
                  spec=Gem::Specification.find_by_name("jared")
         
     | 
| 
       72 
     | 
    
         
            -
                  load("#{spec.gem_dir}/lib/jared/core/*")
         
     | 
| 
       73 
     | 
    
         
            -
                end
         
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
       75 
     | 
    
         
            -
                def load_all
         
     | 
| 
       76 
     | 
    
         
            -
                  load_core
         
     | 
| 
       77 
     | 
    
         
            -
                  load(PATH)
         
     | 
| 
       78 
     | 
    
         
            -
                  return PLUGINS
         
     | 
| 
       79 
     | 
    
         
            -
                end
         
     | 
| 
       80 
     | 
    
         
            -
              end
         
     | 
| 
       81 
     | 
    
         
            -
             
     | 
| 
       82 
     | 
    
         
            -
              # This class contains code for installing plugins.
         
     | 
| 
       83 
     | 
    
         
            -
              class Get
         
     | 
| 
       84 
     | 
    
         
            -
                include Logg
         
     | 
| 
       85 
     | 
    
         
            -
                def initialize
         
     | 
| 
       86 
     | 
    
         
            -
                end
         
     | 
| 
       87 
     | 
    
         
            -
              end
         
     | 
| 
       88 
     | 
    
         
            -
             
     | 
| 
       89 
     | 
    
         
            -
              class List
         
     | 
| 
       90 
     | 
    
         
            -
                include Logg
         
     | 
| 
       91 
     | 
    
         
            -
              end
         
     | 
| 
       92 
     | 
    
         
            -
            end
         
     | 
    
        data/spec/spec_helper.rb
    DELETED
    
    
    
        data/spec/template.rb
    DELETED
    
    
    
        data/spec/tests/date_spec.rb
    DELETED
    
    
    
        data/spec/tests/greeting_spec.rb
    DELETED
    
    
    
        data/spec/tests/jamendo_spec.rb
    DELETED
    
    | 
         @@ -1,10 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require_relative '../spec_helper'
         
     | 
| 
       2 
     | 
    
         
            -
            require 'jared/helpers/jamendo.rb'
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            describe Helpers do
         
     | 
| 
       5 
     | 
    
         
            -
              it "#jamendo should play media from Jamendo" do
         
     | 
| 
       6 
     | 
    
         
            -
                #Helpers.jamendo('once')
         
     | 
| 
       7 
     | 
    
         
            -
                pending "Don't know how to test Gstreamer."
         
     | 
| 
       8 
     | 
    
         
            -
              end
         
     | 
| 
       9 
     | 
    
         
            -
            end
         
     | 
| 
       10 
     | 
    
         
            -
            puts 'Helpers#jamendo, Not tested.'
         
     | 
    
        data/spec/tests/mail_spec.rb
    DELETED
    
    
    
        data/spec/tests/map_spec.rb
    DELETED
    
    | 
         @@ -1,12 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require_relative '../spec_helper'
         
     | 
| 
       2 
     | 
    
         
            -
            require 'jared/helpers/map.rb'
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            describe Helpers do
         
     | 
| 
       5 
     | 
    
         
            -
              it "#map should respond open a browser to PLACE" do
         
     | 
| 
       6 
     | 
    
         
            -
                a=open("http://maps.google.com/?q=google+ca").read
         
     | 
| 
       7 
     | 
    
         
            -
                if a.include?('google ca')
         
     | 
| 
       8 
     | 
    
         
            -
                else
         
     | 
| 
       9 
     | 
    
         
            -
                  fail
         
     | 
| 
       10 
     | 
    
         
            -
                end
         
     | 
| 
       11 
     | 
    
         
            -
              end
         
     | 
| 
       12 
     | 
    
         
            -
            end
         
     | 
    
        data/spec/tests/player_spec.rb
    DELETED
    
    | 
         @@ -1,10 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require_relative '../spec_helper'
         
     | 
| 
       2 
     | 
    
         
            -
            require 'jared/helpers/player.rb'
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
            describe Helpers do
         
     | 
| 
       5 
     | 
    
         
            -
              it "#player should open green_shoes powered media player (Windows Only)" do
         
     | 
| 
       6 
     | 
    
         
            -
                #Helpers.player
         
     | 
| 
       7 
     | 
    
         
            -
                pending "don't know how to test."
         
     | 
| 
       8 
     | 
    
         
            -
              end
         
     | 
| 
       9 
     | 
    
         
            -
            end
         
     | 
| 
       10 
     | 
    
         
            -
            puts 'Helpers#player, Not tested.'
         
     | 
    
        data/spec/tests/stock_spec.rb
    DELETED