class Object

Public Instance Methods

determine_access_key_id!() click to toggle source
# File lib/shenzhen/plugins/s3.rb, line 117
def determine_access_key_id!
  @access_key_id ||= ENV['AWS_ACCESS_KEY_ID']
  @access_key_id ||= ask "Access Key ID:"
end
determine_acl!() click to toggle source
# File lib/shenzhen/plugins/s3.rb, line 136
def determine_acl!
  @acl ||= "public_read"
end
determine_app_version!() click to toggle source
# File lib/shenzhen/plugins/fir.rb, line 138
def determine_app_version!
  @app_version ||= ask "App Version:"
end
determine_bucket!() click to toggle source
# File lib/shenzhen/plugins/s3.rb, line 127
def determine_bucket!
  @bucket ||= ENV['S3_BUCKET']
  @bucket ||= ask "S3 Bucket:"
end
determine_configuration!() click to toggle source
# File lib/shenzhen/commands/build.rb, line 188
def determine_configuration!
  configurations = @xcodebuild_info.build_configurations rescue []
  if configurations.nil? or configurations.empty? or configurations.include?("Debug")
    @configuration = "Debug"
  elsif configurations.length == 1
    @configuration = configurations.first
  end

  if @configuration
    say_warning "Configuration was not passed, defaulting to #{@configuration}"
  else
    @configuration = choose "Select a configuration:", *configurations
  end
end
determine_crashlytics_api_token!() click to toggle source
# File lib/shenzhen/plugins/crashlytics.rb, line 75
def determine_crashlytics_api_token!
  @api_token ||= ask "API Token:"
end
determine_crashlytics_build_secret!() click to toggle source
# File lib/shenzhen/plugins/crashlytics.rb, line 79
def determine_crashlytics_build_secret!
  @build_secret ||= ask "Build Secret:"
end
determine_crashlytics_path!() click to toggle source
# File lib/shenzhen/plugins/crashlytics.rb, line 71
def determine_crashlytics_path!
  @crashlytics_path ||= ask "Path to Crashlytics.framework:"
end
determine_deploygate_api_token!() click to toggle source
# File lib/shenzhen/plugins/deploygate.rb, line 90
def determine_deploygate_api_token!
  @api_token ||= ask "API Token:"
end
determine_deploygate_user_name!() click to toggle source
# File lib/shenzhen/plugins/deploygate.rb, line 94
def determine_deploygate_user_name!
  @user_name ||= ask "User Name:"
end
determine_dsym!() click to toggle source
# File lib/shenzhen/commands/distribute.rb, line 13
def determine_dsym!
  dsym_files = Dir['*.dSYM.zip']
  @dsym ||= case dsym_files.length
            when 0 then nil
            when 1 then dsym_files.first
            else
              dsym_files.detect do |dsym|
                File.basename(dsym, ".app.dSYM.zip") == File.basename(@file, ".ipa")
              end or choose "Select a .dSYM.zip file:", *dsym_files
            end
end
determine_file!() click to toggle source
# File lib/shenzhen/commands/distribute.rb, line 3
def determine_file!
  files = Dir['*.ipa']
  @file ||= case files.length
            when 0 then nil
            when 1 then files.first
            else
              @file = choose "Select an .ipa File:", *files
            end
end
determine_fir_app_id!() click to toggle source
# File lib/shenzhen/plugins/fir.rb, line 134
def determine_fir_app_id!
  @app_id ||= ask "App Id:"
end
determine_fir_user_token!() click to toggle source
# File lib/shenzhen/plugins/fir.rb, line 130
def determine_fir_user_token!
  @user_token ||= ask "User Token:"
end
determine_hockeyapp_api_token!() click to toggle source
# File lib/shenzhen/plugins/hockeyapp.rb, line 116
def determine_hockeyapp_api_token!
  @api_token ||= ask "API Token:"
end
determine_host!() click to toggle source
# File lib/shenzhen/plugins/ftp.rb, line 159
def determine_host!
  @host ||= ask "FTP Host:"
end
determine_is_public!() click to toggle source
# File lib/shenzhen/plugins/pgyer.rb, line 131
def determine_is_public!
  @is_public ||= false
end
determine_itunes_connect_account!() click to toggle source
# File lib/shenzhen/plugins/itunesconnect.rb, line 131
def determine_itunes_connect_account!
  @account ||= ask "iTunes Connect account:"
end
determine_itunes_connect_password!() click to toggle source
# File lib/shenzhen/plugins/itunesconnect.rb, line 135
def determine_itunes_connect_password!
  @password ||= password "iTunes Connect password:"
end
determine_notes!() click to toggle source
# File lib/shenzhen/commands/distribute.rb, line 25
def determine_notes!
  placeholder = %{What's new in this release: }

  @notes = ask_editor placeholder
  @notes = nil if @notes == placeholder
end
determine_password!() click to toggle source
# File lib/shenzhen/plugins/ftp.rb, line 176
def determine_password!
  @password ||= password "Password:"
end
determine_pgyer_api_key!() click to toggle source
# File lib/shenzhen/plugins/pgyer.rb, line 119
def determine_pgyer_api_key!
  @api_key ||= ask "API Key:"
end
determine_pgyer_user_key!() click to toggle source
# File lib/shenzhen/plugins/pgyer.rb, line 123
def determine_pgyer_user_key!
  @user_key ||= ask "User Key:"
end
determine_port!(protocol) click to toggle source
# File lib/shenzhen/plugins/ftp.rb, line 163
def determine_port!(protocol)
  @port = case protocol
          when :sftp
            Net::SSH::Transport::Session::DEFAULT_PORT
          else
            Net::FTP::FTP_PORT
          end
end
determine_publish_range!() click to toggle source
# File lib/shenzhen/plugins/pgyer.rb, line 127
def determine_publish_range!
  @publish_range ||= "1"
end
determine_region!() click to toggle source
# File lib/shenzhen/plugins/s3.rb, line 132
def determine_region!
  @region ||= ENV['AWS_REGION']
end
determine_rivierabuild_api_token!() click to toggle source
# File lib/shenzhen/plugins/rivierabuild.rb, line 78
def determine_rivierabuild_api_token!
  @api_token ||= ask "API Key:"
end
determine_scheme!() click to toggle source
# File lib/shenzhen/commands/build.rb, line 178
def determine_scheme!
  say_error "No schemes found in Xcode project or workspace" and abort unless @xcodebuild_info.schemes

  if @xcodebuild_info.schemes.length == 1
    @scheme = @xcodebuild_info.schemes.first
  else
    @scheme = choose "Select a scheme:", *@xcodebuild_info.schemes
  end
end
determine_secret_access_key!() click to toggle source
# File lib/shenzhen/plugins/s3.rb, line 122
def determine_secret_access_key!
  @secret_access_key ||= ENV['AWS_SECRET_ACCESS_KEY']
  @secret_access_key ||= ask "Secret Access Key:"
end
determine_short_version!() click to toggle source
# File lib/shenzhen/plugins/fir.rb, line 142
def determine_short_version!
  @short_version ||= ask "Short Version:"
end
determine_testfairy_api_key!() click to toggle source
# File lib/shenzhen/plugins/testfairy.rb, line 96
def determine_testfairy_api_key!
  @api_key ||= ask "API Key:"
end
determine_user!() click to toggle source
# File lib/shenzhen/plugins/ftp.rb, line 172
def determine_user!
  @user ||= ask "Username:"
end
determine_workspace_or_project!() click to toggle source
# File lib/shenzhen/commands/build.rb, line 156
def determine_workspace_or_project!
  workspaces, projects = Dir["*.xcworkspace"], Dir["*.xcodeproj"]

  if workspaces.empty?
    if projects.empty?
      say_error "No Xcode projects or workspaces found in current directory" and abort
    else
      if projects.length == 1
        @project = projects.first
      else
        @project = choose "Select a project:", *projects
      end
    end
  else
    if workspaces.length == 1
      @workspace = workspaces.first
    else
      @workspace = choose "Select a workspace:", *workspaces
    end
  end
end
validate_xcode_version!() click to toggle source
# File lib/shenzhen/commands/build.rb, line 151
def validate_xcode_version!
  version = Shenzhen::XcodeBuild.version
  say_error "Shenzhen requires Xcode 4 (found #{version}). Please install or switch to the latest Xcode." and abort if version < "4.0.0"
end
watchkit_present?() click to toggle source
# File lib/shenzhen/commands/build.rb, line 203
def watchkit_present?
  Dir["#{@app_path}/**/*.plist"].any? do |plist_path|
    `/usr/libexec/PlistBuddy -c 'Print WKWatchKitApp' '#{plist_path}' 2>&1`.strip == 'true'
  end
end