hackerearth_api 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/Gemfile +4 -0
- data/README.md +19 -8
- data/hackerearth_api.gemspec +3 -1
- data/lib/hackerearth_api/response.rb +0 -4
- data/lib/hackerearth_api/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcb62e90b2e5cdc4a0799a0b5f7b3a577d5a7c7de8e9f621e81f57cf016686a2
|
4
|
+
data.tar.gz: 9aec0848e9813386ce008b370378c479b2b0620a968fed493d63218dfcc58296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 822a33b4771c781d7eefcdd53d97b299e2f1c57d0f74f1806b78bf7405fec87d14a66d8b72e694553158fe5b33e8f39acd5dadfee385556ddf7480343b0b1c8d
|
7
|
+
data.tar.gz: 624a555177d617bb81f1ff68f3582a7aa2bf19ed56f8c85527d4c5ac66759d1e2161f259c5478961d35c1bd595e736c60f55ace1dfb75a6a9deef03bf66276b9
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,15 @@
|
|
1
1
|
# HackerearthApi
|
2
|
+
[][gem]
|
3
|
+
[][travis]
|
4
|
+
[][maintainability]
|
5
|
+
[][coverall]
|
6
|
+
[][gemnasium]
|
7
|
+
|
8
|
+
[gem]: http://badge.fury.io/rb/hackerearth_api
|
9
|
+
[travis]: https://travis-ci.org/amandeep511997/hackerearth_api
|
10
|
+
[maintainability]: (https://codeclimate.com/github/amandeep511997/hackerearth_api/maintainability)
|
11
|
+
[coverall]: (https://coveralls.io/github/amandeep511997/hackerearth_api?branch=master)
|
12
|
+
[gemnasium]: https://gemnasium.com/projects/github.com/amandeep511997/hackerearth_api
|
2
13
|
|
3
14
|
A Ruby client for the official [Hackerearth API](https://www.hackerearth.com/docs/wiki/developers/v3/). Supports both the API endpoints. Can be used to compile and run code.
|
4
15
|
|
@@ -23,7 +34,7 @@ Or install it yourself as:
|
|
23
34
|
### Creating a Instance
|
24
35
|
To start using gem, you can create a new client instance by passing the client_secret to the constructor as
|
25
36
|
```ruby
|
26
|
-
|
37
|
+
hacker = HackerearthApi.new("[your-client-secret]")
|
27
38
|
```
|
28
39
|
|
29
40
|
### Setting Parameters
|
@@ -31,7 +42,7 @@ Since, the instance already has the client_secret you only need to pass rest of
|
|
31
42
|
|
32
43
|
To view the list of languages supported you can do as follows
|
33
44
|
```ruby
|
34
|
-
|
45
|
+
HackerearthApi.languages
|
35
46
|
```
|
36
47
|
|
37
48
|
'time_limit' and 'memory_limit' should be atmost 5 and 262144 respectively, any values greater than maximum value are set to the maximum value.
|
@@ -39,9 +50,9 @@ To view the list of languages supported you can do as follows
|
|
39
50
|
### Making a Request
|
40
51
|
Now you can further make compile and run calls to the API as follows by passing the parameters mentioned in the API documentation, in the form of a hash.
|
41
52
|
```ruby
|
42
|
-
|
53
|
+
hacker.compile({:source=>"puts('Hello World!')", :lang=>"RUBY"})
|
43
54
|
|
44
|
-
|
55
|
+
hacker.run({:source=>"puts('Hello World!')", :lang=>"RUBY"})
|
45
56
|
```
|
46
57
|
|
47
58
|
### Response from API
|
@@ -51,11 +62,11 @@ It will contain the response same as mentioned in the API documentation, along w
|
|
51
62
|
### Editing the Instance
|
52
63
|
You can view or change the current objects client_secret
|
53
64
|
```ruby
|
54
|
-
|
55
|
-
|
65
|
+
# To read
|
66
|
+
hacker.client_secret_key
|
56
67
|
|
57
|
-
|
58
|
-
|
68
|
+
# To change
|
69
|
+
hacker.client_secret= [new-client-secret]
|
59
70
|
```
|
60
71
|
|
61
72
|
## Contributing
|
data/hackerearth_api.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Amandeep Singh"]
|
9
9
|
spec.email = ["amandeep511997@gmail.com"]
|
10
10
|
|
11
|
-
spec.summary = %q{Ruby library for the Hackerearth API.}
|
11
|
+
spec.summary = %q{Ruby library for the Hackerearth API. Using HackerEarth API you can compile and run your code using their codeTable. }
|
12
12
|
spec.homepage = "https://github.com/amandeep511997/hackerearth_api"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
@@ -19,6 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
+
spec.required_ruby_version = '>= 2.0.0'
|
23
|
+
|
22
24
|
spec.add_development_dependency "bundler", "~> 1.16"
|
23
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hackerearth_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amandeep Singh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -104,7 +104,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
104
|
requirements:
|
105
105
|
- - ">="
|
106
106
|
- !ruby/object:Gem::Version
|
107
|
-
version:
|
107
|
+
version: 2.0.0
|
108
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - ">="
|
@@ -115,5 +115,6 @@ rubyforge_project:
|
|
115
115
|
rubygems_version: 2.7.3
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
|
-
summary: Ruby library for the Hackerearth API.
|
118
|
+
summary: Ruby library for the Hackerearth API. Using HackerEarth API you can compile
|
119
|
+
and run your code using their codeTable.
|
119
120
|
test_files: []
|