weekdone-sdk 0.3.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 15784162103a609dca138f8d60eb2be34b504fad
4
+ data.tar.gz: 58c057c30ea6bb9d9eefca8b0cfbef3a7a5eba39
5
+ SHA512:
6
+ metadata.gz: e62e5b87af587a9450e88b8a5a87cd071f1c3602f0c65fe3df303af69379079a632ad97e56bb51b0b788d9dd4dfa1fb1e4bbf25613a2de0036fa5098489cd7ed
7
+ data.tar.gz: f56a1a792d69eb20d3ecdb13e5d40720a27ce21db5ce7d2b5f216eee94aa048a827c4fd7dd1e06a5b5b7a4fc5135d34d0b72db10e4340a914978c0237256fc0f
@@ -0,0 +1,59 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ # Ignore Byebug command history file.
17
+ .byebug_history
18
+
19
+ ## Specific to RubyMotion:
20
+ .dat*
21
+ .repl_history
22
+ build/
23
+ *.bridgesupport
24
+ build-iPhoneOS/
25
+ build-iPhoneSimulator/
26
+
27
+ ## Specific to RubyMotion (use of CocoaPods):
28
+ #
29
+ # We recommend against adding the Pods directory to your .gitignore. However
30
+ # you should judge for yourself, the pros and cons are mentioned at:
31
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
32
+ #
33
+ # vendor/Pods/
34
+
35
+ ## Documentation cache and generated files:
36
+ /.yardoc/
37
+ /_yardoc/
38
+ /doc/
39
+ /rdoc/
40
+
41
+ ## Environment normalization:
42
+ /.bundle/
43
+ /vendor/bundle
44
+ /lib/bundler/man/
45
+
46
+ # for a library or gem, you might want to ignore these files since the code is
47
+ # intended to run in multiple environments; otherwise, check them in:
48
+ # Gemfile.lock
49
+ # .ruby-version
50
+ # .ruby-gemset
51
+
52
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
53
+ .rvmrc
54
+
55
+ # Used by RuboCop. Remote config files pulled in from inherit_from directive.
56
+ # .rubocop-https?--*
57
+
58
+ /.rspec_status
59
+
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.4.2
6
+ before_install: gem install bundler -v 2.1.4
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in weekdone.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
8
+
9
+ gem "oauth2", "~> 1.4"
10
+ gem "faraday", "~> 1.0"
@@ -0,0 +1,51 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ weekdone-sdk (0.3.0)
5
+ faraday (~> 1.0)
6
+ oauth2 (~> 1.4)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ diff-lcs (1.4.4)
12
+ faraday (1.0.1)
13
+ multipart-post (>= 1.2, < 3)
14
+ jwt (2.2.1)
15
+ multi_json (1.15.0)
16
+ multi_xml (0.6.0)
17
+ multipart-post (2.1.1)
18
+ oauth2 (1.4.4)
19
+ faraday (>= 0.8, < 2.0)
20
+ jwt (>= 1.0, < 3.0)
21
+ multi_json (~> 1.3)
22
+ multi_xml (~> 0.5)
23
+ rack (>= 1.2, < 3)
24
+ rack (2.2.3)
25
+ rake (12.3.3)
26
+ rspec (3.9.0)
27
+ rspec-core (~> 3.9.0)
28
+ rspec-expectations (~> 3.9.0)
29
+ rspec-mocks (~> 3.9.0)
30
+ rspec-core (3.9.2)
31
+ rspec-support (~> 3.9.3)
32
+ rspec-expectations (3.9.2)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.9.0)
35
+ rspec-mocks (3.9.1)
36
+ diff-lcs (>= 1.2.0, < 2.0)
37
+ rspec-support (~> 3.9.0)
38
+ rspec-support (3.9.3)
39
+
40
+ PLATFORMS
41
+ ruby
42
+
43
+ DEPENDENCIES
44
+ faraday (~> 1.0)
45
+ oauth2 (~> 1.4)
46
+ rake (~> 12.0)
47
+ rspec (~> 3.0)
48
+ weekdone-sdk!
49
+
50
+ BUNDLED WITH
51
+ 2.1.4
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 thaim
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,37 @@
1
+ # weekdone-sdk-ruby
2
+ A Ruby gem for communicating with the Weekdone REST API
3
+
4
+ ## Installation
5
+
6
+ Add this line to your application's Gemfile:
7
+
8
+ ```ruby
9
+ gem 'weekdone'
10
+ ```
11
+
12
+ And then execute:
13
+
14
+ $ bundle install
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install weekdone
19
+
20
+ ## Usage
21
+
22
+ TODO: Write usage instructions here
23
+
24
+ ## Development
25
+
26
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
27
+
28
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
29
+
30
+ ## Contributing
31
+
32
+ Bug reports and pull requests are welcome on GitHub at https://github.com/thaim/weekdone-sdk-ruby.
33
+
34
+
35
+ ## License
36
+
37
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "weekdone"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,6 @@
1
+ require "weekdone/version"
2
+ require "weekdone/api"
3
+
4
+ module Weekdone
5
+ class Error < StandardError; end
6
+ end
@@ -0,0 +1,186 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'oauth2'
4
+ require 'faraday'
5
+
6
+ class Weekdone::Api
7
+ API_URL = 'https://api.weekdone.com'
8
+ attr_reader :client, :token_client, :token_code
9
+
10
+ def initialize(client_id, client_secret)
11
+ @client = OAuth2::Client.new(
12
+ client_id, client_secret,
13
+ {
14
+ site: 'https://weekdone.com',
15
+ authorize_url: 'oauth_authorize',
16
+ token_url: 'oauth_token',
17
+ redirect_uri: 'http://localhost:8080/oauth2/callback'
18
+ }
19
+ )
20
+ end
21
+
22
+ def authenticate
23
+ puts "open URL to authorize:"
24
+ puts client.auth_code.authorize_url
25
+
26
+ print "\ninput authorization code: "
27
+ auth_code = gets.chomp
28
+
29
+ @token_client = client.auth_code.get_token(
30
+ auth_code,
31
+ redirect_uri: 'http://localhost:8080/oauth2/authorized'
32
+ )
33
+
34
+ @token_code = @token_client.token
35
+ end
36
+
37
+ def searchForItems(user_id: nil, team_id: nil, period: nil)
38
+ params = { token: @token_code }
39
+ if not user_id.nil?
40
+ params[:user_id] = user_id
41
+ end
42
+ if not team_id.nil?
43
+ params[:team_id] = team_id
44
+ end
45
+ if not period.nil?
46
+ params[:period] = period
47
+ end
48
+
49
+ response = Faraday.get(API_URL + '/1/items', params)
50
+ JSON.parse(response.body)
51
+ end
52
+
53
+ def createItem
54
+ raise NotImplementedError
55
+ end
56
+
57
+ def updateItem
58
+ raise NotImplementedError
59
+ end
60
+
61
+ def assignItemToAnotherUser
62
+ raise NotImplementedError
63
+ end
64
+
65
+ def deleteItem
66
+ raise NotImplementedError
67
+ end
68
+
69
+ def getItemLikes
70
+ raise NotImplementedError
71
+ end
72
+
73
+ def addItemLike
74
+ raise NotImplementedError
75
+ end
76
+
77
+ def deleteItemLike
78
+ raise NotImplementedError
79
+ end
80
+
81
+ def sortItems
82
+ raise NotImplementedError
83
+ end
84
+
85
+ def getItemComments
86
+ raise NotImplementedError
87
+ end
88
+
89
+ def addItemComment
90
+ raise NotImplementedError
91
+ end
92
+
93
+ def deleteItemComment
94
+ raise NotImplementedError
95
+ end
96
+
97
+
98
+ def getReport
99
+ params = { token: @token_code }
100
+
101
+ response = Faraday.get(API_URL + '/1/report', params)
102
+ JSON.parse(response.body)
103
+ end
104
+
105
+
106
+ def getAllTeams
107
+ raise NotImplementedError
108
+ end
109
+
110
+
111
+ def getAllUsers
112
+ raise NotImplementedError
113
+ end
114
+
115
+
116
+ def getAllTypes
117
+ raise NotImplementedError
118
+ end
119
+
120
+
121
+ def getAllTags
122
+ raise NotImplementedError
123
+ end
124
+
125
+ def getSingleTag
126
+ raise NotImplementedError
127
+ end
128
+
129
+ def updateTagPriority
130
+ raise NotImplementedError
131
+ end
132
+
133
+ def updateTagStatus
134
+ raise NotImplementedError
135
+ end
136
+
137
+
138
+ def getAllObjectives
139
+ raise NotImplementedError
140
+ end
141
+
142
+ def createNewObjective
143
+ raise NotImplementedError
144
+ end
145
+
146
+ def updateObjective
147
+ raise NotImplementedError
148
+ end
149
+
150
+ def deleteObjective
151
+ raise NotImplementedError
152
+ end
153
+
154
+ def listObjectiveComments
155
+ raise NotImplementedError
156
+ end
157
+
158
+ def addObjectiveComment
159
+ raise NotImplementedError
160
+ end
161
+
162
+ def updateObjectiveComment
163
+ raise NotImplementedError
164
+ end
165
+
166
+ def deleteObjectiveComment
167
+ raise NotImplementedError
168
+ end
169
+
170
+ def addObjectiveResult
171
+ raise NotImplementedError
172
+ end
173
+
174
+ def updateObjectiveResult
175
+ raise NotImplementedError
176
+ end
177
+
178
+ def deleteObjectiveResult
179
+ raise NotImplementedError
180
+ end
181
+
182
+
183
+ def getCompanyInfo
184
+ raise NotImplementedError
185
+ end
186
+ end
@@ -0,0 +1,3 @@
1
+ module Weekdone
2
+ VERSION = "0.3.0"
3
+ end
@@ -0,0 +1,27 @@
1
+ require_relative 'lib/weekdone/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "weekdone-sdk"
5
+ spec.version = Weekdone::VERSION
6
+ spec.authors = ["thaim"]
7
+ spec.email = ["thaim24@gmail.com"]
8
+
9
+ spec.summary = "A Ruby gem for communicating with the Weekdone REST API"
10
+ spec.description = "A Ruby gem for communicating with the Weekdone REST API"
11
+ spec.homepage = "https://github.com/thaim/weekdone-sdk-ruby"
12
+ spec.license = "MIT"
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
+
15
+ spec.metadata["homepage_uri"] = spec.homepage
16
+ spec.metadata["source_code_uri"] = "https://github.com/thaim/weekdone-sdk-ruby"
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
21
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ end
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_runtime_dependency 'oauth2', '~> 1.4'
26
+ spec.add_runtime_dependency 'faraday', '~> 1.0'
27
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: weekdone-sdk
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ platform: ruby
6
+ authors:
7
+ - thaim
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-08-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: oauth2
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ description: A Ruby gem for communicating with the Weekdone REST API
42
+ email:
43
+ - thaim24@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - ".rspec"
50
+ - ".travis.yml"
51
+ - Gemfile
52
+ - Gemfile.lock
53
+ - LICENSE
54
+ - README.md
55
+ - Rakefile
56
+ - bin/console
57
+ - bin/setup
58
+ - lib/weekdone.rb
59
+ - lib/weekdone/api.rb
60
+ - lib/weekdone/version.rb
61
+ - weekdone-sdk.gemspec
62
+ homepage: https://github.com/thaim/weekdone-sdk-ruby
63
+ licenses:
64
+ - MIT
65
+ metadata:
66
+ homepage_uri: https://github.com/thaim/weekdone-sdk-ruby
67
+ source_code_uri: https://github.com/thaim/weekdone-sdk-ruby
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: 2.3.0
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.6.13
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: A Ruby gem for communicating with the Weekdone REST API
88
+ test_files: []