dynamoid-devise 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 00d5d2ae6921ee071be090c5691020719806b855
4
+ data.tar.gz: e48c5ba15649090ccb8bc34b1aba437295766259
5
+ SHA512:
6
+ metadata.gz: e2871fc0fe8d16dde3d67acd2b7a96d7f42204c1905be6524c11a2dd31008db20eab17bde8a21596c905a665f989c5d29ebc83ea2978cd64592f7e42f33e3502
7
+ data.tar.gz: 7f3ead30ae94fbc50f7780b264f68afc64245005c08a8f99bbce6cb84c1e9cbccec8bb8139f68a2c09325c663f8af3475d2248109809e47e960aeccc585f2ee9
data/Changelog.txt ADDED
@@ -0,0 +1,3 @@
1
+ November 24, 2014
2
+
3
+ Initial tests with Dynamoid gem
data/Gemfile ADDED
@@ -0,0 +1,24 @@
1
+ source :rubygems
2
+
3
+ group :test do
4
+ gem "test-unit", "~> 2.0.9"
5
+ gem "webrat", "~> 0.7.0"
6
+ gem "mocha", "~> 0.9.8", :require => false
7
+ end
8
+
9
+ group :default do
10
+ gem "rails", "~> 3.2.0"
11
+ gem "webrat", "~> 0.7.0"
12
+ gem 'dynamoid'
13
+ gem 'devise', '>= 2.1.0'
14
+ gem 'devise-encryptable'
15
+ gem 'bson_ext', '>= 1.2.0'
16
+ gem 'rake', '>= 0.8.7'
17
+ gem "orm_adapter"
18
+ gem "omniauth-openid", '~>1.0.0'
19
+ gem "omniauth-facebook", '~>1.2.0'
20
+
21
+ platforms :mri_18 do
22
+ gem "SystemTimer"
23
+ end
24
+ end
data/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ Copyright (c) 2014 Vinay C
2
+ for the mofications to enable this work with Rails 4, Devise
3
+ and Dynamoid
4
+
5
+ Copyright (c) 2013 Matteo Gavagnin
6
+ for the modifications of the code originally created by
7
+ Kristian Mandrup for MongoMapper to work with Dynamoid
8
+
9
+ Copyright (c) 2010 Kristian Mandrup
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining
12
+ a copy of this software and associated documentation files (the
13
+ "Software"), to deal in the Software without restriction, including
14
+ without limitation the rights to use, copy, modify, merge, publish,
15
+ distribute, sublicense, and/or sell copies of the Software, and to
16
+ permit persons to whom the Software is furnished to do so, subject to
17
+ the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be
20
+ included in all copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
data/README.markdown ADDED
@@ -0,0 +1,68 @@
1
+ # Devise with DynamoID
2
+
3
+ ## Disclaimer: this is a work in progress
4
+
5
+
6
+ `dynamoid-devise` will let you use [devise](http://github.com/plataformatec/devise) with [Dynamoid](https://github.com/Veraticus/Dynamoid).
7
+
8
+ `dynamoid-devise` is intended for use with `Rails 4.1.x` and `Devise 2` and above. It may work with earlier versions of devise.
9
+
10
+ This README only covers `dynamoid-devise` specifics. Make sure to read the [devise README](http://github.com/plataformatec/devise/blob/master/README.rdoc)
11
+
12
+ ## Installation
13
+
14
+ Add `devise`, `dynamoid` and `dynamoid-devise` gems to your Gemfile (your Rails app Gemfile).
15
+
16
+ gem 'devise'
17
+ gem 'dynamoid'
18
+ gem 'dynamoid-devise'
19
+
20
+ Use bundler to install all required gems in your Rails app
21
+
22
+ bundle install
23
+
24
+ Run the devise install generator, followed by the dynamoid-devise model generator:
25
+
26
+ rails generate devise:install
27
+ rails generate dynamoid:devise MODEL
28
+
29
+ The devise install generator will install an initializer
30
+ (`config/inititializer/devise.rb`) which describes ALL Devise's configuration
31
+ options and you MUST take a look at it. Maker sure this line exists:
32
+
33
+ require 'devise/orm/dynamoid'
34
+
35
+ NOTE: The model generator should do this automatically.
36
+
37
+ To add Devise to any of your models using the generator:
38
+
39
+ rails generate dynamoid:devise MODEL
40
+
41
+ Example: create a User model for use with Devise
42
+
43
+ rails generate dynamoid:devise User
44
+
45
+
46
+ ## Note on Patches/Pull Requests
47
+
48
+ * Fork the project.
49
+ * Make your feature addition or bug fix.
50
+ * Add tests for it. This is important so I don't break it in a
51
+ future version unintentionally.
52
+ * Commit, do not mess with rakefile, version, or history.
53
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
54
+ * Send me a pull request. Bonus points for topic branches.
55
+
56
+ ## Maintainers
57
+
58
+ *Vinay C*
59
+
60
+ Also feel free to suggest, place a fix and improve in the code. Thanks!!!
61
+
62
+ ## Bugs and Feedback
63
+
64
+ For *dynamoid-devise* specific issues, please create an issue on GitHub at: [dynamoid-devise issues](http://github.com/vinaycyadav/dynamoid-devise/issues)
65
+
66
+ ## Copyright
67
+
68
+ Copyright (c) 2014 Vinay C. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,30 @@
1
+ # encoding: UTF-8
2
+
3
+ require 'rake'
4
+ include Rake::DSL if defined?(Rake::DSL)
5
+
6
+ require 'bundler'
7
+ Bundler::GemHelper.install_tasks
8
+
9
+ require 'rake/testtask'
10
+ require 'rake/rdoctask'
11
+ require File.join(File.dirname(__FILE__), 'lib', 'mm-devise', 'version')
12
+
13
+ desc 'Run Devise tests using DynamoID. Specify path to devise with DEVISE_PATH'
14
+ Rake::TestTask.new(:test) do |test|
15
+ ENV['DEVISE_ORM'] ||= 'dynamoid'
16
+ ENV['DEVISE_PATH'] ||= File.join(File.dirname(__FILE__), '../devise')
17
+ unless File.exist?(ENV['DEVISE_PATH'])
18
+ puts "Specify the path to devise (e.g. rake DEVISE_PATH=/path/to/devise). Not found at #{ENV['DEVISE_PATH']}"
19
+ exit
20
+ end
21
+
22
+ test.libs << 'lib' << 'test'
23
+ test.libs << "#{ENV['DEVISE_PATH']}/lib"
24
+ test.libs << "#{ENV['DEVISE_PATH']}/test"
25
+ test.test_files = FileList["#{ENV['DEVISE_PATH']}/test/**/*_test.rb"] + FileList['test/**/*_test.rb']
26
+ test.verbose = true
27
+ end
28
+
29
+ desc 'Default: run tests for DynamoID'
30
+ task :default => :test
@@ -0,0 +1,18 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "dynamoid-devise/version"
4
+ Gem::Specification.new do |s|
5
+ s.name = "dynamoid-devise"
6
+ s.version = Dynamoid::Devise::VERSION
7
+ s.date = "2014-11-24"
8
+ s.summary = %Q{Support for using Dynamoid ORM with devise}
9
+ s.description = %Q{dynamoid-devise adds Dynamoid support to devise (http://github.com/plataformatec/devise) for authentication support for Rails}
10
+ s.email = "vinay.c@india.com"
11
+ s.homepage = "http://github.com/vinaycyadav/dynamoid-devise"
12
+ s.authors = ["Vinay C"]
13
+ s.files = Dir.glob("lib/**/*") + %w(Changelog.txt dynamoid-devise.gemspec Gemfile LICENSE Rakefile README.markdown)
14
+ s.test_files = Dir.glob("test/**/*")
15
+ s.add_dependency 'dynamoid', '>= 0.6'
16
+ s.add_dependency 'devise', '>= 2.0'
17
+ s.add_dependency "SystemTimer", "~> 1.2" if RUBY_VERSION < "1.9"
18
+ end
@@ -0,0 +1,3 @@
1
+ require 'orm_adapter/adapters/dynamoid'
2
+
3
+ DynamoID::Document::ClassMethods.send :include, Devise::Models
@@ -0,0 +1,5 @@
1
+ module Dynamoid
2
+ module Devise
3
+ VERSION = '0.0.1' #.freeze
4
+ end
5
+ end
@@ -0,0 +1,22 @@
1
+ require 'generators/devise/orm_helpers'
2
+
3
+ module Dynamoid
4
+ module Generators
5
+ class DeviseGenerator < Rails::Generators::NamedBase
6
+ include Devise::Generators::OrmHelpers
7
+
8
+ def generate_model
9
+ invoke "dynamoid:model", [name] unless model_exists?
10
+ end
11
+
12
+ def inject_devise_content
13
+ inject_into_file model_path, model_contents, :after => "include Dynamoid::Document\n"
14
+ end
15
+
16
+ def replace_default_devise_orm
17
+ gsub_file Rails.root.join("config/initializers/devise.rb"), 'orm/active_record', 'orm/dynamoid'
18
+ end
19
+
20
+ end
21
+ end
22
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dynamoid-devise
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Vinay C
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dynamoid
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.6'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: devise
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ description: dynamoid-devise adds Dynamoid support to devise (http://github.com/plataformatec/devise)
42
+ for authentication support for Rails
43
+ email: vinay.c@india.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - Changelog.txt
49
+ - Gemfile
50
+ - LICENSE
51
+ - README.markdown
52
+ - Rakefile
53
+ - dynamoid-devise.gemspec
54
+ - lib/devise/orm/ dynamoid.rb
55
+ - lib/dynamoid-devise/version.rb
56
+ - lib/generators/dynamoid/devise_generator.rb
57
+ homepage: http://github.com/vinaycyadav/dynamoid-devise
58
+ licenses: []
59
+ metadata: {}
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubyforge_project:
76
+ rubygems_version: 2.2.2
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: Support for using Dynamoid ORM with devise
80
+ test_files: []
81
+ has_rdoc: