Class: Nimbu::Command::Browse

Inherits:
Base
  • Object
show all
Defined in:
lib/nimbu/command/browse.rb

Overview

open the current site in your browser (simulator, admin)

Instance Attribute Summary

Attributes inherited from Base

#args, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize, namespace, #nimbu

Methods included from Helpers

#action, #ask, #confirm, #confirm_billing, #confirm_command, #create_git_remote, #deprecate, disable_error_capture, #display, #display_header, #display_object, #display_row, #display_table, enable_error_capture, #error, error_with_failure, error_with_failure=, extended, extended_into, #fail, #format_bytes, #format_date, #format_error, #format_with_bang, #get_terminal_environment, #git, #has_git?, #home_directory, #hprint, #hputs, included, included_into, #json_decode, #json_encode, #launchy, #line_formatter, #longest, #output, #output_with_arrow, #output_with_bang, #quantify, #redisplay, #retry_on_exception, #run_command, #running_on_a_mac?, #running_on_windows?, #set_buffer, #shell, #spinner, #status, #string_distance, #styled_array, #styled_error, #styled_hash, #styled_header, #suggestion, #time_ago, #truncate, #with_tty

Methods included from Helpers::System

#browser_launcher, #command?, #osx?, #tmp_dir, #which, #windows?

Constructor Details

This class inherits a constructor from Nimbu::Command::Base

Instance Method Details

#adminObject

browse:admin

open the admin area for your current site



44
45
46
47
48
49
# File 'lib/nimbu/command/browse.rb', line 44

def admin
  cmd = browse_command(args) do
    "https://#{Nimbu::Auth.site}.#{Nimbu::Auth.admin_host}/admin"
  end
  exec(cmd)
end

#indexObject

browse

open the current site in your browser



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/nimbu/command/browse.rb', line 11

def index
  cmd = browse_command(args) do
    dest = args.shift
    dest = nil if dest == '--'

    if dest
      #site = nimbu browser dest
    else
      # $ nimbu browse
      site = Nimbu::Auth.site
    end

    abort "Usage: nimbu browse <SITE>" unless site
    "https://#{site}.#{Nimbu::Auth.admin_host}"
  end
  exec(cmd)
end

#simulatorObject

browse:simulator

open the simulator for your current site



33
34
35
36
37
38
# File 'lib/nimbu/command/browse.rb', line 33

def simulator
  cmd = browse_command(args) do
    "http://localhost:4567"
  end
  exec(cmd)
end