bored-gem 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4c49e1411681e34b8c4225d0d49593bb0ed84b735604f9e05515d48cb0fef3c
4
- data.tar.gz: 270f04ddda85799097d2a7e86673c31cb6b2d5086006565fa72a704749322d69
3
+ metadata.gz: fea1c6e6824caf8b0b64a948bc9383b8f0962ec539ad246dfa6fcb77478fd034
4
+ data.tar.gz: 686d8bf7208181adc4225c7a513baf59839c0d70a4f2d0afb9b04326df8ecc58
5
5
  SHA512:
6
- metadata.gz: 92c4ccc58cb71a58e9160b666cab4698a2b18218103f829d97460648aef353c130f12a7be3cf7caaa2f54bc321ba99951dbb53b88c19699f37bbc01978216e3f
7
- data.tar.gz: c4be6eae331789ecbd062d734613ea2afe2bb89b8165d2b1c1b47713acaa03a97931f6ba239e87139365f3b93292e4644e371688d29ebdeb39d8b2fc4237e328
6
+ metadata.gz: 530147c32621058d562cb4693b1ca5ebe7d25b0011e543a34819acc440b436ccb2666d1d0efc1792ea905c47aa73341ae7c574f9f420a8c8a40c9ef8d47b1795
7
+ data.tar.gz: '08679a8b4bb952ce1c21835004b99dd7c3a7068152182feb2e266f08939ab460ae19178b5dbf62d0969b093c94178903610bbb1d1b106da82327cb5e3bec6578'
data/.rubocop.yml CHANGED
@@ -1,3 +1,7 @@
1
+ require:
2
+ - rubocop-rspec
3
+ - rubocop-rake
4
+
1
5
  AllCops:
2
6
  TargetRubyVersion: 2.6
3
7
 
data/CHANGELOG.md CHANGED
@@ -2,4 +2,8 @@
2
2
 
3
3
  ## [0.0.1] - 2021-11-19
4
4
 
5
+ - Add `bored` CLI
6
+
7
+ ## [0.0.1] - 2021-11-19
8
+
5
9
  - Add Bored.now() method, returning an activity
data/Gemfile CHANGED
@@ -10,3 +10,5 @@ gem "rake", "~> 13.0"
10
10
  gem "rspec", "~> 3.0"
11
11
 
12
12
  gem "rubocop", "~> 1.21"
13
+ gem "rubocop-rake", require: false
14
+ gem "rubocop-rspec", require: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bored-gem (0.0.1)
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
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift(
4
+ "#{__dir__}/../lib"
5
+ )
6
+
7
+ require "bored"
8
+
9
+ Bored::Cli.new(ARGV).run
data/lib/bored/cli.rb ADDED
@@ -0,0 +1,11 @@
1
+ module Bored
2
+ class Cli
3
+ def initialize(argv)
4
+ @argv = argv
5
+ end
6
+
7
+ def run
8
+ puts Bored.now.description
9
+ end
10
+ end
11
+ end
data/lib/bored/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bored
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
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
- :id, :description, :type, :participants,
12
- :accessibility, :price, :link,
13
- keyword_init: true
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
- "www.boredapi.com", "/api/activity"
19
- ))
19
+ "www.boredapi.com", "/api/activity"
20
+ ))
20
21
  Activity.new(
21
- id: json["key"].to_i,
22
- description: json["activity"],
23
- type: json["type"].to_sym,
24
- participants: json["participants"],
25
- accessibility: json["accessibility"],
26
- price: json["price"],
27
- link: json["link"].empty? ? nil :json["link"]
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.1
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: