xmppify 0.0.24 → 0.0.46

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: 726261def4b164d4048a054584544c26a8cee606
4
- data.tar.gz: f7d4451590f322f61569be03c9e1206ad87d9351
3
+ metadata.gz: a468d27148db7e94701e277e0979c6beacc1128d
4
+ data.tar.gz: c1990cf810d18605fdf3610f4de254e057e1ad0c
5
5
  SHA512:
6
- metadata.gz: 0a957cfdc471c147098451baa6ce88d27b579e4d55452a9190de174fe65e041a52193e35fd93caf4e8bed107795889cdf7ece341a25b4b73a7fe8ea09c984d5c
7
- data.tar.gz: db80d3a62b92ac34e8badea5277c26b4d23bcc2084a3610c4640969a95ded3b683fc96e47aaeae3229940ee361aa8c886c85817cbace5f4e27fc1aae9f11e8eb
6
+ metadata.gz: b7f5d94d25d5ceb0ec8946cd122b78fa40d508dce32e1844daf7c20c26f9748f81b82b98bf420d838a0b949ed29acb2dac49a7846627b3e77dffa90b7614f7ef
7
+ data.tar.gz: 9e0e1d2eb998bc7f18e0280c28134f236e0d979d8c75c1d7afb508933275d64b8dd78b2d3538787f3ca331ec066ebbe061be25e34cdd7e50213256b3cfaa826e
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ bin
data/Rakefile CHANGED
@@ -1 +1,2 @@
1
1
  require "bundler/gem_tasks"
2
+
@@ -1,42 +1,11 @@
1
1
 
2
2
  app = angular.module("idlecampus", ["ngResource", "$strap.directives"])
3
- @xmpp = ["$scope","Data",($scope, Data) ->
3
+ @xmpp = ["$scope",($scope) ->
4
4
  group_name = undefined
5
5
  group_code = undefined
6
6
  $scope.$watch "spin", (newValue, oldValue) ->
7
7
 
8
8
 
9
- $scope.changeEmail = ->
10
- console.log $scope.email
11
- $.ajax
12
- type: "GET"
13
- url: "/users/checkEmail"
14
- data:
15
- email: $scope.email
16
-
17
- success: (data) ->
18
- console.log parseInt(data)
19
- $("#emailicon").attr "class", "icon-check" if parseInt(data) is 0
20
- $("#emailicon").attr "class", "icon-remove" if parseInt(data) > 0
21
- console.log $("#emailicon")
22
-
23
- dataType: ""
24
-
25
-
26
- $scope.changeName = ->
27
- console.log "name"
28
- console.log $scope.user
29
- $.ajax
30
- type: "GET"
31
- url: "/users/checkName"
32
- data:
33
- name: $scope.user
34
-
35
- success: (data) ->
36
- $("#nameicon").attr "class", "icon-check" if parseInt(data) is 0
37
- $("#nameicon").attr "class", "icon-remove" if parseInt(data) > 0
38
-
39
- dataType: ""
40
9
 
41
10
 
42
11
  $scope.connected = ->
@@ -265,12 +234,7 @@ app = angular.module("idlecampus", ["ngResource", "$strap.directives"])
265
234
  localStorage.setItem "rid", $(body).attr("rid")
266
235
  localStorage.setItem "sid", $(body).attr("sid")
267
236
 
268
- $scope.getGroupsCreated = ->
269
- $.get "/groups", (data) ->
270
- console.log "groups created"
271
- console.log data
272
- for d in data
273
- Data.groupscreated.push d
237
+
274
238
 
275
239
 
276
240
  $scope.checkIfGroupsToCreate = ->
@@ -279,68 +243,7 @@ app = angular.module("idlecampus", ["ngResource", "$strap.directives"])
279
243
  group_code = gon.group.grup_code
280
244
  $scope.XMPP.connection.pubsub.publish $scope.XMPP.connection.jid.split("/")[0] + "/groups", group_code, (data) ->
281
245
 
282
- $scope.register1 = ->
283
- console.log gon.attacher
284
- form = $scope.signupform
285
- connection = new Strophe.Connection("http://idlecampus.com//http-bind")
286
- sid = localStorage.getItem("sid")
287
- rid = localStorage.getItem("rid")
288
- jid = localStorage.getItem("jid")
289
- console.log "CREDENTIALS"
290
- console.log sid
291
- console.log rid
292
- console.log jid
293
- console.log connection
294
- callback = (status) ->
295
- console.log status
296
- if status is Strophe.Status.REGISTER
297
- connection.register.fields.username = user
298
- connection.register.fields.password = password
299
- connection.register.submit()
300
- else if status is Strophe.Status.REGISTERED
301
- localStorage.setItem "jid", user + "@idlecampus.com"
302
- $scope.connect user + "@idlecampus.com", password
303
- $scope.$digest()
304
- else if status is Strophe.Status.CONNECTED
305
- console.log "logged in!"
306
- else
307
-
308
- if (typeof gon isnt "undefined" and gon isnt null) and (gon.register?)
309
- user = gon.register.name
310
- email = gon.register.email
311
- password = gon.register.password
312
- connection.register.connect "idlecampus.com", callback, 60, 1
313
- if (typeof gon isnt "undefined" and gon isnt null) and (gon.attacher?)
314
- user = gon.attacher.user
315
- password = gon.attacher.password
316
- localStorage.setItem "jid", user + "@idlecampus.com"
317
- return $scope.connect(user + "@idlecampus.com", password)
318
-
319
- if (typeof jid isnt "undefined" and jid isnt null) and (typeof sid isnt "undefined" and sid isnt null) and (typeof rid isnt "undefined" and rid isnt null) and jid isnt "" and sid isnt "" and rid isnt ""
320
- console.log connection
321
- connection.xmlInput = (body) ->
322
- console.log body
323
-
324
- connection.xmlOutput = (body) ->
325
- console.log "XMPP OUTPUT"
326
- console.log body
327
- localStorage.setItem "rid", $(body).attr("rid")
328
- localStorage.setItem "sid", $(body).attr("sid")
329
-
330
- connection.attach jid, sid, rid, (status) ->
331
- console.log status
332
- if status is Strophe.Status.CONNECTED or status is Strophe.Status.ATTACHED
333
- $scope.XMPP.connection = connection
334
- $scope.XMPP.connection.jid = jid
335
- console.log "attached"
336
- $scope.connected()
337
- $scope.getGroupsCreated()
338
- $scope.checkIfGroupsToCreate()
339
- else
340
- $(document).trigger "disconnected" if status is Strophe.Status.DISCONNECTED
341
-
342
- $scope.XMPP.connection = connection
343
-
246
+
344
247
  $scope.signout = ->
345
248
 
346
249
  $scope.XMPP.connection.disconnect()
@@ -8,9 +8,9 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
8
8
  xmpp_credentials = sign_in_as @user
9
9
  ap xmpp_credentials
10
10
  flash[:attacher] = xmpp_credentials
11
- if @user.identities.find_by(provider:"github").nil?
12
- @user.identities.create(provider:"github",auth_token:oauth_data.info.github_auth_token,email:oauth_data.info.github_email)
13
- end
11
+ # if @user.identities.find_by(provider:"github").nil?
12
+ # @user.identities.create(provider:"github",auth_token:oauth_data.info.github_auth_token,email:oauth_data.info.github_email)
13
+ # end
14
14
  sign_in @user
15
15
  redirect_to dashboard_path
16
16
  end
data/app/models/user.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  require 'yaml'
2
2
  require 'ruby_bosh'
3
3
  class User < ActiveRecord::Base
4
- include PublicActivity::Model
5
- tracked
4
+ # include PublicActivity::Model
5
+ # tracked
6
6
  has_many :identities
7
- has_merit
8
- acts_as_followable
9
- acts_as_follower
7
+ # has_merit
8
+ # acts_as_followable
9
+ # acts_as_follower
10
10
  devise :database_authenticatable, :omniauthable, :omniauth_providers => [:doorkeeper]
11
11
 
12
12
  after_create :register_user
@@ -16,7 +16,7 @@
16
16
  <div class="w-col w-col-6 nav-column" data-role='nav-links'>
17
17
  <% if signed_in? -%>
18
18
  <div class="welcome">Welcome, <%= current_user.email %></div>
19
- <%= link_to t('.sign_out'), destroy_user_session_path, :method => :delete, class: "nav-link" %>
19
+ <%= link_to "<i class='fa fa-sign-out'></i> Sign out".html_safe, destroy_user_session_path, method: :delete %>
20
20
  <% else -%>
21
21
  <%= link_to "Sign in with IdleCampus", user_omniauth_authorize_path(:doorkeeper) %>
22
22
 
@@ -5,19 +5,22 @@
5
5
  <%= stylesheet_link_tag "application", media: "all" %>
6
6
  <%= javascript_include_tag "application" %>
7
7
  <%= csrf_meta_tags %>
8
+ <%= include_gon %>
8
9
  <!--[if lt IE 9]>
9
10
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
10
11
  <![endif]-->
11
12
  </head>
12
- <body>
13
+ <body ng-controller="xmpp" ng-init="attach()">
13
14
  <div id='header' data-role='nav-links'>
14
15
  <%= render 'layouts/header' %>
15
16
  </div>
16
17
 
17
18
  <div id='flash'>
18
- <% flash.each do |key, value| -%>
19
- <div id='flash_<%= key %>'><%=h value %></div>
20
- <% end %>
19
+ <% if flash[:notice] %>
20
+ <p id="notice" ><%= flash[:notice] %></p>
21
+ <% elsif flash[:alert] %>
22
+ <p id="alert" ><%= flash[:alert] %></p>
23
+ <% end %>
21
24
  </div>
22
25
 
23
26
  <%= yield %>
@@ -9,7 +9,7 @@
9
9
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
10
10
  <![endif]-->
11
11
  </head>
12
- <body>
12
+ <body ng-controller="xmpp" ng-init="attach()">
13
13
  <div id='header' data-role='nav-links'>
14
14
  <%= render 'layouts/header' %>
15
15
  </div>
data/bin/bundler ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'bundler' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('xmppify', 'bundler')
data/bin/erubis ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'erubis' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('xmppify', 'erubis')
data/bin/rackup ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rackup' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('xmppify', 'rackup')
data/bin/rails CHANGED
@@ -1,8 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rails' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
3
8
 
4
- ENGINE_ROOT = File.expand_path('../..', __FILE__)
5
- ENGINE_PATH = File.expand_path('../../lib/xmppify', __FILE__)
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
6
12
 
7
- require 'rails/all'
8
- require 'rails/engine/commands'
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('xmppify', 'rails')
data/bin/rake ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rake' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('xmppify', 'rake')
data/bin/restclient ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'restclient' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('xmppify', 'restclient')
data/bin/thor ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'thor' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('xmppify', 'thor')
@@ -0,0 +1,255 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ # The secret key used by Devise. Devise uses this key to generate
5
+ # random tokens. Changing this key will render invalid all existing
6
+ # confirmation, reset password and unlock tokens in the database.
7
+ # config.secret_key = '058e80931a360732d9e5a15541e5bbeb5b3cba57450fe85086d977567624e4909b2669021ad9cd0aa53c38a08be0757f72928c46250a44900e6456e05e594e7f'
8
+
9
+ # ==> Mailer Configuration
10
+ # Configure the e-mail address which will be shown in Devise::Mailer,
11
+ # note that it will be overwritten if you use your own mailer class
12
+ # with default "from" parameter.
13
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
14
+
15
+ # Configure the class responsible to send e-mails.
16
+ # config.mailer = 'Devise::Mailer'
17
+
18
+ # ==> ORM configuration
19
+ # Load and configure the ORM. Supports :active_record (default) and
20
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
21
+ # available as additional gems.
22
+ require 'devise/orm/active_record'
23
+ # ==> Configuration for any authentication mechanism
24
+ # Configure which keys are used when authenticating a user. The default is
25
+ # just :email. You can configure it to use [:username, :subdomain], so for
26
+ # authenticating a user, both parameters are required. Remember that those
27
+ # parameters are used only when authenticating and not when retrieving from
28
+ # session. If you need permissions, you should implement that in a before filter.
29
+ # You can also supply a hash where the value is a boolean determining whether
30
+ # or not authentication should be aborted when the value is not present.
31
+ # config.authentication_keys = [ :email ]
32
+
33
+ # Configure parameters from the request object used for authentication. Each entry
34
+ # given should be a request method and it will automatically be passed to the
35
+ # find_for_authentication method and considered in your model lookup. For instance,
36
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
37
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
38
+ # config.request_keys = []
39
+
40
+ # Configure which authentication keys should be case-insensitive.
41
+ # These keys will be downcased upon creating or modifying a user and when used
42
+ # to authenticate or find a user. Default is :email.
43
+ config.case_insensitive_keys = [ :email ]
44
+
45
+ # Configure which authentication keys should have whitespace stripped.
46
+ # These keys will have whitespace before and after removed upon creating or
47
+ # modifying a user and when used to authenticate or find a user. Default is :email.
48
+ config.strip_whitespace_keys = [ :email ]
49
+
50
+ # Tell if authentication through request.params is enabled. True by default.
51
+ # It can be set to an array that will enable params authentication only for the
52
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
53
+ # enable it only for database (email + password) authentication.
54
+ # config.params_authenticatable = true
55
+
56
+ # Tell if authentication through HTTP Auth is enabled. False by default.
57
+ # It can be set to an array that will enable http authentication only for the
58
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
59
+ # enable it only for database authentication. The supported strategies are:
60
+ # :database = Support basic authentication with authentication key + password
61
+ # config.http_authenticatable = false
62
+
63
+ # If http headers should be returned for AJAX requests. True by default.
64
+ # config.http_authenticatable_on_xhr = true
65
+
66
+ # The realm used in Http Basic Authentication. 'Application' by default.
67
+ # config.http_authentication_realm = 'Application'
68
+
69
+ # It will change confirmation, password recovery and other workflows
70
+ # to behave the same regardless if the e-mail provided was right or wrong.
71
+ # Does not affect registerable.
72
+ # config.paranoid = true
73
+
74
+ # By default Devise will store the user in session. You can skip storage for
75
+ # particular strategies by setting this option.
76
+ # Notice that if you are skipping storage for all authentication paths, you
77
+ # may want to disable generating routes to Devise's sessions controller by
78
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
79
+ config.skip_session_storage = [:http_auth]
80
+
81
+ # By default, Devise cleans up the CSRF token on authentication to
82
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
83
+ # requests for sign in and sign up, you need to get a new CSRF token
84
+ # from the server. You can disable this option at your own risk.
85
+ # config.clean_up_csrf_token_on_authentication = true
86
+
87
+ # ==> Configuration for :database_authenticatable
88
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
89
+ # using other encryptors, it sets how many times you want the password re-encrypted.
90
+ #
91
+ # Limiting the stretches to just one in testing will increase the performance of
92
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
93
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
94
+ # encryptor), the cost increases exponentially with the number of stretches (e.g.
95
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
96
+ config.stretches = Rails.env.test? ? 1 : 10
97
+
98
+ # Setup a pepper to generate the encrypted password.
99
+ # config.pepper = '13c949e186732b75ec1ac7b8702bb172a96bc69afa2097dc09079a5fa40126627b42c12942e93b0e8d69224ac0dd9aefca3bc795aa450b253063e549e8a80172'
100
+
101
+ # ==> Configuration for :confirmable
102
+ # A period that the user is allowed to access the website even without
103
+ # confirming their account. For instance, if set to 2.days, the user will be
104
+ # able to access the website for two days without confirming their account,
105
+ # access will be blocked just in the third day. Default is 0.days, meaning
106
+ # the user cannot access the website without confirming their account.
107
+ # config.allow_unconfirmed_access_for = 2.days
108
+
109
+ # A period that the user is allowed to confirm their account before their
110
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
111
+ # their account within 3 days after the mail was sent, but on the fourth day
112
+ # their account can't be confirmed with the token any more.
113
+ # Default is nil, meaning there is no restriction on how long a user can take
114
+ # before confirming their account.
115
+ # config.confirm_within = 3.days
116
+
117
+ # If true, requires any email changes to be confirmed (exactly the same way as
118
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
119
+ # db field (see migrations). Until confirmed, new email is stored in
120
+ # unconfirmed_email column, and copied to email column on successful confirmation.
121
+ config.reconfirmable = true
122
+
123
+ # Defines which key will be used when confirming an account
124
+ # config.confirmation_keys = [ :email ]
125
+
126
+ # ==> Configuration for :rememberable
127
+ # The time the user will be remembered without asking for credentials again.
128
+ # config.remember_for = 2.weeks
129
+
130
+ # If true, extends the user's remember period when remembered via cookie.
131
+ # config.extend_remember_period = false
132
+
133
+ # Options to be passed to the created cookie. For instance, you can set
134
+ # secure: true in order to force SSL only cookies.
135
+ # config.rememberable_options = {}
136
+
137
+ # ==> Configuration for :validatable
138
+ # Range for password length.
139
+ config.password_length = 8..128
140
+
141
+ # Email regex used to validate email formats. It simply asserts that
142
+ # one (and only one) @ exists in the given string. This is mainly
143
+ # to give user feedback and not to assert the e-mail validity.
144
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
145
+
146
+ # ==> Configuration for :timeoutable
147
+ # The time you want to timeout the user session without activity. After this
148
+ # time the user will be asked for credentials again. Default is 30 minutes.
149
+ # config.timeout_in = 30.minutes
150
+
151
+ # If true, expires auth token on session timeout.
152
+ # config.expire_auth_token_on_timeout = false
153
+
154
+ # ==> Configuration for :lockable
155
+ # Defines which strategy will be used to lock an account.
156
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
157
+ # :none = No lock strategy. You should handle locking by yourself.
158
+ # config.lock_strategy = :failed_attempts
159
+
160
+ # Defines which key will be used when locking and unlocking an account
161
+ # config.unlock_keys = [ :email ]
162
+
163
+ # Defines which strategy will be used to unlock an account.
164
+ # :email = Sends an unlock link to the user email
165
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
166
+ # :both = Enables both strategies
167
+ # :none = No unlock strategy. You should handle unlocking by yourself.
168
+ # config.unlock_strategy = :both
169
+
170
+ # Number of authentication tries before locking an account if lock_strategy
171
+ # is failed attempts.
172
+ # config.maximum_attempts = 20
173
+
174
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
175
+ # config.unlock_in = 1.hour
176
+
177
+ # Warn on the last attempt before the account is locked.
178
+ # config.last_attempt_warning = false
179
+
180
+ # ==> Configuration for :recoverable
181
+ #
182
+ # Defines which key will be used when recovering the password for an account
183
+ # config.reset_password_keys = [ :email ]
184
+
185
+ # Time interval you can reset your password with a reset password key.
186
+ # Don't put a too small interval or your users won't have the time to
187
+ # change their passwords.
188
+ config.reset_password_within = 6.hours
189
+
190
+ # ==> Configuration for :encryptable
191
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
192
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
193
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
194
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
195
+ # REST_AUTH_SITE_KEY to pepper).
196
+ #
197
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
198
+ # config.encryptor = :sha512
199
+
200
+ # ==> Scopes configuration
201
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
202
+ # "users/sessions/new". It's turned off by default because it's slower if you
203
+ # are using only default views.
204
+ # config.scoped_views = false
205
+
206
+ # Configure the default scope given to Warden. By default it's the first
207
+ # devise role declared in your routes (usually :user).
208
+ # config.default_scope = :user
209
+
210
+ # Set this configuration to false if you want /users/sign_out to sign out
211
+ # only the current scope. By default, Devise signs out all scopes.
212
+ # config.sign_out_all_scopes = true
213
+
214
+ # ==> Navigation configuration
215
+ # Lists the formats that should be treated as navigational. Formats like
216
+ # :html, should redirect to the sign in page when the user does not have
217
+ # access, but formats like :xml or :json, should return 401.
218
+ #
219
+ # If you have any extra navigational formats, like :iphone or :mobile, you
220
+ # should add them to the navigational formats lists.
221
+ #
222
+ # The "*/*" below is required to match Internet Explorer requests.
223
+ # config.navigational_formats = ['*/*', :html]
224
+
225
+ # The default HTTP method used to sign out a resource. Default is :delete.
226
+ config.sign_out_via = :delete
227
+
228
+ # ==> OmniAuth
229
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
230
+ # up on your models and hooks.
231
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
232
+
233
+ # ==> Warden configuration
234
+ # If you want to use other strategies, that are not supported by Devise, or
235
+ # change the failure app, you can configure them inside the config.warden block.
236
+ #
237
+ # config.warden do |manager|
238
+ # manager.intercept_401 = false
239
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
240
+ # end
241
+
242
+ # ==> Mountable engine configurations
243
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
244
+ # is mountable, there are some extra configurations to be taken into account.
245
+ # The following options are available, assuming the engine is mounted as:
246
+ #
247
+ # mount MyEngine, at: '/my_engine'
248
+ #
249
+ # The router that invoked `devise_for`, in the example above, would be:
250
+ # config.router_name = :my_engine
251
+ #
252
+ # When using omniauth, Devise cannot automatically set Omniauth path,
253
+ # so you need to do it manually. For the users scope, it would be:
254
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
255
+ end
@@ -0,0 +1,59 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your account was successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "Invalid email or password."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account will be locked."
15
+ not_found_in_database: "Invalid email or password."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your account before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock Instructions"
26
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
32
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
+ updated: "Your password was changed successfully. You are now signed in."
34
+ updated_not_active: "Your password was changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
41
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
42
+ updated: "You updated your account successfully."
43
+ sessions:
44
+ signed_in: "Signed in successfully."
45
+ signed_out: "Signed out successfully."
46
+ unlocks:
47
+ send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
48
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
49
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
50
+ errors:
51
+ messages:
52
+ already_confirmed: "was already confirmed, please try signing in"
53
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
54
+ expired: "has expired, please request a new one"
55
+ not_found: "not found"
56
+ not_locked: "was not locked"
57
+ not_saved:
58
+ one: "1 error prohibited this %{resource} from being saved:"
59
+ other: "%{count} errors prohibited this %{resource} from being saved:"
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ Xmppify::Engine.routes.draw do
2
+ devise_for :users
3
+ # devise_for :users, class_name: "Xmppify::User", module: :devise
4
+
5
+ end
@@ -5,6 +5,8 @@ class CreateUsers < ActiveRecord::Migration
5
5
  t.integer :doorkeeper_uid
6
6
  t.string :doorkeeper_access_token
7
7
  t.string :encrypted_data
8
+ t.string :email
9
+ t.string :name
8
10
  t.timestamps
9
11
  end
10
12
  end
@@ -4,7 +4,6 @@ class CreateIdentities < ActiveRecord::Migration
4
4
  t.references :user, index: true
5
5
  t.string :provider
6
6
  t.string :email
7
-
8
7
  t.timestamps
9
8
  end
10
9
  end
@@ -0,0 +1,9 @@
1
+ # This migration comes from xmppify_engine (originally 20140330183230)
2
+ class DeviseCreateUsers < ActiveRecord::Migration
3
+ def change
4
+
5
+ add_column :users,:encrypted_password,:string, null: false, default: ""
6
+ add_index :users, :email,unique: true
7
+
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Xmppify
2
- VERSION = "0.0.24"
2
+ VERSION = "0.0.46"
3
3
  end
data/lib/xmppify.rb CHANGED
@@ -1,5 +1,11 @@
1
1
  require "xmppify/version"
2
-
2
+ require 'rails'
3
+ require 'devise'
4
+ require 'omniauth-oauth2'
5
+ require 'xmpp4r'
6
+ require 'doorkeeper'
7
+ require 'hpricot'
8
+ require 'gon'
3
9
  module Xmppify
4
10
  class Engine < Rails::Engine
5
11
  end
data/xmppify.gemspec CHANGED
@@ -17,8 +17,27 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
-
21
- spec.add_development_dependency "bundler", "~> 1.5"
22
- spec.add_development_dependency "rake"
23
- spec.add_development_dependency 'angularjs-rails'
20
+ spec.test_files = Dir["spec/**/*"]
21
+ spec.add_dependency "bundler", "~> 1.5"
22
+ spec.add_dependency "rake"
23
+ spec.add_dependency 'angularjs-rails'
24
+ spec.add_dependency 'devise'
25
+ spec.add_dependency 'gon'
26
+ spec.add_dependency 'rest-client'
27
+ spec.add_dependency 'hpricot'
28
+ spec.add_dependency 'omniauth-oauth2'
29
+ spec.add_dependency 'doorkeeper'
30
+ spec.add_dependency 'xmpp4r','0.5.5'
31
+ spec.add_development_dependency 'dotenv-rails'
32
+ spec.add_development_dependency 'awesome_print'
33
+ spec.add_development_dependency 'rspec-rails'
34
+ spec.add_development_dependency 'guard-rspec', '2.5.0'
35
+ spec.add_development_dependency 'spork-rails', '4.0.0'
36
+ spec.add_development_dependency 'guard-spork', '1.5.0'
37
+ spec.add_development_dependency 'childprocess'
38
+ spec.add_development_dependency 'factory_girl_rails'
39
+ spec.add_development_dependency "database_cleaner", "~> 1.2.0"
40
+ spec.add_development_dependency "poltergeist"
41
+ spec.add_development_dependency 'capybara'
42
+ spec.add_development_dependency 'launchy'
24
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmppify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.46
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-29 00:00:00.000000000 Z
11
+ date: 2014-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
- type: :development
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
@@ -31,7 +31,7 @@ dependencies:
31
31
  - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
- type: :development
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
@@ -40,6 +40,272 @@ dependencies:
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: angularjs-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: devise
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: gon
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rest-client
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: hpricot
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: omniauth-oauth2
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: doorkeeper
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: xmpp4r
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '='
144
+ - !ruby/object:Gem::Version
145
+ version: 0.5.5
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '='
151
+ - !ruby/object:Gem::Version
152
+ version: 0.5.5
153
+ - !ruby/object:Gem::Dependency
154
+ name: dotenv-rails
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: awesome_print
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rspec-rails
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - '>='
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: guard-rspec
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - '='
200
+ - !ruby/object:Gem::Version
201
+ version: 2.5.0
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - '='
207
+ - !ruby/object:Gem::Version
208
+ version: 2.5.0
209
+ - !ruby/object:Gem::Dependency
210
+ name: spork-rails
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - '='
214
+ - !ruby/object:Gem::Version
215
+ version: 4.0.0
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - '='
221
+ - !ruby/object:Gem::Version
222
+ version: 4.0.0
223
+ - !ruby/object:Gem::Dependency
224
+ name: guard-spork
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - '='
228
+ - !ruby/object:Gem::Version
229
+ version: 1.5.0
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - '='
235
+ - !ruby/object:Gem::Version
236
+ version: 1.5.0
237
+ - !ruby/object:Gem::Dependency
238
+ name: childprocess
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - '>='
242
+ - !ruby/object:Gem::Version
243
+ version: '0'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - '>='
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: factory_girl_rails
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - '>='
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - '>='
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ - !ruby/object:Gem::Dependency
266
+ name: database_cleaner
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - ~>
270
+ - !ruby/object:Gem::Version
271
+ version: 1.2.0
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - ~>
277
+ - !ruby/object:Gem::Version
278
+ version: 1.2.0
279
+ - !ruby/object:Gem::Dependency
280
+ name: poltergeist
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - '>='
284
+ - !ruby/object:Gem::Version
285
+ version: '0'
286
+ type: :development
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - '>='
291
+ - !ruby/object:Gem::Version
292
+ version: '0'
293
+ - !ruby/object:Gem::Dependency
294
+ name: capybara
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - '>='
298
+ - !ruby/object:Gem::Version
299
+ version: '0'
300
+ type: :development
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - '>='
305
+ - !ruby/object:Gem::Version
306
+ version: '0'
307
+ - !ruby/object:Gem::Dependency
308
+ name: launchy
43
309
  requirement: !ruby/object:Gem::Requirement
44
310
  requirements:
45
311
  - - '>='
@@ -60,7 +326,13 @@ description: 'We have extracted out the logic from IdleCampus and built xmppify
60
326
  email:
61
327
  - ankothari@gmail.com
62
328
  executables:
329
+ - bundler
330
+ - erubis
331
+ - rackup
63
332
  - rails
333
+ - rake
334
+ - restclient
335
+ - thor
64
336
  extensions: []
65
337
  extra_rdoc_files: []
66
338
  files:
@@ -183,9 +455,19 @@ files:
183
455
  - app/views/xmppify/layouts/_footer.html.erb
184
456
  - app/views/xmppify/layouts/_header.html.erb
185
457
  - app/views/xmppify/layouts/application.html.erb
458
+ - bin/bundler
459
+ - bin/erubis
460
+ - bin/rackup
186
461
  - bin/rails
462
+ - bin/rake
463
+ - bin/restclient
464
+ - bin/thor
465
+ - config/initializers/devise.rb
466
+ - config/locales/devise.en.yml
467
+ - config/routes.rb
187
468
  - db/migrate/20140329065635_create_users.rb
188
469
  - db/migrate/20140329070238_create_identities.rb
470
+ - db/migrate/20140330183230_devise_create_users.rb
189
471
  - lib/xmppify.rb
190
472
  - lib/xmppify/version.rb
191
473
  - xmppify.gemspec
@@ -209,7 +491,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
491
  version: '0'
210
492
  requirements: []
211
493
  rubyforge_project:
212
- rubygems_version: 2.1.10
494
+ rubygems_version: 2.1.9
213
495
  signing_key:
214
496
  specification_version: 4
215
497
  summary: A gem for all your real time communication needs like group chatting, one-on-one