如何在我的项目中设置.npmrc文件,我可以在其中定义自己的私有注册表?我不想在我的用户配置.npmrc中进行这种配置.每个其他开发人员都应该能够只git clone运行项目并运行npm install.
这是我到目前为止:
// .npmrc
registry=https://npm.fury.io/AUTH_TOKEN/me/
// package.json:
{
"name": "webapp",
"description": "",
"version": "1.0.0",
"private": true,
"dependencies": {
"jquery": "1.2.3",
"myPrivateLibFromNpmFury": "0.0.4"
}
}
Run Code Online (Sandbox Code Playgroud)
npm install myPrivateLibFromNpmFury
回报
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/myPrivateLibFromNpmFury
我有这个问题
activerecord:
notices:
messages:
success:
create: "Something was created"
models:
user:
success:
create: "Thanks for registration"
I18n.t("activerecord.notices.models.user.success.create")
# => "Thanks for registration"
I18n.t("activerecord.notices.models.book.success.create")
# => "translation missing: de, activerecord, notices, models, book, success, create"
Run Code Online (Sandbox Code Playgroud)
我不知道为什么书模型没有得到后备按摩.我已经定了config.i18n.fallbacks = true.我正在使用Rails 3
fallback ruby-on-rails internationalization ruby-on-rails-3 rails-i18n
嘿,我正在寻找这个问题的干净解决方案:

我i = 0在第二个循环步骤中开始循环i = 1,然后i = -1然后等i = 2.
如何用for干净的方式编程这个?
是否可以使用不同的键来获得相同的值?
[activerecord, activemodel]: 'test'
Run Code Online (Sandbox Code Playgroud)
我期望与此相同的结果:
activerecord: 'test'
activemodel: 'test'
Run Code Online (Sandbox Code Playgroud) 嘿,我需要一种从我的专栏中获取格式化数字的方法 decimal(23,2) NOT NULL DEFAULT '0.00'
在PHP我可以使用number_format('1111.00', 2, ',', '.');
它将返回的这个函数1.111,00(在德国我们使用,以定义十进制数字)
我将如何在mysql中执行此操作?用字符串替换?
我想实时代理在其他环境中运行的测试结果.
这是我想要实现的一些伪代码:
var test = proxy.getCurrentTest();
// => {slow: 200, timeout: 2000, duration: 235, result: 'error'};
var tmpIt = it('test1', function(){
this.slow(test.slow);
this.timeout(test.timeout);
});
tmpIt.close({
duration: test.duration,
result: test.result
});
// this should make this test red in the output,
// because the `result` is not 'success'
Run Code Online (Sandbox Code Playgroud)
无论如何可以设置测试的结果和持续时间而不"真正"运行它?并将所有可视摩卡输出到终端?
编辑:这个问题不是关于如何将带有子进程的测试结果的变量传递给主进程.它已经为我工作了.
$ npm install
my_module@0.0.1 /Users/antpaw/my_module
??? my_module@0.0.1
??? UNMET PEER DEPENDENCY request@^2.74.0
npm WARN my_module@0.0.1 requires a peer of request@^2.74.0 but none was installed.
Run Code Online (Sandbox Code Playgroud)
我不明白这怎么可能只是一个警告.如果"请求"未安装且我的应用程序崩溃,对我的应用程序来说这是一个非常大的交易.
我怎样才能让npm install一个退出1如果对等的依赖是未满足或者是有什么样npm do-i-have-everything-i-need-installed的命令,将与退出1?
嘿我玩了bundler一些宝石,现在我不能再使用rake了
如果我做一个简单的db:migrate我得到这个错误:
mac:app antpaw$ rake db:migrate
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:335:in `bin_path': can't find executable rake for rake-0.8.7 (Gem::Exception)
from <internal:gem_prelude>:282:in `method_missing'
from /usr/local/bin/rake:19:in `<main>'
Run Code Online (Sandbox Code Playgroud)
但如果我这样做,就会列出佣金gem list.我使用rails 3.0.0beta4,bundler 1.0.0.beta.5和ruby 1.9.2dev.
编辑发布了我的 export
mac:trickpipe antpaw$ export
declare -x Apple_PubSub_Socket_Render="/tmp/launch-2GMaKT/Render"
declare -x COMMAND_MODE="unix2003"
declare -x DISPLAY="/tmp/launch-5RguhF/:0"
declare -x HOME="/Users/antpaw"
declare -x LC_CTYPE="UTF-8"
declare -x LOGNAME="antpaw"
declare -x OLDPWD="/Users/antpaw"
declare -x PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin"
declare -x PWD="/Volumes/Work HD/localhost/trickpipe"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_AUTH_SOCK="/tmp/launch-N13Ivn/Listeners"
declare -x TERM="xterm-color"
declare -x TERM_PROGRAM="Apple_Terminal" …Run Code Online (Sandbox Code Playgroud) 我的开发数据库是SQLite,但我将我的应用程序部署到Heroku,他们正在使用PostgreSQL.
现在,如果我执行搜索,有时会出现两个不同的结果,因为PostgreSQL区分大小写,但SQLite不是.
Rails不应该标准化这些东西吗?我应该用什么方法来解决这个问题?
我如何通过arrray键对此数组进行排序
array(
4 => 'four',
3 => 'three',
2 => 'two',
1 => 'one',
)
Run Code Online (Sandbox Code Playgroud)
像这样
array(
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
)
Run Code Online (Sandbox Code Playgroud) javascript ×4
node.js ×3
arrays ×2
npm ×2
php ×2
fallback ×1
for-loop ×1
key ×1
loops ×1
mocha.js ×1
mysql ×1
postgresql ×1
rails-i18n ×1
rake ×1
ruby ×1
rubygems ×1
sorting ×1
sql-like ×1
unit-testing ×1
yaml ×1