Permalink
...
Comparing changes
Open a pull request
- 3 commits
- 2 files changed
- 0 commit comments
- 1 contributor
Unified
Split
Showing
with
7 additions
and 7 deletions.
- +6 −6 scripts/apt.coffee
- +1 −1 test/apt.coffee
View
12
scripts/apt.coffee
| @@ -1,5 +1,5 @@ | ||
| module.exports = (bot) -> | ||
| - | ||
| + | ||
| bot.regexp /^.apt (.+)/, | ||
| ".apt <paket> -- Najde pakete po imenu na packages.ubuntu.com", | ||
| (match, r) -> | ||
| @@ -16,7 +16,7 @@ module.exports = (bot) -> | ||
| if archname.indexOf("-") == -1 | ||
| arches.push archname | ||
| paketi.push "#{$(paket).text().replace("Package ","")} {#{arches.join(", ")}}" | ||
| - cb paketi.reverse().slice(-10).join "\n" | ||
| + cb paketi.reverse().slice(-5).join "\n" | ||
| else | ||
| cb "Ne najdem" | ||
| @@ -27,15 +27,15 @@ module.exports = (bot) -> | ||
| ".aptf <ime_datoteke> -- Najde pakete po vsebini na packages.ubuntu.com", | ||
| (match, r) -> | ||
| aptf = (paket, cb)=> | ||
| - url = "http://packages.ubuntu.com/search?searchon=contents&keywords=#{encodeURI(paket)}&mode=exactfilename&suite=saucy&arch=any" | ||
| + url = "http://packages.ubuntu.com/search?searchon=contents&keywords=#{encodeURI(paket)}&mode=exactfilename&suite=xenial&arch=any" | ||
| bot.fetchHTML url , ($)-> | ||
| if $? | ||
| paketi = [] | ||
| - for paket in $("td.file") | ||
| + for paket in $("td.file") | ||
| paketi.push [$(paket).text().trim(), $(paket).next().text().trim()].join(" > ") | ||
| - cb paketi.reverse().slice(-10).join "\n" | ||
| + cb paketi.reverse().slice(-5).join "\n" | ||
| else | ||
| cb "Ne najdem" | ||
| aptf match[1].trim(), (answer)-> | ||
| - r.reply answer | ||
| + r.reply answer | ||
View
2
test/apt.coffee
| @@ -17,5 +17,5 @@ describe 'apt.coffee', -> | ||
| it 'test .aptf evp.h', (done)-> | ||
| bot.test ".aptf evp.h", (msg)-> | ||
| expect(msg).to.be.a('string') | ||
| - msg.should.equal '/usr/include/xmlsec1/xmlsec/openssl/evp.h > libxmlsec1-dev\n/usr/include/openssl/evp.h > libssl-dev\n/usr/include/heimdal/hcrypto/evp.h > heimdal-multidev\n/usr/include/hcrypto/evp.h > heimdal-dev' | ||
| + msg.should.equal '/usr/include/xmlsec1/xmlsec/openssl/evp.h > libxmlsec1-dev\n/usr/include/wolfssl/openssl/evp.h > libwolfssl-dev [not ppc64el]\n/usr/include/openssl/evp.h > libssl-dev\n/usr/include/heimdal/hcrypto/evp.h > heimdal-multidev\n/usr/include/cyassl/openssl/evp.h > libwolfssl-dev [not ppc64el]' | ||
| done() | ||