wordwise 1.0.3 → 1.0.4

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: 5bf3640288ff2b721444c8bcdf078994e141310161d58c894feb48d1aad8c28f
4
- data.tar.gz: b5b3b4da7aedd571aecd245bc468c50674de1718e01f1b2f76f3428750a8bb47
3
+ metadata.gz: 20c8845199839e43a24b90f64450e9376c0b55a860c626167d619250fb3b1b86
4
+ data.tar.gz: 875a578a5fe977542bdc8afb0a0bfb7e4615dfb99a2c16bfdb48606ce2cdf282
5
5
  SHA512:
6
- metadata.gz: 1946a7da775be7042d75bb3d6c94dcbb7c2416ab7269fa66339d8fd57951f1651fcf081673633eccee627fa03c88ff5a81c33ed1c69dbcede23af29d13530576
7
- data.tar.gz: a1504590cba5b536facfb60d00a6188dc76f39f38d8672494f1adda0408183c0d6d497405c20d4bfd233481e6c47897ad2b16105dbe84c8e185a64e2a11cae44
6
+ metadata.gz: 1ea21ca96406ded30a2e9616026f79d4cb7ed7b77eb29bea5d6ba43b4469e7f1c46ab15d0b1495a6e2432b17321a75bd4bea96cb557d129130889824c80e7ba3
7
+ data.tar.gz: dbc6a28d494b1e836b7f408d428363de76763899128e324490ff219893eff4d537797ee02abd9ad5c6fddfeb8f852e1fcd39db4a5b97e90b5e5338c3a434abe8
@@ -0,0 +1 @@
1
+ version: 2.1
@@ -0,0 +1,19 @@
1
+ name: Docker Image CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+
7
+ jobs:
8
+
9
+ build:
10
+
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: Build the Docker image
16
+ run: |
17
+ echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin docker.io
18
+ docker build . --file Dockerfile --tag docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/${{ secrets.DOCKER_HUB_REPOSITORY }}:$GITHUB_SHA
19
+ docker push docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/${{ secrets.DOCKER_HUB_REPOSITORY }}:$GITHUB_SHA
data/Gemfile.lock CHANGED
@@ -2,34 +2,37 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  wordwise (1.0.3)
5
+ bundler (>= 2.2.10)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
9
- coderay (1.1.2)
10
- diff-lcs (1.3)
11
- method_source (0.9.2)
12
- mini_portile2 (2.4.0)
13
- nokogiri (1.10.8)
14
- mini_portile2 (~> 2.4.0)
15
- pry (0.12.2)
16
- coderay (~> 1.1.0)
17
- method_source (~> 0.9.0)
18
- rake (13.0.1)
19
- require_all (2.0.0)
20
- rspec (3.8.0)
21
- rspec-core (~> 3.8.0)
22
- rspec-expectations (~> 3.8.0)
23
- rspec-mocks (~> 3.8.0)
24
- rspec-core (3.8.0)
25
- rspec-support (~> 3.8.0)
26
- rspec-expectations (3.8.2)
10
+ coderay (1.1.3)
11
+ diff-lcs (1.4.4)
12
+ method_source (1.0.0)
13
+ mini_portile2 (2.8.0)
14
+ nokogiri (1.13.6)
15
+ mini_portile2 (~> 2.8.0)
16
+ racc (~> 1.4)
17
+ pry (0.14.1)
18
+ coderay (~> 1.1)
19
+ method_source (~> 1.0)
20
+ racc (1.6.0)
21
+ rake (13.0.6)
22
+ require_all (3.0.0)
23
+ rspec (3.10.0)
24
+ rspec-core (~> 3.10.0)
25
+ rspec-expectations (~> 3.10.0)
26
+ rspec-mocks (~> 3.10.0)
27
+ rspec-core (3.10.1)
28
+ rspec-support (~> 3.10.0)
29
+ rspec-expectations (3.10.1)
27
30
  diff-lcs (>= 1.2.0, < 2.0)
28
- rspec-support (~> 3.8.0)
29
- rspec-mocks (3.8.0)
31
+ rspec-support (~> 3.10.0)
32
+ rspec-mocks (3.10.2)
30
33
  diff-lcs (>= 1.2.0, < 2.0)
31
- rspec-support (~> 3.8.0)
32
- rspec-support (3.8.0)
34
+ rspec-support (~> 3.10.0)
35
+ rspec-support (3.10.2)
33
36
 
34
37
  PLATFORMS
35
38
  ruby
@@ -44,4 +47,4 @@ DEPENDENCIES
44
47
  wordwise!
45
48
 
46
49
  BUNDLED WITH
47
- 1.17.3
50
+ 2.3.13
@@ -0,0 +1,11 @@
1
+ # Makefile 012: Cover Yourself With Codecov
2
+
3
+ Having recently graduated from Flatiron School, I'm going though by portfolio projects to refactor them into the best portfolio I can produce.
4
+
5
+ My very first project was [WordWise](https://rubygems.org/search?query=wordwise), a Ruby Gem that scrapes [Dictionary.com](https://www.dictionary.com/) to make a fun quiz game. While refactoring, I don't want to break any app, much less this one that to my complete astonishment has now been downloaded over 6000 times. I want to make sure I have good test coverage before I begin.
6
+
7
+ I have a vague memory of trying out [Codecov](https://about.codecov.io/) as a command line tool a while ago, so I decided to see how it could help and was pleased to see it has an integration with GitHub that's free for a small open source project like mine. Even though my project happens to be in Ruby, they also serve some 20 other languages.
8
+
9
+ To use it, go to their [homepage](https://about.codecov.io/) and sign up with your code host (GitHub, GitLab, etc.). Choose the repo you want to use it with. (If you have a lot and the one you want is near the end of the alphabet it may take a few minutes for the syncing to reach it.) You'll be given a token you can set in your CI environment variables. (I saved mine in a secure location.) Then you can look at an example repo and get quick-start and language-specific setup guides.
10
+
11
+ Codecov recommends using their service with a continuous integration provider to run your tests and upload a report. In next week's post, I'll write about setting this up.
data/lib/scraper.rb CHANGED
@@ -2,11 +2,11 @@
2
2
  # definitions.
3
3
  class Wordwise::Scraper
4
4
 
5
- BASEPATH = 'https://en.oxforddictionaries.com'
5
+ BASEPATH = 'https://www.lexico.com'
6
6
 
7
7
  # Scrapes page with list of word lists.
8
8
  def self.scrape_word_lists
9
- html = Nokogiri::HTML(open(BASEPATH + '/explore/word-lists'))
9
+ html = Nokogiri::HTML(URI.open(BASEPATH + '/explore/word-lists'))
10
10
  @list_urls, lists = [], []
11
11
 
12
12
  # Populates arrays of word list names and urls.
@@ -25,7 +25,7 @@ class Wordwise::Scraper
25
25
  # Scrapes a page with a word list.
26
26
  def self.scrape_word_list(page_idx)
27
27
 
28
- doc = Nokogiri::HTML(open(@list_urls[page_idx]))
28
+ doc = Nokogiri::HTML(URI.open(@list_urls[page_idx]))
29
29
  @words_defs = {}
30
30
 
31
31
  # Creates hash of word-definition pairs.
@@ -50,7 +50,7 @@ class Wordwise::Scraper
50
50
  # and put in another array.
51
51
  question_words.each_index do |i|
52
52
  word_urls << "#{BASEPATH}/definition/#{question_words[i]}"
53
- docs << Nokogiri::HTML(open(word_urls[i]))
53
+ docs << Nokogiri::HTML(URI.open(word_urls[i]))
54
54
  end
55
55
 
56
56
  # Sets variable for word origin.
@@ -1,3 +1,3 @@
1
1
  module Wordwise
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
3
3
  end
data/notes/devlog.md ADDED
@@ -0,0 +1,155 @@
1
+ # Devlog
2
+
3
+ *Entries by Ron Sala unless otherwise noted.*
4
+
5
+ Mon Sep 13 05:17:45 EDT 2021
6
+
7
+ Beginning to upgrade the app, based largely on Flatiron School's Software Engineering Post Work curriculum. Will also expand tests to ensure functionality as I refactor and add features.
8
+
9
+ Created `testing` branch. Moved `NOTES.md`, `spec.md` to `/notes`. Added this file.
10
+
11
+ ```
12
+ RONALDs-MacBook-Pro-2 dev/wordwise ‹testing› » rspec
13
+ /Users/RonSala/.rvm/gems/ruby-2.6.3/gems/pry-0.13.1/lib/pry/cli.rb:8: warning: already initialized constant Pry::CLI::NoOptionsError
14
+ /Users/RonSala/.rvm/gems/ruby-2.6.3/gems/pry-0.13.1/lib/pry/cli.rb:8: warning: previous definition of NoOptionsError was here
15
+
16
+ [!] There was an error parsing `Gemfile`:
17
+ [!] There was an error while loading `wordwise.gemspec`: uninitialized constant Pry::Command::ExitAll. Bundler cannot continue.
18
+
19
+ # from /Users/RonSala/Dropbox/dev/wordwise/wordwise.gemspec:5
20
+ # -------------------------------------------
21
+ # require 'open-uri'
22
+ > require 'pry'
23
+ # require 'nokogiri'
24
+ # -------------------------------------------
25
+ . Bundler cannot continue.
26
+
27
+ # from /Users/RonSala/Dropbox/dev/wordwise/Gemfile:11
28
+ # -------------------------------------------
29
+ # # Specify your gem's dependencies in wordwise.gemspec
30
+ > gemspec
31
+ # -------------------------------------------
32
+
33
+ No examples found.
34
+ ```
35
+
36
+ ```
37
+ RONALDs-MacBook-Pro-2 dev/wordwise ‹testing*› » bundle
38
+ ```
39
+
40
+ ,
41
+
42
+ ```
43
+ RONALDs-MacBook-Pro-2 dev/wordwise ‹testing*› » ruby bin/wordwise
44
+ ```
45
+
46
+ and
47
+
48
+
49
+ ```
50
+ RONALDs-MacBook-Pro-2 dev/wordwise ‹testing*› » bundle install
51
+ ```
52
+
53
+ give same error.
54
+
55
+ Fri Sep 17 04:25:19 EDT 2021
56
+
57
+ Removed and recreated Gemfile.lock. Now getting:
58
+
59
+ ```
60
+ RONALDs-MacBook-Pro-2 dev/wordwise ‹testing*› » ruby bin/wordwise
61
+ Traceback (most recent call last):
62
+ 8: from bin/wordwise:3:in `<main>'
63
+ 7: from bin/wordwise:3:in `require_relative'
64
+ 6: from /Users/RonSala/Dropbox/dev/wordwise/config/environment.rb:6:in `<top (required)>'
65
+ 5: from /Users/RonSala/.rvm/gems/ruby-2.6.3/gems/require_all-3.0.0/lib/require_all.rb:96:in `require_all'
66
+ 4: from /Users/RonSala/.rvm/gems/ruby-2.6.3/gems/require_all-3.0.0/lib/require_all.rb:96:in `each'
67
+ 3: from /Users/RonSala/.rvm/gems/ruby-2.6.3/gems/require_all-3.0.0/lib/require_all.rb:98:in `block in require_all'
68
+ 2: from /Users/RonSala/.rvm/gems/ruby-2.6.3/gems/require_all-3.0.0/lib/require_all.rb:208:in `__require'
69
+ 1: from /Users/RonSala/.rvm/gems/ruby-2.6.3/gems/require_all-3.0.0/lib/require_all.rb:208:in `require'
70
+ /Users/RonSala/Dropbox/dev/wordwise/lib/cli.rb:2:in `<top (required)>': uninitialized constant Wordwise (NameError)
71
+ 6: from bin/wordwise:3:in `<main>'
72
+ 5: from bin/wordwise:3:in `require_relative'
73
+ 4: from /Users/RonSala/Dropbox/dev/wordwise/config/environment.rb:6:in `<top (required)>'
74
+ 3: from /Users/RonSala/.rvm/gems/ruby-2.6.3/gems/require_all-3.0.0/lib/require_all.rb:96:in `require_all'
75
+ 2: from /Users/RonSala/.rvm/gems/ruby-2.6.3/gems/require_all-3.0.0/lib/require_all.rb:96:in `each'
76
+ 1: from /Users/RonSala/.rvm/gems/ruby-2.6.3/gems/require_all-3.0.0/lib/require_all.rb:97:in `block in require_all'
77
+ /Users/RonSala/.rvm/gems/ruby-2.6.3/gems/require_all-3.0.0/lib/require_all.rb:102:in `rescue in block in require_all': Could not require /Users/RonSala/Dropbox/dev/wordwise/lib/cli.rb (uninitialized constant Wordwise). Please require the necessary files (RequireAll::LoadError)
78
+ ```
79
+
80
+ Next time, will continue debugging.
81
+
82
+ Sat Oct 16 20:09:37 EDT 2021
83
+
84
+ The problem seems to have been with require_all not recognizing the Wordwise namespace. I see the master branch on GitHub has v 2.0.0, while the master branch locally has 3.0.0. I remain confused, though, why the local master and testing branches had load errors while a subsequently created require_all branch does not, even though all list 3.0.0 in Gemfile.lock.
85
+
86
+ Tried to recreate the problem with `bundle`, `bin/setup`, and `rake spec`. I see from my notes above I had run `rspec`. Perhaps this was the source of the issue. I see from the README, this is not the specified command. Leaving well enough alone....
87
+
88
+ Now setting up Codecov though GitHub and writing a blog post about it.
89
+
90
+ Tue Oct 19 19:21:29 EDT 2021
91
+
92
+ Working on setting up CircleCI. Reading the [docs](https://circleci.com/docs/). Found a promising orb, [ruby-gem@0.2.1](https://circleci.com/developer/orbs/orb/zfhui/ruby-gem?utm_source=google&utm_medium=sem&utm_campaign=sem-google-dg--uscan-en-dsa-maxConv-auth-brand&utm_term=g_b-_c__dsa_&utm_content=&gclid=CjwKCAjw2bmLBhBREiwAZ6ugo5wGiuvzqbtVF5VmMVDdAAoRK9Ikg0qUrJh3chk_mRCGWaDQDK9aBxoCwb0QAvD_BwE).
93
+
94
+ Sun Oct 24 16:41:45 EDT 2021
95
+
96
+ Bumped racc from 1.5.2 to 1.6.0.
97
+
98
+ Bumped bundler from 2.0.2 to 2.2.29. As a consequence, the Dependabot alert about it has been removed.
99
+
100
+ Found `rspec spec` leads to passing test.
101
+
102
+ Tried getting CircleCI to work but getting `config.yml is not valid`. Looks like I need an "executor" and Docker fits the bill.
103
+
104
+ Went to [https://docs.docker.com/get-started/overview/](https://docs.docker.com/get-started/overview/) and am following instructions.
105
+
106
+ Trying to set up Docker. Will do a pull request with this added sentence to test.
107
+
108
+ ## 20220517
109
+
110
+ Switched to new date format for this log.
111
+
112
+ Pulled in a PR from Dependabot concerning a security vulnerability with nokogiri.
113
+
114
+ Changed the BASEURL to the new lexico domain, eliminating the need for a redirect.
115
+
116
+ Added `URI.` before each call to `open` when scraping, eliminating `No such file or directory @ rb_sysopen` errors.
117
+
118
+ Got rid of `Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.` when starting app by updating bundler:
119
+
120
+ ```zsh
121
+ RONALDs-MacBook-Pro-2 dev/wordwise ‹workshop› » bundler -v
122
+ Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
123
+ Bundler version 2.2.29
124
+ RONALDs-MacBook-Pro-2 dev/wordwise ‹workshop› » gem install bundler
125
+ Fetching bundler-2.3.13.gem
126
+ Successfully installed bundler-2.3.13
127
+ Parsing documentation for bundler-2.3.13
128
+ Installing ri documentation for bundler-2.3.13
129
+ Done installing documentation for bundler after 0 seconds
130
+ 1 gem installed
131
+ RONALDs-MacBook-Pro-2 dev/wordwise ‹workshop› » bundle update --bundler
132
+ Fetching gem metadata from https://rubygems.org/.
133
+ Using rake 13.0.6
134
+ Using bundler 2.3.13
135
+ Using coderay 1.1.3
136
+ Using diff-lcs 1.4.4
137
+ Using method_source 1.0.0
138
+ Using mini_portile2 2.8.0
139
+ Using racc 1.6.0
140
+ Using nokogiri 1.13.6 (x86_64-darwin)
141
+ Using pry 0.14.1
142
+ Using require_all 3.0.0
143
+ Using rspec-support 3.10.2
144
+ Using rspec-core 3.10.1
145
+ Using rspec-expectations 3.10.1
146
+ Using rspec-mocks 3.10.2
147
+ Using rspec 3.10.0
148
+ Using wordwise 1.0.3 from source at `.`
149
+ Bundle updated!
150
+ ```
151
+
152
+ ```zsh
153
+ RONALDs-MacBook-Pro-2 dev/wordwise ‹workshop› » bcm "bump version from 1.0.3 to 1.0.4"
154
+ ```
155
+
data/wordwise.gemspec CHANGED
@@ -32,7 +32,8 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ["lib"]
34
34
 
35
- spec.add_development_dependency "bundler", "~> 1.16"
35
+ # spec.add_development_dependency "bundler", "~> 1.16"
36
+ spec.add_runtime_dependency 'bundler', '~> 2.2', '>= 2.2.10'
36
37
  spec.add_development_dependency "rake", "~> 13.0"
37
38
  spec.add_development_dependency "rspec", "~> 3.0"
38
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordwise
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ron Sala
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-01 00:00:00.000000000 Z
11
+ date: 2022-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
20
- type: :development
19
+ version: '2.2'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.2.10
23
+ type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
- version: '1.16'
29
+ version: '2.2'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 2.2.10
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rake
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -60,9 +66,10 @@ executables: []
60
66
  extensions: []
61
67
  extra_rdoc_files: []
62
68
  files:
69
+ - ".circleci/config.yml"
70
+ - ".github/workflows/main.yml"
63
71
  - ".gitignore"
64
72
  - ".rspec"
65
- - ".travis.yml"
66
73
  - CODE_OF_CONDUCT.md
67
74
  - Gemfile
68
75
  - Gemfile.lock
@@ -72,6 +79,7 @@ files:
72
79
  - Rakefile
73
80
  - bin/setup
74
81
  - bin/wordwise
82
+ - blog-posts/makefile-012--cover-yourself-with-codecov.md
75
83
  - changelog.md
76
84
  - config/environment.rb
77
85
  - lib/cli.rb
@@ -79,13 +87,14 @@ files:
79
87
  - lib/scraper.rb
80
88
  - lib/wordwise.rb
81
89
  - lib/wordwise/version.rb
90
+ - notes/devlog.md
82
91
  - spec.md
83
92
  - wordwise.gemspec
84
93
  homepage: https://github.com/ronsala/wordwise
85
94
  licenses:
86
95
  - MIT
87
96
  metadata: {}
88
- post_install_message:
97
+ post_install_message:
89
98
  rdoc_options: []
90
99
  require_paths:
91
100
  - lib
@@ -100,8 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
109
  - !ruby/object:Gem::Version
101
110
  version: '0'
102
111
  requirements: []
103
- rubygems_version: 3.0.4
104
- signing_key:
112
+ rubygems_version: 3.3.7
113
+ signing_key:
105
114
  specification_version: 4
106
115
  summary: A quiz game. Challenge your vocabulary!
107
116
  test_files: []
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3.0
5
- before_install: gem install bundler -v 1.16.1