cequel-devise 1.0.0

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: b96d483814598e31ace066f87eb1560c01ebefd7
4
+ data.tar.gz: 68f7e35ae06edea155417bfa820af4c6e8bf07e4
5
+ SHA512:
6
+ metadata.gz: aa4b780a40f716adf806dd1b1e68a5164852eb9b6a468acbe15448f1f0ef96b66efeb32e36747e765d262858d91b0d358b35ee278be2262fd2922ea9cb9827db
7
+ data.tar.gz: b8d222591efd5f5a61e3a2229cae71826de704ab36e370b7362f76a81931e9e69f00ad17a598b86ea32774d81717d947119bcb92ff103e31c61a55592334d27a
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Mat Brown
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # Cequel::Devise
2
+
3
+ Integrates [Devise](https://github.com/platformatec/devise) with
4
+ [Cequel](https://github.com/cequel/cequel)
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'cequel-devise'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install cequel-devise
19
+
20
+ ## Usage
21
+
22
+ Allows you to use `devise` directives in `Cequel::Record` models. See the
23
+ [Devise README](https://github.com/platformatec/devise) for how to use Devise
24
+ generally. Note that you will need to define the columns that Devise expects.
25
+
26
+ ## Contributing
27
+
28
+ 1. Fork it
29
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
30
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
31
+ 4. Push to the branch (`git push origin my-new-feature`)
32
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,38 @@
1
+ require File.expand_path('../lib/cequel/devise/version', __FILE__)
2
+
3
+ task :default => :release
4
+ task :release => [
5
+ :build,
6
+ :tag,
7
+ :update_stable,
8
+ :push,
9
+ :cleanup
10
+ ]
11
+
12
+ desc 'Build gem'
13
+ task :build do
14
+ system 'gem build cequel-devise.gemspec'
15
+ end
16
+
17
+ desc 'Create git release tag'
18
+ task :tag do
19
+ system "git tag -a -m 'Version #{Cequel::Devise::VERSION}' #{Cequel::Devise::VERSION}"
20
+ system "git push origin #{Cequel::Devise::VERSION}:#{Cequel::Devise::VERSION}"
21
+ end
22
+
23
+ desc 'Update stable branch on GitHub'
24
+ task :update_stable do
25
+ if Cequel::Devise::VERSION =~ /^(\d+\.)+\d+$/ # Don't push for prerelease
26
+ system "git push -f origin HEAD:stable"
27
+ end
28
+ end
29
+
30
+ desc 'Push gem to repository'
31
+ task :push do
32
+ system "gem push cequel-devise-#{Cequel::Devise::VERSION}.gem"
33
+ end
34
+
35
+ task 'Remove packaged gems'
36
+ task :cleanup do
37
+ system "rm -v *.gem"
38
+ end
@@ -0,0 +1 @@
1
+ require 'devise/orm/cequel'
@@ -0,0 +1,9 @@
1
+ module Cequel
2
+ module Devise
3
+ class Railtie < Rails::Railtie
4
+ generators do
5
+ require 'cequel/devise/record_generator'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,24 @@
1
+ require 'generators/devise/orm_helpers'
2
+
3
+ module Cequel
4
+ module Devise
5
+ class RecordGenerator < Rails::Generators::NamedBase
6
+ include ::Devise::Generators::OrmHelpers
7
+
8
+ namespace 'cequel:devise'
9
+ argument :attributes, type: :array, default: [],
10
+ banner: 'field:type[:index] field:type[:index]'
11
+
12
+ def generate_record
13
+ invoke "cequel",
14
+ [name, 'email:ascii:index', 'encrypted_password:ascii']
15
+ end
16
+
17
+ def inject_devise_content
18
+ content = "\n devise :database_authenticatable, :registerable\n"
19
+ inject_into_file(model_path, content, before: /^end$/) if model_exists?
20
+ end
21
+ end
22
+ end
23
+ end
24
+
@@ -0,0 +1,5 @@
1
+ module Cequel
2
+ module Devise
3
+ VERSION = '1.0.0'
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ require 'devise'
2
+ require 'cequel/record/orm_adapter'
3
+ require 'cequel/devise/railtie' if defined? Rails
4
+ Cequel::Record::ClassMethods.module_eval { include Devise::Models }
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cequel-devise
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Mat Brown
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: cequel
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: orm_adapter-cequel
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: devise
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '3.2'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '3.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: Integration for Devise with the Cequel Cassandra ORM
84
+ email:
85
+ - mat.a.brown@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - lib/cequel/devise/railtie.rb
91
+ - lib/cequel/devise/record_generator.rb
92
+ - lib/cequel/devise/version.rb
93
+ - lib/cequel-devise.rb
94
+ - lib/devise/orm/cequel.rb
95
+ - Gemfile
96
+ - LICENSE.txt
97
+ - Rakefile
98
+ - README.md
99
+ homepage: https://github.com/cequel/cequel-devise
100
+ licenses:
101
+ - MIT
102
+ metadata: {}
103
+ post_install_message:
104
+ rdoc_options: []
105
+ require_paths:
106
+ - lib
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ requirements: []
118
+ rubyforge_project:
119
+ rubygems_version: 2.1.11
120
+ signing_key:
121
+ specification_version: 4
122
+ summary: Integrate Devise with Cequel
123
+ test_files: []
124
+ has_rdoc: