Sha256: f5e854da50b469f6a4d488ddb4ea201e7f12120b15cae5f8685b69bd3df18598

Contents?: true

Size: 668 Bytes

Versions: 16

Compression:

Stored size: 668 Bytes

Contents

# encoding: UTF-8

module Vines
  module Command
    class Schema
      def run(opts)
        raise 'vines schema <domain>' unless opts[:args].size == 1
        require opts[:config]
        domain = opts[:args].first
        unless storage = Config.instance.vhost(domain).storage rescue nil
          raise "#{domain} virtual host not found in conf/config.rb"
        end
        unless storage.respond_to?(:create_schema)
          raise "SQL storage not configured for #{domain} virtual host"
        end
        begin
          storage.create_schema
        rescue => e
          raise "Schema creation failed: #{e.message}"
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
lygneo-vines-0.1.5 lib/vines/command/schema.rb
lygneo-vines-0.1.1 lib/vines/command/schema.rb
vines-0.4.10 lib/vines/command/schema.rb
diaspora-vines-0.1.22 lib/vines/command/schema.rb
diaspora-vines-0.1.21 lib/vines/command/schema.rb
diaspora-vines-0.1.2 lib/vines/command/schema.rb
vines-0.4.9 lib/vines/command/schema.rb
vines-0.4.8 lib/vines/command/schema.rb
vines-0.4.7 lib/vines/command/schema.rb
vines-0.4.6 lib/vines/command/schema.rb
vinesmod-0.4.5.2 lib/vines/command/schema.rb
vinesmod-0.4.5 lib/vines/command/schema.rb
vines-0.4.5 lib/vines/command/schema.rb
vines-0.4.4 lib/vines/command/schema.rb
vines-0.4.3 lib/vines/command/schema.rb
vines-0.4.2 lib/vines/command/schema.rb