Code Monkey home page Code Monkey logo

bearcat's People

Contributors

blueseason avatar fantasyni avatar paulmillr avatar princ avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bearcat's Issues

All testcase based on bearcat fail after updating from 0.2.37 to 0.3.15

_All testcases say an error:_

TypeError: Cannot read property 'start' of undefined

_error is throw from bearcat.start() in every testcase file_

    before(function(done) {
        bearcat.start(function() {
            done();
        });
    });

_I noticed that the Bearcat.createApp has been changed_

Bearcat.createApp = function(configLocations, opts) {
    if (this.state >= STATE_INITED) {
        return;
    }

_I tried change the code as follow but it fails too._

Bearcat.createApp = function(configLocations, opts) {
    if (this.state >= STATE_INITED) {
        return Bearcat;
    }

_you can use bearcat-dao to test after updating the bearcat_

aop AroundRuntime 没有return

dynamicAopProxy 109行,203行,205行没有 return。导致promise方式的方法调用后无返回值,没办法then

examples里有bug

比如aop_annotation的代码就有问题,这个的beans是否不需要在context.json中定义,而是使用annotation?
还有aop的两个demo,examples/app.js中的car.run是没有的,这个是否需要fix一下?

这个对ES6的class有用吗

现在pomelo、express、浏览器等等都可以愉快的es6了,用class编起来很爽,那么这个bearcat能够管理class吗?

bearcat is not working with cocos2d-js(3.6.1)!

it says there is error in main.js which is generator by bearcat grunt!

i guess the require is changed, so bearcat need change too.

error output:

D/cocos2d-x debug info(23941): script:main.js
D/cocos2d-x debug info(23941): (evaluatedOK == JS_FALSE)

the output above is from follow:

bool ScriptingCore::runScript(const char *path, JS::HandleObject global, JSContext* cx)
{
    if (cx == NULL) {
        cx = _cx;
    }

    compileScript(path,global,cx);
    JS::RootedScript script(cx, getScript(path));
    bool evaluatedOK = false;
    if (script) {
        JS::RootedValue rval(cx);
        JSAutoCompartment ac(cx, global);
        evaluatedOK = JS_ExecuteScript(cx, global, script, &rval);
        if (false == evaluatedOK) {
            cocos2d::log("script:%s", path);
            cocos2d::log("(evaluatedOK == JS_FALSE)");
            JS_ReportPendingException(cx);
        }
    }

    return evaluatedOK;
}

placeholder problem

in bearcat version v0.4.25:

this work:

var Test =function(){
    this.$id = 'test';
    this.test = "${test}";
}   

but this not work:

var Test =function(){
    this.$id = 'test';
    this.test = '${test}';
}   

because FUNC_PROPS_REGEXP_ATTR just match " not '

FUNC_PROPS_REGEXP_ATTR: /\s_this.\w+\s_=\s_"$(.|\s)_?";/g

How to do the unit test with bearcat?

First, there may be a bug in config context.json "scan" property. "scan" cannot resolve the path with ".."

Then, can I do some value injection in context.json. For example, "proj/app" contains all beans, "proj/test", contains many tests including unit tests and integrated tests. I want to use different values in different tests, but I won't create 'conifg' dir in every tests directory. Is there any method I can just inject some value in context.json such as 'mysql.port' in to-do example?

关于 model 和 constraint 问题

在examples 里面的model 文件夹,app.js 第51行 应该会返回一个error 才对呀,为什么没有返回?我测试了下也是没有返回不知道是什么原因,可以解答下么?

[Issue/Feature Request] Bean config in context.json ignored due to 'scan'

Hi,

I noticed today when when using the scan: ['app'] property in context.json to cover most cases of properties and the like of the beans in the application, any beans with custom properties defined in beans: [] section later on are ignored.

Should the beans being the more specific config not take precedence over the general scan? My use case here is wanting to mock out certain things in a test/dev environment vs. a production environment, and be able to call a different module based on the environment (planning to generate the context.json on startup based on env). The mix of scan and beans would allow sane defaults to minimise boilerplate code in cases where the property set is identically named to the bean needed (covered by scan), but cases that need to branch or don't align exactly in name can be set manually.

In the complex-function-annotation example, here's what I'm requesting it to look like where we want both an engine and testEngine, while allowing the rest to be set up using scan automagically:


{
	"name": "complex_function_annotation",
        "scan": ["app"],
	"beans": [{
		"id": "car",
		"func": "./app/car",
		"scope2": "prototype",
		"props": [{
			"name": "$engine",
			"ref": "testEngine"
		}]
	}, {
		"id": "engine",
		"func": "./app/engine"
	}, {
                "id": "testEngine",
                "func": "./app/testEngine"
    }]
}

where wheel and light don't need to be defined in beans explicitly on account of scan. Is this already already possible but not as straightforward as I'm making it out to be? If not, would it be possible to introduce this functionality?

cocos2d-js环境,导入bean失败!

测试环境基于bearcat-cocos2d-js-example。

1,npm install bluebird --save,并修改client.js如下:

require('./bearcat-bootstrap.js');
var Promise = require('bluebird');
var bearcat = require('bearcat'); // 依赖bearcat库
window.bearcat = bearcat; // using browserify to resolve npm modules
window.Promise = Promise; 

cc.game.onStart = function() {
    cc.view.adjustViewPort(true);
    cc.view.setDesignResolutionSize(800, 450, cc.ResolutionPolicy.SHOW_ALL);
    cc.view.resizeWithBrowserSize(true);
    var self = this;
    //load resources
    bearcat.createApp();
    bearcat.use(['helloWorldScene']);
    bearcat.start(function() {
        var resourceUtil = bearcat.getBean('resourceUtil');
        var g_resources = resourceUtil.getResources();
        cc.LoaderScene.preload(g_resources, function() {
            var helloWorldScene = bearcat.getBean('helloWorldScene');
            cc.director.runScene(helloWorldScene.get());
        }, self);
    });

};

2,在bearcat-cocos2d-js-example/app-client目录中添加个testBean.js 如下:

"user strict";

function TestBean () {
    this.$id = "testBean";
    this.$init = "init";
}


TestBean.prototype.init = function () {
}


TestBean.prototype.logonServer = Promise.coroutine(function* () {
    return;
});


bearcat.module(TestBean, typeof module !== 'undefined' ? module : {});

3,grunt命令,Promise.coroutine 这里报错:undefine is not a function.

分析应该是bearcat扫描的时候,var Promise = require('bluebird');不生效

太棒了

感觉核心像游戏里面那个Sprite。我喜欢这种思路。

koa with bearcat not work

hi, i plan to migrate to koa from express.

i write a middleware with bearcat as follow:

bearcat.getRoute("testMiddleware", "auth") //for route
"use strict";


var TestMiddleware = function() {
    this.$id = "testMiddleware";
}


TestMiddleware.prototype.auth =  function* (next) {
    this.checkBody('password', 'Invalid password').notEmpty();
    if (this.errors){
        this.body = this.errors;
        return;
    }
};



module.exports = TestMiddleware;

but this.body is not defined.
i print the this in the auth function. it says that this is TestMiddleware object.

aop 依赖注入bean对象引用报错!!

重现过程:
1,使用官方的例子:bearcat/examples/aop_annotation
在car.js 中删除dyInit 函数。使得该用例能work

2,在Aspect中引用wheel

var Aspect = function() {
        this.$id = "aspect";
        this.$aop = true;
        this.$wheel = null;
}

3,测试该例子报错:
[2015-07-01 16:01:55.499] [ERROR] bearcat - [BeanFactory] circle reference beanName aspect is in creating

4,wheel没有任何对象引用,不存在循环引用。

没有能直接加载json功能吗

比如
var code = {OK: 200, FAIL: 500}
module.exports = code;

不想按例子里要写成 var code = function() {this.OK = 200}, 因为这些code可能在客户端里也要

(0.3.18版本)每个bean都被加载两次。

启动进程,发现每个bean都被加载了2次,以下是一个bean构造函数在进程启动过程中的打印信息

[2015-02-23 20:24:37.934] [INFO] console - Bean:RequireUtil 构造函数
[2015-02-23 20:24:38.016] [INFO] console - Process:master-server-1
[2015-02-23 20:24:38.669] [INFO] console - Bean:RequireUtil 构造函数
[2015-02-23 20:24:38.825] [INFO] console - Process:master-server-1

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.