user_mgmt 0.0.62 → 0.0.511

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -8
  3. data/Gemfile +2 -12
  4. data/README.md +2 -10
  5. data/Rakefile +0 -35
  6. data/app/controllers/user_mgmt_controller.rb +4 -0
  7. data/app/views/user_mgmt/registrations/_user_form.html.haml +6 -3
  8. data/app/views/user_mgmt/registrations/new.html.haml +7 -18
  9. data/lib/generators/templates/README +2 -18
  10. data/lib/generators/templates/user_mgmt.rb +1 -28
  11. data/lib/generators/user_mgmt/install_generator.rb +0 -6
  12. data/lib/user_mgmt/configurator.rb +8 -0
  13. data/lib/user_mgmt/engine.rb +5 -28
  14. data/lib/user_mgmt/version.rb +1 -1
  15. data/lib/user_mgmt.rb +13 -8
  16. data/user_mgmt.gemspec +24 -40
  17. metadata +19 -298
  18. data/Gemfile.lock +0 -171
  19. data/MIT-LICENSE +0 -20
  20. data/app/assets/images/user_mgmt/.keep +0 -0
  21. data/app/assets/javascripts/user_mgmt/application.js +0 -13
  22. data/app/assets/javascripts/user_mgmt/registrations.js +0 -2
  23. data/app/assets/javascripts/user_mgmt/sessions.js +0 -2
  24. data/app/assets/stylesheets/user_mgmt/application.css.scss +0 -14
  25. data/app/assets/stylesheets/user_mgmt/registrations.css +0 -34
  26. data/app/assets/stylesheets/user_mgmt/sessions.css +0 -4
  27. data/app/controllers/user_mgmt/application_controller.rb +0 -101
  28. data/app/controllers/user_mgmt/registrations_controller.rb +0 -32
  29. data/app/controllers/user_mgmt/sessions_controller.rb +0 -81
  30. data/app/helpers/user_mgmt/application_helper.rb +0 -9
  31. data/app/helpers/user_mgmt/registrations_helper.rb +0 -4
  32. data/app/helpers/user_mgmt/sessions_helper.rb +0 -4
  33. data/app/models/user_mgmt/user.rb +0 -15
  34. data/app/views/layouts/user_mgmt/application.html.haml +0 -17
  35. data/app/views/user_mgmt/registrations/edit.html.haml +0 -5
  36. data/app/views/user_mgmt/sessions/new.html.haml +0 -30
  37. data/app/views/user_mgmt/sessions/oauth_email.html.haml +0 -11
  38. data/bin/rails +0 -8
  39. data/config/routes.rb +0 -16
  40. data/lib/tasks/user_mgmt_tasks.rake +0 -4
  41. data/test/controllers/user_mgmt/registrations_controller_test.rb +0 -16
  42. data/test/controllers/user_mgmt/sessions_controller_test.rb +0 -21
  43. data/test/dummy/README.rdoc +0 -28
  44. data/test/dummy/Rakefile +0 -6
  45. data/test/dummy/app/assets/images/.keep +0 -0
  46. data/test/dummy/app/assets/javascripts/application.js +0 -13
  47. data/test/dummy/app/assets/javascripts/simulate.js +0 -2
  48. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  49. data/test/dummy/app/assets/stylesheets/simulate.css +0 -4
  50. data/test/dummy/app/controllers/application_controller.rb +0 -8
  51. data/test/dummy/app/controllers/concerns/.keep +0 -0
  52. data/test/dummy/app/controllers/simulate_controller.rb +0 -5
  53. data/test/dummy/app/helpers/application_helper.rb +0 -2
  54. data/test/dummy/app/helpers/simulate_helper.rb +0 -2
  55. data/test/dummy/app/mailers/.keep +0 -0
  56. data/test/dummy/app/models/.keep +0 -0
  57. data/test/dummy/app/models/concerns/.keep +0 -0
  58. data/test/dummy/app/views/layouts/application.html.haml +0 -17
  59. data/test/dummy/app/views/simulate/index.html.haml +0 -12
  60. data/test/dummy/bin/bundle +0 -3
  61. data/test/dummy/bin/rails +0 -4
  62. data/test/dummy/bin/rake +0 -4
  63. data/test/dummy/config/application.rb +0 -23
  64. data/test/dummy/config/boot.rb +0 -5
  65. data/test/dummy/config/database.yml +0 -25
  66. data/test/dummy/config/environment.rb +0 -5
  67. data/test/dummy/config/environments/development.rb +0 -29
  68. data/test/dummy/config/environments/production.rb +0 -80
  69. data/test/dummy/config/environments/test.rb +0 -36
  70. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  71. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  72. data/test/dummy/config/initializers/inflections.rb +0 -16
  73. data/test/dummy/config/initializers/mime_types.rb +0 -5
  74. data/test/dummy/config/initializers/secret_token.rb +0 -12
  75. data/test/dummy/config/initializers/session_store.rb +0 -3
  76. data/test/dummy/config/initializers/user_mgmt.rb +0 -37
  77. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  78. data/test/dummy/config/locales/en.yml +0 -23
  79. data/test/dummy/config/routes.rb +0 -7
  80. data/test/dummy/config.ru +0 -4
  81. data/test/dummy/lib/assets/.keep +0 -0
  82. data/test/dummy/log/.keep +0 -0
  83. data/test/dummy/public/404.html +0 -58
  84. data/test/dummy/public/422.html +0 -58
  85. data/test/dummy/public/500.html +0 -57
  86. data/test/dummy/public/favicon.ico +0 -0
  87. data/test/dummy/test/controllers/simulate_controller_test.rb +0 -9
  88. data/test/dummy/test/helpers/simulate_helper_test.rb +0 -4
  89. data/test/helpers/user_mgmt/registrations_helper_test.rb +0 -6
  90. data/test/helpers/user_mgmt/sessions_helper_test.rb +0 -6
  91. data/test/integration/navigation_test.rb +0 -10
  92. data/test/test_helper.rb +0 -15
  93. data/test/user_mgmt_test.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a5c2bd299dafff13cee9a059b952c699d962049
4
- data.tar.gz: 8e9cb1c9855713a8a781222a1dd7134dacf5fe76
3
+ metadata.gz: 86334c3e262291f46da3acbb06ad1b9b278c3a5c
4
+ data.tar.gz: f92fc29e0754fc0174328f9caf7355685b2febe3
5
5
  SHA512:
6
- metadata.gz: ecabaed49da560c0bd3790b55b1678e662057f37180518e8faf6da889f685e9283aba07ccef1dc8e631d72e274ef6843336849a54fb658230ff91181107e1e5f
7
- data.tar.gz: c4b6d3f89129f40452171e1aa7bd9a6a48f2d4dfdd855c4bbe3f822e81b047201cde365eb1a02a5496a9e30534627d8f7431f86a9f4e1d52fede41453df9144b
6
+ metadata.gz: f33a5faacbdb533857873abeb981fbbb08f7c46875505afd0e73d739654cc8b6a7004714430ad1d201489e5c44e926e361a478965eda0e4ef409bf704cc41355
7
+ data.tar.gz: 2cf4886d53302f74c76a297b5aa39cf06fa448c9b45227d48b61a15d07d9b495bfb78693cc511042fe084a6afbb8cb1925f6a7971c78abecd4ac2db77d2a292f
data/.gitignore CHANGED
@@ -1,13 +1,6 @@
1
- .bundle/
2
- log/*.log
3
- pkg/
4
- test/dummy/db/*.sqlite3
5
- test/dummy/db/*.sqlite3-journal
6
- test/dummy/log/*.log
7
- test/dummy/tmp/
8
- test/dummy/.sass-cache
9
1
  *.gem
10
2
  *.rbc
3
+ .bundle
11
4
  .config
12
5
  .yardoc
13
6
  Gemfile.lock
@@ -16,6 +9,7 @@ _yardoc
16
9
  coverage
17
10
  doc/
18
11
  lib/bundler/man
12
+ pkg
19
13
  rdoc
20
14
  spec/reports
21
15
  test/tmp
data/Gemfile CHANGED
@@ -1,14 +1,4 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- # Declare your gem's dependencies in user_mgmt.gemspec.
4
- # Bundler will treat runtime dependencies like base dependencies, and
5
- # development dependencies will be added by default to the :development group.
3
+ # Specify your gem's dependencies in user_mgmt.gemspec
6
4
  gemspec
7
-
8
- # Declare any dependencies that are still in development here instead of in
9
- # your gemspec. These might include edge Rails or gems from your path or
10
- # Git. Remember to move these dependencies to your gemspec before releasing
11
- # your gem to rubygems.org.
12
-
13
- # To use debugger
14
- # gem 'debugger'
data/README.md CHANGED
@@ -16,19 +16,11 @@ Then you have to run the generator:
16
16
 
17
17
  rails generate user_mgmt:install
18
18
 
19
- This generator will install an initializer which describes all the gem's configuration options and you must take a look at it.
19
+ This generator will install an initializer which describes all the gem's configuration options and you must take a look at it.
20
20
 
21
21
  ## Usage
22
22
 
23
- The gem includes some views (with their respective controllers) that are gonna be used by many distinct apps.
24
-
25
- In order to use the gem's views, you have to refer to them by:
26
-
27
- user_mgmt.<route path>
28
-
29
- Which can be "log_in_path", "sign_up_path" and "log_out_path" (more to be added in the future), e.g:
30
-
31
- user_mgmt.log_in_path
23
+ TODO: Write usage instructions here
32
24
 
33
25
  ## Contributing
34
26
 
data/Rakefile CHANGED
@@ -1,38 +1,3 @@
1
- # begin
2
- # require 'bundler/setup'
3
- # rescue LoadError
4
- # puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
- # end
6
-
7
- # require 'rdoc/task'
8
-
9
- # RDoc::Task.new(:rdoc) do |rdoc|
10
- # rdoc.rdoc_dir = 'rdoc'
11
- # rdoc.title = 'UserMgmt'
12
- # rdoc.options << '--line-numbers'
13
- # rdoc.rdoc_files.include('README.rdoc')
14
- # rdoc.rdoc_files.include('lib/**/*.rb')
15
- # end
16
-
17
- # APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
- # load 'rails/tasks/engine.rake'
19
-
20
-
21
-
22
- # Bundler::GemHelper.install_tasks
23
-
24
- # require 'rake/testtask'
25
-
26
- # Rake::TestTask.new(:test) do |t|
27
- # t.libs << 'lib'
28
- # t.libs << 'test'
29
- # t.pattern = 'test/**/*_test.rb'
30
- # t.verbose = false
31
- # end
32
-
33
-
34
- # task default: :test
35
-
36
1
  #explained at http://railscasts.com/episodes/301-extracting-a-ruby-gem?view=asciicast
37
2
  require "bundler/gem_tasks"
38
3
  require 'rspec/core/rake_task'
@@ -0,0 +1,4 @@
1
+ # All controllers are inherited from here.
2
+ class UserMgmtController < UserMgmt.parent_controller.constantize
3
+
4
+ end
@@ -6,10 +6,13 @@
6
6
  / %li= error
7
7
 
8
8
  %div
9
- = text_field :user, 'Email', :class => "input-block-level", :placeholder => 'Email'
9
+ = label :user, :email, 'Email'
10
+ = text_field :user, 'Email'
10
11
 
11
12
  %div
12
- = text_field :user, 'Password', :class => "input-block-level", :type => "password", :placeholder => 'Password'
13
+ = label :user, :password, 'Password'
14
+ = text_field :user, 'Password'
13
15
 
14
16
  %div
15
- = text_field :user, 'Password Confirmation', :class => "input-block-level", :type => "password", :placeholder => 'Password Confirmation'
17
+ = label :user, :password_confirmation, 'Password Confirmation'
18
+ = text_field :user, 'Password Confirmation'
@@ -1,18 +1,7 @@
1
- .container
2
- = form_tag user_path, :class => "form-signin", :method => :post do
3
- %h2 Sign up
4
- = render :partial => 'user_form'
5
- = submit_tag 'submit', :class => "btn btn-large btn-primary"
6
- %ul.unstyled
7
- %li
8
- = link_to "Log in with Facebook", "auth/facebook"
9
- %li
10
- = link_to "Log in with Twitter", "auth/twitter"
11
- %li
12
- = link_to "Log in with Outlook", "auth/windowslive"
13
- %li
14
- = link_to "Log in with LinkedIn", "auth/linkedin"
15
- %li
16
- = link_to "Log in with Yahoo", "auth/yahoo"
17
- %li
18
- = link_to "Log in with GMail", "auth/google_oauth2"
1
+ %h2 Sign up
2
+ / = form_tag @@external_database_URI, :method => :post do
3
+ / = render :partial => 'user_form'
4
+ / = submit_tag 'submit'
5
+
6
+ %div po
7
+ /a{}
@@ -3,24 +3,8 @@
3
3
  Some setup you must do manually if you haven't yet:
4
4
 
5
5
  1. Ensure you have defined your external database URI, in
6
- config/initializers/user_mgmt.rb.
7
- For example:
6
+ config/initializers/user_mgmt.rb:
8
7
 
9
- config.external_database_URI = "http://localhost:3000/"
10
-
11
- 2. Ensure you have defined root_url to *something* in your config/routes.rb.
12
- For example:
13
-
14
- root :to => "home#index"
15
-
16
- 3. Ensure you have flash messages in app/views/layouts/application.html.haml.
17
- For example:
18
-
19
- %body
20
- #main
21
- - if flash[:notice]
22
- #notice.message= flash[:notice]
23
- - elsif flash[:warning]
24
- #warning.message= flash[:warning]
8
+ config.external_database_URI = "yourexternaldatabaseuri.com"
25
9
 
26
10
  ===============================================================================
@@ -4,33 +4,6 @@ UserMgmt.setup do |config|
4
4
 
5
5
  # Ensure you defined default external database URI, otherwise
6
6
  # authentication won't be possible to happen
7
- config.external_database_URI = "http://localhost:3000/"
7
+ config.external_database_URI = "yourexternaldatabaseuri.com"
8
8
 
9
9
  end
10
-
11
- # Edit your strategy keys:
12
-
13
- ENV['TWITTER_KEY'] = ""
14
- ENV['TWITTER_SECRET'] = ""
15
-
16
- ENV['FACEBOOK_KEY'] = ""
17
- ENV['FACEBOOK_SECRET'] = ""
18
-
19
- ENV['LINKEDIN_KEY'] = ""
20
- ENV['LINKEDIN_SECRET'] = ""
21
-
22
- ENV['WINDOWSLIVE_KEY'] = ""
23
- ENV['WINDOWSLIVE_SECRET'] = ""
24
-
25
- ENV['YAHOO_KEY'] = ""
26
- ENV['YAHOO_SECRET'] = ""
27
-
28
- ENV['GOOGLE_KEY'] = ""
29
- ENV['GOOGLE_SECRET'] = ""
30
-
31
- # The code below include the view helpers from user_mgmt in the main app.
32
- # NOTE: Do not change this code.
33
- ActiveSupport.on_load :action_controller do
34
- helper UserMgmt::ApplicationHelper
35
- end
36
-
@@ -14,15 +14,9 @@ module UserMgmt
14
14
  # copy_file "../../../config/locales/en.yml", "config/locales/user_mgmt.en.yml"
15
15
  # end
16
16
 
17
- def add_user_mgmt_routes
18
- user_mgmt_route = "mount UserMgmt::Engine => '/user'"
19
- route user_mgmt_route
20
- end
21
-
22
17
  def show_readme
23
18
  readme "README" if behavior == :invoke
24
19
  end
25
-
26
20
  end
27
21
  end
28
22
  end
@@ -0,0 +1,8 @@
1
+ # module UserMgmt
2
+
3
+
4
+ # class Configurator
5
+
6
+ # def
7
+
8
+ # end
@@ -1,28 +1,5 @@
1
- module UserMgmt
2
-
3
- require "rails"
4
- require 'omniauth'
5
- require 'omniauth-facebook'
6
- require 'omniauth-twitter'
7
- require 'omniauth-linkedin'
8
- require 'omniauth-windowslive'
9
- require 'omniauth-yahoo'
10
- require "omniauth-google-oauth2"
11
-
12
-
13
- class Engine < ::Rails::Engine
14
- isolate_namespace UserMgmt
15
-
16
- #http://stackoverflow.com/questions/8304225/omniauth-route-issue-related-to-ruby-version
17
- middleware.use OmniAuth::Builder do
18
- # provider :developer unless Rails.env.production?
19
- provider :twitter, ENV['TWITTER_KEY'], ENV['TWITTER_SECRET']
20
- provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET']
21
- provider :linkedin, ENV['LINKEDIN_KEY'], ENV['LINKEDIN_SECRET'], :scope => 'r_fullprofile r_emailaddress r_network'
22
- provider :windowslive, ENV['WINDOWSLIVE_KEY'], ENV['WINDOWSLIVE_SECRET'], :scope => 'wl.basic'
23
- provider :yahoo, ENV['YAHOO_KEY'], ENV['YAHOO_SECRET']
24
- provider :google_oauth2, ENV["GOOGLE_KEY"], ENV["GOOGLE_SECRET"]
25
- end
26
-
27
- end
28
- end
1
+ require 'rails'
2
+ module UserMgmt
3
+ class Engine < Rails::Engine
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module UserMgmt
2
- VERSION = "0.0.62"
2
+ VERSION = "0.0.511"
3
3
  end
data/lib/user_mgmt.rb CHANGED
@@ -1,4 +1,3 @@
1
- require "user_mgmt/engine"
2
1
  require "user_mgmt/version"
3
2
  require "rails"
4
3
 
@@ -6,13 +5,19 @@ module UserMgmt
6
5
 
7
6
  # URI of the external database where authentication happens and gets its data stored at
8
7
  mattr_accessor :external_database_URI
9
- @@external_database_URI = "http://localhost:3000/"
8
+ @@external_database_URI = nil
10
9
 
10
+ # The parent controller all UserMgmt controllers inherits from.
11
+ # Defaults to ApplicationController. This should be set early
12
+ # in the initialization process and should be set to a string.
13
+ mattr_accessor :parent_controller
14
+ @@parent_controller = "ApplicationController"
11
15
 
12
- # Default way to setup UserMgmt. Run rails generate user_mgmt:install to create
13
- # a fresh initializer with all configuration values.
14
- def self.setup
15
- yield self
16
- end
17
16
 
18
- end
17
+ # Default way to setup UserMgmt. Run rails generate user_mgmt:install to create
18
+ # a fresh initializer with all configuration values.
19
+ def self.setup
20
+ yield self
21
+ end
22
+
23
+ end
data/user_mgmt.gemspec CHANGED
@@ -1,44 +1,28 @@
1
- $:.push File.expand_path("../lib", __FILE__)
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'user_mgmt/version'
2
5
 
3
- # Maintain your gem's version:
4
- require "user_mgmt/version"
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "user_mgmt"
8
+ spec.version = UserMgmt::VERSION
9
+ spec.authors = ["Danilo Faria, Fernando Gorodscy, Josh Leslie"]
10
+ spec.email = ["su_critic@hotmail.com"]
11
+ spec.description = %q{Includes functionality for site-specific registration and third-party authentication strategies such as social networks (Facebook, Twitter and Linkedin) and freemail providers (Yahoo, Windows Live and Gmail) with support for external database authentication.}
12
+ spec.summary = %q{Various authentication options in an outside database.}
13
+ spec.homepage = "https://github.com/Methos2013/user_mgmt_gem"
14
+ spec.license = "MIT"
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
5
19
 
6
- # Describe your gem and declare its dependencies:
7
- Gem::Specification.new do |s|
8
- s.name = "user_mgmt"
9
- s.version = UserMgmt::VERSION
10
- s.authors = ["Danilo Faria, Fernando Gorodscy, Josh Leslie"]
11
- s.email = ["su_critic@hotmail.com"]
12
- s.description = %q{Includes functionality for site-specific registration and third-party authentication strategies such as social networks (Facebook, Twitter and Linkedin) and freemail providers (Yahoo, Windows Live and Gmail) with support for external database authentication.}
13
- s.summary = %q{Various authentication options in an outside database.}
14
- s.homepage = "https://github.com/Methos2013/user_mgmt_gem"
15
- s.license = "MIT"
16
-
17
- s.files = `git ls-files`.split($/) - `git ls-files -d`.split($/)
18
- s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
- s.test_files = s.files.grep(%r{^(test|s|features)/})
20
- s.require_paths = ["lib"]
21
-
22
- s.add_development_dependency "sqlite3"
23
-
24
- s.add_development_dependency "rspec"
25
- s.add_development_dependency "genspec"
26
- s.add_development_dependency "rake"
27
- s.add_development_dependency "bundler", "~> 1.3"
28
-
29
- s.add_runtime_dependency "rails"
30
- s.add_development_dependency "haml"
31
- # For some reason that I coudn't figure out, I get an error if I dont add 'haml' as a development dependency as well as a runtime dependecy.
32
- s.add_runtime_dependency "haml"
33
- s.add_runtime_dependency "haml-rails"
34
- s.add_runtime_dependency 'sass-rails'#, '~> 3.2'
35
- s.add_runtime_dependency 'bootstrap-sass'#, '~> 2.3.2.1'
36
- s.add_runtime_dependency 'omniauth'
37
- s.add_runtime_dependency 'omniauth-facebook'
38
- s.add_runtime_dependency 'omniauth-twitter'
39
- s.add_runtime_dependency 'omniauth-linkedin'
40
- s.add_runtime_dependency 'omniauth-windowslive'
41
- s.add_runtime_dependency 'omniauth-yahoo'
42
- s.add_runtime_dependency "omniauth-google-oauth2"
20
+ spec.add_development_dependency "rspec"
21
+ spec.add_development_dependency "genspec"
22
+ spec.add_development_dependency "rails"
23
+ spec.add_development_dependency "warden"
24
+ spec.add_development_dependency "haml"
43
25
 
26
+ spec.add_development_dependency "bundler", "~> 1.3"
27
+ spec.add_development_dependency "rake"
44
28
  end