doodle_rails 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/doodle/auth_controller.rb +3 -3
  3. data/app/controllers/doodle/channels_controller.rb +10 -0
  4. data/app/controllers/doodle/chat_controller.rb +30 -14
  5. data/app/controllers/doodle/conversations_controller.rb +15 -3
  6. data/app/controllers/doodle/keywords_controller.rb +15 -2
  7. data/app/controllers/doodle/messages_controller.rb +28 -0
  8. data/app/controllers/doodle/users_controller.rb +1 -2
  9. data/app/helpers/doodle/keywords_helper.rb +9 -0
  10. data/app/helpers/doodle/reports_helper.rb +37 -0
  11. data/app/models/doodle/channel.rb +4 -0
  12. data/app/models/doodle/history.rb +35 -0
  13. data/app/models/doodle/protocol.rb +22 -10
  14. data/app/models/doodle/user/analyst.rb +6 -2
  15. data/app/models/doodle/user.rb +5 -1
  16. data/app/models/doodle/user_channel.rb +11 -0
  17. data/app/services/doodle/keyword/action/finder_service.rb +8 -0
  18. data/app/services/doodle/keyword/finder_service.rb +5 -1
  19. data/app/services/doodle/keyword/text/finder_service.rb +8 -0
  20. data/app/services/doodle/protocol/finalizer_service.rb +1 -0
  21. data/app/services/doodle/protocol/finder_service.rb +23 -4
  22. data/app/services/layer/conversation/finder_service.rb +11 -0
  23. data/config/routes.rb +11 -11
  24. data/db/migrate/20160211202503_create_doodle_user_channels.rb +1 -1
  25. data/db/migrate/20160320142137_create_doodle_users.rb +3 -2
  26. data/db/migrate/20160320175917_create_doodle_protocols.rb +2 -0
  27. data/lib/doodle/version.rb +1 -1
  28. data/test/dummy/tmp/pids/server.pid +1 -0
  29. metadata +46 -38
  30. data/test/dummy/config/private_key.pem +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af2ea8a12cd16908d7f2afecc8f5bbdcb2f72d11
4
- data.tar.gz: 81ee8369d7a1c904a43b8c18a724b9d82fe5003f
3
+ metadata.gz: 579622ab1e8deccb39248454da64333e6f4c9d7e
4
+ data.tar.gz: 55bd433fcfd2b66144591e8b535a4eb9b5102eec
5
5
  SHA512:
6
- metadata.gz: 198575898ddef68256d9b11dbae7231d95f1cbe8bb4286f74eb18c6d61e92e91a858ac26fb0e93a445255c0edef2a94665c5c79421d9642d30747e1b18935d9f
7
- data.tar.gz: e91b49295a269c5be4901299463f02226411ab4bea4d6674ef593b167f5e72810ef59db429542847db591fdf6d424d18578fe6df39b4f436d3b85691689f9d35
6
+ metadata.gz: c2f53e6fd36837eea86fb38b8a00aaec571bbcf15bef048f2cb78f0b66d6c6cc021b271ba12b7ddf65f33f959fe8694bb29ffd27c6c7ad63f634bfad92f12d75
7
+ data.tar.gz: 31394809f20813d159f903e1a604797cdffbf5db2e81c39dff78cc32eabe6b6830c6a25a8c98f04ecb3f81169ae838c80b6914a8dab3c307c17a70fa183fb7ea
@@ -3,17 +3,17 @@ require_dependency "doodle/application_controller"
3
3
  module Doodle
4
4
  class AuthController < ApplicationController
5
5
  def authenticate
6
- @user = User.where(pass: auth_params[:pass], login: auth_params[:login], type: auth_params[:type]).first
6
+ @user = User.where(password: auth_params[:password], login: auth_params[:login], type: auth_params[:type]).first
7
7
 
8
8
  if @user.present?
9
- render json: { login: @user.login, session_token: token_creator_service.token }
9
+ render json: { id: @user.id, login: @user.login, session_token: token_creator_service.token }
10
10
  else
11
11
  render json: { error: "When authenticate user" }
12
12
  end
13
13
  end
14
14
 
15
15
  def auth_params
16
- @params ||= params.require(:auth).permit(:login, :pass, :type)
16
+ @params ||= params.require(:auth).permit(:login, :password, :type)
17
17
  end
18
18
 
19
19
  def token_creator_service
@@ -0,0 +1,10 @@
1
+ require_dependency "doodle/application_controller"
2
+
3
+ module Doodle
4
+ class ChannelsController < ApplicationController
5
+ def index
6
+ render json: Channel.all
7
+ end
8
+ end
9
+ end
10
+
@@ -2,33 +2,43 @@ require_dependency "doodle/application_controller"
2
2
 
3
3
  module Doodle
4
4
  class ChatController < ApplicationController
5
+ before_filter :find_analyst
5
6
 
6
7
  def has_protocols?
7
- protocols = Protocol.waiting_in_channel(params.require(:channel))
8
- render json: { has_protocols: protocols.size }, status: 200
8
+ protocols = protocol_finder_service.waiting_on_user_channels(@user)
9
+
10
+ render json: { has_protocols: protocols.count }, status: 200
9
11
  end
10
12
 
11
13
  def next
12
- protocol = protocol_finder_service.next
13
- join_service = chat_join_service(protocol)
14
- if join_service.break_limit? && protocol.blank?
15
- render json: { error: 'Analyst already have limit of protocols in progress' }, status: 422
14
+ if @user.blank?
15
+ render json: { error: 'Dont found this analyst' }
16
16
  else
17
- join_service.join(params.require(:channel))
18
- render json: { conversation: protocol.conversation_id }, status: 200
17
+ protocol = protocol_finder_service.next_for_user(@user)
18
+
19
+ if protocol.blank?
20
+ render json: { error: 'Dont found protocols for this channel' }
21
+ else
22
+ join_service = chat_join_service(protocol, @user)
23
+ if join_service.break_limit? && protocol.blank?
24
+ render json: { error: 'Analyst already have limit of protocols in progress' }, status: 422
25
+ else
26
+ join_service.join(protocol.channel_id)
27
+ render json: { conversation: protocol.conversation_id }, status: 200
28
+ end
29
+ end
19
30
  end
20
31
  end
21
32
 
22
33
  def finalize
23
- user = User::Analyst.find_by_login(params.require(:login))
24
- protocol = protocol_finder_service.find_by_conversation(params.require(:id))
34
+ protocol = protocol_finder_service.find_by_conversation(params.require(:conversation_id))
25
35
 
26
- if user.blank? || protocol.blank?
27
- render json: { text: "Protocol or user dont found"}, status: 422
36
+ if protocol.blank?
37
+ render json: { text: "Protocol isn't found"}, status: 422
28
38
  else
29
39
 
30
40
  protocol_finalizer_service(protocol).call
31
- chat_join_service(protocol, user).out(protocol.channel.name)
41
+ chat_join_service(protocol, protocol.user).out(protocol.channel.name) if params.require(:login)
32
42
 
33
43
  render json: { id: protocol.id, text: "Protocol finalized with success" }
34
44
  end
@@ -45,6 +55,12 @@ module Doodle
45
55
  def protocol_finder_service
46
56
  @finder_service ||= Protocol::FinderService.new
47
57
  end
58
+
59
+ private
60
+
61
+ def find_analyst
62
+ @user = User::Analyst.find_by_login(params.require(:login))
63
+ end
64
+
48
65
  end
49
66
  end
50
-
@@ -8,14 +8,27 @@ module Doodle
8
8
  if channel.present?
9
9
  conversation = conversation_creator_service([params.require(:login)]).call
10
10
  protocol = protocol_creator_service(channel, conversation).call
11
- render json: { protocol_id: protocol.id, prococol_status: protocol.status, channel: channel.name, conversation_id: conversation.id }, status: 201
11
+ render json: { protocol_id: protocol.id, protocol_status: protocol.status, channel: channel.name, conversation_id: conversation.id }, status: 201
12
12
  else
13
13
  render json: { error: 'Channel dont found, Please create channel with this name first' }
14
14
  end
15
15
  end
16
16
 
17
+ def messages
18
+ if params.permit(:conversation_id).present?
19
+ @conversation = finder_service.call
20
+ render json: @conversation.messages.to_json, status: 200
21
+ else
22
+ render json: { error: 'conversation_id can\'t be blank'}, status: 404
23
+ end
24
+ end
25
+
26
+ def finder_service
27
+ @finder_service ||= Layer::Conversation::FinderService.new("layer:///conversations/#{params.require(:conversation_id)}")
28
+ end
29
+
17
30
  def channel_finder_service
18
- @channel_finder_service ||= Channel::FinderService.new({name: params.require(:channel)})
31
+ @channel_finder_service ||= Channel::FinderService.new(id: params.require(:channel_id))
19
32
  end
20
33
 
21
34
  def protocol_creator_service(channel, conversation)
@@ -27,4 +40,3 @@ module Doodle
27
40
  end
28
41
  end
29
42
  end
30
-
@@ -17,16 +17,29 @@ module Doodle
17
17
  if params[:keyword].present?
18
18
  render json: finder_service.to_json
19
19
  else
20
- render json: Keyword.all.to_json
20
+ render json: Keyword::Text.all.to_json
21
21
  end
22
22
  end
23
23
 
24
+ def all_actions
25
+ render json: Doodle::Keyword::Action.all
26
+ end
27
+
28
+ def action
29
+ @keyword = Doodle::Keyword::Action::FinderService.new(name: params.require(:name)).call.first
30
+ if @keyword
31
+ render json: Doodle::KeywordsHelper.stub_action(@keyword)
32
+ else
33
+ render json: {error: 'Missing Action Keyword'}, status: 404
34
+ end
35
+ end
36
+
24
37
  def keyword_params
25
38
  params.require(:keyword).permit(:name, :value, :type)
26
39
  end
27
40
 
28
41
  def finder_service
29
- @finder_service || Doodle::Keyword::FinderService.new(keyword_params)
42
+ @finder_service || Doodle::Keyword::Text::FinderService.new(keyword_params)
30
43
  end
31
44
  end
32
45
  end
@@ -0,0 +1,28 @@
1
+ require_dependency "doodle/application_controller"
2
+
3
+ module Doodle
4
+ class MessagesController < ApplicationController
5
+ def create
6
+ conversation = Layer::Conversation.find(conversation_params[:id])
7
+
8
+ if !message_params[:parts][0]['body'].blank?
9
+ message = conversation.messages.create(message_params)
10
+ render json: message, status: 201
11
+ else
12
+ render text: 'body cant be blank', status: 422
13
+ end
14
+
15
+ end
16
+
17
+ def conversation_params
18
+ params.require(:conversation)
19
+ end
20
+
21
+ def message_params
22
+ {
23
+ sender: conversation_params[:sender],
24
+ parts: conversation_params[:parts].respond_to?(:values) ? conversation_params[:parts].values : conversation_params[:parts]
25
+ }
26
+ end
27
+ end
28
+ end
@@ -18,7 +18,6 @@ module Doodle
18
18
 
19
19
  end
20
20
 
21
-
22
21
  def create
23
22
  user = User.new(users_params)
24
23
  if user.save
@@ -29,7 +28,7 @@ module Doodle
29
28
  end
30
29
 
31
30
  def users_params
32
- params.require(:user).permit(:login, :pass, :type)
31
+ params.require(:user).permit(:login, :password, :type)
33
32
  end
34
33
  end
35
34
  end
@@ -1,4 +1,13 @@
1
1
  module Doodle
2
2
  module KeywordsHelper
3
+ module_function
4
+
5
+ def stub_action(keyword)
6
+ {
7
+ name: keyword.name,
8
+ nodes: { imap: true, pop: true, smtp: false },
9
+ options: { postal: '89% Utilizado', domain: 'Locaweb MX', anti_spam: 'ativo' }
10
+ }
11
+ end
3
12
  end
4
13
  end
@@ -0,0 +1,37 @@
1
+ module Doodle
2
+ module ReportsHelper
3
+ module_function
4
+
5
+ def online_users_and_protocols_in_progress
6
+ result = []
7
+ protocols_in_progress = Doodle::Protocol.number_by_user(Doodle::UserChannel.user_by_status(UserChannel::STATUSES[:online]))
8
+ protocols_in_progress.each do |k, v|
9
+ result << {login: User.find(k).login, number: v}
10
+ end
11
+ result
12
+ end
13
+
14
+ def waiting_users
15
+ result = []
16
+ Doodle::User::Analyst.inative.pluck(:login).each do |v|
17
+ result << {login: v}
18
+ end
19
+ result
20
+ end
21
+
22
+ def protocol_with_status(status)
23
+ result = []
24
+ Doodle::Channel.all.pluck(:name).each do |n|
25
+ result << {name: n, number: Protocol.in_channel_with_status(n, status).count}
26
+ end
27
+ result
28
+ end
29
+
30
+ def service_metrics
31
+ {
32
+ waiting_time: "#{Doodle::Protocol.average_waiting_time.round / 60.to_f} min",
33
+ service_time: "#{Doodle::Protocol.average_service_time.round / 60.to_f} min"
34
+ }
35
+ end
36
+ end
37
+ end
@@ -5,6 +5,10 @@ module Doodle
5
5
 
6
6
  has_many :protocols
7
7
 
8
+ accepts_nested_attributes_for :user_channels, allow_destroy: true
9
+
10
+ scope :has_user?, -> (channel_name, user_login) { joins(:users).where(name: channel_name, 'doodle_users.login' => user_login) }
11
+
8
12
  def self.find_protocols_by_channel(name)
9
13
  Channel.find_by_name(name).protocols
10
14
  end
@@ -0,0 +1,35 @@
1
+ module Doodle
2
+ class History
3
+ def initialize(conversation)
4
+ @conversation = conversation
5
+ end
6
+
7
+ def self.find(conversation_id)
8
+ self.new(Layer::Conversation.find("layer:///conversations/#{conversation_id}"))
9
+ end
10
+
11
+ def messages
12
+ @conversation.messages.entries.map do |e|
13
+ Message.new(e)
14
+ end
15
+ end
16
+ end
17
+
18
+ class Message
19
+ def initialize(entries)
20
+ @entries = entries
21
+ end
22
+
23
+ def parts
24
+ @entries.parts.map { |p| {body: p.try(:[], 'body'), mime_type: p.try(:[], 'mime_type')} }
25
+ end
26
+
27
+ def sender
28
+ @entries.sender.try(:[], 'user_id') || @entries.sender.try(:[], 'name')
29
+ end
30
+
31
+ def sent_at
32
+ @entries.sent_at
33
+ end
34
+ end
35
+ end
@@ -4,6 +4,21 @@ module Doodle
4
4
  belongs_to :channel
5
5
  belongs_to :user
6
6
 
7
+ STATUSES = {
8
+ waiting: 'waiting',
9
+ in_progress: 'in_progress',
10
+ finalized: 'finalized'
11
+ }
12
+
13
+ scope :by_user, ->(user_ids) { where(user_id: user_ids) }
14
+ scope :by_date, ->(start_date = Time.now.beginning_of_month, end_date = Time.now) { where(created_at: start_date...end_date) }
15
+ scope :by_status, ->(status) { by_date.where(status: status) }
16
+ scope :number_by_user, ->(user_ids) { by_status(STATUSES[:in_progress]).by_user(user_ids).group(:user_id).count }
17
+ scope :in_channel_with_status, -> (channel, status) { by_status(status).joins(:channel).where("#{Doodle::Channel.table_name}.name" => channel) }
18
+ scope :in_channels_with_status, -> (channels, status) { by_status(status).joins(:channel).where(:"#{Doodle::Channel.table_name}.id" => channels) }
19
+ scope :average_service_time, -> () { by_date.average(:duration) }
20
+ scope :average_waiting_time, -> () { by_date.average(:waiting_time) }
21
+
7
22
  aasm column: :status do
8
23
  state :waiting, initial: true
9
24
  state :in_progress
@@ -13,7 +28,7 @@ module Doodle
13
28
 
14
29
  event :progress do
15
30
  before do
16
- self.update(in_progress_at: Time.now)
31
+ self.update(in_progress_at: Time.now, waiting_time: (Time.now - self.created_at))
17
32
  end
18
33
 
19
34
  transitions from: :waiting, to: :in_progress
@@ -21,17 +36,16 @@ module Doodle
21
36
 
22
37
  event :finalize do
23
38
  before do
24
- self.update(finalized_at: Time.now)
39
+ self.update(finalized_at: Time.now, duration: (Time.now - self.created_at))
25
40
  end
26
41
 
27
42
  transitions from: :in_progress, to: :finalized
28
43
  end
29
44
  end
30
45
 
31
- scope :waiting_in_channel, -> (channel){ joins(:channel).where(status: :waiting, 'doodle_channels.name' => channel) }
32
-
33
- def duration
34
- (self.finalized_at - self.created_at).round
46
+ def duration_min
47
+ return nil if self.finalized_at.blank?
48
+ "#{(self.finalized_at - self.created_at).round / 60} min"
35
49
  end
36
50
 
37
51
  def log_status_change
@@ -55,10 +69,8 @@ module Doodle
55
69
  conversation.save
56
70
  end
57
71
 
58
- def self.next(channel = 'corporativo')
59
- protocol = self.waiting_in_channel(channel).first
60
- protocol.progress!
61
- protocol
72
+ def conversation
73
+ self.conversation_id.split('/').last
62
74
  end
63
75
 
64
76
  end
@@ -1,8 +1,8 @@
1
1
  module Doodle
2
2
  class User::Analyst < User
3
3
 
4
- def enter_in_channel(name)
5
- user_channel = user_channel_by_name(name)
4
+ def enter_in_channel(channel_id)
5
+ user_channel = self.user_channels.where(channel_id: channel_id).first
6
6
  user_channel.turn_online! if user_channel.may_turn_online?
7
7
  end
8
8
 
@@ -14,5 +14,9 @@ module Doodle
14
14
  def user_channel_by_name(name)
15
15
  self.user_channels.joins(:channel).where('doodle_channels.name' => name).first
16
16
  end
17
+
18
+ def break_limit_concurrent_protocols?
19
+ self.protocols.where.not(status: 'finalized').count > self.concurrent_protocols
20
+ end
17
21
  end
18
22
  end
@@ -2,8 +2,12 @@ module Doodle
2
2
  class User < ActiveRecord::Base
3
3
  has_many :user_channels
4
4
  has_many :channels, through: :user_channels
5
+ has_many :protocols
5
6
 
7
+ scope :inative, -> { User.where.not(id: UserChannel.user_by_status('online')) }
6
8
 
7
-
9
+ def has_permission?(channel)
10
+ Channel.has_user?(channel, self.login).count > 0
11
+ end
8
12
  end
9
13
  end
@@ -5,6 +5,17 @@ module Doodle
5
5
  belongs_to :user
6
6
  belongs_to :channel
7
7
 
8
+ accepts_nested_attributes_for :user
9
+ accepts_nested_attributes_for :channel
10
+
11
+ scope :by_status, ->(status) { where(status: status) }
12
+ scope :user_by_status, ->(status) { by_status(status).group(:user_id).pluck(:user_id).compact }
13
+
14
+ STATUSES = {
15
+ online: 'online',
16
+ offline: 'offline'
17
+ }
18
+
8
19
  aasm column: :status do
9
20
  state :offline, initial: true
10
21
  state :online
@@ -0,0 +1,8 @@
1
+ module Doodle
2
+ class Keyword::Action::FinderService < Keyword::FinderService
3
+ def klass
4
+ Doodle::Keyword::Action
5
+ end
6
+ end
7
+ end
8
+
@@ -7,9 +7,13 @@ module Doodle
7
7
  def call
8
8
  scope = nil
9
9
  @params.each do |k, v|
10
- scope = Doodle::Keyword.where(k, v)
10
+ scope = klass.where(k.to_s => v)
11
11
  end
12
12
  scope.all
13
13
  end
14
+
15
+ def klass
16
+ Doodle::Keyword
17
+ end
14
18
  end
15
19
  end
@@ -0,0 +1,8 @@
1
+ module Doodle
2
+ class Keyword::Text::FinderService < Keyword::FinderService
3
+ def klass
4
+ Doodle::Keyword::Text
5
+ end
6
+ end
7
+ end
8
+
@@ -5,6 +5,7 @@ module Doodle
5
5
  end
6
6
 
7
7
  def call
8
+ @protocol.progress! if @protocol.waiting?
8
9
  @protocol.finalize!
9
10
  end
10
11
  end
@@ -1,13 +1,32 @@
1
1
  module Doodle
2
2
  class Protocol::FinderService
3
- def next
4
- Protocol.next
3
+ def next(channel)
4
+ protocol = Protocol.in_channel_with_status(user_channels_ids(user), Protocol::STATUSES[:waiting]).first
5
+ return nil if protocol.blank?
6
+ protocol.progress!
7
+ protocol
8
+
9
+ end
10
+
11
+ def next_for_user(user)
12
+ protocol = Protocol.in_channels_with_status(user_channels_ids(user), Protocol::STATUSES[:waiting]).first
13
+ return nil if protocol.blank?
14
+ protocol.progress!
15
+ protocol
16
+ end
17
+
18
+ def waiting_on_user_channels(user)
19
+ Protocol.in_channels_with_status(user_channels_ids(user), Protocol::STATUSES[:waiting])
5
20
  end
6
21
 
7
22
  def find_by_conversation(id)
8
23
  Protocol.find_by_conversation_id(id)
9
24
  end
10
- end
11
- end
12
25
 
26
+ private
27
+ def user_channels_ids(user)
28
+ user.channels.pluck(:id)
29
+ end
13
30
 
31
+ end
32
+ end
@@ -0,0 +1,11 @@
1
+ module Layer
2
+ class Conversation::FinderService
3
+ def initialize(conversation_id)
4
+ @conversation_id = conversation_id
5
+ end
6
+
7
+ def call
8
+ Layer::Conversation.find(@conversation_id)
9
+ end
10
+ end
11
+ end
data/config/routes.rb CHANGED
@@ -3,23 +3,23 @@ Doodle::Engine.routes.draw do
3
3
  resources :users, only: [:index, :create]
4
4
  resources :keywords, only: [:index, :create]
5
5
 
6
+ get 'keywords/action', to: 'keywords#action'
7
+ get 'keywords/all_actions', to: 'keywords#all_actions'
8
+
6
9
  post 'authenticate', to: 'auth#authenticate'
7
- get '/chat/:channel/has_protocols', to: 'chat#has_protocols?'
10
+
8
11
 
9
12
  post '/conversations', to: 'conversations#create'
10
- post '/chat/:channel/next', to: 'chat#next'
13
+ #post '/chat/:channel/next', to: 'chat#next'
14
+ get '/chat/:login/has_protocols', to: 'chat#has_protocols?'
15
+ post '/chat/:login/next', to: 'chat#next'
11
16
 
12
17
  post '/chat/finalize', to: 'chat#finalize'
13
18
 
14
- #
15
- # get '/chat', to: 'chat#index'
16
- # get '/chat/support', to: 'chat#support'
17
- # post '/chat/finalize', to: 'chat#finalize'
18
- #
19
- # post '/users/:channel/join', to: 'users#join'
20
- #
21
- # post '/conversations/messages', to: 'conversations#messages'
22
- # post '/messages', to: 'messages#create'
19
+ post '/conversations/messages', to: 'conversations#messages'
20
+ post '/messages', to: 'messages#create'
21
+
22
+ get '/channels', to: 'channels#index'
23
23
 
24
24
 
25
25
  end
@@ -4,7 +4,7 @@ class CreateDoodleUserChannels < ActiveRecord::Migration
4
4
  t.belongs_to :user, index: true, foreign_key: true
5
5
  t.belongs_to :channel, index: true, foreign_key: true
6
6
  t.string :status
7
- t.integer :concurrent_protocols
7
+ t.boolean :enable
8
8
 
9
9
  t.timestamps null: false
10
10
  end
@@ -1,9 +1,10 @@
1
1
  class CreateDoodleUsers < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :doodle_users do |t|
4
- t.string :login
5
- t.string :pass
4
+ t.string :login, unique: true
5
+ t.string :password
6
6
  t.string :type
7
+ t.integer :concurrent_protocols
7
8
 
8
9
  t.timestamps null: false
9
10
  end
@@ -9,6 +9,8 @@ class CreateDoodleProtocols < ActiveRecord::Migration
9
9
  t.string :status
10
10
  t.datetime :in_progress_at
11
11
  t.datetime :finalized_at
12
+ t.decimal :duration
13
+ t.decimal :waiting_time
12
14
 
13
15
  t.timestamps null: false
14
16
  end
@@ -1,3 +1,3 @@
1
1
  module Doodle
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1 @@
1
+ 6929
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doodle_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Malaquias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-05 00:00:00.000000000 Z
11
+ date: 2016-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -58,15 +58,19 @@ files:
58
58
  - app/assets/stylesheets/doodle/users.css
59
59
  - app/controllers/doodle/application_controller.rb
60
60
  - app/controllers/doodle/auth_controller.rb
61
+ - app/controllers/doodle/channels_controller.rb
61
62
  - app/controllers/doodle/chat_controller.rb
62
63
  - app/controllers/doodle/conversations_controller.rb
63
64
  - app/controllers/doodle/keywords_controller.rb
65
+ - app/controllers/doodle/messages_controller.rb
64
66
  - app/controllers/doodle/users_controller.rb
65
67
  - app/helpers/doodle/application_helper.rb
66
68
  - app/helpers/doodle/auth_helper.rb
67
69
  - app/helpers/doodle/keywords_helper.rb
70
+ - app/helpers/doodle/reports_helper.rb
68
71
  - app/helpers/doodle/users_helper.rb
69
72
  - app/models/doodle/channel.rb
73
+ - app/models/doodle/history.rb
70
74
  - app/models/doodle/keyword.rb
71
75
  - app/models/doodle/keyword/action.rb
72
76
  - app/models/doodle/keyword/text.rb
@@ -77,11 +81,14 @@ files:
77
81
  - app/models/doodle/user_channel.rb
78
82
  - app/services/doodle/channel/finder_service.rb
79
83
  - app/services/doodle/chat/join_service.rb
84
+ - app/services/doodle/keyword/action/finder_service.rb
80
85
  - app/services/doodle/keyword/finder_service.rb
86
+ - app/services/doodle/keyword/text/finder_service.rb
81
87
  - app/services/doodle/protocol/creator_service.rb
82
88
  - app/services/doodle/protocol/finalizer_service.rb
83
89
  - app/services/doodle/protocol/finder_service.rb
84
90
  - app/services/layer/conversation/creator_service.rb
91
+ - app/services/layer/conversation/finder_service.rb
85
92
  - app/services/layer/token_creator_service.rb
86
93
  - app/views/layouts/doodle/application.html.erb
87
94
  - config/initializers/layer.rb
@@ -127,7 +134,6 @@ files:
127
134
  - test/dummy/config/initializers/session_store.rb
128
135
  - test/dummy/config/initializers/wrap_parameters.rb
129
136
  - test/dummy/config/locales/en.yml
130
- - test/dummy/config/private_key.pem
131
137
  - test/dummy/config/routes.rb
132
138
  - test/dummy/config/secrets.yml
133
139
  - test/dummy/db/development.sqlite3
@@ -137,6 +143,7 @@ files:
137
143
  - test/dummy/public/422.html
138
144
  - test/dummy/public/500.html
139
145
  - test/dummy/public/favicon.ico
146
+ - test/dummy/tmp/pids/server.pid
140
147
  - test/fixtures/doodle/keywords.yml
141
148
  - test/fixtures/doodle/users.yml
142
149
  - test/integration/navigation_test.rb
@@ -169,50 +176,51 @@ specification_version: 4
169
176
  summary: A Rails Engine for vists based in Layer Plataform
170
177
  test_files:
171
178
  - test/controllers/doodle/auth_controller_test.rb
172
- - test/controllers/doodle/users_controller_test.rb
173
179
  - test/controllers/doodle/keywords_controller_test.rb
174
- - test/dummy/README.rdoc
175
- - test/dummy/public/favicon.ico
176
- - test/dummy/public/422.html
177
- - test/dummy/public/404.html
178
- - test/dummy/public/500.html
179
- - test/dummy/log/development.log
180
- - test/dummy/bin/setup
181
- - test/dummy/bin/bundle
182
- - test/dummy/bin/rake
183
- - test/dummy/bin/rails
184
- - test/dummy/app/controllers/application_controller.rb
185
- - test/dummy/app/views/layouts/application.html.erb
180
+ - test/controllers/doodle/users_controller_test.rb
181
+ - test/doodle_test.rb
186
182
  - test/dummy/app/assets/javascripts/application.js
187
183
  - test/dummy/app/assets/stylesheets/application.css
184
+ - test/dummy/app/controllers/application_controller.rb
188
185
  - test/dummy/app/helpers/application_helper.rb
189
- - test/dummy/Rakefile
190
- - test/dummy/config.ru
191
- - test/dummy/db/development.sqlite3
192
- - test/dummy/db/schema.rb
193
- - test/dummy/config/initializers/cookies_serializer.rb
194
- - test/dummy/config/initializers/wrap_parameters.rb
186
+ - test/dummy/app/views/layouts/application.html.erb
187
+ - test/dummy/bin/bundle
188
+ - test/dummy/bin/rails
189
+ - test/dummy/bin/rake
190
+ - test/dummy/bin/setup
191
+ - test/dummy/config/application.rb
192
+ - test/dummy/config/boot.rb
193
+ - test/dummy/config/database.yml
194
+ - test/dummy/config/environment.rb
195
+ - test/dummy/config/environments/development.rb
196
+ - test/dummy/config/environments/production.rb
197
+ - test/dummy/config/environments/test.rb
198
+ - test/dummy/config/initializers/assets.rb
195
199
  - test/dummy/config/initializers/backtrace_silencers.rb
196
- - test/dummy/config/initializers/inflections.rb
200
+ - test/dummy/config/initializers/cookies_serializer.rb
197
201
  - test/dummy/config/initializers/filter_parameter_logging.rb
202
+ - test/dummy/config/initializers/inflections.rb
198
203
  - test/dummy/config/initializers/mime_types.rb
199
- - test/dummy/config/initializers/assets.rb
200
204
  - test/dummy/config/initializers/session_store.rb
201
- - test/dummy/config/secrets.yml
202
- - test/dummy/config/boot.rb
203
- - test/dummy/config/application.rb
204
- - test/dummy/config/routes.rb
205
- - test/dummy/config/private_key.pem
206
- - test/dummy/config/environments/production.rb
207
- - test/dummy/config/environments/test.rb
208
- - test/dummy/config/environments/development.rb
209
- - test/dummy/config/database.yml
205
+ - test/dummy/config/initializers/wrap_parameters.rb
210
206
  - test/dummy/config/locales/en.yml
211
- - test/dummy/config/environment.rb
212
- - test/models/doodle/keyword_test.rb
213
- - test/models/doodle/user_test.rb
214
- - test/fixtures/doodle/users.yml
207
+ - test/dummy/config/routes.rb
208
+ - test/dummy/config/secrets.yml
209
+ - test/dummy/config.ru
210
+ - test/dummy/db/development.sqlite3
211
+ - test/dummy/db/schema.rb
212
+ - test/dummy/log/development.log
213
+ - test/dummy/public/404.html
214
+ - test/dummy/public/422.html
215
+ - test/dummy/public/500.html
216
+ - test/dummy/public/favicon.ico
217
+ - test/dummy/Rakefile
218
+ - test/dummy/README.rdoc
219
+ - test/dummy/tmp/pids/server.pid
215
220
  - test/fixtures/doodle/keywords.yml
221
+ - test/fixtures/doodle/users.yml
216
222
  - test/integration/navigation_test.rb
223
+ - test/models/doodle/keyword_test.rb
224
+ - test/models/doodle/user_test.rb
217
225
  - test/test_helper.rb
218
- - test/doodle_test.rb
226
+ has_rdoc:
@@ -1,15 +0,0 @@
1
- -----BEGIN RSA PRIVATE KEY-----
2
- MIICXQIBAAKBgQCSD4Ga2raKX4Ao1OVDUC4vfhbe4pjFh2Y+f5xzsiJ08qZ1Pdcz
3
- Lt42UboOaObjXRqv1KSHsukwXIVQO+HdfOILf5uq6rGVdeEQpaSMymtChP4s767U
4
- zjBdABYWqEyKiX9zP5aMDmUToQYsW0Lxhzn6qq+bLHkr2CklloJoQkU8lQIDAQAB
5
- AoGAZDt753bb+c1bt6mRw0XMzA6tRzsdN8CZK56LEOJXvwWdsatEeP1axNAE7EqU
6
- 18ZWv/8fAXiHigaT/eF6OHKw88WyYUAYWS0L0PrIDT/+KQj86xZoUVGgz8nXHnaw
7
- 2TwFx1xX4jPppAP+3DznvFnU2mnhsMLEMlMY1uLsaAuuCsECQQDBlXlOlYiFW/kf
8
- ZtDdlaxqR4/M0a7AIl8IB75cngQ0SC8ziTXFGiYmcnDgKoy3lu4UIUCY3g7lM9YZ
9
- AxWl8e2dAkEAwSduQ1Bau3aQuAThZAsTWTa1zG0Dqb8RUZPTIkffV5nP8t/L6R5Y
10
- 0AXnm6HF5jpeXn+4pJX+y8FaNzP20W7VWQJAZg9gPUYpC+ZJmXyjca+Pjxjbf6is
11
- 8S8t2xX6DupgXRARkqIsbxYyNuLvD8BfIAu6yXIelHm+cKi7n8Q4jZzXIQJBAJKs
12
- RJitHhkYcdCrNBRqLKkkWG0BozR1OMt/u2ZeuYSl8jj2JLvDJaHhufx+ne60CBEu
13
- X6HrnO5QxxcASL7EsRECQQC8Y06TKIZZb8sPMIDsHePrbGemgiNT8LB5o0BpXZXy
14
- f71b9gdd6sRTK348Auje62StD1kRo/DDyqHozXko4L9B
15
- -----END RSA PRIVATE KEY-----