trusty 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26fbd1e4bd287cc22f54d8a47b0f8a70dcc13a8e
4
- data.tar.gz: 59a202fac4a6fca65002f084dcdb4d9de1531d3d
3
+ metadata.gz: ecc5a4aaa2950c1df33a04997cc6a6785b63cc1a
4
+ data.tar.gz: 33a98591652aa3f4f5b0d3249482df0d545ec628
5
5
  SHA512:
6
- metadata.gz: 80de689d5625429d4485b818be41531c030b438d101566cea9ed0932b9c6bfd41941e7fc434969e28eeb76d9b9b943f8ba3e30ce0990e70190a1fd35b6510653
7
- data.tar.gz: 91805fec54ceb3ec4cd9fe5c1116f57b75444b1c7228cd901730835d45e7559c0384fceb5faa21cd0ffa5706db493790bc36b92288e6fc2ec4dbe53d6f43016b
6
+ metadata.gz: fb4f89d216571b5e6c823e3d64a964b4ea869821ba9b120ff07d746f07601f7846e854ade0cbc0659f2a219c1a0e820752fd8b430cfca71f0204962484a09990
7
+ data.tar.gz: ca03bc174cd9007085a6c86f3a1cb0675d099ac50591e0fff6dfde37e86a949e23bcfd5dcd409500db1489eb5e4ce0025694ef19c96566aa976b2c0b9d40d004
@@ -28,12 +28,16 @@ module Trusty
28
28
  end
29
29
  end
30
30
 
31
- def build_record
32
- model.new(attributes, :without_protection => true)
31
+ def build_record(additional_attributes = {})
32
+ model.new(attributes.merge(additional_attributes), without_protection: true)
33
33
  end
34
34
 
35
35
  def update_record!(record)
36
- record.update_attributes!(attributes, :without_protection => true)
36
+ if Rails::VERSION::MAJOR >= 4
37
+ record.update_attributes!(attributes)
38
+ else
39
+ record.update_attributes!(attributes, without_protection: true)
40
+ end
37
41
  end
38
42
 
39
43
  def column_names
@@ -64,14 +64,14 @@ module Trusty
64
64
 
65
65
  # USER
66
66
 
67
- def build_user
68
- @provider_user.build_record
67
+ def build_user(attributes = {})
68
+ @provider_user.build_record(attributes)
69
69
  end
70
70
 
71
71
  # IDENTITY
72
72
 
73
- def build_identity
74
- @provider_identity.build_record
73
+ def build_identity(attributes = {})
74
+ @provider_identity.build_record(attributes)
75
75
  end
76
76
 
77
77
  def build_identity_for_user(user)
@@ -91,6 +91,7 @@ module Trusty
91
91
  ###### General ######
92
92
 
93
93
  def attributes(*filter_attribute_names)
94
+ puts "provider_attributes: #{provider_attributes.inspect}"
94
95
  unless @attributes
95
96
  info = provider_attributes.fetch('info', {})
96
97
  credentials = provider_attributes['credentials']
@@ -119,7 +120,9 @@ module Trusty
119
120
  :expires_at => (Time.at(credentials['expires_at']) rescue nil),
120
121
  :raw_info => provider_attributes['extra'].except('access_token').as_json,
121
122
  # extra
122
- :time_zone => Time.zone.name
123
+ :location => info['location'],
124
+ :time_zone => info['time_zone'] || Time.zone.name,
125
+ :locale => info['locale'] || I18n.locale
123
126
  }.with_indifferent_access
124
127
 
125
128
  @attributes.reject!{|_,value| value.nil?} if options[:skip_nils]
@@ -1,3 +1,3 @@
1
1
  module Trusty
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/trusty.gemspec CHANGED
@@ -18,26 +18,25 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake"
21
+ spec.add_development_dependency "bundler", ">= 1.3"
23
22
 
24
23
  # Trusty::Rails (and defined?(Rails) checks sprinkled throughout)
25
- spec.add_development_dependency "rails"
24
+ spec.add_development_dependency "rails", ">= 3"
26
25
 
27
26
  # Trusty::Omniauth
28
- spec.add_development_dependency "omniauth"
27
+ spec.add_development_dependency "omniauth", "~> 1"
29
28
 
30
29
  # Trusty::Errors::ExceptionHandlers
31
- spec.add_development_dependency "active_support" # active_support/notifications
30
+ spec.add_development_dependency "activesupport", ">= 3" # active_support/notifications
32
31
 
33
32
  # Trusty::ExceptionNotification
34
- spec.add_development_dependency "exception_notification"
33
+ spec.add_development_dependency "exception_notification", ">= 3"
35
34
 
36
35
  # Trusty::Rake
37
- spec.add_development_dependency "rake"
36
+ spec.add_development_dependency "rake", ">= 9"
38
37
 
39
38
  # Trusty::IronIo::QueueProcessor
40
- spec.add_development_dependency "typhoeus" # used by iron_mq
39
+ spec.add_development_dependency "typhoeus", ">= 0.8" # used by iron_mq
41
40
  spec.add_development_dependency "iron_mq"
42
41
 
43
42
  # Trusty::Environment
metadata CHANGED
@@ -1,167 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trusty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Van Horn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-06 00:00:00.000000000 Z
11
+ date: 2015-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rails
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - '>='
31
+ - - ">="
46
32
  - !ruby/object:Gem::Version
47
- version: '0'
33
+ version: '3'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - '>='
38
+ - - ">="
53
39
  - !ruby/object:Gem::Version
54
- version: '0'
40
+ version: '3'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: omniauth
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - '>='
45
+ - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: '0'
47
+ version: '1'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - '>='
52
+ - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: '0'
54
+ version: '1'
69
55
  - !ruby/object:Gem::Dependency
70
- name: active_support
56
+ name: activesupport
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - '>='
59
+ - - ">="
74
60
  - !ruby/object:Gem::Version
75
- version: '0'
61
+ version: '3'
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - '>='
66
+ - - ">="
81
67
  - !ruby/object:Gem::Version
82
- version: '0'
68
+ version: '3'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: exception_notification
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - '>='
73
+ - - ">="
88
74
  - !ruby/object:Gem::Version
89
- version: '0'
75
+ version: '3'
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - '>='
80
+ - - ">="
95
81
  - !ruby/object:Gem::Version
96
- version: '0'
82
+ version: '3'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: rake
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
- - - '>='
87
+ - - ">="
102
88
  - !ruby/object:Gem::Version
103
- version: '0'
89
+ version: '9'
104
90
  type: :development
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - '>='
94
+ - - ">="
109
95
  - !ruby/object:Gem::Version
110
- version: '0'
96
+ version: '9'
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: typhoeus
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
- - - '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
- version: '0'
103
+ version: '0.8'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
- - - '>='
108
+ - - ">="
123
109
  - !ruby/object:Gem::Version
124
- version: '0'
110
+ version: '0.8'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: iron_mq
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
- - - '>='
115
+ - - ">="
130
116
  - !ruby/object:Gem::Version
131
117
  version: '0'
132
118
  type: :development
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
- - - '>='
122
+ - - ">="
137
123
  - !ruby/object:Gem::Version
138
124
  version: '0'
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: dotenv
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
- - - '>='
129
+ - - ">="
144
130
  - !ruby/object:Gem::Version
145
131
  version: 0.9.0
146
132
  type: :runtime
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
- - - '>='
136
+ - - ">="
151
137
  - !ruby/object:Gem::Version
152
138
  version: 0.9.0
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: hashie
155
141
  requirement: !ruby/object:Gem::Requirement
156
142
  requirements:
157
- - - '>='
143
+ - - ">="
158
144
  - !ruby/object:Gem::Version
159
145
  version: '2.0'
160
146
  type: :runtime
161
147
  prerelease: false
162
148
  version_requirements: !ruby/object:Gem::Requirement
163
149
  requirements:
164
- - - '>='
150
+ - - ">="
165
151
  - !ruby/object:Gem::Version
166
152
  version: '2.0'
167
153
  description: Trusty is a configuration and utilities library.
@@ -171,7 +157,7 @@ executables: []
171
157
  extensions: []
172
158
  extra_rdoc_files: []
173
159
  files:
174
- - .gitignore
160
+ - ".gitignore"
175
161
  - Gemfile
176
162
  - LICENSE.txt
177
163
  - README.md
@@ -210,19 +196,20 @@ require_paths:
210
196
  - lib
211
197
  required_ruby_version: !ruby/object:Gem::Requirement
212
198
  requirements:
213
- - - '>='
199
+ - - ">="
214
200
  - !ruby/object:Gem::Version
215
201
  version: '0'
216
202
  required_rubygems_version: !ruby/object:Gem::Requirement
217
203
  requirements:
218
- - - '>='
204
+ - - ">="
219
205
  - !ruby/object:Gem::Version
220
206
  version: '0'
221
207
  requirements: []
222
208
  rubyforge_project:
223
- rubygems_version: 2.1.5
209
+ rubygems_version: 2.4.5
224
210
  signing_key:
225
211
  specification_version: 4
226
212
  summary: Trusty allows you to manage environment variables and other common configuration
227
213
  challenges.
228
214
  test_files: []
215
+ has_rdoc: