bored-gem 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +8 -1
- data/exe/bored +9 -0
- data/lib/bored/cli.rb +11 -0
- data/lib/bored/version.rb +1 -1
- data/lib/bored.rb +13 -12
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fea1c6e6824caf8b0b64a948bc9383b8f0962ec539ad246dfa6fcb77478fd034
|
4
|
+
data.tar.gz: 686d8bf7208181adc4225c7a513baf59839c0d70a4f2d0afb9b04326df8ecc58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 530147c32621058d562cb4693b1ca5ebe7d25b0011e543a34819acc440b436ccb2666d1d0efc1792ea905c47aa73341ae7c574f9f420a8c8a40c9ef8d47b1795
|
7
|
+
data.tar.gz: '08679a8b4bb952ce1c21835004b99dd7c3a7068152182feb2e266f08939ab460ae19178b5dbf62d0969b093c94178903610bbb1d1b106da82327cb5e3bec6578'
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bored-gem (0.0.
|
4
|
+
bored-gem (0.0.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -39,18 +39,25 @@ GEM
|
|
39
39
|
unicode-display_width (>= 1.4.0, < 3.0)
|
40
40
|
rubocop-ast (1.13.0)
|
41
41
|
parser (>= 3.0.1.1)
|
42
|
+
rubocop-rake (0.6.0)
|
43
|
+
rubocop (~> 1.0)
|
44
|
+
rubocop-rspec (1.35.0)
|
45
|
+
rubocop (>= 0.60.0)
|
42
46
|
ruby-progressbar (1.11.0)
|
43
47
|
unicode-display_width (2.1.0)
|
44
48
|
|
45
49
|
PLATFORMS
|
46
50
|
universal-darwin-21
|
47
51
|
x86_64-darwin-20
|
52
|
+
x86_64-linux
|
48
53
|
|
49
54
|
DEPENDENCIES
|
50
55
|
bored-gem!
|
51
56
|
rake (~> 13.0)
|
52
57
|
rspec (~> 3.0)
|
53
58
|
rubocop (~> 1.21)
|
59
|
+
rubocop-rake
|
60
|
+
rubocop-rspec
|
54
61
|
|
55
62
|
BUNDLED WITH
|
56
63
|
2.2.31
|
data/exe/bored
ADDED
data/lib/bored/cli.rb
ADDED
data/lib/bored/version.rb
CHANGED
data/lib/bored.rb
CHANGED
@@ -3,28 +3,29 @@
|
|
3
3
|
require "net/http"
|
4
4
|
require "json"
|
5
5
|
require_relative "bored/version"
|
6
|
+
require_relative "bored/cli"
|
6
7
|
|
7
8
|
module Bored
|
8
9
|
class Error < StandardError; end
|
9
10
|
|
10
11
|
Activity = Struct.new(
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
:id, :description, :type, :participants,
|
13
|
+
:accessibility, :price, :link,
|
14
|
+
keyword_init: true
|
14
15
|
)
|
15
16
|
|
16
17
|
def self.now
|
17
18
|
json = JSON.parse(Net::HTTP.get(
|
18
|
-
|
19
|
-
|
19
|
+
"www.boredapi.com", "/api/activity"
|
20
|
+
))
|
20
21
|
Activity.new(
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
id: json["key"].to_i,
|
23
|
+
description: json["activity"],
|
24
|
+
type: json["type"].to_sym,
|
25
|
+
participants: json["participants"],
|
26
|
+
accessibility: json["accessibility"],
|
27
|
+
price: json["price"],
|
28
|
+
link: json["link"].empty? ? nil : json["link"]
|
28
29
|
)
|
29
30
|
end
|
30
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bored-gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Sulyanov
|
@@ -13,7 +13,8 @@ dependencies: []
|
|
13
13
|
description:
|
14
14
|
email:
|
15
15
|
- oleg@sulyanov.com
|
16
|
-
executables:
|
16
|
+
executables:
|
17
|
+
- bored
|
17
18
|
extensions: []
|
18
19
|
extra_rdoc_files: []
|
19
20
|
files:
|
@@ -28,7 +29,9 @@ files:
|
|
28
29
|
- Rakefile
|
29
30
|
- bin/console
|
30
31
|
- bin/setup
|
32
|
+
- exe/bored
|
31
33
|
- lib/bored.rb
|
34
|
+
- lib/bored/cli.rb
|
32
35
|
- lib/bored/version.rb
|
33
36
|
homepage: https://hithub.com/osulyanov/bored-gem
|
34
37
|
licenses:
|