限制对REMOTE域的操作

时间:2013-09-29 21:09:20

标签: rubygems gem command install switch-statement

我不得不安装gem,建议使用-r switch。如果您使用帮助或谷歌,它会为您提供主题内容。但它真正意味着什么?它限制到远程域的哪种操作?什么是远程域名?下载宝石的那个?

示例:

gem install -r log4r

1 个答案:

答案 0 :(得分:0)

Gems可以从本地文件(remote domain扩展名)安装,也可以从服务器(-l)下载。

默认情况下,它将首先在当前目录中搜索,然后从服务器下载。

您有2个命令行选项来控制它:

-r强制从本地文件

安装

public class XMPPService extends Service { XMPPTCPConnection connection; String USERNAME; String PASSWORD; public XMPPService() { } @Override public int onStartCommand(Intent intent, int flags, int startId) { onHandleIntent(); return START_STICKY; } private void onHandleIntent() { connection = XMPPClient.getConnection(); connection.addConnectionListener( new AbstractConnectionListener() { public void connectionClosed() { Log.i("connection", "closed"); } public void connectionClosedOnError(Exception e) { Log.i("connection", "closed on error"); } public void reconnectionFailed(Exception e) { Log.i("reconnection", "failed"); } public void reconnectionSuccessful() { if (connection.isAuthenticated()) { Log.i("isauthenticauted : ", String.valueOf(connection.isAuthenticated())); Log.i("reconnection", "succesful"); } else { try { connection.login(USERNAME, PASSWORD); } catch (XMPPException e) { e.printStackTrace(); } catch (SmackException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } Log.i("reconnection", "succesful"); } } public void reconnectingIn(int seconds) { Log.i("reconnectingIn", String.valueOf(seconds)); } } ); } @Override public void onCreate() { Log.i("service", "created"); } @Override public IBinder onBind(Intent intent) { // TODO: Return the communication channel to the service. throw new UnsupportedOperationException("Not yet implemented"); } 强行下载