rbitter 0.1.2-java → 0.2.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 157a4cd2b13330fa06547688fc8cce5d22c30670
4
- data.tar.gz: d12d38c95d8fd84047cb6b3ee2805dde1d0cd7af
3
+ metadata.gz: 5c9c0ff087a6aacd028509c314aaefcbbf58dd36
4
+ data.tar.gz: 920cd1f50bf68313d4c53bc63ce702d94eec3e44
5
5
  SHA512:
6
- metadata.gz: fbd300e20e5fdf8e711c3fdb38552d144552f7e84898a3274363de2267e9643dca13ddf888c1b8163b384c67de959839f00acc08db27568cdb962a280ffbf559
7
- data.tar.gz: 2095fe34daf61fa83bfaa6fd1d276a24bf0e917591adbb0ea78c08788a8428fb4fa00200222236cadf3793b72beca9c5b00a05e63d27c1b25f94ad8e6d1d6d8b
6
+ metadata.gz: 234b2fddc686b01706d92146da6230d0c45f323bf0dd75447522f71f5543e21bc6afe2bf4ad98865d1524802e54aef9e7671d15abc2ea5b4f5198054dc0f9af2
7
+ data.tar.gz: 7d11d501b9f3fcb2b5f78a76d4c3c1f197e0562aca9e59cdcfdbd0c54f16bed0c6c673c6b4d96af0c7abb6dd09b9eb9ea64ee596bd359738912a10eb86fef3c4
data/.gitignore CHANGED
@@ -17,5 +17,6 @@ mkmf.log
17
17
  *.gem
18
18
  *.json
19
19
  *.sqlite
20
+ *.png
20
21
  .rbitter
21
22
  .rbitter/*
data/README.md CHANGED
@@ -30,6 +30,11 @@ Put your customized config.json to one of below locations.
30
30
  1. ./config.json (current folder)
31
31
  2. ./.rbitter/config.json (current folder)
32
32
 
33
+ ### XMLRPC handlers ###
34
+ To get XMLRPC handlers, visit [Rbitter XMLRPC](https://github.com/nidev/rbitter-rpchandles).
35
+
36
+ You can find the document to write your own XMLRPC handler.
37
+
33
38
  ## Set up and run ##
34
39
  With config.json,
35
40
 
@@ -42,9 +47,6 @@ With config.json,
42
47
  ```bash
43
48
  $ rbitter serve
44
49
  ```
45
- ## XMLRPC API ##
46
-
47
- See XMLRPC.md
48
50
 
49
51
  ## TODO ##
50
52
  * Streaming Client
@@ -15,10 +15,16 @@ module Rbitter
15
15
  LOG_NORMAL = 0
16
16
  LOG_INIT = 1
17
17
  LOG_HALT = 2
18
+ LOG_ERROR = 4
18
19
 
19
20
  def initialize(xmlrpcd_class = Rbitter::RPCServer)
20
21
  @xmlrpcd_class = xmlrpcd_class
22
+ @dt = DLThread.new(
23
+ Rbitter['media_downloader']['download_dir'],
24
+ Rbitter['media_downloader']['large_image'])
25
+ end
21
26
 
27
+ def arsupport_init
22
28
  ARSupport.connect_database
23
29
 
24
30
  if not ARSupport.prepared?
@@ -31,10 +37,10 @@ module Rbitter
31
37
  end
32
38
 
33
39
  ARSupport.update_database_scheme
40
+ end
34
41
 
35
- @dt = DLThread.new(
36
- Rbitter['media_downloader']['download_dir'],
37
- Rbitter['media_downloader']['large_image'])
42
+ def arsupport_halt
43
+ ARSupport.disconnect_database
38
44
  end
39
45
 
40
46
  def xmlrpcd_start
@@ -72,21 +78,38 @@ module Rbitter
72
78
  :fav_count => 0})
73
79
  end
74
80
 
75
- def write_init_marker
81
+ def mark_init
76
82
  mark(LOG_INIT, "Archiving service started")
77
83
  end
78
84
 
79
- def write_halt_marker
85
+ def mark_halt
80
86
  mark(LOG_HALT, "Archiving service halted")
81
87
  end
82
88
 
89
+ def mark_error(exception_string, err_msg)
90
+ mark(LOG_ERROR, "Errored (#{exception_string}, #{err_msg}")
91
+ end
92
+
93
+ def resurrect_loop?
94
+ if Rbitter.env['twitter']['connection']['reconnect']
95
+ puts "[rbitter] Try to reconnect..."
96
+ sleep Rbitter.env['twitter']['connection']['timeout_secs']
97
+ true
98
+ else
99
+ puts "[rbitter] Give up!"
100
+ false
101
+ end
102
+ end
103
+
83
104
  def main_loop(streaming_adapter = Rbitter::StreamClient)
84
105
  xmlrpcd_start if Rbitter['xmlrpc']['enable']
85
106
 
107
+ arsupport_init
108
+
86
109
  begin
87
- write_init_marker
110
+ mark_init
88
111
 
89
- streaming_adapter.new(Rbitter['twitter'].dup).run { |a|
112
+ streaming_adapter.new(Rbitter['twitter']).run { |a|
90
113
  @dt << a['media_urls']
91
114
 
92
115
  record = Record.find_or_initialize_by(tweetid: a['tweetid'])
@@ -106,25 +129,37 @@ module Rbitter
106
129
  rescue Interrupt => e
107
130
  puts ""
108
131
  puts "Interrupted..."
132
+ mark_error(e.to_s, "(exit) SIGINT - interrupted by user")
109
133
  rescue Twitter::Error::Unauthorized => e
110
134
  warn "Twitter access unauthorized:"
111
135
  warn " Possible solutions"
112
136
  warn " 1. Configure Twitter token on config.json"
113
137
  warn " 2. Check system time (Time is important on authentication)"
114
138
  warn " 3. Check Twitter account status"
115
- rescue Twitter::Error::ServerError, Resolv::ResolvError => e
116
- puts "Service unavailable now. Retry in 5 second..."
117
- sleep 5
118
- retry
139
+ rescue Twitter::Error::ServerError => e
140
+ puts "Service unavailable now. Retry in 5 seconds..."
141
+ mark_error(e.to_s, "(retry) Twitter server unavailable / Timeout")
142
+
143
+ retry if resurrect_loop?
144
+ rescue Resolv::ResolvError, Errno::ECONNABORTED,
145
+ Errno::ECONNREFUSED, Errno::ECONNRESET => e
146
+ puts "Network problem. Retry in 5 seconds..."
147
+ mark_error(e.to_s, "(retry) Network problem")
148
+
149
+ retry if resurrect_loop?
119
150
  rescue Twitter::Error => e
120
151
  warn "Twitter Error: #{e.inspect}"
121
- warn "Main loop of ArcServer halted."
152
+ warn "Rbitter halts due to Twitter::Error"
153
+ mark_error(e.to_s, "(exit) Twitter Error")
122
154
  ensure
123
155
  xmlrpcd_stop if Rbitter['xmlrpc']['enable']
124
156
  @dt.job_cleanup
125
157
 
126
- write_halt_marker
158
+ mark_halt
127
159
  end
160
+
161
+ arsupport_halt
128
162
  end
163
+
129
164
  end
130
165
  end
@@ -5,7 +5,11 @@ module Rbitter
5
5
  "consumer_key": "",
6
6
  "consumer_secret": "",
7
7
  "access_token": "",
8
- "access_token_secret": ""
8
+ "access_token_secret": "",
9
+ "connection": {
10
+ "reconnect": true,
11
+ "timeout_secs": 5
12
+ }
9
13
  },
10
14
  "activerecord": "sqlite3",
11
15
  "sqlite3": {
data/lib/rbitter/env.rb CHANGED
@@ -1,11 +1,13 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require "json"
4
+ require "rbitter/default/config_json"
4
5
 
5
6
  module Rbitter
6
7
  @@env = Hash.new
7
8
 
8
9
  class ConfigFileError < StandardError; end
10
+ class MissingFieldError < StandardError; end
9
11
 
10
12
  def self.[](k)
11
13
  @@env[k]
@@ -20,9 +22,60 @@ module Rbitter
20
22
  @@env.clear
21
23
  end
22
24
 
23
- def env_validate?
24
- # TODO: Add validator
25
- true
25
+ def env_listfields hash
26
+ path_stack = ['']
27
+ generated = []
28
+
29
+ until path_stack.empty?
30
+ path = path_stack.pop
31
+
32
+ if path == ''
33
+ o = hash
34
+ else
35
+ nodes = path.strip.split('->')
36
+ o = hash
37
+ until nodes.empty?
38
+ o = o[nodes.shift]
39
+ end
40
+ end
41
+
42
+ o.each_key { |k|
43
+ if o[k].is_a?(Hash)
44
+ path_stack << "#{k}" if path.empty?
45
+ path_stack << path + "->#{k}" unless path.empty?
46
+ else
47
+ generated << "#{k}" if path.empty?
48
+ generated << path + "->#{k}" unless path.empty?
49
+ end
50
+ }
51
+ end
52
+
53
+ generated
54
+ end
55
+
56
+ def env_valid?
57
+ defaults = env_listfields(JSON.parse(DEFAULT_CONFIG_JSON))
58
+ currents = env_listfields(@@env)
59
+ not_errored = true
60
+
61
+ # Cross checking (2 phases)
62
+ # In current exists, default does not: redundant configuration
63
+ # Level: warning since it is not utilized at all.
64
+ currents.each { |conf|
65
+ unless defaults.include?(conf)
66
+ warn "[config.json] Unused config: #{conf}. You can safely remove it."
67
+ end
68
+ }
69
+
70
+ # In default exists, current does not: missing configuration
71
+ # Level: error and program should stop. (return false for this)
72
+ defaults.each { |conf|
73
+ unless currents.include?(conf)
74
+ warn "[config.json] Config not found: #{conf}. Invalid configuration!"
75
+ not_errored = false
76
+ end
77
+ }
78
+ not_errored
26
79
  end
27
80
 
28
81
  def config_initialize json_path=nil
@@ -34,7 +87,7 @@ module Rbitter
34
87
  @@env = JSON.parse(file.read)
35
88
  }
36
89
 
37
- return @@env if env_validate?
90
+ return @@env if env_valid?
38
91
  fail StandardError, "Invalid configuration"
39
92
  rescue => e
40
93
  fail ConfigFileError, "Load Failure (#{json_path}): #{e.to_s}"
@@ -52,11 +105,12 @@ module Rbitter
52
105
  open(location, 'r') { |file|
53
106
  @@env = JSON.parse(file.read)
54
107
  }
55
- break if env_validate?
108
+ break unless @@env.empty?
56
109
  end
57
110
 
58
- if @@env.empty?
59
- fail ConfigFileError, "Can not load any configuration in [#{locations.join(', ')}]"
60
- end
111
+ fail ConfigFileError, "No config.json on #{locations.join(' or ')}" if @@env.empty?
112
+ fail ConfigFileError, "Configuration outdated. Please see above messages to update it" if not env_valid?
113
+
114
+ puts "[config.json] Loaded configuration is valid. good to go!"
61
115
  end
62
116
  end
@@ -0,0 +1,8 @@
1
+ # encoding: utf-8
2
+ require 'socket'
3
+
4
+ class Socket
5
+ def self.ip_address_list
6
+ fail NotImplementedError
7
+ end
8
+ end
@@ -0,0 +1,47 @@
1
+ =begin
2
+ This module gives special workarounds for some issues.
3
+
4
+ Problems are bypassed by monkey-patching.
5
+
6
+ As soon as a problem is resolved, patch should be removed.
7
+
8
+ **** Known issues ****
9
+
10
+ 1. gem/twitter
11
+ Location : override/gem/twitter/connection.rb
12
+ Maintain : until below issue is fixed
13
+ Reference: https://github.com/sferik/twitter/pull/669
14
+
15
+ Gem 'twitter' does not handle streaming timeout. By applying this,
16
+ reading timeout works and Rbitter can handle timeouts.
17
+
18
+ 2. gem/rubysl-socket
19
+ Location : override/gem/rubysl-socket/socket.rb
20
+ Maintain : until ip_address_list is implemented
21
+ Reference: https://github.com/rubysl/rubysl-socket/pull/9
22
+
23
+ With ipv6 environment, Resolv#use_ipv6? (in rubysl-resolv gem) checks
24
+ Socket.ip_address_list. This is not implemented at all with rubysl-socket-2.0.1.
25
+ NoMethodError exception is raised instead of NotImplementedError.
26
+
27
+ By applying this, Socket.ip_address_list is implemented and the method throws
28
+ NotImplementedError exception.
29
+
30
+ =end
31
+
32
+ def gem_twitter_patcher
33
+ require 'rbitter/override/gems/twitter/connection'
34
+ end
35
+
36
+ if Twitter::Version.const_defined?(:MAJOR)
37
+ b5_version = Twitter::Version::MAJOR * 10000
38
+ + Twitter::Version::MINOR * 100 + Twitter::Version::PATCH
39
+ gem_twitter_patcher if b5_version <= 51400
40
+ else
41
+ b6_version = Twitter::Version.to_a
42
+ if b6_version[0] <= 6 and b6_version[1] <= 0 and b6_version[2] <= 0
43
+ gem_twitter_patcher
44
+ end
45
+ end
46
+
47
+ require 'rbitter/override/gems/rubysl-socket/socket' if RUBY_ENGINE == 'rbx'
@@ -63,6 +63,12 @@ module ARSupport
63
63
  end
64
64
  end
65
65
 
66
+ def disconnect_database
67
+ if ActiveRecord::Base.connected?
68
+ ActiveRecord::Base.connection.close
69
+ end
70
+ end
71
+
66
72
  def update_database_scheme
67
73
  current_version = ActiveRecord::Migrator.current_version
68
74
  if current_version < SCHEME_VERSION
@@ -1,6 +1,6 @@
1
1
  module Rbitter
2
2
  PRODUCT_NAME = "Rbitter"
3
- VERSION = "0.1.2"
3
+ VERSION = "0.2.0"
4
4
 
5
5
  def major
6
6
  VERSION.match(/^([0-9]+)\./)[1]
data/lib/rbitter.rb CHANGED
@@ -6,6 +6,7 @@ require "rbitter/arcserver"
6
6
  require "rbitter/env"
7
7
  require "rbitter/console"
8
8
  require "rbitter/xmlrpc"
9
+ require "rbitter/override"
9
10
 
10
11
  module Rbitter
11
12
  BOOTSTRAP_ARGS = ['configure', 'console', 'help', 'logs', 'serve']
@@ -26,29 +27,6 @@ module Rbitter
26
27
  puts "`- logs : Show Rbitter internal logs"
27
28
  end
28
29
 
29
- def self.prebootstrap
30
- # Due to stalled socket problem, If unpatched twitter gem is installed.
31
- # Twitter::Streaming::Connection will be monkey-patched.
32
- patch_required = false
33
-
34
- if Twitter::Version.const_defined?(:MAJOR)
35
- b5_version = Twitter::Version::MAJOR * 10000
36
- + Twitter::Version::MINOR * 100 + Twitter::Version::PATCH
37
- if b5_version <= 51400
38
- warn "[rbitter] Monkey-patching Twitter::Streaming::Connection"
39
- warn "[rbitter] Please upgrade twitter gem to apply streaming read timeout"
40
- patch_required = true
41
- end
42
- else
43
- b6_version = Twitter::Version.to_a
44
- if b6_version[0] <= 6 and b6_version[1] <= 0 and b6_version[2] <= 0
45
- patch_required = true
46
- end
47
- end
48
-
49
- require "rbitter/libtwitter_connection_override" if patch_required
50
- end
51
-
52
30
  def self.bootstrap_configs
53
31
  require "rbitter/default/config_json"
54
32
 
@@ -61,8 +39,6 @@ module Rbitter
61
39
  return nil if args.length < 1
62
40
 
63
41
  if args[0] == "serve"
64
- prebootstrap
65
-
66
42
  Rbitter.config_initialize
67
43
 
68
44
  archive_server = Rbitter::ArcServer.new
@@ -53,10 +53,24 @@ describe Rbitter do
53
53
  end
54
54
  end
55
55
 
56
- context 'when env_validator validates loaded configuration' do
57
- # TODO: Perform test with spec/config/default.json
58
- # TODO: Adding configuration validator on env.rb
59
- end
56
+ context "when 'env_valid?' validates loaded configuration" do
57
+ before(:all) do
58
+ Rbitter.bootstrap(['configure'])
59
+ expect(File.file?('config.json')).to be(true)
60
+ end
61
+
62
+ it 'gets \'false\' for empty configuration' do
63
+ Rbitter.env_reset
64
+ expect(Rbitter.env_valid?).to be(false)
65
+ end
60
66
 
61
- # TODO: Perform test with spec/config/default.json
67
+ it "gets \'true\' with default and another default" do
68
+ Rbitter.config_initialize
69
+ expect(Rbitter.env_valid?).to be(true)
70
+ end
71
+
72
+ after(:all) do
73
+ File.delete('config.json')
74
+ end
75
+ end
62
76
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require "rbitter/libtwitter_connection_override"
2
+ require "rbitter/override/gems/twitter/connection"
3
3
 
4
4
  describe Rbitter do
5
5
  it 'overrides twitter gem' do
data/spec/rbitter_spec.rb CHANGED
@@ -22,10 +22,6 @@ describe Rbitter do
22
22
  Rbitter.bootstrap(['configure'])
23
23
  end
24
24
 
25
- it 'executes prebootstrap properly' do
26
- Rbitter.prebootstrap
27
- end
28
-
29
25
  it 'bootstraps nothing when empty ARGV is given' do
30
26
  Rbitter.bootstrap([])
31
27
  end
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: java
6
6
  authors:
7
7
  - Nidev Plontra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-17 00:00:00.000000000 Z
11
+ date: 2015-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ~>
17
17
  - !ruby/object:Gem::Version
18
18
  version: '5.14'
19
19
  name: twitter
@@ -21,13 +21,13 @@ dependencies:
21
21
  type: :runtime
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '5.14'
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - "~>"
30
+ - - ~>
31
31
  - !ruby/object:Gem::Version
32
32
  version: '1.7'
33
33
  name: json
@@ -35,13 +35,13 @@ dependencies:
35
35
  type: :runtime
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.7'
41
41
  - !ruby/object:Gem::Dependency
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ~>
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0.7'
47
47
  name: ripl
@@ -49,13 +49,13 @@ dependencies:
49
49
  type: :runtime
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.7'
55
55
  - !ruby/object:Gem::Dependency
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - "~>"
58
+ - - ~>
59
59
  - !ruby/object:Gem::Version
60
60
  version: '4.0'
61
61
  name: activerecord
@@ -63,13 +63,13 @@ dependencies:
63
63
  type: :runtime
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '4.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ~>
73
73
  - !ruby/object:Gem::Version
74
74
  version: '1.3'
75
75
  name: activerecord-jdbc-adapter
@@ -77,13 +77,13 @@ dependencies:
77
77
  type: :runtime
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  requirement: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - "~>"
86
+ - - ~>
87
87
  - !ruby/object:Gem::Version
88
88
  version: '3.8'
89
89
  name: jdbc-sqlite3
@@ -91,13 +91,13 @@ dependencies:
91
91
  type: :runtime
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.8'
97
97
  - !ruby/object:Gem::Dependency
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - "~>"
100
+ - - ~>
101
101
  - !ruby/object:Gem::Version
102
102
  version: '5.1'
103
103
  name: jdbc-mysql
@@ -105,13 +105,13 @@ dependencies:
105
105
  type: :runtime
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: '5.1'
111
111
  - !ruby/object:Gem::Dependency
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - "~>"
114
+ - - ~>
115
115
  - !ruby/object:Gem::Version
116
116
  version: '1.3'
117
117
  name: activerecord-jdbcsqlite3-adapter
@@ -119,13 +119,13 @@ dependencies:
119
119
  type: :runtime
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ~>
123
123
  - !ruby/object:Gem::Version
124
124
  version: '1.3'
125
125
  - !ruby/object:Gem::Dependency
126
126
  requirement: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - "~>"
128
+ - - ~>
129
129
  - !ruby/object:Gem::Version
130
130
  version: '1.3'
131
131
  name: activerecord-jdbcmysql-adapter
@@ -133,13 +133,13 @@ dependencies:
133
133
  type: :runtime
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ~>
137
137
  - !ruby/object:Gem::Version
138
138
  version: '1.3'
139
139
  - !ruby/object:Gem::Dependency
140
140
  requirement: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - "~>"
142
+ - - ~>
143
143
  - !ruby/object:Gem::Version
144
144
  version: '1.6'
145
145
  name: bundler
@@ -147,13 +147,13 @@ dependencies:
147
147
  type: :development
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ~>
151
151
  - !ruby/object:Gem::Version
152
152
  version: '1.6'
153
153
  - !ruby/object:Gem::Dependency
154
154
  requirement: !ruby/object:Gem::Requirement
155
155
  requirements:
156
- - - "~>"
156
+ - - ~>
157
157
  - !ruby/object:Gem::Version
158
158
  version: '10.0'
159
159
  name: rake
@@ -161,7 +161,7 @@ dependencies:
161
161
  type: :development
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - ~>
165
165
  - !ruby/object:Gem::Version
166
166
  version: '10.0'
167
167
  description: Rbitter archives all tweets appeared on user streaming using ActiveRecord. XMLRPC is used to serve archived tweets and useful features
@@ -172,14 +172,13 @@ executables:
172
172
  extensions: []
173
173
  extra_rdoc_files: []
174
174
  files:
175
- - ".gitignore"
176
- - ".rspec"
177
- - ".travis.yml"
175
+ - .gitignore
176
+ - .rspec
177
+ - .travis.yml
178
178
  - Gemfile
179
179
  - LICENSE.txt
180
180
  - README.md
181
181
  - Rakefile
182
- - XMLRPC.md
183
182
  - bin/rbitter
184
183
  - lib/rbitter.rb
185
184
  - lib/rbitter/arcserver.rb
@@ -187,7 +186,9 @@ files:
187
186
  - lib/rbitter/default/config_json.rb
188
187
  - lib/rbitter/dlthread.rb
189
188
  - lib/rbitter/env.rb
190
- - lib/rbitter/libtwitter_connection_override.rb
189
+ - lib/rbitter/override.rb
190
+ - lib/rbitter/override/gems/rubysl-socket/socket.rb
191
+ - lib/rbitter/override/gems/twitter/connection.rb
191
192
  - lib/rbitter/records.rb
192
193
  - lib/rbitter/records_migrate/.keep
193
194
  - lib/rbitter/records_migrate/20150327_add_index.rb
@@ -207,7 +208,8 @@ files:
207
208
  - spec/rbitter/default/config_json_spec.rb
208
209
  - spec/rbitter/dlthread_spec.rb
209
210
  - spec/rbitter/env_spec.rb
210
- - spec/rbitter/libtwitter_connection_override_spec.rb
211
+ - spec/rbitter/override/gems/rubysl-socket/socket_spec.rb
212
+ - spec/rbitter/override/gems/twitter/connection_spec.rb
211
213
  - spec/rbitter/records_spec.rb
212
214
  - spec/rbitter/streaming_spec.rb
213
215
  - spec/rbitter/version_spec.rb
@@ -229,17 +231,17 @@ require_paths:
229
231
  - lib
230
232
  required_ruby_version: !ruby/object:Gem::Requirement
231
233
  requirements:
232
- - - ">="
234
+ - - '>='
233
235
  - !ruby/object:Gem::Version
234
236
  version: '0'
235
237
  required_rubygems_version: !ruby/object:Gem::Requirement
236
238
  requirements:
237
- - - ">="
239
+ - - '>='
238
240
  - !ruby/object:Gem::Version
239
241
  version: '0'
240
242
  requirements: []
241
243
  rubyforge_project:
242
- rubygems_version: 2.4.5
244
+ rubygems_version: 2.4.6
243
245
  signing_key:
244
246
  specification_version: 4
245
247
  summary: Rbitter is a Twitter client specialized in archiving
@@ -251,7 +253,8 @@ test_files:
251
253
  - spec/rbitter/default/config_json_spec.rb
252
254
  - spec/rbitter/dlthread_spec.rb
253
255
  - spec/rbitter/env_spec.rb
254
- - spec/rbitter/libtwitter_connection_override_spec.rb
256
+ - spec/rbitter/override/gems/rubysl-socket/socket_spec.rb
257
+ - spec/rbitter/override/gems/twitter/connection_spec.rb
255
258
  - spec/rbitter/records_spec.rb
256
259
  - spec/rbitter/streaming_spec.rb
257
260
  - spec/rbitter/version_spec.rb
data/XMLRPC.md DELETED
@@ -1,19 +0,0 @@
1
- # What is RPC handle ? #
2
- ## Commands ##
3
- ### Authentication ###
4
- ### Revoke Authentication Token ###
5
- ### Echo ###
6
- ### Last Active ###
7
- ### Retriever ###
8
- ### Statistic ###
9
- # How to write own RPC handle? #
10
- RPC handle is a Ruby class. Writing a method in Ruby class, that's it. Names of methods are treated as XMLRPC command.
11
-
12
- When you write a new class for your own RPC handle, you must inherit either Auth or NoAuth class from rpc/base.rb.
13
-
14
- * class Auth < Object: Methods in a Ruby class inheriting Auth requires *auth_key* to access.
15
- * class NoAuth < Object: Methods in a Ruby class inheriting NoAuth doesn't require *auth_key* and these XMLRPC commands can be called by anonymous user.
16
-
17
- Filename should start with 'rh_'. It's prefix to be autoloaded by xmlrpc.rb.
18
-
19
- Refer rpc/rh_echo.rb as an example.