rubyfox-client 0.3.0.pre2-java → 0.4.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3c30eed27445c08c9c37b18343e0ee2d13fd35f0
4
+ data.tar.gz: f55a58f4fbc6b2a28db4b390be6a6c8aef58e1d9
5
+ SHA512:
6
+ metadata.gz: e932cf55dfccc12611adf9280136d48257d7fc678575590b6b76ca1b03114fb9fb1e76d6455c090a72c79621b40c84c56d6d0fe44cc79671871393ddf1ac9c28
7
+ data.tar.gz: bbdbc792ca65afb3a99e3ac747a42402f6ef06578e7929db142556741206b740560fac2d576deb17e48bc098932f55409bdd8972c61b99725ccc184839b006e5
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ rubyfox-client
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ jruby
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in rubyfox-client.gemspec
4
4
  gemspec
data/README.rdoc CHANGED
@@ -28,8 +28,14 @@ Or install it yourself as:
28
28
  ARGV.size == 3 or abort "usage: simple.rb username password zone"
29
29
 
30
30
  Rubyfox::Client.boot!
31
-
32
- client = Rubyfox::Client.new
31
+
32
+ # optional
33
+ options = {
34
+ host: '127.0.0.1',
35
+ debug: true
36
+ }
37
+
38
+ client = Rubyfox::Client.new(options)
33
39
  client.on_event :connection do |event|
34
40
  p :connected!
35
41
  client.send :login, *ARGV
data/examples/any.rb CHANGED
@@ -1,14 +1,14 @@
1
- require 'rubyfox/client'
1
+ require "rubyfox/client"
2
2
 
3
3
  unless ARGV.size == 3
4
4
  abort "usage: #{$0} username password zone"
5
5
  end
6
6
 
7
- unless ENV['SF_DIR']
7
+ unless ENV["SF_DIR"]
8
8
  abort "Point SF_DIR to your SmartFox installation"
9
9
  end
10
10
 
11
- Rubyfox::Client.require_libs(ENV['SF_DIR'] + "/lib")
11
+ Rubyfox::Client.require_libs(ENV["SF_DIR"] + "/lib")
12
12
  Rubyfox::Client.boot!
13
13
 
14
14
  Rubyfox::Client.new(:debug => true) do |client|
@@ -1,14 +1,14 @@
1
- require 'rubyfox/client'
1
+ require "rubyfox/client"
2
2
 
3
3
  unless ARGV.size == 3
4
4
  abort "usage: #{$0} username password zone"
5
5
  end
6
6
 
7
- unless ENV['SF_DIR']
7
+ unless ENV["SF_DIR"]
8
8
  abort "Point SF_DIR to your SmartFox installation"
9
9
  end
10
10
 
11
- Rubyfox::Client.require_libs(ENV['SF_DIR'] + "/lib")
11
+ Rubyfox::Client.require_libs(ENV["SF_DIR"] + "/lib")
12
12
  Rubyfox::Client.boot!
13
13
 
14
14
  Rubyfox::Client.new(:debug => true) do |client|
data/examples/simple.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'rubyfox/client'
1
+ require "rubyfox/client"
2
2
 
3
3
  ARGV.size == 3 or abort "usage: simple.rb username password zone"
4
4
 
@@ -5,17 +5,17 @@ module Rubyfox
5
5
  Transport.new(config, &block)
6
6
  end
7
7
 
8
- def self.boot!(vendor_dir=File.expand_path('client/vendor', File.dirname(__FILE__)))
8
+ def self.boot!(vendor_dir = File.expand_path("client/vendor", File.dirname(__FILE__)))
9
9
  require_libs vendor_dir
10
10
 
11
- require 'rubyfox/sfsobject/core_ext'
11
+ require "rubyfox/sfsobject/core_ext"
12
12
 
13
- require 'rubyfox/client/transport'
14
- require 'rubyfox/client/recorder'
13
+ require "rubyfox/client/transport"
14
+ require "rubyfox/client/recorder"
15
15
  end
16
16
 
17
17
  def self.require_libs(dir)
18
- glob = File.join(dir, '*.jar')
18
+ glob = File.join(dir, "*.jar")
19
19
  libs = Dir[glob].to_a
20
20
  if libs.empty?
21
21
  abort "No libs to require for #{glob}"
@@ -1,7 +1,7 @@
1
1
  module Rubyfox
2
2
  module Client
3
3
  class Config
4
- def initialize(options={})
4
+ def initialize(options = {})
5
5
  @options = options
6
6
  end
7
7
 
@@ -1,4 +1,4 @@
1
- require 'rubyfox/client/java'
1
+ require "rubyfox/client/java"
2
2
 
3
3
  module Rubyfox
4
4
  module Client
@@ -1,10 +1,10 @@
1
- require 'rubyfox/client/event'
1
+ require "rubyfox/client/event"
2
2
 
3
3
  module Rubyfox
4
4
  module Client
5
5
  class EventHandler
6
6
  def initialize(smartfox)
7
- @handler = Hash.new { |hash, type| hash[type] = [] }
7
+ @handler = Hash.new { |hash, type| hash[type] = [] }
8
8
  @smartfox = smartfox
9
9
  end
10
10
 
@@ -4,8 +4,8 @@ module Rubyfox
4
4
  Request = Struct.new(:command, :params, :room, :packet_id)
5
5
 
6
6
  def initialize(event_handler)
7
- @handler = Hash.new { |hash, type| hash[type] = [] }
8
- @event_handler = event_handler
7
+ @handler = Hash.new { |hash, type| hash[type] = [] }
8
+ @event_handler = event_handler
9
9
  end
10
10
 
11
11
  def register
@@ -1,12 +1,12 @@
1
- require 'java'
1
+ require "java"
2
2
 
3
3
  module Rubyfox
4
4
  module Client
5
5
  module Java
6
- SmartFox = ::Java.sfs2x.client.SmartFox
7
- Request = ::Java.sfs2x.client.requests
8
- SFSEvent = ::Java.sfs2x.client.core.SFSEvent
9
- System = ::Java.java.lang.System
6
+ SmartFox = ::Java.sfs2x.client.SmartFox
7
+ Request = ::Java.sfs2x.client.requests
8
+ SFSEvent = ::Java.sfs2x.client.core.SFSEvent
9
+ System = ::Java.java.lang.System
10
10
  end
11
11
  end
12
12
  end
@@ -1,5 +1,5 @@
1
- require 'timeout'
2
- require 'rubyfox/client/event'
1
+ require "timeout"
2
+ require "rubyfox/client/event"
3
3
 
4
4
  module Rubyfox
5
5
  module Client
@@ -23,8 +23,8 @@ module Rubyfox
23
23
  include Timeout
24
24
 
25
25
  def initialize(client)
26
- @client = client
27
- @events = Hash.new { |hash, type| hash[type] = [] }
26
+ @client = client
27
+ @events = Hash.new { |hash, type| hash[type] = [] }
28
28
  @extensions = Hash.new { |hash, command| hash[command] = [] }
29
29
  @connection_lost = false
30
30
  install_callbacks
@@ -39,7 +39,7 @@ module Rubyfox
39
39
  @extensions[command]
40
40
  end
41
41
 
42
- def verify(options={}, &block)
42
+ def verify(options = {}, &block)
43
43
  @client.connect
44
44
  wait = options[:timeout] || 1
45
45
  timeout wait do
@@ -1,17 +1,19 @@
1
- require 'active_support/core_ext/string/inflections'
2
- require 'rubyfox/client/java'
1
+ require "dry/inflector"
2
+ require "rubyfox/client/java"
3
3
 
4
4
  module Rubyfox
5
5
  module Client
6
6
  Request = Java::Request
7
7
 
8
8
  module Request
9
+ Inflector = Dry::Inflector.new
10
+
9
11
  def self.[](name)
10
12
  case name
11
13
  when Request::BaseRequest
12
14
  name
13
15
  else
14
- name = name.to_s.camelcase
16
+ name = Inflector.camelize(name.to_s)
15
17
  name += "Request" unless name.end_with?("Request")
16
18
  Request.__send__(name)
17
19
  end
@@ -1,17 +1,17 @@
1
- require 'rubyfox/client/java'
2
- require 'rubyfox/client/config'
3
- require 'rubyfox/client/request'
4
- require 'rubyfox/client/event_handler'
5
- require 'rubyfox/client/extension_handler'
1
+ require "rubyfox/client/java"
2
+ require "rubyfox/client/config"
3
+ require "rubyfox/client/request"
4
+ require "rubyfox/client/event_handler"
5
+ require "rubyfox/client/extension_handler"
6
6
 
7
7
  module Rubyfox
8
8
  module Client
9
9
  class Transport
10
10
  def initialize(config)
11
- @config = config
12
- @smartfox = Java::SmartFox.new(@config.debug?)
13
- @event_handler = EventHandler.new(@smartfox)
14
- @extension_handler = ExtensionHandler.new(@event_handler)
11
+ @config = config
12
+ @smartfox = Java::SmartFox.new(@config.debug?)
13
+ @event_handler = EventHandler.new(@smartfox)
14
+ @extension_handler = ExtensionHandler.new(@event_handler)
15
15
  if block_given?
16
16
  yield self
17
17
  connect
@@ -35,7 +35,7 @@ module Rubyfox
35
35
  @event_handler.unregister
36
36
  end
37
37
 
38
- def exit(ret=0)
38
+ def exit(ret = 0)
39
39
  disconnect
40
40
  Java::System.exit(ret)
41
41
  end
@@ -45,7 +45,7 @@ module Rubyfox
45
45
  @smartfox.send(request)
46
46
  end
47
47
 
48
- def send_extension(command, params=nil, room=nil)
48
+ def send_extension(command, params = nil, room = nil)
49
49
  send :extension, command.to_s, params, room
50
50
  end
51
51
 
@@ -1,5 +1,5 @@
1
1
  module Rubyfox
2
2
  module Client
3
- VERSION = "0.3.0.pre2"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
@@ -7,8 +7,8 @@ Gem::Specification.new do |gem|
7
7
  gem.name = "rubyfox-client"
8
8
  gem.version = Rubyfox::Client::VERSION
9
9
  gem.platform = Gem::Platform::JAVA
10
- gem.authors = ["Peter Suschlik", "Jakob Holderbaum"]
11
- gem.email = ["ps@neopoly.de", "jh@neopoly.de"]
10
+ gem.authors = ["Peter Leitzen", "Jakob Holderbaum"]
11
+ gem.email = ["pl@neopoly.de", "jh@neopoly.de"]
12
12
  gem.description = %q{Ruby bindings for SmartFox's client.}
13
13
  gem.summary = %q{}
14
14
  gem.homepage = "https://github.com/neopoly/rubyfox-client"
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ["lib"]
20
20
 
21
- gem.add_dependency 'activesupport'
21
+ gem.add_dependency 'dry-inflector', '~> 0.1'
22
22
  gem.add_dependency 'rubyfox-sfsobject', '>= 0.2.2'
23
23
 
24
24
  gem.add_development_dependency 'rake'
metadata CHANGED
@@ -1,97 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyfox-client
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 0.3.0.pre2
4
+ version: 0.4.0
6
5
  platform: java
7
6
  authors:
8
- - Peter Suschlik
7
+ - Peter Leitzen
9
8
  - Jakob Holderbaum
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2012-12-06 00:00:00.000000000 Z
12
+ date: 2018-07-12 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
- name: activesupport
17
- version_requirements: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: !binary |-
22
- MA==
23
- none: false
24
15
  requirement: !ruby/object:Gem::Requirement
25
16
  requirements:
26
- - - ! '>='
17
+ - - "~>"
27
18
  - !ruby/object:Gem::Version
28
- version: !binary |-
29
- MA==
30
- none: false
19
+ version: '0.1'
20
+ name: dry-inflector
31
21
  prerelease: false
32
22
  type: :runtime
33
- - !ruby/object:Gem::Dependency
34
- name: rubyfox-sfsobject
35
23
  version_requirements: !ruby/object:Gem::Requirement
36
24
  requirements:
37
- - - ! '>='
25
+ - - "~>"
38
26
  - !ruby/object:Gem::Version
39
- version: 0.2.2
40
- none: false
27
+ version: '0.1'
28
+ - !ruby/object:Gem::Dependency
41
29
  requirement: !ruby/object:Gem::Requirement
42
30
  requirements:
43
- - - ! '>='
31
+ - - ">="
44
32
  - !ruby/object:Gem::Version
45
33
  version: 0.2.2
46
- none: false
34
+ name: rubyfox-sfsobject
47
35
  prerelease: false
48
36
  type: :runtime
49
- - !ruby/object:Gem::Dependency
50
- name: rake
51
37
  version_requirements: !ruby/object:Gem::Requirement
52
38
  requirements:
53
- - - ! '>='
39
+ - - ">="
54
40
  - !ruby/object:Gem::Version
55
- version: !binary |-
56
- MA==
57
- none: false
41
+ version: 0.2.2
42
+ - !ruby/object:Gem::Dependency
58
43
  requirement: !ruby/object:Gem::Requirement
59
44
  requirements:
60
- - - ! '>='
45
+ - - ">="
61
46
  - !ruby/object:Gem::Version
62
- version: !binary |-
63
- MA==
64
- none: false
47
+ version: '0'
48
+ name: rake
65
49
  prerelease: false
66
50
  type: :development
67
- - !ruby/object:Gem::Dependency
68
- name: rdoc
69
51
  version_requirements: !ruby/object:Gem::Requirement
70
52
  requirements:
71
- - - ! '>='
53
+ - - ">="
72
54
  - !ruby/object:Gem::Version
73
- version: !binary |-
74
- MA==
75
- none: false
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
76
57
  requirement: !ruby/object:Gem::Requirement
77
58
  requirements:
78
- - - ! '>='
59
+ - - ">="
79
60
  - !ruby/object:Gem::Version
80
- version: !binary |-
81
- MA==
82
- none: false
61
+ version: '0'
62
+ name: rdoc
83
63
  prerelease: false
84
64
  type: :development
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
85
70
  description: Ruby bindings for SmartFox's client.
86
71
  email:
87
- - ps@neopoly.de
72
+ - pl@neopoly.de
88
73
  - jh@neopoly.de
89
74
  executables: []
90
75
  extensions: []
91
76
  extra_rdoc_files: []
92
77
  files:
93
- - .gitignore
94
- - .rvmrc
78
+ - ".gitignore"
79
+ - ".ruby-gemset"
80
+ - ".ruby-version"
95
81
  - Gemfile
96
82
  - README.rdoc
97
83
  - Rakefile
@@ -116,31 +102,25 @@ files:
116
102
  - rubyfox-client.gemspec
117
103
  homepage: https://github.com/neopoly/rubyfox-client
118
104
  licenses: []
105
+ metadata: {}
119
106
  post_install_message:
120
107
  rdoc_options: []
121
108
  require_paths:
122
109
  - lib
123
110
  required_ruby_version: !ruby/object:Gem::Requirement
124
111
  requirements:
125
- - - ! '>='
112
+ - - ">="
126
113
  - !ruby/object:Gem::Version
127
- segments:
128
- - 0
129
- hash: 2
130
- version: !binary |-
131
- MA==
132
- none: false
114
+ version: '0'
133
115
  required_rubygems_version: !ruby/object:Gem::Requirement
134
116
  requirements:
135
- - - !binary |-
136
- Pg==
117
+ - - ">="
137
118
  - !ruby/object:Gem::Version
138
- version: 1.3.1
139
- none: false
119
+ version: '0'
140
120
  requirements: []
141
121
  rubyforge_project:
142
- rubygems_version: 1.8.24
122
+ rubygems_version: 2.6.14.1
143
123
  signing_key:
144
- specification_version: 3
124
+ specification_version: 4
145
125
  summary: ''
146
126
  test_files: []
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm jruby@rubyfox-client --create