arachni-rpc 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -0,0 +1,6 @@
1
+ # ChangeLog
2
+
3
+ ## Version 0.1.2 _(Under development)_
4
+
5
+ - Code cleanup
6
+ - Arachni::RPC::Request#do_not_defer! => Arachni::RPC::Request#do_not_defer
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # License
2
2
 
3
- Copyright (C) 2011, Tasos Laskos <tasos.laskos@gmail.com>
3
+ Copyright (C) 2011-2012, Tasos Laskos <tasos.laskos@gmail.com>
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without modification,
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  <table>
3
3
  <tr>
4
4
  <th>Version</th>
5
- <td>0.1.1</td>
5
+ <td>0.1.2</td>
6
6
  </tr>
7
7
  <tr>
8
8
  <th>Github page</th>
@@ -14,7 +14,7 @@
14
14
  </tr>
15
15
  <tr>
16
16
  <th>Author</th>
17
- <td><a href="mailto:tasos.laskos@gmail.com">Tasos</a> "<a href="mailto:zapotek@segfault.gr">Zapotek</a>" <a href="mailto:tasos.laskos@gmail.com">Laskos</a></td>
17
+ <td><a href="mailto:tasos.laskos@gmail.com">Tasos "Zapotek" Laskos</a></td>
18
18
  </tr>
19
19
  <tr>
20
20
  <th>Twitter</th>
@@ -22,7 +22,7 @@
22
22
  </tr>
23
23
  <tr>
24
24
  <th>Copyright</th>
25
- <td>2011</td>
25
+ <td>2011-2012</td>
26
26
  </tr>
27
27
  <tr>
28
28
  <th>License</th>
data/Rakefile CHANGED
@@ -7,21 +7,20 @@
7
7
  =end
8
8
 
9
9
  require 'rubygems'
10
+ require File.expand_path( File.dirname( __FILE__ ) ) + '/lib/arachni/rpc/version'
10
11
 
11
12
  begin
12
13
  require 'rspec'
13
14
  require 'rspec/core/rake_task'
14
15
 
15
- RSpec::Core::RakeTask.new do |t|
16
- t.rspec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
17
- end
16
+ RSpec::Core::RakeTask.new
18
17
  rescue
19
18
  end
20
19
 
21
- desc "Generate docs"
20
+ task default: [ :spec ]
22
21
 
22
+ desc "Generate docs"
23
23
  task :docs do
24
-
25
24
  outdir = "../arachni-rpc-pages"
26
25
  sh "mkdir #{outdir}" if !File.directory?( outdir )
27
26
 
@@ -34,45 +33,22 @@ task :docs do
34
33
  sh "rm -rf .yard*"
35
34
  end
36
35
 
37
-
38
- #
39
- # Cleans reports and logs
40
- #
41
36
  desc "Cleaning..."
42
37
  task :clean do
43
38
  sh "rm *.gem || true"
44
39
  end
45
40
 
46
-
47
-
48
- #
49
- # Building
50
- #
51
41
  desc "Build the arachni-rpc gem."
52
42
  task :build => [ :clean ] do
53
43
  sh "gem build arachni-rpc.gemspec"
54
44
  end
55
45
 
56
-
57
- #
58
- # Installing
59
- #
60
46
  desc "Build and install the arachni gem."
61
47
  task :install => [ :build ] do
62
-
63
- require File.expand_path( File.dirname( __FILE__ ) ) + '/lib/arachni/rpc/version'
64
-
65
48
  sh "gem install arachni-rpc-#{Arachni::RPC::VERSION}.gem"
66
49
  end
67
50
 
68
-
69
- #
70
- # Publishing
71
- #
72
51
  desc "Push a new version to Gemcutter"
73
52
  task :publish => [ :build ] do
74
-
75
- require File.expand_path( File.dirname( __FILE__ ) ) + '/lib/arachni/rpc/version'
76
-
77
53
  sh "gem push arachni-rpc-#{Arachni::RPC::VERSION}.gem"
78
54
  end
@@ -19,6 +19,8 @@
19
19
  # By default they'll return false, individual RPC Exceptions will overwrite them to
20
20
  # return true when applicable.
21
21
  #
22
+ # @author: Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
23
+ #
22
24
  class Object
23
25
 
24
26
  # @return [Bool] false
@@ -69,7 +71,7 @@ module Exceptions
69
71
  klass = Arachni::RPC::Exceptions.const_get( obj['type'].to_sym )
70
72
  e = klass.new( obj['exception'] )
71
73
  e.set_backtrace( obj['backtrace'] )
72
- return e
74
+ e
73
75
  end
74
76
 
75
77
  class Base < ::Exception
@@ -6,18 +6,13 @@
6
6
 
7
7
  =end
8
8
 
9
- require File.join( File.expand_path( File.dirname( __FILE__ ) ), '../', 'rpc' )
10
-
11
9
  module Arachni
12
10
  module RPC
13
11
 
14
12
  #
15
13
  # Represents an RPC message, serves as the basis for {Request} and {Response}.
16
14
  #
17
- # @author: Tasos "Zapotek" Laskos
18
- # <tasos.laskos@gmail.com>
19
- # <zapotek@segfault.gr>
20
- # @version: 0.1
15
+ # @author: Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
21
16
  #
22
17
  class Message
23
18
 
@@ -25,10 +20,7 @@ class Message
25
20
  # @param [Hash] opts sets instance attributes
26
21
  #
27
22
  def initialize( opts = {} )
28
- opts.each_pair {
29
- |k, v|
30
- instance_variable_set( "@#{k}".to_sym, v )
31
- }
23
+ opts.each_pair { |k, v| instance_variable_set( "@#{k}".to_sym, v ) }
32
24
  end
33
25
 
34
26
  #
@@ -39,11 +31,10 @@ class Message
39
31
  # @param [Message] message
40
32
  #
41
33
  def merge!( message )
42
- message.instance_variables.each {
43
- |var|
34
+ message.instance_variables.each do |var|
44
35
  val = message.instance_variable_get( var )
45
36
  instance_variable_set( var, val )
46
- }
37
+ end
47
38
  end
48
39
 
49
40
  #
@@ -55,13 +46,10 @@ class Message
55
46
  # @return [Hash]
56
47
  #
57
48
  def prepare_for_tx
58
- hash = {}
59
- instance_variables.each {
60
- |k|
61
- next if !transmit?( k )
62
- hash[normalize( k )] = instance_variable_get( k )
63
- }
64
- return hash
49
+ instance_variables.inject({}) do |h, k|
50
+ h[normalize( k )] = instance_variable_get( k ) if transmit?( k )
51
+ h
52
+ end
65
53
  end
66
54
 
67
55
  #
@@ -70,7 +58,7 @@ class Message
70
58
  # @param [Symbol] attr attribute symbol (i.e. :@token)
71
59
  #
72
60
  def transmit?( attr )
73
- return true
61
+ true
74
62
  end
75
63
 
76
64
  private
@@ -41,10 +41,7 @@ module RPC
41
41
  # server = Arachni::RPC::EM::Server.new( :host => 'localhost', :port => 7331 )
42
42
  # server.add_handler( 'bench', Bench.new )
43
43
  #
44
- # @author: Tasos "Zapotek" Laskos
45
- # <tasos.laskos@gmail.com>
46
- # <zapotek@segfault.gr>
47
- # @version: 0.1
44
+ # @author: Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
48
45
  #
49
46
  class RemoteObjectMapper
50
47
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  =end
8
8
 
9
- require File.join( File.expand_path( File.dirname( __FILE__ ) ), '../', 'rpc' )
9
+ require File.join( File.expand_path( File.dirname( __FILE__ ) ), 'message' )
10
10
 
11
11
  module Arachni
12
12
  module RPC
@@ -30,10 +30,7 @@ module RPC
30
30
  # Any client that has SSL support and can serialize a Hash
31
31
  # just like the one above can communicate with the RPC server.
32
32
  #
33
- # @author: Tasos "Zapotek" Laskos
34
- # <tasos.laskos@gmail.com>
35
- # <zapotek@segfault.gr>
36
- # @version: 0.1
33
+ # @author: Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
37
34
  #
38
35
  class Request < Message
39
36
 
@@ -70,7 +67,7 @@ class Request < Message
70
67
  super
71
68
  end
72
69
 
73
- def do_not_defer!
70
+ def do_not_defer
74
71
  @defer = false
75
72
  end
76
73
 
@@ -81,10 +78,7 @@ class Request < Message
81
78
  private
82
79
 
83
80
  def transmit?( attr )
84
- ![
85
- :@defer,
86
- :@callback
87
- ].include?( attr )
81
+ ![ :@defer, :@callback ].include?( attr )
88
82
  end
89
83
 
90
84
  end
@@ -6,7 +6,7 @@
6
6
 
7
7
  =end
8
8
 
9
- require File.join( File.expand_path( File.dirname( __FILE__ ) ), '../', 'rpc' )
9
+ require File.join( File.expand_path( File.dirname( __FILE__ ) ), 'message' )
10
10
 
11
11
  module Arachni
12
12
  module RPC
@@ -25,10 +25,7 @@ module RPC
25
25
  # 'obj' => object
26
26
  # }
27
27
  #
28
- # @author: Tasos "Zapotek" Laskos
29
- # <tasos.laskos@gmail.com>
30
- # <zapotek@segfault.gr>
31
- # @version: 0.1
28
+ # @author: Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
32
29
  #
33
30
  class Response < Message
34
31
 
@@ -72,9 +69,7 @@ class Response < Message
72
69
  private
73
70
 
74
71
  def transmit?( attr )
75
- ![
76
- :@async
77
- ].include?( attr )
72
+ ![ :@async ].include?( attr )
78
73
  end
79
74
 
80
75
 
@@ -8,6 +8,6 @@
8
8
 
9
9
  module Arachni
10
10
  module RPC
11
- VERSION = '0.1.1'
11
+ VERSION = '0.1.2'
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arachni-rpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
5
- prerelease:
4
+ prerelease:
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tasos Laskos
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-28 00:00:00.000000000 Z
12
+ date: 2012-06-18 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: ! " Arachni-RPC is a simple and lightweight Remote Procedure Call
15
- protocol\n used to provide the basis for Arachni's Grid infrastructure.\n"
14
+ description: ! " Arachni-RPC is a simple and lightweight Remote Procedure Call\
15
+ \ protocol\n used to provide the basis for Arachni's Grid infrastructure.\n"
16
16
  email: tasos.laskos@gmail.com
17
17
  executables: []
18
18
  extensions: []
@@ -25,37 +25,45 @@ files:
25
25
  - Rakefile
26
26
  - LICENSE.md
27
27
  - CHANGELOG.md
28
- - lib/arachni/rpc/response.rb
29
- - lib/arachni/rpc/version.rb
30
- - lib/arachni/rpc/remote_object_mapper.rb
31
- - lib/arachni/rpc/exceptions.rb
32
- - lib/arachni/rpc/request.rb
33
- - lib/arachni/rpc/message.rb
34
- - lib/arachni/rpc.rb
28
+ - !binary |-
29
+ bGliL2FyYWNobmkvcnBjLnJi
30
+ - !binary |-
31
+ bGliL2FyYWNobmkvcnBjL3JlcXVlc3QucmI=
32
+ - !binary |-
33
+ bGliL2FyYWNobmkvcnBjL3JlbW90ZV9vYmplY3RfbWFwcGVyLnJi
34
+ - !binary |-
35
+ bGliL2FyYWNobmkvcnBjL3ZlcnNpb24ucmI=
36
+ - !binary |-
37
+ bGliL2FyYWNobmkvcnBjL2V4Y2VwdGlvbnMucmI=
38
+ - !binary |-
39
+ bGliL2FyYWNobmkvcnBjL3Jlc3BvbnNlLnJi
40
+ - !binary |-
41
+ bGliL2FyYWNobmkvcnBjL21lc3NhZ2UucmI=
35
42
  homepage: https://github.com/Arachni/arachni-rpc
36
43
  licenses: []
37
- post_install_message:
44
+ post_install_message:
38
45
  rdoc_options:
39
46
  - --charset=UTF-8
40
47
  require_paths:
41
48
  - lib
42
49
  required_ruby_version: !ruby/object:Gem::Requirement
43
- none: false
44
50
  requirements:
45
51
  - - ! '>='
46
52
  - !ruby/object:Gem::Version
47
- version: '0'
48
- required_rubygems_version: !ruby/object:Gem::Requirement
53
+ version: !binary |-
54
+ MA==
49
55
  none: false
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
57
  requirements:
51
58
  - - ! '>='
52
59
  - !ruby/object:Gem::Version
53
- version: '0'
60
+ version: !binary |-
61
+ MA==
62
+ none: false
54
63
  requirements: []
55
- rubyforge_project:
56
- rubygems_version: 1.8.10
57
- signing_key:
64
+ rubyforge_project:
65
+ rubygems_version: 1.8.24
66
+ signing_key:
58
67
  specification_version: 3
59
68
  summary: The RPC protocol specification of the Arachni WebAppSec scanner Grid.
60
69
  test_files: []
61
- has_rdoc: