Sha256: a3754d0bdb16da58d2e34883510a97527431045f9191fed79f3206b8a39adf4e

Contents?: true

Size: 1.25 KB

Versions: 3

Compression:

Stored size: 1.25 KB

Contents

gem 'oauth'
require 'oauth'
gem 'json'
require 'json'
gem 'haml', '~>2.0.9'
require 'haml/util'
require 'haml/engine'
gem 'curb'
require 'curb'
require 'logger'

gem 'data_objects', '~>0.9.11'
gem 'dm-core', '~>0.9.10'
gem 'dm-types', '~>0.9.10'
gem 'dm-validations', '~>0.9.10'
gem 'dm-timestamps', '~>0.9.10'
require 'dm-core'
require 'dm-types'
require 'dm-validations'
require 'dm-timestamps'
require 'sinatra/base'

module <%= name.camelize %>
  module Log
    def self.logger
      if @logger.nil?
        @logger        = Logger.new("<%= name %>.log")
        @logger.level  = Logger::INFO 
      end
      @logger
    end
  end

  module OAuth
    def self.consumer
      ::OAuth::Consumer.new(ENV['<%= name.upcase %>_READKEY'],
                            ENV['<%= name.upcase %>_READSECRET'],
                            {:site => 'http://twitter.com'})
    end
  end

  def self.retryable(options = {}, &block)
    opts = { :tries => 1, :on => StandardError }.merge(options)
    retry_exception, retries = opts[:on], opts[:tries]

    begin
      return yield
    rescue retry_exception
      retry if (retries -= 1) > 0
    end
    yield
  end
end

require File.dirname(__FILE__)+'/<%= name %>/models/user'
require File.dirname(__FILE__)+'/<%= name %>/sinatra/app'

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
atmos-singem-0.0.5 lib/generators/twitter/templates/lib/templates.rb.erb
singem-0.0.3 lib/generators/twitter/templates/lib/templates.rb.erb
singem-0.0.4 lib/generators/twitter/templates/lib/templates.rb.erb