devise-neo4j 1.0.3 → 2.0.0.alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.travis.yml +5 -0
  4. data/Gemfile +33 -0
  5. data/README.md +108 -0
  6. data/Rakefile +20 -8
  7. data/Vagrantfile +22 -0
  8. data/devise-neo4j.gemspec +8 -11
  9. data/lib/devise-neo4j.rb +0 -1
  10. data/lib/devise-neo4j/version.rb +1 -1
  11. data/lib/devise/orm/neo4j.rb +4 -8
  12. data/lib/devise/orm/neo4j/date_time.rb +8 -0
  13. data/lib/devise/orm/neo4j/hook.rb +7 -12
  14. data/lib/devise/orm/neo4j/nil_class_converter.rb +24 -0
  15. data/lib/generators/neo4j/devise_generator.rb +69 -6
  16. data/provisioning/roles/common/tasks/main.yml +13 -0
  17. data/provisioning/roles/java/README.md +30 -0
  18. data/provisioning/roles/java/files/.gitkeep +0 -0
  19. data/provisioning/roles/java/files/webupd8.key.asc +13 -0
  20. data/provisioning/roles/java/handlers/.gitkeep +0 -0
  21. data/provisioning/roles/java/tasks/.gitkeep +0 -0
  22. data/provisioning/roles/java/tasks/main.yml +6 -0
  23. data/provisioning/roles/java/tasks/openjdk.yml +6 -0
  24. data/provisioning/roles/java/tasks/oracle.yml +12 -0
  25. data/provisioning/roles/java/tasks/webupd8.yml +13 -0
  26. data/provisioning/roles/java/templates/.gitkeep +0 -0
  27. data/provisioning/roles/java/vars/.gitkeep +0 -0
  28. data/provisioning/roles/java/vars/main.yml +2 -0
  29. data/provisioning/roles/neo4j/files/neo4j-server.properties +20 -0
  30. data/provisioning/roles/neo4j/files/neo4j.conf +6 -0
  31. data/provisioning/roles/neo4j/tasks/main.yml +45 -0
  32. data/provisioning/roles/neo4j/vars/main.yml +1 -0
  33. data/provisioning/vagrant.yml +17 -0
  34. data/test/generators/neo4j/devise_generator_test.rb +1 -2
  35. data/test/orm/neo4j.rb +52 -7
  36. data/test/overrides/authenticatable_test.rb +14 -0
  37. data/test/overrides/database_authenticatable_test.rb +17 -0
  38. data/test/overrides/mapping_test.rb +11 -0
  39. data/test/rails_app/app/neo4j/admin.rb +36 -4
  40. data/test/rails_app/app/neo4j/user.rb +41 -5
  41. data/test/rails_app/app/neo4j/user_on_engine.rb +43 -0
  42. data/test/rails_app/app/neo4j/user_on_main_app.rb +43 -0
  43. data/test/rails_app/config/application.rb +11 -11
  44. data/test/support/i18n.rb +1 -1
  45. data/test/test_helper.rb +16 -23
  46. data/test/test_models.rb +33 -0
  47. metadata +174 -164
  48. data/Gemfile.lock +0 -156
  49. data/README.rdoc +0 -48
  50. data/lib/devise/orm/neo4j/schema.rb +0 -40
  51. data/test/overrides/models/recoverable_test.rb +0 -21
  52. data/test/rails_app/app/neo4j/shim.rb +0 -2
  53. data/test/support/fix_last.rb +0 -12
data/Gemfile.lock DELETED
@@ -1,156 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- devise-neo4j (1.0.3)
5
- devise (~> 1.3)
6
- neo4j (~> 1.1)
7
- oa-oauth (~> 0.2.0)
8
- oa-openid (~> 0.2.0)
9
-
10
- GEM
11
- remote: http://rubygems.org/
12
- specs:
13
- actionmailer (3.1.0)
14
- actionpack (= 3.1.0)
15
- mail (~> 2.3.0)
16
- actionpack (3.1.0)
17
- activemodel (= 3.1.0)
18
- activesupport (= 3.1.0)
19
- builder (~> 3.0.0)
20
- erubis (~> 2.7.0)
21
- i18n (~> 0.6)
22
- rack (~> 1.3.2)
23
- rack-cache (~> 1.0.3)
24
- rack-mount (~> 0.8.2)
25
- rack-test (~> 0.6.1)
26
- sprockets (~> 2.0.0)
27
- activemodel (3.1.0)
28
- activesupport (= 3.1.0)
29
- bcrypt-ruby (~> 3.0.0)
30
- builder (~> 3.0.0)
31
- i18n (~> 0.6)
32
- activerecord (3.1.0)
33
- activemodel (= 3.1.0)
34
- activesupport (= 3.1.0)
35
- arel (~> 2.2.1)
36
- tzinfo (~> 0.3.29)
37
- activeresource (3.1.0)
38
- activemodel (= 3.1.0)
39
- activesupport (= 3.1.0)
40
- activesupport (3.1.0)
41
- multi_json (~> 1.0)
42
- addressable (2.2.6)
43
- arel (2.2.1)
44
- bcrypt-ruby (3.0.1-java)
45
- builder (3.0.0)
46
- columnize (0.3.4)
47
- devise (1.4.7)
48
- bcrypt-ruby (~> 3.0)
49
- orm_adapter (~> 0.0.3)
50
- warden (~> 1.0.3)
51
- erubis (2.7.0)
52
- faraday (0.6.1)
53
- addressable (~> 2.2.4)
54
- multipart-post (~> 1.1.0)
55
- rack (>= 1.1.0, < 2)
56
- hike (1.2.1)
57
- i18n (0.6.0)
58
- mail (2.3.0)
59
- i18n (>= 0.4.0)
60
- mime-types (~> 1.16)
61
- treetop (~> 1.4.8)
62
- metaclass (0.0.1)
63
- mime-types (1.16)
64
- mocha (0.10.0)
65
- metaclass (~> 0.0.1)
66
- multi_json (1.0.3)
67
- multi_xml (0.2.2)
68
- multipart-post (1.1.3)
69
- neo4j (1.2.2-java)
70
- activemodel (>= 3.0.0)
71
- orm_adapter (>= 0.0.3)
72
- railties (>= 3.0.0)
73
- will_paginate (= 3.0.pre4)
74
- nokogiri (1.5.0-java)
75
- oa-core (0.2.6)
76
- oa-oauth (0.2.6)
77
- faraday (~> 0.6.1)
78
- multi_json (~> 1.0.0)
79
- multi_xml (~> 0.2.2)
80
- oa-core (= 0.2.6)
81
- oauth (~> 0.4.0)
82
- oauth2 (~> 0.4.1)
83
- oa-openid (0.2.6)
84
- oa-core (= 0.2.6)
85
- rack-openid (~> 1.3.1)
86
- ruby-openid-apps-discovery (~> 1.2.0)
87
- oauth (0.4.5)
88
- oauth2 (0.4.1)
89
- faraday (~> 0.6.1)
90
- multi_json (>= 0.0.5)
91
- orm_adapter (0.0.5)
92
- polyglot (0.3.2)
93
- rack (1.3.3)
94
- rack-cache (1.0.3)
95
- rack (>= 0.4)
96
- rack-mount (0.8.3)
97
- rack (>= 1.0.0)
98
- rack-openid (1.3.1)
99
- rack (>= 1.1.0)
100
- ruby-openid (>= 2.1.8)
101
- rack-ssl (1.3.2)
102
- rack
103
- rack-test (0.6.1)
104
- rack (>= 1.0)
105
- rails (3.1.0)
106
- actionmailer (= 3.1.0)
107
- actionpack (= 3.1.0)
108
- activerecord (= 3.1.0)
109
- activeresource (= 3.1.0)
110
- activesupport (= 3.1.0)
111
- bundler (~> 1.0)
112
- railties (= 3.1.0)
113
- railties (3.1.0)
114
- actionpack (= 3.1.0)
115
- activesupport (= 3.1.0)
116
- rack-ssl (~> 1.3.2)
117
- rake (>= 0.8.7)
118
- rdoc (~> 3.4)
119
- thor (~> 0.14.6)
120
- rake (0.9.2)
121
- rdoc (3.9.4)
122
- ruby-debug (0.10.4)
123
- columnize (>= 0.1)
124
- ruby-debug-base (~> 0.10.4.0)
125
- ruby-debug-base (0.10.4-java)
126
- ruby-openid (2.1.8)
127
- ruby-openid-apps-discovery (1.2.0)
128
- ruby-openid (>= 2.1.7)
129
- sprockets (2.0.0)
130
- hike (~> 1.2)
131
- rack (~> 1.0)
132
- tilt (~> 1.1, != 1.3.0)
133
- thor (0.14.6)
134
- tilt (1.3.3)
135
- treetop (1.4.10)
136
- polyglot
137
- polyglot (>= 0.3.1)
138
- tzinfo (0.3.29)
139
- warden (1.0.5)
140
- rack (>= 1.0)
141
- webrat (0.7.2)
142
- nokogiri (>= 1.2.0)
143
- rack (>= 1.0)
144
- rack-test (>= 0.5.3)
145
- will_paginate (3.0.pre4)
146
-
147
- PLATFORMS
148
- java
149
-
150
- DEPENDENCIES
151
- devise-neo4j!
152
- mocha
153
- rails (~> 3.0)
154
- rake
155
- ruby-debug (>= 0.10.3)
156
- webrat (= 0.7.2)
data/README.rdoc DELETED
@@ -1,48 +0,0 @@
1
- = devise-neo4j
2
-
3
- A gem for Neo4j integration with the Devise authentication framework.
4
-
5
- Neo4j: https://github.com/andreasronge/neo4j
6
- Devise: https://github.com/plataformatec/devise
7
-
8
- == Usage
9
-
10
- === Installation
11
-
12
- Add the neo4j and devise-neo4j gems to your Gemfile:
13
-
14
- gem "neo4j", "~> 1.2"
15
- gem "devise-neo4j"
16
-
17
- Run the bundle install command:
18
-
19
- bundle install
20
-
21
- Then run the devise install generator and optionally update or create a devise-neo4j model:
22
-
23
- bundle exec rails g devise:install --orm=neo4j
24
- bundle exec rails g neo4j:devise MODEL
25
-
26
- Now the model is setup like a default devise model, meaning you can do things like adding a before_filter in a controller to restrict access to logged-in users only:
27
-
28
- before_filter :authenticate_<your model name>!
29
-
30
- == Example App
31
-
32
- You can see a very simple app that demonstrates Neo4j and devise here:
33
-
34
- https://github.com/benjackson/devise-neo4j-example
35
-
36
- == Note on Patches/Pull Requests
37
-
38
- * Fork the project.
39
- * Make your feature addition or bug fix.
40
- * Add tests for it. This is important so I don't break it in a
41
- future version unintentionally.
42
- * Commit, do not mess with rakefile, version, or history.
43
- (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)
44
- * Send me a pull request. Bonus points for topic branches.
45
-
46
- == Copyright
47
-
48
- Copyright (c) 2011 Ben Jackson. See LICENSE for details.
@@ -1,40 +0,0 @@
1
- module Devise
2
- module Orm
3
- module Neo4j
4
- module Schema
5
- include Devise::Schema
6
-
7
- INDEXED_PROPERTIES = [ :email, :authentication_token, :confirmation_token, :remember_token, :reset_password_token, :unlock_token ]
8
-
9
- # Tell how to apply schema methods
10
- def apply_devise_schema(name, type, options={})
11
- index name, :type => :exact if INDEXED_PROPERTIES.include?(name)
12
- create_property(name, type, options)
13
- end
14
-
15
- protected
16
- def create_property(name, type, options)
17
- # Hack to get around encrypted_password not having the default of ""
18
- options.delete(:default) if name == :encrypted_password
19
-
20
- # If the property is required, its presence should be checked anyway
21
- options.delete(:null)
22
-
23
- property name, { :type => map_type(type) }.merge!(options)
24
- end
25
-
26
- # map the Java type to the right Ruby type
27
- def map_type(type)
28
- case type.to_s
29
- when "DateTime"
30
- Time
31
- when "Integer"
32
- Fixnum
33
- else
34
- type
35
- end
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,21 +0,0 @@
1
- require "test_helper"
2
-
3
- if DEVISE_ORM == :neo4j
4
-
5
- class RecoverableTest < ActiveSupport::TestCase
6
- undef :test_should_save_the_model_when_the_reset_password_sent_at_doesnt_exist
7
-
8
- test 'should save the model when the reset_password_sent_at doesnt exist' do
9
- user = create_user
10
- user.stubs(:respond_to?)
11
- user.stubs(:respond_to?).with("email=").returns(true)
12
- user.stubs(:respond_to?).with(:updated_at).returns(false)
13
- user.stubs(:respond_to?).with(:reset_password_sent_at=).returns(false)
14
- user.stubs(:respond_to?).with(:headers_for).returns(false)
15
- user.send_reset_password_instructions
16
- user.reload
17
- assert_not_nil user.reset_password_token
18
- end
19
- end
20
-
21
- end
@@ -1,2 +0,0 @@
1
- module Shim
2
- end
@@ -1,12 +0,0 @@
1
- require 'neo4j'
2
-
3
- class Neo4j::Rails::Model
4
- # Hack to get around the fact that Neo4j doesn't support :order (currently)
5
- def self.last(*args)
6
- if args == [{ :order => "id" }]
7
- last
8
- else
9
- super
10
- end
11
- end
12
- end