diff options
| author | Chris Sepic | 2010-02-27 14:55:41 -0600 | 
|---|---|---|
| committer | Chris Sepic | 2010-02-27 14:55:41 -0600 | 
| commit | d37a991568df31dd89521a09e1c9f25a5b9c4a94 (patch) | |
| tree | 3a02c5ea558e97bb1a2f5cdc9d471423fa66beb5 /lib | |
| parent | 839114cf53e30d4dc2585d4ab9b5720c2c408b80 (diff) | |
| parent | 56d612120451c490fce4b006650c067498ed1678 (diff) | |
| download | evernote-d37a991568df31dd89521a09e1c9f25a5b9c4a94.tar.bz2 | |
merging
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/evernote/client.rb | 4 | ||||
| -rw-r--r-- | lib/evernote/user_store.rb | 13 | 
2 files changed, 15 insertions, 2 deletions
| diff --git a/lib/evernote/client.rb b/lib/evernote/client.rb index 80eb484..6293f17 100644 --- a/lib/evernote/client.rb +++ b/lib/evernote/client.rb @@ -1,6 +1,6 @@  module Evernote    class Client -   +      THRIFT_DEFAULTS = {        :transport => Thrift::HTTPClientTransport      }.freeze @@ -14,4 +14,4 @@ module Evernote        @client.send(name, *args, &block)      end    end -end
\ No newline at end of file +end diff --git a/lib/evernote/user_store.rb b/lib/evernote/user_store.rb index bbbdfcb..b8b6102 100644 --- a/lib/evernote/user_store.rb +++ b/lib/evernote/user_store.rb @@ -1,4 +1,7 @@  module Evernote + +  VersionOutOfDate = Class.new(StandardError) +    class UserStore      AuthenticationFailure = Class.new(StandardError) @@ -15,6 +18,8 @@ module Evernote        end        @client = Evernote::Client.new(Evernote::EDAM::UserStore::UserStore::Client, uri, thrift_client_options) +       +      validate_version      end      def authenticate @@ -26,5 +31,13 @@ module Evernote      def method_missing(name, *args, &block)        @client.send(name, *args, &block)      end + +    def validate_version +      raise VersionOutOfDate, "The vendored Evernote client code is out of date and needs to be regenerated" unless version_valid? +    end + +    def version_valid? +      checkVersion("Ruby EDAMTest", Evernote::EDAM::UserStore::EDAM_VERSION_MAJOR, Evernote::EDAM::UserStore::EDAM_VERSION_MINOR) +    end    end  end | 
