Coder Social home page Coder Social logo

crowdstar / svn-agent-host Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 213 KB

A native messaging host to handle SVN commands received from specific Chrome extension.

License: Apache License 2.0

PHP 96.98% Shell 2.86% Smarty 0.17%
chrome native-messaging native-messaging-host php

svn-agent-host's Introduction

Build Status AppVeyor Build Status Latest Stable Version Latest Unstable Version License

A native messaging host to handle SVN commands received from specific Chrome extension.

The host program is built for Mac and Linux. For Windows users, you may have the host program installed in Ubuntu or some other Linux distribution through the Windows Subsystem for Linux.

This repository was for an internal project at Glu Mobile. We make part of the whole project open source to share our experience on

Run Tests

We use Docker to setup our test environments. You may run unit tests, coding style checks, and other tests on different versions of PHP and Subversion installations (prepared with Docker) using following commands:

PHP_VERSION=7.0    SVN_VERSION=1.8.19 ./bin/ci-on-linux.sh
PHP_VERSION=7.1    SVN_VERSION=1.9.9  ./bin/ci-on-linux.sh
PHP_VERSION=7.2    SVN_VERSION=1.10.3 ./bin/ci-on-linux.sh
PHP_VERSION=7.3    SVN_VERSION=1.11.0 ./bin/ci-on-linux.sh
PHP_VERSION=7.4    SVN_VERSION=1.13.0 ./bin/ci-on-linux.sh
# or, more specifically:
PHP_VERSION=7.1.19 SVN_VERSION=1.10.0 ./bin/ci-on-linux.sh

To run unit tests with current PHP and Subversion installation on your box, just execute following commands directly:

./bin/ci-on-osx.sh

Demo Code

Following demo code shows how to communicate with the native message host from a Chrome extension.

// content.js: a Content Script file.
window.addEventListener(
    "message",
    function (event) {
        chrome.runtime.sendMessage(
            event.data,
            function (response) {
                console.log('response from the background script', response);
            }
        );
    },
    false
);
window.postMessage({action: "create", data: {"path": "path/1"}}, "*");

// background.js: a Background Script file.
chrome.runtime.onMessage.addListener(
    function (request, sender, sendResponse) {
        chrome.runtime.sendNativeMessage(
            'com.glu.crowdstar.svnagent', // name of the native messaging host.
            request,
            function (response) {
                console.log("response from the native messaging host: ", response);
                // sendResponse(response);
            }
        );

        return true;
    }
);

svn-agent-host's People

Contributors

deminy avatar

Watchers

 avatar  avatar

svn-agent-host's Issues

Run Tests Without Docker

Refactor the project allowing to easily run tests without Docker.

The host program could run in MacOS and we need to be able to run tests directly under MacOS.

Accept SSL Server Certificates with Failures

Some remote SVN repositories return error messages like following back:

Error: svn: E170013: Unable to connect to a repository at URL 'https://example.com/path'
svn: E230001: Server SSL certificate verification failed: issuer is not trusted

Please add an optional option allowing to accept SSL server certificates with failures. By default SSL server certificates must be valid.

Run Tests in AppVeyor

Allow to run unit tests in Appveyor.

We should be able to run unit tests for most classes/methods that don't deal with Subversion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.