nimbox_ruby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6838ebba3261b76fed3a9c501b99f0fc14d55df5
4
+ data.tar.gz: 6a4422025d0c58d1c11e1eddd69634f4333cf644
5
+ SHA512:
6
+ metadata.gz: c4d44b6a88b3ac6dffe01c9d35059b2ff714205d1ecd13a431fb45963df77dbbf9847c162d030eac7c8e18eee9419184384799a4d1b6a01516848499b97f9166
7
+ data.tar.gz: aaf7c5da5217cec28572463fcbc3efb2cab4e789d4aa2c33bcda7f6199781455dde8b5b40160e77387353cec485c138ed37b2d10c14fec7ea7eedecad635c123
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in nimbox_ruby.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Amed Rodriguez
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 ADDED
@@ -0,0 +1,70 @@
1
+ # Nimbo X Ruby Gem
2
+
3
+ A Ruby wrapper for the Nimbo X API.
4
+
5
+ You should access the Nimbo X API documentation in order to learn more
6
+ about the request/response parameters for each endpoint.
7
+
8
+ ## Installation
9
+
10
+ ```ruby
11
+ $ gem install nimbox_ruby
12
+ ```
13
+
14
+ ## API Usage Examples
15
+
16
+ You will need to get an app_id, app_secret and access token in order to make
17
+ authenticated requests.
18
+
19
+ ```ruby
20
+ # initializing the client
21
+ client = Nimbox::Client.new(client_id: <redacted>, client_secret: <redacted>,
22
+ access_token: <redacted>)
23
+ ```
24
+
25
+ ### People
26
+
27
+ Create a person.
28
+
29
+ ```ruby
30
+ attributes = { first_name: 'John', last_name: 'Doe' }
31
+ response = client.people.create!(attributes)
32
+ response['person'].inspect
33
+ ```
34
+
35
+ Update a person.
36
+
37
+ ```ruby
38
+ client.people('1').update!(first_name: 'Foo')
39
+ ```
40
+
41
+ Retrieve a person.
42
+
43
+ ```ruby
44
+ client.people!('1')
45
+ ```
46
+
47
+ ### Consultations
48
+
49
+ Create a consultation.
50
+
51
+ ```ruby
52
+ attributes = { cause: 'John', person_id: 1 }
53
+ response = client.consultations.create!(attributes)
54
+ response['consultation'].inspect
55
+ ```
56
+
57
+ Update a consultation.
58
+
59
+ ```ruby
60
+ client.consultations('1').update!(cause: 'Foo')
61
+ ```
62
+
63
+ Retrieve a consultation.
64
+
65
+ ```ruby
66
+ client.consultations!('1')
67
+ ```
68
+ ## License
69
+
70
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "nimbox_ruby"
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
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,22 @@
1
+ module Nimbox
2
+ class Client < Rapidash::Client
3
+ method :oauth
4
+
5
+ extension :json
6
+
7
+ encode_request_with :json
8
+
9
+ raise_errors
10
+
11
+ resource :people, class_name: Nimbox::Resources::People
12
+ resource :consultations, class_name: Nimbox::Resources::Consultations
13
+
14
+ def initialize(options={})
15
+ options[:site] = options[:site]
16
+ options[:uid] ||= options[:client_id]
17
+ options[:secret] ||= options[:client_secret]
18
+
19
+ super(options)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,6 @@
1
+ module Nimbox
2
+ module Resources
3
+ class Consultations < Rapidash::Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Nimbox
2
+ module Resources
3
+ class People < Rapidash::Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,3 @@
1
+ module Nimbox
2
+ VERSION = "0.1.0"
3
+ end
data/lib/nimbox.rb ADDED
@@ -0,0 +1,8 @@
1
+ require 'rapidash'
2
+ require_relative 'nimbox/version'
3
+ require_relative 'nimbox/resources/people'
4
+ require_relative 'nimbox/resources/consultations'
5
+ require_relative 'nimbox/client'
6
+
7
+ module Nimbox
8
+ end
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'nimbox/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "nimbox_ruby"
8
+ spec.version = Nimbox::VERSION
9
+ spec.authors = ["Amed Rodriguez"]
10
+ spec.email = ["amed.rdz@gmail.com"]
11
+
12
+ spec.summary = %q{Nimbo X Ruby Wrapper}
13
+ spec.homepage = "https://github.com/amedrz/nimbox_ruby"
14
+ spec.license = "MIT"
15
+
16
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
17
+ # delete this section to allow pushing this gem to any host.
18
+ if spec.respond_to?(:metadata)
19
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
20
+ else
21
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.add_development_dependency "bundler", "~> 1.10"
30
+ spec.add_development_dependency "rake", "~> 10.0"
31
+ spec.add_development_dependency "rspec"
32
+ spec.add_development_dependency "webmock"
33
+ spec.add_development_dependency "vcr"
34
+ spec.add_development_dependency "pry"
35
+
36
+ spec.add_runtime_dependency 'rapidash', '~> 0.4.0'
37
+ end
metadata ADDED
@@ -0,0 +1,158 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nimbox_ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Amed Rodriguez
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-12-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: webmock
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: vcr
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rapidash
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.4.0
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.4.0
111
+ description:
112
+ email:
113
+ - amed.rdz@gmail.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - ".gitignore"
119
+ - ".travis.yml"
120
+ - CODE_OF_CONDUCT.md
121
+ - Gemfile
122
+ - LICENSE.txt
123
+ - README.md
124
+ - Rakefile
125
+ - bin/console
126
+ - bin/setup
127
+ - lib/nimbox.rb
128
+ - lib/nimbox/client.rb
129
+ - lib/nimbox/resources/consultations.rb
130
+ - lib/nimbox/resources/people.rb
131
+ - lib/nimbox/version.rb
132
+ - nimbox_ruby.gemspec
133
+ homepage: https://github.com/amedrz/nimbox_ruby
134
+ licenses:
135
+ - MIT
136
+ metadata:
137
+ allowed_push_host: https://rubygems.org
138
+ post_install_message:
139
+ rdoc_options: []
140
+ require_paths:
141
+ - lib
142
+ required_ruby_version: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ required_rubygems_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ requirements: []
153
+ rubyforge_project:
154
+ rubygems_version: 2.4.5
155
+ signing_key:
156
+ specification_version: 4
157
+ summary: Nimbo X Ruby Wrapper
158
+ test_files: []