rhack 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/rhack.yml.template +16 -16
- data/lib/generators/rhack/config_generator.rb +11 -0
- data/lib/rhack/clients/base.rb +8 -1
- data/lib/rhack/curl/global.rb +1 -0
- data/lib/rhack/scout.rb +3 -1
- data/lib/rhack/version.rb +1 -1
- data/rhack.gemspec +3 -3
- metadata +9 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c009239c6fbd460ac03d66f1d5c9120625bd444e
|
4
|
+
data.tar.gz: 20a9a3b468d1cb046a5cc8f570e8e5bb4fe3538d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 765f9ad74e11d35c647498eb7e42e6a4a8ba8f15d0a11a1be8e2611b0fb26213b9f8265172c126b4dbeb69c9e26a194b84283f585e6faea1e49c23144164027a
|
7
|
+
data.tar.gz: 08b87a49dde4b46bf372545a348f2f4dfa0d282c55e5c4a1589d9d4ff9a9105315193c1d5926558be1f33522536c0a37b11b74acf8eed3c3a02e252a4ae3922f
|
data/config/rhack.yml.template
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# By default, Scout uses randomly chosen ua (string from specified
|
1
|
+
# By default, Scout uses randomly chosen ua (string from specified file)
|
2
2
|
# for User-Agent header
|
3
3
|
useragents:
|
4
4
|
desktop: config/uas.txt
|
@@ -23,19 +23,19 @@ scout:
|
|
23
23
|
# Defaults to a file @ RAILS_PATH/config/RAILS_ENV.yml
|
24
24
|
# Rhack is intended to use a database only for caching,
|
25
25
|
# so I've came to a conclusion that Redis is the most suitable choice
|
26
|
-
# redis.conf can be generated using `rake redis:config`
|
27
|
-
#
|
28
|
-
db:
|
29
|
-
redis:
|
30
|
-
configfilename: config/redis.conf
|
31
|
-
socket: tmp/sockets/redis.socket
|
32
|
-
pidfile: tmp/pids/redis.pid
|
33
|
-
port: 0
|
34
|
-
hostname: localhost
|
35
|
-
dbfilename: db/redis-dump.rdb
|
36
|
-
db: 0
|
37
|
-
save:
|
38
|
-
# "run BGSAVE every minute if anything have changed"
|
39
|
-
- 60 1
|
40
|
-
# You can change it to whatever you want and just use Redis#bgsave before exit Ruby
|
26
|
+
# redis.conf can be generated using `rake redis:config` from this gem dir
|
27
|
+
# Unomment this block to enable Redis connection
|
28
|
+
#db:
|
29
|
+
# redis:
|
30
|
+
# configfilename: config/redis.conf
|
31
|
+
# socket: tmp/sockets/redis.socket
|
32
|
+
# pidfile: tmp/pids/redis.pid
|
33
|
+
# port: 0
|
34
|
+
# hostname: localhost
|
35
|
+
# dbfilename: db/redis-dump.rdb
|
36
|
+
# db: 0
|
37
|
+
# save:
|
38
|
+
# # "run BGSAVE every minute if anything have changed"
|
39
|
+
# - 60 1
|
40
|
+
# # You can change it to whatever you want and just use Redis#bgsave before exit Ruby
|
41
41
|
|
data/lib/rhack/clients/base.rb
CHANGED
@@ -9,7 +9,14 @@ module RHACK
|
|
9
9
|
attr_accessor :f
|
10
10
|
alias_constant :URI
|
11
11
|
|
12
|
-
def
|
12
|
+
def self.inherited(child)
|
13
|
+
child.class_eval {
|
14
|
+
include RHACK
|
15
|
+
__init__
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize(service=:api, frame=nil, *args)
|
13
20
|
@service = service
|
14
21
|
# first argument should be a string so that frame won't be static
|
15
22
|
@f = frame || Frame(URI(service) || URI(:login), *args)
|
data/lib/rhack/curl/global.rb
CHANGED
data/lib/rhack/scout.rb
CHANGED
@@ -238,14 +238,16 @@ module RHACK
|
|
238
238
|
# в сорцах on_failure не вызывается по коду 0, это какой-то глюк
|
239
239
|
# в любом случае такой поворот не означает ошибки
|
240
240
|
L.warn "Got Curl::Err::CurlOK, response was: #{c.res}"
|
241
|
+
load!
|
241
242
|
else
|
242
|
-
@http.on_complete &Proc::NULL
|
243
243
|
c.outdate!
|
244
244
|
if retry? e
|
245
245
|
L.debug "#{e[0]} -> reloading scout"
|
246
246
|
#load uri, headers, not_redir, relvl, &callback
|
247
247
|
load! # all params including post_body are still set
|
248
|
+
# DO they include `on_complete'?
|
248
249
|
else
|
250
|
+
@http.on_complete &Proc::NULL
|
249
251
|
L.debug "#{e[0]} -> not reloading scout"
|
250
252
|
raise *e if @raise_err
|
251
253
|
end
|
data/lib/rhack/version.rb
CHANGED
data/rhack.gemspec
CHANGED
@@ -17,12 +17,12 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
19
|
spec.add_runtime_dependency "activesupport"
|
20
|
-
spec.add_runtime_dependency "redis"
|
21
|
-
spec.add_runtime_dependency "rmtools", ">=
|
20
|
+
#spec.add_runtime_dependency "redis"
|
21
|
+
spec.add_runtime_dependency "rmtools", ">= 2.3.0"
|
22
22
|
spec.add_runtime_dependency "libxml-ruby"
|
23
23
|
|
24
24
|
spec.extensions << 'ext/curb/extconf.rb'
|
25
25
|
|
26
|
-
spec.add_development_dependency "bundler"
|
26
|
+
spec.add_development_dependency "bundler"
|
27
27
|
spec.add_development_dependency "rake"
|
28
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Baev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -24,34 +24,20 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: redis
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - '>='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - '>='
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rmtools
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - '>='
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
33
|
+
version: 2.3.0
|
48
34
|
type: :runtime
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - '>='
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
40
|
+
version: 2.3.0
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: libxml-ruby
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,16 +56,16 @@ dependencies:
|
|
70
56
|
name: bundler
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- -
|
59
|
+
- - '>='
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
61
|
+
version: '0'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- -
|
66
|
+
- - '>='
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
68
|
+
version: '0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: rake
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,6 +128,7 @@ files:
|
|
142
128
|
- ext/curb/curb_upload.c
|
143
129
|
- ext/curb/curb_upload.h
|
144
130
|
- ext/curb/extconf.rb
|
131
|
+
- lib/generators/rhack/config_generator.rb
|
145
132
|
- lib/rhack.rb
|
146
133
|
- lib/rhack/clients.rb
|
147
134
|
- lib/rhack/clients/base.rb
|