Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
inherit_from: .rubocop_todo.yml
38 changes: 38 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This configuration was generated by `rubocop --auto-gen-config`
# on 2015-01-28 23:27:09 +0200 using RuboCop version 0.28.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 21
Metrics/AbcSize:
Max: 47

# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 126

# Offense count: 7
Metrics/CyclomaticComplexity:
Max: 13

# Offense count: 169
# Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength:
Max: 114

# Offense count: 16
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 37

# Offense count: 7
Metrics/PerceivedComplexity:
Max: 13

# Offense count: 43
Style/Documentation:
Enabled: false

2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ group :docs do
end

group :development do
gem 'rspec', '~> 3.1'
gem 'rubocop'
gem 'pry'
end

Expand Down
39 changes: 29 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ PATH
GEM
remote: https://rubygems.org/
specs:
ast (2.0.0)
astrolabe (1.3.0)
parser (>= 2.2.0.pre.3, < 3.0)
coderay (1.0.9)
colorize (0.5.8)
coveralls (0.6.7)
Expand All @@ -16,30 +19,45 @@ GEM
rest-client
simplecov (>= 0.7)
thor
diff-lcs (1.2.4)
diff-lcs (1.2.5)
fabrication (2.7.2)
method_source (0.8.2)
mime-types (1.23)
mini_portile (0.5.1)
multi_json (1.7.7)
nokogiri (1.6.0)
mini_portile (~> 0.5.0)
parser (2.2.0.2)
ast (>= 1.1, < 3.0)
powerpack (0.0.9)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
rainbow (2.0.0)
rake (10.1.0)
redcarpet (2.3.0)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
rubocop (0.28.0)
astrolabe (~> 1.3)
parser (>= 2.2.0.pre.7, < 3.0)
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4)
ruby-progressbar (1.7.0)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
Expand All @@ -59,5 +77,6 @@ DEPENDENCIES
pry
rake (~> 10.1.0)
redcarpet (~> 2.3.0)
rspec (~> 2.13.0)
rspec (~> 3.1)
rubocop
yard (~> 0.8.6)
6 changes: 3 additions & 3 deletions diaspora-federation.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ Gem::Specification.new do |s|
s.version = DiasporaFederation::VERSION
s.date = '2013-06-28'
s.summary = 'Diaspora* Federation module'
s.description = 'This gem provides the functionality for de-/serialization and '+
'de-/encryption of Entities in the protocols used for communication '+
s.description = 'This gem provides the functionality for de-/serialization and '\
'de-/encryption of Entities in the protocols used for communication '\
'among the various installations of Diaspora*'
s.authors = ['Florian Staudacher']
s.email = '[email protected]'
s.homepage = 'https://github.com/Raven24/diaspora-federation'

s.required_ruby_version = '>= 1.9.3'

s.require_paths = ["lib"]
s.require_paths = ['lib']
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- spec/*`.split("\n")

Expand Down
44 changes: 22 additions & 22 deletions lib/diaspora-federation/entities.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@

# This namespace contains all the entities used to encapsulate data that is
# passed around in the Diaspora* network as part of the federation protocol.
#
# All entities must be defined in this namespace. otherwise the XML
# de-serialization will fail.
module DiasporaFederation::Entities
end
module DiasporaFederation
module Entities
# stand-alone
require 'diaspora-federation/entities/account_deletion'
require 'diaspora-federation/entities/comment'
require 'diaspora-federation/entities/like'
require 'diaspora-federation/entities/location'
require 'diaspora-federation/entities/message'
require 'diaspora-federation/entities/participation'
require 'diaspora-federation/entities/photo'
require 'diaspora-federation/entities/profile'
require 'diaspora-federation/entities/relayable_retraction'
require 'diaspora-federation/entities/request'
require 'diaspora-federation/entities/reshare'
require 'diaspora-federation/entities/retraction'
require 'diaspora-federation/entities/signed_retraction'

# stand-alone
require 'diaspora-federation/entities/account_deletion'
require 'diaspora-federation/entities/comment'
require 'diaspora-federation/entities/like'
require 'diaspora-federation/entities/location'
require 'diaspora-federation/entities/message'
require 'diaspora-federation/entities/participation'
require 'diaspora-federation/entities/photo'
require 'diaspora-federation/entities/profile'
require 'diaspora-federation/entities/relayable_retraction'
require 'diaspora-federation/entities/request'
require 'diaspora-federation/entities/reshare'
require 'diaspora-federation/entities/retraction'
require 'diaspora-federation/entities/signed_retraction'

# nested
require 'diaspora-federation/entities/conversation'
require 'diaspora-federation/entities/person'
require 'diaspora-federation/entities/status_message'
# nested
require 'diaspora-federation/entities/conversation'
require 'diaspora-federation/entities/person'
require 'diaspora-federation/entities/status_message'
end
end
14 changes: 7 additions & 7 deletions lib/diaspora-federation/entities/account_deletion.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module DiasporaFederation; module Entities
class AccountDeletion < Entity

define_props do
property :diaspora_handle
module DiasporaFederation
module Entities
class AccountDeletion < Entity
define_props do
property :diaspora_handle
end
end

end
end; end
end
24 changes: 12 additions & 12 deletions lib/diaspora-federation/entities/comment.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module DiasporaFederation; module Entities
class Comment < Entity

define_props do
property :guid
property :parent_guid
property :parent_author_signature
property :author_signature
property :text
property :diaspora_handle
module DiasporaFederation
module Entities
class Comment < Entity
define_props do
property :guid
property :parent_guid
property :parent_author_signature
property :author_signature
property :text
property :diaspora_handle
end
end

end
end; end
end
24 changes: 12 additions & 12 deletions lib/diaspora-federation/entities/conversation.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module DiasporaFederation; module Entities
class Conversation < Entity

define_props do
property :guid
property :subject
property :created_at, default: -> { Time.now.utc }
entity :messages, [Entities::Message]
property :diaspora_handle
property :participant_handles
module DiasporaFederation
module Entities
class Conversation < Entity
define_props do
property :guid
property :subject
property :created_at, default: -> { Time.now.utc }
entity :messages, [Entities::Message]
property :diaspora_handle
property :participant_handles
end
end

end
end; end
end
26 changes: 13 additions & 13 deletions lib/diaspora-federation/entities/like.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module DiasporaFederation; module Entities
class Like < Entity

define_props do
property :positive
property :guid
property :target_type
property :parent_guid
property :parent_author_signature
property :author_signature
property :diaspora_handle
module DiasporaFederation
module Entities
class Like < Entity
define_props do
property :positive
property :guid
property :target_type
property :parent_guid
property :parent_author_signature
property :author_signature
property :diaspora_handle
end
end

end
end; end
end
18 changes: 9 additions & 9 deletions lib/diaspora-federation/entities/location.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module DiasporaFederation; module Entities
class Location < Entity

define_props do
property :address
property :lat
property :lng
module DiasporaFederation
module Entities
class Location < Entity
define_props do
property :address
property :lat
property :lng
end
end

end
end; end
end
28 changes: 14 additions & 14 deletions lib/diaspora-federation/entities/message.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module DiasporaFederation; module Entities
class Message < Entity

define_props do
property :guid
property :parent_guid
property :parent_author_signature
property :author_signature
property :text
property :created_at, default: -> { Time.now.utc }
property :diaspora_handle
property :conversation_guid
module DiasporaFederation
module Entities
class Message < Entity
define_props do
property :guid
property :parent_guid
property :parent_author_signature
property :author_signature
property :text
property :created_at, default: -> { Time.now.utc }
property :diaspora_handle
property :conversation_guid
end
end

end
end; end
end
24 changes: 12 additions & 12 deletions lib/diaspora-federation/entities/participation.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module DiasporaFederation; module Entities
class Participation < Entity

define_props do
property :guid
property :target_type
property :parent_guid
property :parent_author_signature
property :author_signature
property :diaspora_handle
module DiasporaFederation
module Entities
class Participation < Entity
define_props do
property :guid
property :target_type
property :parent_guid
property :parent_author_signature
property :author_signature
property :diaspora_handle
end
end

end
end; end
end
22 changes: 11 additions & 11 deletions lib/diaspora-federation/entities/person.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module DiasporaFederation; module Entities
class Person < Entity

define_props do
property :guid
property :diaspora_handle
property :url
entity :profile, Entities::Profile
property :exported_key
module DiasporaFederation
module Entities
class Person < Entity
define_props do
property :guid
property :diaspora_handle
property :url
entity :profile, Entities::Profile
property :exported_key
end
end

end
end; end
end
Loading