Module: Strobe

Defined in:
lib/strobe.rb,
lib/strobe/cli.rb,
lib/strobe/key.rb,
lib/strobe/config.rb,
lib/strobe/version.rb,
lib/strobe/cli/main.rb,
lib/strobe/cli/input.rb,
lib/strobe/cli/table.rb,
lib/strobe/cli/users.rb,
lib/strobe/resources.rb,
lib/strobe/cli/ticker.rb,
lib/strobe/collection.rb,
lib/strobe/connection.rb,
lib/strobe/association.rb,
lib/strobe/cli/deploys.rb,
lib/strobe/cli/preview.rb,
lib/strobe/validations.rb,
lib/strobe/cli/settings.rb,
lib/strobe/identity_map.rb,
lib/strobe/resources/me.rb,
lib/strobe/addons/social.rb,
lib/strobe/resource/base.rb,
lib/strobe/resources/team.rb,
lib/strobe/resources/user.rb,
lib/strobe/resources/build.rb,
lib/strobe/middleware/proxy.rb,
lib/strobe/resources/deploy.rb,
lib/strobe/resources/signup.rb,
lib/strobe/middleware/addons.rb,
lib/strobe/resources/account.rb,
lib/strobe/exception_notifier.rb,
lib/strobe/middleware/rewrite.rb,
lib/strobe/resource/singleton.rb,
lib/strobe/cli/deploy_progress.rb,
lib/strobe/resource/collection.rb,
lib/strobe/resources/assignment.rb,
lib/strobe/resources/membership.rb,
lib/strobe/addons/social/twitter.rb,
lib/strobe/resources/application.rb,
lib/strobe/addons/social/facebook.rb,
lib/strobe/resources/platform_install.rb

Defined Under Namespace

Modules: Addons, Middleware, Resource, Resources, Validations Classes: Association, CLI, Collection, Config, Connection, DeployInterrupted, ExceptionNotifier, IdentityMap, InvalidPortError, JSONParseError, Key, NoDeploy, NotifiableError, OutdatedStrobeVersionError, RequestError, ResourceNotFoundError, ServerError, StrobeError, UnauthenticatedError, UnderMaintenanceError, ValidationError

Constant Summary collapse

VERSION =
"0.3.9"

Class Method Summary collapse

Class Method Details

.connectionObject



66
67
68
# File 'lib/strobe.rb', line 66

def self.connection
  @connection
end

.connection=(connection) ⇒ Object



70
71
72
# File 'lib/strobe.rb', line 70

def self.connection=(connection)
  @connection = connection
end

.ruby_digestObject



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/strobe.rb', line 95

def self.ruby_digest
  engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"

  version = case engine
    when "jruby" then JRUBY_VERSION
    when "rbx"   then Rubinius::VERSION
    else              RUBY_VERSION
  end

  platform = defined?(RUBY_PLATFORM) ? RUBY_PLATFORM : "unknown"

  "#{engine}/#{version} (#{platform})"
rescue Exception => e
  # Be cool, don't freak out
  "unknown/0 (unknown)"
end

.user_agentObject



112
113
114
115
# File 'lib/strobe.rb', line 112

def self.user_agent
  type = ENV['RUBY_PACKAGER'] ? 'pkg' : 'cli'
  "strobe-#{type}/#{Strobe::VERSION} #{Strobe.ruby_digest}"
end

.user_homeObject

sadly, copied from Rubygems



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/strobe.rb', line 75

def self.user_home
  unless RUBY_VERSION > '1.9' then
    ['HOME', 'USERPROFILE'].each do |homekey|
      return File.expand_path(ENV[homekey]) if ENV[homekey]
    end

    if ENV['HOMEDRIVE'] && ENV['HOMEPATH'] then
      return File.expand_path("#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}")
    end
  end

  File.expand_path "~"
rescue
  if File::ALT_SEPARATOR then
    "C:/"
  else
    "/"
  end
end