Sha256: a496275f6d82dfcc4ae7661cd488e3c3f55c6051f03d82116b9a25c4eb058531

Contents?: true

Size: 660 Bytes

Versions: 1

Compression:

Stored size: 660 Bytes

Contents

require 'ppds/config'
require 'ppds/tumblr'
require 'grumblr/ui'
require 'gtk2'

module Grumblr
  IMAGE_ROOT = File.expand_path(File.join(APP_ROOT, '..', 'images'))

  class Core
    attr_accessor :blog

    def initialize
      $app = self

      $cfg = Ppds::Config.new 'grumblr'

      $gui = Grumblr::UI.new
      $gui.show_all

      $api = Ppds::Tumblr.new
      if $api.authenticate($cfg.get(:email), $cfg.get(:password))
        $gui.add Grumblr::Dashboard.new
      else
        $gui.add Grumblr::SettingsFrame.new
      end
    end

    def main
      Gtk::main
    end

    def quit
      Gtk::main_quit
    ensure
      $cfg.save
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
themactep-grumblr-2.0.0 lib/grumblr/core.rb