webceo 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -4
- data/lib/webceo.rb +17 -5
- data/lib/webceo/api.rb +5 -0
- data/lib/webceo/api/client.rb +1 -7
- data/lib/webceo/api/request.rb +1 -1
- data/lib/webceo/configuration.rb +22 -0
- data/lib/webceo/version.rb +14 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 271714cff7c51be222dda592a803eb43e5a1b94f
|
4
|
+
data.tar.gz: a0b597a38c8c4f73ced9009f3fb5532dc6fa1a23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5deeba8cadd4933f85756ca281033acc10283359878740fc6fde359a7d7a41379099239becaac45f21fca8e3f5e3be18240d5bbe97a1fbf748af7663cf7d075b
|
7
|
+
data.tar.gz: a25f20e18a168c7ae7cde920c3725e67b3b39ab7b0015d095effcaf8e19ebd9d073d6f7ec2cbdfbfef1ec638ae7172c6a6818c58e783b93f6a3ee06d2815c00e
|
data/README.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Webceo
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/webceo.svg)][gem_version]
|
4
|
+
[![Gem](https://img.shields.io/gem/dv/webceo/stable.svg)][gem_downloads]
|
5
|
+
![GitHub tag](https://img.shields.io/github/tag/agnel/webceo.svg)
|
6
|
+
[![Liberapay receiving](https://img.shields.io/liberapay/receives/agnelwaghela.svg)][liberapay_donate_link]
|
7
|
+
|
8
|
+
[gem_version]: https://badge.fury.io/rb/webceo
|
9
|
+
[gem_downloads]: https://rubygems.org/gems/webceo
|
10
|
+
[liberapay_donate_link]: https://liberapay.com/agnelwaghela/donate
|
11
|
+
|
3
12
|
Integrate your ruby application with this `webceo` gem to perform the api action using your webceo account. Take a look at the [Webceo API Reference](https://www.webceo.com/api-documentation.htm).
|
4
13
|
|
5
14
|
## Getting Started
|
@@ -21,9 +30,18 @@ Or install it yourself as:
|
|
21
30
|
## Usage
|
22
31
|
|
23
32
|
```ruby
|
24
|
-
|
25
|
-
#
|
26
|
-
|
33
|
+
|
34
|
+
# Configure the gem
|
35
|
+
Webceo.configure do |config|
|
36
|
+
# set the api_key option as per your convenience, for example using environment variables
|
37
|
+
config.api_key = ENV['WEBCEO_API_KEY']
|
38
|
+
end
|
39
|
+
|
40
|
+
# initialize an instance of the Client
|
41
|
+
client = Webceo::Api::Client.new
|
42
|
+
|
43
|
+
# get the list of all methods
|
44
|
+
client.list_methods # => ['get_projects', 'get_project', ...]
|
27
45
|
|
28
46
|
# get list of all the projects, see api reference
|
29
47
|
client.get_projects({ :id => 'my_request_id' })
|
@@ -37,7 +55,10 @@ client.get_project({ :project => '8ady5y7e36' })
|
|
37
55
|
|
38
56
|
## Contributing
|
39
57
|
|
40
|
-
[![Open Source Helpers](https://www.codetriage.com/agnel/webceo/badges/users.svg)]
|
58
|
+
[![Open Source Helpers](https://www.codetriage.com/agnel/webceo/badges/users.svg)][open_source_helpers]
|
59
|
+
![Maintenance](https://img.shields.io/maintenance/yes/2018.svg)
|
60
|
+
|
61
|
+
[open_source_helpers]: https://www.codetriage.com/agnel/webceo
|
41
62
|
|
42
63
|
Bug reports and pull requests are welcome on GitHub at https://github.com/agnel/webceo. 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.
|
43
64
|
|
@@ -46,9 +67,15 @@ Check out the [Webceo Ruby Gem Google Group](https://groups.google.com/forum/#!f
|
|
46
67
|
|
47
68
|
## License
|
48
69
|
|
70
|
+
[![license](https://img.shields.io/github/license/agnel/webceo.svg)][mit_license]
|
71
|
+
|
72
|
+
[mit_license]: http://opensource.org/licenses/MIT
|
73
|
+
|
49
74
|
Webceo is released under the [MIT License](http://opensource.org/licenses/MIT).
|
50
75
|
|
51
76
|
## Todo
|
52
77
|
|
78
|
+
- [ ] Configuration Support
|
79
|
+
- [ ] Generator for initializer with configuration boilerplate
|
53
80
|
- [ ] Batch Operations Support
|
54
81
|
- [ ] Specs
|
data/lib/webceo.rb
CHANGED
@@ -4,9 +4,21 @@ require 'httparty'
|
|
4
4
|
require 'multi_json'
|
5
5
|
require 'active_support/core_ext/hash/indifferent_access'
|
6
6
|
require 'webceo/api'
|
7
|
-
require 'webceo/
|
8
|
-
require 'webceo/api/response'
|
9
|
-
require 'webceo/api/error'
|
10
|
-
require 'webceo/api/client'
|
7
|
+
require 'webceo/configuration'
|
11
8
|
|
12
|
-
module Webceo
|
9
|
+
module Webceo
|
10
|
+
|
11
|
+
class << self
|
12
|
+
attr_accessor :configuration
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.configure
|
16
|
+
self.configuration ||= Webceo::Configuration.new
|
17
|
+
yield(configuration)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.reset
|
21
|
+
self.configuration = Webceo::Configuration.new
|
22
|
+
end
|
23
|
+
|
24
|
+
end # end of module Webceo
|
data/lib/webceo/api.rb
CHANGED
data/lib/webceo/api/client.rb
CHANGED
@@ -14,13 +14,7 @@ module Webceo
|
|
14
14
|
#
|
15
15
|
# Intializes an instance of Client to make api calls
|
16
16
|
#
|
17
|
-
|
18
|
-
#
|
19
|
-
# @param [String] api_key Webceo API Key
|
20
|
-
#
|
21
|
-
def initialize(api_key = nil)
|
22
|
-
self.class.default_options.merge!({ api_key: (api_key || ENV['WEBCEO_API_KEY']) })
|
23
|
-
end
|
17
|
+
def initialize; end
|
24
18
|
|
25
19
|
#
|
26
20
|
# It lists names of all the available API methods on the Webceo API Reference
|
data/lib/webceo/api/request.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
module Webceo
|
2
|
+
#
|
3
|
+
# Class Configuration provides ability to set webceo specific configurations
|
4
|
+
#
|
5
|
+
# @author Agnel Waghela <agnelwaghela@gmail.com>
|
6
|
+
#
|
7
|
+
class Configuration
|
8
|
+
|
9
|
+
#
|
10
|
+
# @!attribute [rw] api_key
|
11
|
+
# @return [String] API Key required to be present along with the api request
|
12
|
+
attr_accessor :api_key
|
13
|
+
|
14
|
+
#
|
15
|
+
# Initialize default attribute values
|
16
|
+
#
|
17
|
+
#
|
18
|
+
def initialize
|
19
|
+
@api_key = nil
|
20
|
+
end
|
21
|
+
end # end of class Configuration
|
22
|
+
end # end of module Webceo
|
data/lib/webceo/version.rb
CHANGED
@@ -1,17 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Webceo
|
4
|
-
#
|
4
|
+
#
|
5
|
+
# Returns the version of the currently loaded Webceo as a <tt>Gem::Version</tt>
|
6
|
+
#
|
5
7
|
def self.gem_version
|
6
8
|
Gem::Version.new VERSION::STRING
|
7
9
|
end
|
8
10
|
|
11
|
+
#
|
12
|
+
# Module VERSION provides constants as per the semantic versioning specification
|
13
|
+
#
|
14
|
+
# @see https://semver.org/
|
15
|
+
#
|
16
|
+
# @author Agnel Waghela <agnelwaghela@gmail.com>
|
17
|
+
#
|
9
18
|
module VERSION
|
10
|
-
MAJOR =
|
11
|
-
MINOR =
|
12
|
-
|
19
|
+
MAJOR = 1
|
20
|
+
MINOR = 0
|
21
|
+
PATCH = 0
|
13
22
|
PRE = nil # 'alpha', 'beta', 'rc1', 'rc2', nil
|
14
23
|
|
15
|
-
STRING = [MAJOR, MINOR,
|
24
|
+
STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
|
16
25
|
end
|
17
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webceo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agnel Waghela
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03
|
11
|
+
date: 2018-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- lib/webceo/api/request.rb
|
151
151
|
- lib/webceo/api/response.rb
|
152
152
|
- lib/webceo/api_methods.yml
|
153
|
+
- lib/webceo/configuration.rb
|
153
154
|
- lib/webceo/version.rb
|
154
155
|
- webceo.gemspec
|
155
156
|
homepage: http://agnelwaghela.in/project/webceo-api-client
|