refworks 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWIwYjRiNzYzNDMyMjhmMTM4NzVkNTUwNWQwZjJjNzNjODI0OGRjZA==
4
+ YWM4MGQxMTk1NzY5NzQzYTc3N2ZlMzk0ZDA0OTU2ODViZDJkYmQxZg==
5
5
  data.tar.gz: !binary |-
6
- ZDdmNWIzNjgzM2Y2MTY5ZWQ0MDg5NWYwYTM5MDk0YTY4ZDI3OGU4YQ==
6
+ ODQxYThhNWIxMGE4M2Y0Njc0ODUzNDBhYTI3YWM1MDFjOGJiYmExNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZWNjMzZjZmNlMTc0MGYwODkwOGZhZjUzMTljOTg3Y2I5ZTFlZWRmNTJjNDIz
10
- ZWE2ZDNmYjkxZWZiNDQwOTE4YWNjZThkNTY5MTcxYmM0MWM3YjMyMjNjNzVm
11
- OTk5ZmIzY2QxMzAwYTZiMThmYzFjYWI4YWNkYmY5M2Y2NDIyMmI=
9
+ MGQ3NGMwZTk5MWI3MjgxY2JlOTM5YjE1NzFkOGFkNDI3NTQ5YjYwMjNkMzcx
10
+ MmE2OWE3NzZkMjFjNzc0YjM0MWRhYmU0OTE4NjM3YzZmMTczZWMxMDEzOWRm
11
+ ZTJlZjk2ZDg4MGY3NDE2YjQ0ZjRiZGFlYzdjYTI5ZTA3ZWRlMmY=
12
12
  data.tar.gz: !binary |-
13
- NTNhYmQ2ZjhjYTA3OWI1YTc3MjEzYjYyZGE3NDVmZjA5MTUzY2FhZTFhOGU0
14
- MjY2MzE5MTA2YmEzNTJhYjEwODJkNTNmZTg2OTVmMWU3NmQ0ZjM5NGMxYzNl
15
- NzNmNTU5ZDVjMGFjMzk5M2YyMTcyMmE3ZjU4M2JiZjMyMDY0N2U=
13
+ MDdjM2FiZDc2ZTJjZTQwZDFlMzU5MDkyNGFmOTk5ZDE5NmUzYWU2YzEzMjM2
14
+ NjgyZjU5YjBkZThhYTczZWU0NWYwOWEyMGZjYzEyMzRlZjBmMDAwMTc5M2U0
15
+ YzIxOTk3YWUxMjM1MmY5NzgzZDNlMjBhN2FjMjI5YTBjYWY0OTI=
data/lib/refworks.rb CHANGED
@@ -55,28 +55,32 @@ class Refworks
55
55
 
56
56
  # probably should check here that I have the minimal set of required attributes to continue
57
57
 
58
- # Can't do much without a session, so get one now
59
- # May need to refactor this - there are parts of the API that don't strictly need a session
60
- if (@group_code)
61
- response = request('authentication', 'newsess',
62
- {
63
- :login_name => @login_name,
64
- :group_code => @group_code,
65
- :password => @password,
66
- }
67
- )
58
+ # Can't do much without a session, so get one now if one wasn't passed in
59
+ if params[:sess]
60
+ @sess = params[:sess]
68
61
  else
69
- response = request('authentication', 'newsess',
70
- {
71
- :login_name => @login_name,
72
- :id => @id,
73
- :password => @password,
74
- }
75
- )
76
- end
62
+ # May need to refactor this - there are parts of the API that don't strictly need a session
63
+ if (@group_code)
64
+ response = request('authentication', 'newsess',
65
+ {
66
+ :login_name => @login_name,
67
+ :group_code => @group_code,
68
+ :password => @password,
69
+ }
70
+ )
71
+ else
72
+ response = request('authentication', 'newsess',
73
+ {
74
+ :login_name => @login_name,
75
+ :id => @id,
76
+ :password => @password,
77
+ }
78
+ )
79
+ end
77
80
 
78
- # Grab the session string.
79
- @sess = response.sess
81
+ # Grab the session string.
82
+ @sess = response.sess
83
+ end
80
84
 
81
85
  # Need some error checking here
82
86
  end
@@ -1,3 +1,3 @@
1
1
  class Refworks
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refworks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fran Fabrizio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-24 00:00:00.000000000 Z
11
+ date: 2014-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty