jokerino 1.0.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
+ SHA256:
3
+ metadata.gz: 7447ef4fbd2502c1909176126ab85e7b054262ebe5985f858a1afed7242adb82
4
+ data.tar.gz: f3ed6fb8a254223d5e9bf2ebd0989aac10e9599683cb5ed9ebc74c8b49785341
5
+ SHA512:
6
+ metadata.gz: f4ed128425ee61c58c342ebf4da04ca3282323e2feb2109a427f31c09173432d8b7243503db3c297c86a762099235a21c03736597986134dd583128a620b2bd5
7
+ data.tar.gz: e2b95e604daff6686230b010fa05eb6715e80b4fa37ef58824a61151d1945bbea4b111ab3bea30c7ac50d9fac312690a6e47ce2747b42c59faef5681f502959e
@@ -0,0 +1,16 @@
1
+ name: Ruby
2
+
3
+ on: [push,pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ - name: Set up Ruby
11
+ uses: ruby/setup-ruby@v1
12
+ with:
13
+ ruby-version: 3.0.2
14
+ bundler-cache: true
15
+ - name: Run the default task
16
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Datasource local storage ignored files
5
+ /dataSources/
6
+ /dataSources.local.xml
7
+ # Editor-based HTTP Client requests
8
+ /httpRequests/
data/.idea/joker.iml ADDED
@@ -0,0 +1,104 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$">
8
+ <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
+ <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
+ </content>
12
+ <orderEntry type="inheritedJdk" />
13
+ <orderEntry type="sourceFolder" forTests="false" />
14
+ <orderEntry type="library" scope="PROVIDED" name="aruba (v2.0.0, rbenv: 3.0.2) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, rbenv: 3.0.2) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="builder (v3.2.4, rbenv: 3.0.2) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.2.22, rbenv: 3.0.2) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="childprocess (v4.1.0, rbenv: 3.0.2) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="contracts (v0.17, rbenv: 3.0.2) [gem]" level="application" />
20
+ <orderEntry type="library" scope="PROVIDED" name="cucumber (v7.0.0, rbenv: 3.0.2) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="cucumber-core (v10.0.1, rbenv: 3.0.2) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="cucumber-create-meta (v6.0.1, rbenv: 3.0.2) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="cucumber-cucumber-expressions (v12.1.1, rbenv: 3.0.2) [gem]" level="application" />
24
+ <orderEntry type="library" scope="PROVIDED" name="cucumber-gherkin (v20.0.1, rbenv: 3.0.2) [gem]" level="application" />
25
+ <orderEntry type="library" scope="PROVIDED" name="cucumber-html-formatter (v16.0.1, rbenv: 3.0.2) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="cucumber-messages (v17.0.1, rbenv: 3.0.2) [gem]" level="application" />
27
+ <orderEntry type="library" scope="PROVIDED" name="cucumber-tag-expressions (v3.0.1, rbenv: 3.0.2) [gem]" level="application" />
28
+ <orderEntry type="library" scope="PROVIDED" name="cucumber-wire (v6.1.0, rbenv: 3.0.2) [gem]" level="application" />
29
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.4.4, rbenv: 3.0.2) [gem]" level="application" />
30
+ <orderEntry type="library" scope="PROVIDED" name="faraday (v1.7.0, rbenv: 3.0.2) [gem]" level="application" />
31
+ <orderEntry type="library" scope="PROVIDED" name="faraday-em_http (v1.0.0, rbenv: 3.0.2) [gem]" level="application" />
32
+ <orderEntry type="library" scope="PROVIDED" name="faraday-em_synchrony (v1.0.0, rbenv: 3.0.2) [gem]" level="application" />
33
+ <orderEntry type="library" scope="PROVIDED" name="faraday-excon (v1.1.0, rbenv: 3.0.2) [gem]" level="application" />
34
+ <orderEntry type="library" scope="PROVIDED" name="faraday-httpclient (v1.0.1, rbenv: 3.0.2) [gem]" level="application" />
35
+ <orderEntry type="library" scope="PROVIDED" name="faraday-net_http (v1.0.1, rbenv: 3.0.2) [gem]" level="application" />
36
+ <orderEntry type="library" scope="PROVIDED" name="faraday-net_http_persistent (v1.2.0, rbenv: 3.0.2) [gem]" level="application" />
37
+ <orderEntry type="library" scope="PROVIDED" name="faraday-patron (v1.0.0, rbenv: 3.0.2) [gem]" level="application" />
38
+ <orderEntry type="library" scope="PROVIDED" name="faraday-rack (v1.0.0, rbenv: 3.0.2) [gem]" level="application" />
39
+ <orderEntry type="library" scope="PROVIDED" name="faraday_middleware (v1.1.0, rbenv: 3.0.2) [gem]" level="application" />
40
+ <orderEntry type="library" scope="PROVIDED" name="ffi (v1.15.3, rbenv: 3.0.2) [gem]" level="application" />
41
+ <orderEntry type="library" scope="PROVIDED" name="mime-types (v3.3.1, rbenv: 3.0.2) [gem]" level="application" />
42
+ <orderEntry type="library" scope="PROVIDED" name="mime-types-data (v3.2021.0704, rbenv: 3.0.2) [gem]" level="application" />
43
+ <orderEntry type="library" scope="PROVIDED" name="multi_test (v0.1.2, rbenv: 3.0.2) [gem]" level="application" />
44
+ <orderEntry type="library" scope="PROVIDED" name="multipart-post (v2.1.1, rbenv: 3.0.2) [gem]" level="application" />
45
+ <orderEntry type="library" scope="PROVIDED" name="parallel (v1.20.1, rbenv: 3.0.2) [gem]" level="application" />
46
+ <orderEntry type="library" scope="PROVIDED" name="parser (v3.0.2.0, rbenv: 3.0.2) [gem]" level="application" />
47
+ <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.0.0, rbenv: 3.0.2) [gem]" level="application" />
48
+ <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, rbenv: 3.0.2) [gem]" level="application" />
49
+ <orderEntry type="library" scope="PROVIDED" name="rbs (v1.0.4, rbenv: 3.0.2) [gem]" level="application" />
50
+ <orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.1.1, rbenv: 3.0.2) [gem]" level="application" />
51
+ <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, rbenv: 3.0.2) [gem]" level="application" />
52
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v3.10.0, rbenv: 3.0.2) [gem]" level="application" />
53
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.10.1, rbenv: 3.0.2) [gem]" level="application" />
54
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.10.1, rbenv: 3.0.2) [gem]" level="application" />
55
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.10.2, rbenv: 3.0.2) [gem]" level="application" />
56
+ <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.10.2, rbenv: 3.0.2) [gem]" level="application" />
57
+ <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.19.0, rbenv: 3.0.2) [gem]" level="application" />
58
+ <orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.10.0, rbenv: 3.0.2) [gem]" level="application" />
59
+ <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.11.0, rbenv: 3.0.2) [gem]" level="application" />
60
+ <orderEntry type="library" scope="PROVIDED" name="ruby2_keywords (v0.0.5, rbenv: 3.0.2) [gem]" level="application" />
61
+ <orderEntry type="library" scope="PROVIDED" name="sys-uname (v1.2.2, rbenv: 3.0.2) [gem]" level="application" />
62
+ <orderEntry type="library" scope="PROVIDED" name="thor (v1.1.0, rbenv: 3.0.2) [gem]" level="application" />
63
+ <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.0.0, rbenv: 3.0.2) [gem]" level="application" />
64
+ </component>
65
+ <component name="RakeTasksCache">
66
+ <option name="myRootTask">
67
+ <RakeTaskImpl id="rake">
68
+ <subtasks>
69
+ <RakeTaskImpl description="Build joker-0.1.0.gem into the pkg directory" fullCommand="build" id="build" />
70
+ <RakeTaskImpl id="build">
71
+ <subtasks>
72
+ <RakeTaskImpl description="Generate SHA512 checksum if joker-0.1.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
73
+ </subtasks>
74
+ </RakeTaskImpl>
75
+ <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
76
+ <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
77
+ <RakeTaskImpl description="Build and install joker-0.1.0.gem into system gems" fullCommand="install" id="install" />
78
+ <RakeTaskImpl id="install">
79
+ <subtasks>
80
+ <RakeTaskImpl description="Build and install joker-0.1.0.gem into system gems without network access" fullCommand="install:local" id="local" />
81
+ </subtasks>
82
+ </RakeTaskImpl>
83
+ <RakeTaskImpl description="Create tag v0.1.0 and build and push joker-0.1.0.gem to TODO: Set to 'https://mygemserver.com'" fullCommand="release[remote]" id="release[remote]" />
84
+ <RakeTaskImpl description="Run RuboCop" fullCommand="rubocop" id="rubocop" />
85
+ <RakeTaskImpl id="rubocop">
86
+ <subtasks>
87
+ <RakeTaskImpl description="Auto-correct RuboCop offenses" fullCommand="rubocop:auto_correct" id="auto_correct" />
88
+ </subtasks>
89
+ </RakeTaskImpl>
90
+ <RakeTaskImpl description="Run RSpec code examples" fullCommand="spec" id="spec" />
91
+ <RakeTaskImpl description="" fullCommand="default" id="default" />
92
+ <RakeTaskImpl description="" fullCommand="release" id="release" />
93
+ <RakeTaskImpl id="release">
94
+ <subtasks>
95
+ <RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
96
+ <RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
97
+ <RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
98
+ </subtasks>
99
+ </RakeTaskImpl>
100
+ </subtasks>
101
+ </RakeTaskImpl>
102
+ </option>
103
+ </component>
104
+ </module>
data/.idea/misc.xml ADDED
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 3.0.2" project-jdk-type="RUBY_SDK" />
4
+ </project>
data/.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/joker.iml" filepath="$PROJECT_DIR$/.idea/joker.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.0
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## [0.1.0] - 2021-08-13
2
+
3
+ - Initial release
4
+
5
+ ## [1.0.0] - 2021-08-13
6
+
7
+ - Programming jokes only
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in joker.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.7"
13
+
14
+ gem 'faraday'
15
+
16
+ gem 'faraday_middleware'
data/Gemfile.lock ADDED
@@ -0,0 +1,132 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jokerino (1.0.0)
5
+ thor
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ aruba (2.0.0)
11
+ bundler (>= 1.17, < 3.0)
12
+ childprocess (>= 2.0, < 5.0)
13
+ contracts (>= 0.16.0, < 0.18.0)
14
+ cucumber (>= 4.0, < 8.0)
15
+ rspec-expectations (~> 3.4)
16
+ thor (~> 1.0)
17
+ ast (2.4.2)
18
+ builder (3.2.4)
19
+ childprocess (4.1.0)
20
+ contracts (0.17)
21
+ cucumber (7.0.0)
22
+ builder (~> 3.2, >= 3.2.4)
23
+ cucumber-core (~> 10.0, >= 10.0.1)
24
+ cucumber-create-meta (~> 6.0, >= 6.0.1)
25
+ cucumber-cucumber-expressions (~> 12.1, >= 12.1.1)
26
+ cucumber-gherkin (~> 20.0, >= 20.0.1)
27
+ cucumber-html-formatter (~> 16.0, >= 16.0.1)
28
+ cucumber-messages (~> 17.0, >= 17.0.1)
29
+ cucumber-wire (~> 6.0, >= 6.0.1)
30
+ diff-lcs (~> 1.4, >= 1.4.4)
31
+ mime-types (~> 3.3, >= 3.3.1)
32
+ multi_test (~> 0.1, >= 0.1.2)
33
+ sys-uname (~> 1.2, >= 1.2.2)
34
+ cucumber-core (10.0.1)
35
+ cucumber-gherkin (~> 20.0, >= 20.0.1)
36
+ cucumber-messages (~> 17.0, >= 17.0.1)
37
+ cucumber-tag-expressions (~> 3.0, >= 3.0.1)
38
+ cucumber-create-meta (6.0.1)
39
+ cucumber-messages (~> 17.0, >= 17.0.1)
40
+ sys-uname (~> 1.2, >= 1.2.2)
41
+ cucumber-cucumber-expressions (12.1.1)
42
+ cucumber-gherkin (20.0.1)
43
+ cucumber-messages (~> 17.0, >= 17.0.1)
44
+ cucumber-html-formatter (16.0.1)
45
+ cucumber-messages (~> 17.0, >= 17.0.1)
46
+ cucumber-messages (17.0.1)
47
+ cucumber-tag-expressions (3.0.1)
48
+ cucumber-wire (6.1.0)
49
+ cucumber-core (~> 10.0, >= 10.0.1)
50
+ cucumber-cucumber-expressions (~> 12.1, >= 12.1.1)
51
+ cucumber-messages (~> 17.0, >= 17.0.1)
52
+ diff-lcs (1.4.4)
53
+ faraday (1.7.0)
54
+ faraday-em_http (~> 1.0)
55
+ faraday-em_synchrony (~> 1.0)
56
+ faraday-excon (~> 1.1)
57
+ faraday-httpclient (~> 1.0.1)
58
+ faraday-net_http (~> 1.0)
59
+ faraday-net_http_persistent (~> 1.1)
60
+ faraday-patron (~> 1.0)
61
+ faraday-rack (~> 1.0)
62
+ multipart-post (>= 1.2, < 3)
63
+ ruby2_keywords (>= 0.0.4)
64
+ faraday-em_http (1.0.0)
65
+ faraday-em_synchrony (1.0.0)
66
+ faraday-excon (1.1.0)
67
+ faraday-httpclient (1.0.1)
68
+ faraday-net_http (1.0.1)
69
+ faraday-net_http_persistent (1.2.0)
70
+ faraday-patron (1.0.0)
71
+ faraday-rack (1.0.0)
72
+ faraday_middleware (1.1.0)
73
+ faraday (~> 1.0)
74
+ ffi (1.15.3)
75
+ mime-types (3.3.1)
76
+ mime-types-data (~> 3.2015)
77
+ mime-types-data (3.2021.0704)
78
+ multi_test (0.1.2)
79
+ multipart-post (2.1.1)
80
+ parallel (1.20.1)
81
+ parser (3.0.2.0)
82
+ ast (~> 2.4.1)
83
+ rainbow (3.0.0)
84
+ rake (13.0.6)
85
+ regexp_parser (2.1.1)
86
+ rexml (3.2.5)
87
+ rspec (3.10.0)
88
+ rspec-core (~> 3.10.0)
89
+ rspec-expectations (~> 3.10.0)
90
+ rspec-mocks (~> 3.10.0)
91
+ rspec-core (3.10.1)
92
+ rspec-support (~> 3.10.0)
93
+ rspec-expectations (3.10.1)
94
+ diff-lcs (>= 1.2.0, < 2.0)
95
+ rspec-support (~> 3.10.0)
96
+ rspec-mocks (3.10.2)
97
+ diff-lcs (>= 1.2.0, < 2.0)
98
+ rspec-support (~> 3.10.0)
99
+ rspec-support (3.10.2)
100
+ rubocop (1.19.0)
101
+ parallel (~> 1.10)
102
+ parser (>= 3.0.0.0)
103
+ rainbow (>= 2.2.2, < 4.0)
104
+ regexp_parser (>= 1.8, < 3.0)
105
+ rexml
106
+ rubocop-ast (>= 1.9.1, < 2.0)
107
+ ruby-progressbar (~> 1.7)
108
+ unicode-display_width (>= 1.4.0, < 3.0)
109
+ rubocop-ast (1.10.0)
110
+ parser (>= 3.0.1.1)
111
+ ruby-progressbar (1.11.0)
112
+ ruby2_keywords (0.0.5)
113
+ sys-uname (1.2.2)
114
+ ffi (~> 1.1)
115
+ thor (1.1.0)
116
+ unicode-display_width (2.0.0)
117
+
118
+ PLATFORMS
119
+ x86_64-linux
120
+
121
+ DEPENDENCIES
122
+ aruba
123
+ cucumber
124
+ faraday
125
+ faraday_middleware
126
+ jokerino!
127
+ rake (~> 13.0)
128
+ rspec (~> 3.0)
129
+ rubocop (~> 1.7)
130
+
131
+ BUNDLED WITH
132
+ 2.2.22
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 NikitaNakv
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,37 @@
1
+ # Joker
2
+
3
+ A cli to use https://v2.jokeapi.dev/ api
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'joker'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install joker
20
+
21
+ ## Usage
22
+
23
+ joker tell - outputs a joke
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/NikitaNakv/joker.
34
+
35
+ ## License
36
+
37
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "joker"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/exe/joker ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require 'joker/cli'
3
+ Joker::CLI.start
data/joker.gemspec ADDED
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/joker/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "jokerino"
7
+ spec.version = Joker::VERSION
8
+ spec.authors = ["NikitaNakv"]
9
+ spec.email = ["nak-nikita@yandex.ru"]
10
+
11
+ spec.summary = "tells a joke"
12
+ spec.description = "cli for https://v2.jokeapi.dev/"
13
+ spec.homepage = "https://github.com/NikitaNakv/joker"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.4.0"
16
+
17
+ spec.metadata["allowed_push_host"] = "https://rubygems.org/"
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = "https://github.com/NikitaNakv/joker"
21
+ spec.metadata["changelog_uri"] = "https://github.com/NikitaNakv/joker/blob/main/CHANGELOG.md"
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+ spec.add_development_dependency "cucumber"
32
+ spec.add_development_dependency "aruba"
33
+ spec.add_dependency "thor"
34
+
35
+ # Uncomment to register a new dependency of your gem
36
+ # spec.add_dependency "example-gem", "~> 1.0"
37
+
38
+ # For more information and examples about making a new gem, checkout our
39
+ # guide at: https://bundler.io/guides/creating_gem.html
40
+ end
data/lib/joker.rb ADDED
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ require 'faraday'
3
+ require 'json'
4
+ require 'faraday_middleware'
5
+ require_relative "joker/version"
6
+
7
+ module Joker
8
+
9
+ class Error < StandardError; end
10
+ # Your code goes here...
11
+
12
+ class Teller
13
+
14
+ def self.tell
15
+ conn = Faraday.new do |f|
16
+ f.response :json # decode response bodies as JSON
17
+ end
18
+
19
+ response = conn.get('https://v2.jokeapi.dev/joke/Programming', {type: 'single', blacklistFlags: 'nsfw,racist,sexist,explicit'})
20
+
21
+ response.body["joke"]
22
+ end
23
+ end
24
+ end
data/lib/joker/cli.rb ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+ require 'thor'
3
+ require 'joker'
4
+
5
+ module Joker
6
+ class CLI < Thor
7
+
8
+ desc "tell (JOKE)", "tells something really dumb"
9
+ def tell
10
+ puts Joker::Teller.tell
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Joker
4
+ VERSION = "1.0.0"
5
+ end
metadata ADDED
@@ -0,0 +1,112 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jokerino
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - NikitaNakv
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-08-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: cucumber
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: aruba
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: thor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: cli for https://v2.jokeapi.dev/
56
+ email:
57
+ - nak-nikita@yandex.ru
58
+ executables:
59
+ - joker
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".github/workflows/main.yml"
64
+ - ".gitignore"
65
+ - ".idea/.gitignore"
66
+ - ".idea/joker.iml"
67
+ - ".idea/misc.xml"
68
+ - ".idea/modules.xml"
69
+ - ".idea/vcs.xml"
70
+ - ".rspec"
71
+ - ".rubocop.yml"
72
+ - CHANGELOG.md
73
+ - Gemfile
74
+ - Gemfile.lock
75
+ - LICENSE.txt
76
+ - README.md
77
+ - Rakefile
78
+ - bin/console
79
+ - bin/setup
80
+ - exe/joker
81
+ - joker.gemspec
82
+ - lib/joker.rb
83
+ - lib/joker/cli.rb
84
+ - lib/joker/version.rb
85
+ homepage: https://github.com/NikitaNakv/joker
86
+ licenses:
87
+ - MIT
88
+ metadata:
89
+ allowed_push_host: https://rubygems.org/
90
+ homepage_uri: https://github.com/NikitaNakv/joker
91
+ source_code_uri: https://github.com/NikitaNakv/joker
92
+ changelog_uri: https://github.com/NikitaNakv/joker/blob/main/CHANGELOG.md
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: 2.4.0
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubygems_version: 3.2.22
109
+ signing_key:
110
+ specification_version: 4
111
+ summary: tells a joke
112
+ test_files: []