ahub 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env_example +0 -1
- data/README.md +1 -1
- data/lib/ahub/modules/api_resource.rb +10 -4
- data/lib/ahub/user.rb +2 -6
- data/lib/ahub/version.rb +1 -1
- data/lib/ahub.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e94b19d6a71c1c761abf9422484e2829e1626ce
|
4
|
+
data.tar.gz: 4bd48dfe8351b100d5be1d650b7b8e1f9575520f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23a2946761d77f409e0d59de8a717b9b69039d1dd4436b1fb72fa8e7ff1d2b8502bccb8f090996a838c0d5b7edf14701f8e931f36cffce12abf23860db5df1d4
|
7
|
+
data.tar.gz: 47e9685a9a645907e4ea57583cd4b491d4320b6b0404454c8bbaee9a09f1aaa271503d5885a36cede1f54860c59d78e1e879e075716b67d0521c64b221fdb90d
|
data/.env_example
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Master
|
|
6
6
|
|
7
7
|
## Warning :warning:
|
8
8
|
|
9
|
-
Ahub
|
9
|
+
Ahub will strictly follow [Semantic Version](http://semver.org/)...AFTER version 1.0.0. Until then, the gem will pivot as I see fit :smiling_imp:. At the moment, however, Ahub is best used for data management tasks (like importing [questions](http://docs.answerhubapiv2.apiary.io/#reference/question)/[answers](http://docs.answerhubapiv2.apiary.io/#reference/answer)/[topics](http://docs.answerhubapiv2.apiary.io/#reference/topic)/[users](http://docs.answerhubapiv2.apiary.io/#reference/user)) & exploration of the data ([groups](http://docs.answerhubapiv2.apiary.io/#reference/group)/[spaces](http://docs.answerhubapiv2.apiary.io/#reference/space)) in your environment.
|
10
10
|
|
11
11
|
In otherwords, please wait until I remove this warning message before rolling it into your production stack. :sweat_smile:
|
12
12
|
|
@@ -6,8 +6,7 @@ module Ahub
|
|
6
6
|
module APIResource
|
7
7
|
extend ActiveSupport::Concern
|
8
8
|
|
9
|
-
|
10
|
-
end
|
9
|
+
attr_reader :attributes
|
11
10
|
|
12
11
|
def update
|
13
12
|
raise NotImplementedError
|
@@ -18,10 +17,17 @@ module Ahub
|
|
18
17
|
end
|
19
18
|
|
20
19
|
def initialize(attrs)
|
20
|
+
@attributes = attrs
|
21
21
|
attrs.each_pair do |k,v|
|
22
|
-
|
22
|
+
attribute_name = k.to_s.underscore
|
23
|
+
|
24
|
+
if instance_variable_get("@#{attribute_name}").nil?
|
25
|
+
instance_variable_set("@#{attribute_name}", v)
|
26
|
+
end
|
27
|
+
|
28
|
+
next if respond_to?(k) && k != :id
|
23
29
|
|
24
|
-
self.class.send(:define_method,
|
30
|
+
self.class.send(:define_method, attribute_name) do
|
25
31
|
instance_variable_get("@#{__method__}")
|
26
32
|
end
|
27
33
|
end
|
data/lib/ahub/user.rb
CHANGED
@@ -2,14 +2,10 @@ module Ahub
|
|
2
2
|
class User
|
3
3
|
include Ahub::APIResource
|
4
4
|
|
5
|
-
def self.create(username:, email:, password:
|
5
|
+
def self.create(username:, email:, password:)
|
6
6
|
url = "#{base_url}.json"
|
7
7
|
|
8
|
-
payload = {
|
9
|
-
email: email,
|
10
|
-
username: username,
|
11
|
-
password: password || Ahub::DEFAULT_PASSWORD,
|
12
|
-
}
|
8
|
+
payload = {email: email, username: username, password: password}
|
13
9
|
|
14
10
|
create_resource(url: url, payload: payload, headers: admin_headers)
|
15
11
|
end
|
data/lib/ahub/version.rb
CHANGED
data/lib/ahub.rb
CHANGED
@@ -17,7 +17,6 @@ module Ahub
|
|
17
17
|
Dotenv.load ENV['AHUB_ENV_FILE'] if ENV['AHUB_ENV_FILE']
|
18
18
|
|
19
19
|
DOMAIN = ENV['AHUB_DOMIAN'] || 'http://localhost:8888'
|
20
|
-
DEFAULT_PASSWORD = ENV['AHUB_DEFAULT_PASSWORD'] || 'password'
|
21
20
|
ADMIN_USER = ENV['AHUB_ADMIN_USER'] || 'answerhub'
|
22
21
|
ADMIN_PASS = ENV['AHUB_ADMIN_PASS'] || 'answerhub'
|
23
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ahub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abel Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|