workmate 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG ADDED
@@ -0,0 +1 @@
1
+ v0.1.0 first release
data/LICENSE ADDED
File without changes
data/Manifest ADDED
@@ -0,0 +1,8 @@
1
+ CHANGELOG
2
+ LICENSE
3
+ Manifest
4
+ README.rdoc
5
+ Rakefile
6
+ init.rb
7
+ lib/workmate.rb
8
+ lib/workmate/client.rb
data/README.rdoc ADDED
@@ -0,0 +1,13 @@
1
+ == Installation
2
+ $ gem install gcal-ruby
3
+
4
+ == Using
5
+ require 'gcal'
6
+
7
+ client = GCal::Client.new(api_key, api_secret, oauth_token, oauth_secret)
8
+ client.all_calendars # returns all user calendars
9
+ client.own_calendars # returns user owned calendars
10
+ client.events(calendar.id) # returns events in calendar
11
+
12
+ # retrieving events with options
13
+ client.events(calendar.id, :start_time => 1.month.ago, :timezone => 'Europe/Moscow')
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require 'psych'
2
+ require 'rubygems'
3
+ require 'rake'
4
+ require 'echoe'
5
+
6
+ Echoe.new('workmate', '0.1.0') do |p|
7
+ p.description = "Ruby library for Workmate API."
8
+ p.url = "http://github.com/workmate/workmate-ruby"
9
+ p.author = "Iskander Haziev"
10
+ p.email = "gvalmon@gmail.com"
11
+ p.ignore_pattern = ["tmp/*", "script/*"]
12
+ p.runtime_dependencies = ['oauth2', 'json']
13
+ end
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'workmate'
data/lib/workmate.rb ADDED
@@ -0,0 +1,4 @@
1
+ module Workmate
2
+ require 'workmate/client'
3
+ require 'workmate/user'
4
+ end
@@ -0,0 +1,26 @@
1
+ require 'json'
2
+ require 'oauth2'
3
+ module Workmate
4
+ class Client
5
+ BASE_URL = 'http://localhost.localdomain:3000'
6
+ API_URL = "#{BASE_URL}/api"
7
+
8
+ def initialize(client_id, client_secret, token = nil)
9
+ @client = OAuth2::Client.new(client_id, client_secret, :site => BASE_URL)
10
+ @token = OAuth2::AccessToken.from_hash(@client, access_token: token)
11
+ end
12
+
13
+ def call(uri)
14
+ response = @token.get("#{API_URL}#{uri}.json", parse: :json)
15
+ response.parsed
16
+ end
17
+
18
+ def me
19
+ call('/users/me')
20
+ end
21
+
22
+ def user(user_id)
23
+ call('/users/' + user_id)
24
+ end
25
+ end
26
+ end
data/workmate.gemspec ADDED
@@ -0,0 +1,35 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{workmate}
5
+ s.version = "0.1.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = [%q{Iskander Haziev}]
9
+ s.date = %q{2011-11-21}
10
+ s.description = %q{Ruby library for Workmate API.}
11
+ s.email = %q{gvalmon@gmail.com}
12
+ s.extra_rdoc_files = [%q{CHANGELOG}, %q{LICENSE}, %q{README.rdoc}, %q{lib/workmate.rb}, %q{lib/workmate/client.rb}]
13
+ s.files = [%q{CHANGELOG}, %q{LICENSE}, %q{Manifest}, %q{README.rdoc}, %q{Rakefile}, %q{init.rb}, %q{lib/workmate.rb}, %q{lib/workmate/client.rb}, %q{workmate.gemspec}]
14
+ s.homepage = %q{http://github.com/workmate/workmate-ruby}
15
+ s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Workmate}, %q{--main}, %q{README.rdoc}]
16
+ s.require_paths = [%q{lib}]
17
+ s.rubyforge_project = %q{workmate}
18
+ s.rubygems_version = %q{1.8.6}
19
+ s.summary = %q{Ruby library for Workmate API.}
20
+
21
+ if s.respond_to? :specification_version then
22
+ s.specification_version = 3
23
+
24
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
+ s.add_runtime_dependency(%q<oauth2>, [">= 0"])
26
+ s.add_runtime_dependency(%q<json>, [">= 0"])
27
+ else
28
+ s.add_dependency(%q<oauth2>, [">= 0"])
29
+ s.add_dependency(%q<json>, [">= 0"])
30
+ end
31
+ else
32
+ s.add_dependency(%q<oauth2>, [">= 0"])
33
+ s.add_dependency(%q<json>, [">= 0"])
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: workmate
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Iskander Haziev
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-11-21 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: oauth2
16
+ requirement: &2164875160 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *2164875160
25
+ - !ruby/object:Gem::Dependency
26
+ name: json
27
+ requirement: &2164874060 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *2164874060
36
+ description: Ruby library for Workmate API.
37
+ email: gvalmon@gmail.com
38
+ executables: []
39
+ extensions: []
40
+ extra_rdoc_files:
41
+ - CHANGELOG
42
+ - LICENSE
43
+ - README.rdoc
44
+ - lib/workmate.rb
45
+ - lib/workmate/client.rb
46
+ files:
47
+ - CHANGELOG
48
+ - LICENSE
49
+ - Manifest
50
+ - README.rdoc
51
+ - Rakefile
52
+ - init.rb
53
+ - lib/workmate.rb
54
+ - lib/workmate/client.rb
55
+ - workmate.gemspec
56
+ homepage: http://github.com/workmate/workmate-ruby
57
+ licenses: []
58
+ post_install_message:
59
+ rdoc_options:
60
+ - --line-numbers
61
+ - --inline-source
62
+ - --title
63
+ - Workmate
64
+ - --main
65
+ - README.rdoc
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '1.2'
80
+ requirements: []
81
+ rubyforge_project: workmate
82
+ rubygems_version: 1.8.6
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: Ruby library for Workmate API.
86
+ test_files: []