epitech_api 0.1.0 → 0.1.1

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: 2f8fd7b0e9b3dc9279de36f87735ec206b20f442
4
- data.tar.gz: 8dd26a94a163646d4e18b756e247a1179b0bdc19
3
+ metadata.gz: c3a50858a3247c8c84e8322a7a4622e15690f54c
4
+ data.tar.gz: d235532b69bc9923bf89119627201436cda8fbcf
5
5
  SHA512:
6
- metadata.gz: f118d0995cd7d96ead830106e37cdaa6664c0a14e66fb5faa8eeadd6375084af854d73d598102d8f50e4b12ed9555e20f3c5854ee163e478f422b12184698d97
7
- data.tar.gz: 3c6f1bb44af43495afd0ae77f8fd8fa71bb72635cb4acae4ddcca9ead96da2af807ca96fc6642f85e2da9191e906dde9a11c210f13bc5e231ed2f60c9c03af4f
6
+ metadata.gz: 8011c29fe817e58b20dde598a804a971951ae15579e4495e6ba69e4bac04001ee6f7a689c4a3cb417c720267ae3d059df33a5acec4bf8904e56d7b7d58e5b9b2
7
+ data.tar.gz: f57231471fba674bae76441408118c4058dc1e924b949c905ba56c83ccfa1030d9eeb55baf8aef351118e28a6d7d9fef1d8719f2dcf1f2f69271d6f1f309f3ff
data/.gitignore CHANGED
@@ -1,11 +1,11 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.idea/.rakeTasks ADDED
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Settings><!--This file was automatically generated by Ruby plugin.
3
+ You are allowed to:
4
+ 1. Remove rake task
5
+ 2. Add existing rake tasks
6
+ To add existing rake tasks automatically delete this file and reload the project.
7
+ --><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$" />
8
+ <orderEntry type="jdk" jdkName="Remote: ruby-2.3.1-p112" jdkType="RUBY_SDK" />
9
+ <orderEntry type="sourceFolder" forTests="false" />
10
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, Remote: ruby-2.3.1-p112) [gem]" level="application" />
11
+ <orderEntry type="library" scope="PROVIDED" name="json (v2.1.0, Remote: ruby-2.3.1-p112) [gem]" level="application" />
12
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v3.7.0, Remote: ruby-2.3.1-p112) [gem]" level="application" />
13
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.7.0, Remote: ruby-2.3.1-p112) [gem]" level="application" />
14
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.7.0, Remote: ruby-2.3.1-p112) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.7.0, Remote: ruby-2.3.1-p112) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.7.0, Remote: ruby-2.3.1-p112) [gem]" level="application" />
17
+ </component>
18
+ </module>
@@ -0,0 +1,5 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="PROJECT_PROFILE" />
4
+ </settings>
5
+ </component>
data/.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/epitech-api-gem.iml" filepath="$PROJECT_DIR$/.idea/epitech-api-gem.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="a6d28a3d-3312-4d02-b67c-a379cc8a4099" name="Default" comment="" />
5
+ <option name="TRACKING_ENABLED" value="true" />
6
+ <option name="SHOW_DIALOG" value="false" />
7
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
8
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
9
+ <option name="LAST_RESOLUTION" value="IGNORE" />
10
+ </component>
11
+ <component name="ShelveChangesManager" show_recycled="false">
12
+ <option name="remove_strategy" value="false" />
13
+ </component>
14
+ <component name="TaskManager">
15
+ <task active="true" id="Default" summary="Default task">
16
+ <created>1513463785735</created>
17
+ <option name="number" value="Default" />
18
+ <option name="presentableId" value="Default" />
19
+ <updated>1513463785735</updated>
20
+ </task>
21
+ <servers />
22
+ </component>
23
+ <component name="XDebuggerManager">
24
+ <breakpoint-manager />
25
+ <watches-manager />
26
+ </component>
27
+ </project>
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3.3
5
- before_install: gem install bundler -v 1.16.0
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.3
5
+ before_install: gem install bundler -v 1.16.0
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,74 +1,74 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at antoine.foret@epitech.eu. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at antoine.foret@epitech.eu. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in epitech_api.gemspec
6
- gemspec
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in epitech_api.gemspec
6
+ gemspec
data/Gemfile.lock CHANGED
@@ -1,37 +1,37 @@
1
- PATH
2
- remote: .
3
- specs:
4
- epitech_api (0.1.0)
5
- json (~> 2.1.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- diff-lcs (1.3)
11
- json (2.1.0)
12
- rake (10.5.0)
13
- rspec (3.7.0)
14
- rspec-core (~> 3.7.0)
15
- rspec-expectations (~> 3.7.0)
16
- rspec-mocks (~> 3.7.0)
17
- rspec-core (3.7.0)
18
- rspec-support (~> 3.7.0)
19
- rspec-expectations (3.7.0)
20
- diff-lcs (>= 1.2.0, < 2.0)
21
- rspec-support (~> 3.7.0)
22
- rspec-mocks (3.7.0)
23
- diff-lcs (>= 1.2.0, < 2.0)
24
- rspec-support (~> 3.7.0)
25
- rspec-support (3.7.0)
26
-
27
- PLATFORMS
28
- ruby
29
-
30
- DEPENDENCIES
31
- bundler (~> 1.16)
32
- epitech_api!
33
- rake (~> 10.0)
34
- rspec (~> 3.0)
35
-
36
- BUNDLED WITH
37
- 1.16.0
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ epitech_api (0.1.0)
5
+ json (~> 2.1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ diff-lcs (1.3)
11
+ json (2.1.0)
12
+ rake (10.5.0)
13
+ rspec (3.7.0)
14
+ rspec-core (~> 3.7.0)
15
+ rspec-expectations (~> 3.7.0)
16
+ rspec-mocks (~> 3.7.0)
17
+ rspec-core (3.7.0)
18
+ rspec-support (~> 3.7.0)
19
+ rspec-expectations (3.7.0)
20
+ diff-lcs (>= 1.2.0, < 2.0)
21
+ rspec-support (~> 3.7.0)
22
+ rspec-mocks (3.7.0)
23
+ diff-lcs (>= 1.2.0, < 2.0)
24
+ rspec-support (~> 3.7.0)
25
+ rspec-support (3.7.0)
26
+
27
+ PLATFORMS
28
+ ruby
29
+
30
+ DEPENDENCIES
31
+ bundler (~> 1.16)
32
+ epitech_api!
33
+ rake (~> 10.0)
34
+ rspec (~> 3.0)
35
+
36
+ BUNDLED WITH
37
+ 1.16.0
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2017 eliastre100
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2017 eliastre100
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.
data/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2017 Antoine FORET
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
13
- all 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
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Antoine FORET
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,43 +1,43 @@
1
- # EpitechApi
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/epitech_api`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'epitech_api'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install epitech_api
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- 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.
30
-
31
- 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).
32
-
33
- ## Contributing
34
-
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/epitech_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
-
37
- ## License
38
-
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
-
41
- ## Code of Conduct
42
-
43
- Everyone interacting in the EpitechApi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/epitech_api/blob/master/CODE_OF_CONDUCT.md).
1
+ # EpitechApi
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/epitech_api`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'epitech_api'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install epitech_api
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ 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.
30
+
31
+ 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).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/epitech_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the EpitechApi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/epitech_api/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,6 +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
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console CHANGED
@@ -1,14 +1,14 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "epitech_api"
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__)
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "epitech_api"
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__)
data/bin/setup CHANGED
@@ -1,8 +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
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
data/epitech_api.gemspec CHANGED
@@ -1,37 +1,37 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "epitech_api/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "epitech_api"
8
- spec.version = EpitechApi::VERSION
9
- spec.authors = ["Antoine FORET"]
10
- spec.email = ["antoine.foret@epitech.eu"]
11
-
12
- spec.summary = %q{Simply access to every epitech's intranet information!}
13
- # spec.description = %q{TODO: Write a longer description or delete this line.}
14
- spec.homepage = 'https://github.com/eliastre100/epitech-api-gem'
15
- spec.license = 'MIT'
16
-
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
- if spec.respond_to?(:metadata)
20
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
- else
22
- raise "RubyGems 2.0 or newer is required to protect against " \
23
- "public gem pushes."
24
- end
25
-
26
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
- f.match(%r{^(test|spec|features)/})
28
- end
29
- spec.bindir = "exe"
30
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
- spec.require_paths = ["lib"]
32
-
33
- spec.add_runtime_dependency "json", "~> 2.1.0", ">= 2.1.0"
34
- spec.add_development_dependency "bundler", "~> 1.16"
35
- spec.add_development_dependency "rake", "~> 10.0"
36
- spec.add_development_dependency "rspec", "~> 3.0"
37
- end
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "epitech_api/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "epitech_api"
8
+ spec.version = EpitechApi::VERSION
9
+ spec.authors = ["Antoine FORET"]
10
+ spec.email = ["antoine.foret@epitech.eu"]
11
+
12
+ spec.summary = %q{Simply access to every epitech's intranet information!}
13
+ # spec.description = %q{TODO: Write a longer description or delete this line.}
14
+ spec.homepage = 'https://github.com/eliastre100/epitech-api-gem'
15
+ spec.license = 'MIT'
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against " \
23
+ "public gem pushes."
24
+ end
25
+
26
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
+ f.match(%r{^(test|spec|features)/})
28
+ end
29
+ spec.bindir = "exe"
30
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
+ spec.require_paths = ["lib"]
32
+
33
+ spec.add_runtime_dependency "json", "~> 2.1.0"
34
+ spec.add_development_dependency "bundler", "~> 1.16"
35
+ spec.add_development_dependency "rake", "~> 10.0"
36
+ spec.add_development_dependency "rspec", "~> 3.0"
37
+ end
@@ -1,3 +1,3 @@
1
- class InvalidCredentials < SecurityError
2
-
1
+ class InvalidCredentials < SecurityError
2
+
3
3
  end
@@ -1,3 +1,3 @@
1
- class InvalidRights < SecurityError
2
-
1
+ class InvalidRights < SecurityError
2
+
3
3
  end
@@ -0,0 +1,17 @@
1
+ require 'net/https'
2
+ require 'cgi/cookie'
3
+ require_relative '../Exceptions/invalid_credentials'
4
+ require_relative '../user'
5
+
6
+ class IntraProvider
7
+
8
+ def self.auto_login(code)
9
+ uri = URI("https://intra.epitech.eu/#{code}")
10
+ response = Net::HTTP.get_response(uri)
11
+ raise InvalidCredentials unless response.code.to_i == 302
12
+
13
+ cookie = CGI::Cookie::parse(response['Set-Cookie'])
14
+ token = cookie['user']
15
+ User.new token
16
+ end
17
+ end
@@ -1,17 +1,17 @@
1
- require 'net/https'
2
- require 'cgi/cookie'
3
- require_relative '../Exceptions/InvalidCredentials'
4
- require_relative '../User'
5
-
6
- class OfficeProvider
7
-
8
- def self.login(code)
9
- uri = URI("https://intra.epitech.eu/auth/office365?code=#{code}&state=%2f")
10
- response = Net::HTTP.get_response(uri)
11
- raise InvalidCredentials unless response.code.to_i == 302
12
-
13
- cookie = CGI::Cookie::parse(response['Set-Cookie'])
14
- token = cookie['user']
15
- User.new token
16
- end
17
- end
1
+ require 'net/https'
2
+ require 'cgi/cookie'
3
+ require_relative '../Exceptions/invalid_credentials'
4
+ require_relative '../user'
5
+
6
+ class OfficeProvider
7
+
8
+ def self.login(code)
9
+ uri = URI("https://intra.epitech.eu/auth/office365?code=#{code}&state=%2f")
10
+ response = Net::HTTP.get_response(uri)
11
+ raise InvalidCredentials unless response.code.to_i == 302
12
+
13
+ cookie = CGI::Cookie::parse(response['Set-Cookie'])
14
+ token = cookie['user']
15
+ User.new token
16
+ end
17
+ end
@@ -0,0 +1,23 @@
1
+ class Gatherer
2
+
3
+ def initialize(token)
4
+ @token = token
5
+ end
6
+
7
+ def promos(location, year)
8
+ uri = URI("https://intra.epitech.eu/user/filter/promo?format=json&location=#{location}&year=#{year}&active=true")
9
+ puts uri
10
+
11
+ req = Net::HTTP::Get.new uri
12
+ req['Cookie'] = "#{@token}"
13
+
14
+ http = Net::HTTP.new(uri.hostname, uri.port)
15
+ http.use_ssl = true
16
+
17
+ response = http.request req
18
+
19
+ puts response
20
+ raise InvalidRights unless response.code.to_i == 200
21
+ JSON.parse response.body
22
+ end
23
+ end
@@ -1,24 +1,29 @@
1
- require_relative 'Exceptions/InvalidRights'
2
- require 'json'
3
-
4
- class User
5
-
6
- def initialize(token)
7
- @token = token
8
- end
9
-
10
- def info
11
- uri = URI('https://intra.epitech.eu/user/?format=json')
12
-
13
- req = Net::HTTP::Get.new uri
14
- req['Cookie'] = "#{@token}"
15
-
16
- http = Net::HTTP.new(uri.hostname, uri.port)
17
- http.use_ssl = true
18
-
19
- response = http.request req
20
-
21
- raise InvalidRights unless response.code.to_i == 200
22
- JSON.parse response.body
23
- end
1
+ require 'json'
2
+ require_relative 'Exceptions/invalid_rights'
3
+ require_relative 'gatherer'
4
+
5
+ class User
6
+
7
+ def initialize(token)
8
+ @token = token
9
+ end
10
+
11
+ def gatherer
12
+ Gatherer.new @token
13
+ end
14
+
15
+ def info
16
+ uri = URI('https://intra.epitech.eu/user/?format=json')
17
+
18
+ req = Net::HTTP::Get.new uri
19
+ req['Cookie'] = "#{@token}"
20
+
21
+ http = Net::HTTP.new(uri.hostname, uri.port)
22
+ http.use_ssl = true
23
+
24
+ response = http.request req
25
+
26
+ raise InvalidRights unless response.code.to_i == 200
27
+ JSON.parse response.body
28
+ end
24
29
  end
@@ -1,3 +1,3 @@
1
- module EpitechApi
2
- VERSION = "0.1.0"
3
- end
1
+ module EpitechApi
2
+ VERSION = "0.1.1"
3
+ end
data/lib/epitech_api.rb CHANGED
@@ -1,5 +1,5 @@
1
- require "epitech_api/version"
2
-
3
- module EpitechApi
4
- # Your code goes here...
5
- end
1
+ require "epitech_api/version"
2
+
3
+ module EpitechApi
4
+ # Your code goes here...
5
+ end
data/test.rb ADDED
@@ -0,0 +1,9 @@
1
+ require 'epitech_api/Provider/intra_provider'
2
+ require 'epitech_api/Provider/office_provider'
3
+
4
+ user = IntraProvider.auto_login 'auth-cb01ff8a7f60c846dbc8f1c4a7b3616f38b302ee'
5
+ infos = user.info
6
+
7
+ puts infos.inspect
8
+ promos = user.gatherer.promos(infos['location'], 2017)
9
+ puts promos
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epitech_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antoine FORET
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-16 00:00:00.000000000 Z
11
+ date: 2017-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -17,9 +17,6 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.1.0
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 2.1.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,9 +24,6 @@ dependencies:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: 2.1.0
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 2.1.0
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: bundler
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +74,11 @@ extensions: []
80
74
  extra_rdoc_files: []
81
75
  files:
82
76
  - ".gitignore"
77
+ - ".idea/.rakeTasks"
78
+ - ".idea/epitech-api-gem.iml"
79
+ - ".idea/inspectionProfiles/profiles_settings.xml"
80
+ - ".idea/modules.xml"
81
+ - ".idea/workspace.xml"
83
82
  - ".rspec"
84
83
  - ".travis.yml"
85
84
  - CODE_OF_CONDUCT.md
@@ -93,11 +92,14 @@ files:
93
92
  - bin/setup
94
93
  - epitech_api.gemspec
95
94
  - lib/epitech_api.rb
96
- - lib/epitech_api/Exceptions/InvalidCredentials.rb
97
- - lib/epitech_api/Exceptions/InvalidRights.rb
98
- - lib/epitech_api/Provider/OfficeProvider.rb
99
- - lib/epitech_api/User.rb
95
+ - lib/epitech_api/Exceptions/invalid_credentials.rb
96
+ - lib/epitech_api/Exceptions/invalid_rights.rb
97
+ - lib/epitech_api/Provider/intra_provider.rb
98
+ - lib/epitech_api/Provider/office_provider.rb
99
+ - lib/epitech_api/gatherer.rb
100
+ - lib/epitech_api/user.rb
100
101
  - lib/epitech_api/version.rb
102
+ - test.rb
101
103
  homepage: https://github.com/eliastre100/epitech-api-gem
102
104
  licenses:
103
105
  - MIT
@@ -119,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
121
  version: '0'
120
122
  requirements: []
121
123
  rubyforge_project:
122
- rubygems_version: 2.5.2.1
124
+ rubygems_version: 2.5.1
123
125
  signing_key:
124
126
  specification_version: 4
125
127
  summary: Simply access to every epitech's intranet information!