ninsho 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +19 -10
- data/lib/ninsho.rb +1 -1
- data/lib/ninsho/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -8,7 +8,7 @@ Ninsho is an easy flexible authentication solution when using providers
|
|
8
8
|
|
9
9
|
## Getting started
|
10
10
|
|
11
|
-
Ninsho 0.0
|
11
|
+
Ninsho 0.1.0 works with rails 3.1 onwards. You can add it to your Gemfile with:
|
12
12
|
|
13
13
|
```ruby
|
14
14
|
gem 'ninsho'
|
@@ -121,20 +121,23 @@ So if you need to add an extra field to your ninsho model (commonly 'Authenticat
|
|
121
121
|
|
122
122
|
Let's say we want to save the nickname from the hash into our ninsho model:
|
123
123
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
124
|
+
i. Add the migration to the ninsho model
|
125
|
+
|
126
|
+
```console
|
127
|
+
rails g migration add_nickname_to_MODEL nickname:string
|
128
|
+
```
|
129
|
+
ii. Run the migration and add the callback which should look like:
|
130
|
+
|
129
131
|
```ruby
|
130
132
|
before_save :set_nickname
|
131
133
|
```
|
134
|
+
|
132
135
|
```ruby
|
133
136
|
def set_nickname
|
134
137
|
self.nickname = self.auth_hash.info.nickname
|
135
138
|
end
|
136
139
|
```
|
137
|
-
|
140
|
+
iii. You are good to go, and any time the user changes the nickname yours will too!
|
138
141
|
|
139
142
|
|
140
143
|
### I18n
|
@@ -146,16 +149,22 @@ en:
|
|
146
149
|
ninsho:
|
147
150
|
sessions:
|
148
151
|
signed_in: "Signed in successfully"
|
149
|
-
signed_out: "Signed out successfully"
|
152
|
+
signed_out: "Signed out successfully"
|
150
153
|
```
|
151
154
|
|
155
|
+
###Psst! Here is a live example in rails
|
156
|
+
|
157
|
+
[Rails ninsho example](https://github.com/IcaliaLabs/ninsho_example)
|
158
|
+
|
152
159
|
### Changelog
|
153
160
|
|
154
|
-
* Current gem version 0.0
|
161
|
+
* Current gem version 0.1.0
|
155
162
|
* Add more documentation on code
|
156
163
|
* Add aouth token for Facebook friends
|
157
164
|
* Add more flexibility to handle authentications and save to multiple fields
|
158
165
|
* Add handy helpers
|
166
|
+
* Add rails live example
|
167
|
+
* Released gem version 0.0.3
|
159
168
|
* Released gem version 0.0.2
|
160
169
|
* Released gem version 0.0.1
|
161
170
|
|
@@ -168,7 +177,7 @@ en:
|
|
168
177
|
* Add tests
|
169
178
|
* Support for Mongoid
|
170
179
|
* Add wiki
|
171
|
-
|
180
|
+
|
172
181
|
|
173
182
|
|
174
183
|
## Credits
|
data/lib/ninsho.rb
CHANGED
@@ -37,7 +37,7 @@ module Ninsho
|
|
37
37
|
# The class name for the resource relation
|
38
38
|
# Is commonly the class User
|
39
39
|
mattr_accessor :parent_resource_name
|
40
|
-
@@parent_resource_name = ''
|
40
|
+
@@parent_resource_name = 'User'
|
41
41
|
|
42
42
|
# Hash which contains omniauth configurations
|
43
43
|
mattr_reader :omniauth_configs
|
data/lib/ninsho/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ninsho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: orm_adapter
|