evernote_oauth 0.2.1 → 0.2.2

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: c7f057a5e6fde4727e46ee167723fd6ad3d33f64
4
- data.tar.gz: 1ce9e06e488e2aa0f841f9f543e4f29ea51b3606
3
+ metadata.gz: 30ba1a01720d5f09afaa632916d0fe32281eb5db
4
+ data.tar.gz: ae11f9e158f911b9a99bf266c7077e18fb3bfae3
5
5
  SHA512:
6
- metadata.gz: 779806f2b5055513b710fe8175772cdbac9dccf1b17462af979531b5b0cbb7405bbb42bbbc8cc0cfa69b3066e7f5722bb4147d4cbcb46e6417068146556d2f3a
7
- data.tar.gz: 1df76e510cff8845b65d224e04d295f905644a6ec2839443eb7a2d06a3c0113d43083ea87d69edd4795111d4a9952418ac238d376e3b8882982cd6e744c18572
6
+ metadata.gz: 240177f3aa7c487781a6a5d7623322e486e8fe0937c3673e7354f51b982d36c71de7435208f65b3fff3854690c1c3086188b5f3621acbb75efdf7e73d2ee132f
7
+ data.tar.gz: 0f8ef1b2c63c9a74547ccfcc0f2e67037171e70e82912cb6cffe5121dea79c9c578d16269bf1209ebbad26c7aab317585d5e6df8143738f281cd070ea14ba83d
@@ -16,7 +16,6 @@ module EvernoteOAuth
16
16
  result = @client.send(name, *args, &block)
17
17
  end
18
18
 
19
- attr_name = underscore(self.class.name.gsub(/::Store$/, '').split('::').last).to_sym
20
19
  attr_value = self
21
20
  [result].flatten.each{|r|
22
21
  begin
@@ -29,6 +28,17 @@ module EvernoteOAuth
29
28
  end
30
29
 
31
30
  private
31
+ def attr_name
32
+ name = underscore(self.class.name.gsub(/::Store$/, '').split('::').last)
33
+ if name.end_with?('user_store')
34
+ :user_store
35
+ elsif name.end_with?('note_store')
36
+ :note_store
37
+ else
38
+ raise "Unsupported type: #{self.class.name}"
39
+ end
40
+ end
41
+
32
42
  def underscore(word)
33
43
  word.to_s.gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
34
44
  gsub(/([a-z\d])([A-Z])/,'\1_\2').
@@ -1,3 +1,3 @@
1
1
  module EvernoteOAuth
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -40,15 +40,13 @@ describe "EvernoteOAuth::BusinessUtils" do
40
40
  )
41
41
  business_note_store = mock(Object)
42
42
  business_note_store.stub(:createNotebook).with(notebook).and_return(business_notebook)
43
- should_receive(:business_note_store).and_return(business_note_store)
43
+ should_receive(:business_note_store).twice.and_return(business_note_store)
44
44
 
45
45
  business_user = Evernote::EDAM::Type::User.new(
46
46
  username: 'username',
47
47
  shardId: 'shardId'
48
48
  )
49
- user_store = mock(Object)
50
- user_store.stub(:getUser).and_return(business_user)
51
- should_receive(:user_store).and_return(user_store)
49
+ business_note_store.stub(:user).and_return(business_user)
52
50
 
53
51
  note_store = mock(Object)
54
52
  note_store.should_receive(:createLinkedNotebook).with(
@@ -74,7 +72,7 @@ describe "EvernoteOAuth::BusinessUtils" do
74
72
  should_receive(:shared_note_store).with(business_notebook).and_return(shared_note_store)
75
73
 
76
74
  business_note_store = mock(Object)
77
- business_note_store.should_receive(:getNotebookWithGuid).with('notebook_guid')
75
+ business_note_store.should_receive(:getNotebook).with('notebook_guid')
78
76
  should_receive(:business_note_store).and_return(business_note_store)
79
77
 
80
78
  get_corresponding_notebook(business_notebook)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evernote_oauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evernote
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-31 00:00:00.000000000 Z
11
+ date: 2013-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth