aoc_rb 0.2.2 → 0.2.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: 03b8a728ae0c5b35a43fc4a6c84c178820c71bc216682fd4998f4fa4aa3f713f
4
- data.tar.gz: 5f3286c76bf28ae59b9247a8b537fa3f1f642cc0ff3752bec90ccd71d34650d3
3
+ metadata.gz: 5e7022fa9b1978076b33de4b63e0161f63ac1359b0cabf42f5eb89ba0fea309f
4
+ data.tar.gz: 5ecae3ef947b0cef0719278644af8c211946fff6b985e046f4225f044fa0c2cb
5
5
  SHA512:
6
- metadata.gz: b6c6be37087f9ba31bc68a1d317a3215fda3786787cd6c908cfa59a459c98bd1713a59129e583459396768780e2b4564895c7261058f23cd1026881414e89deb
7
- data.tar.gz: fbb164d72c20009d22ada48ac5bd7731418581c7ee4db3733cb4488c6c29fdd3c7cd56927637009f9faf32385533f4fdd0f9f9ed4cd478bfc766c9a02aa34664
6
+ metadata.gz: 86b1cd0f4090056041bd9e53c215684ad598d97b394c2a724a8b71ef6e4497e5aa1a66197ad09c651c48ad910b58654349f33e9ad142e36e2a5defa850576c1b
7
+ data.tar.gz: 430b19f6c60a9bc95e487e63cbffcb3bb5cf0f86f93921e41d7269c1addbfdc1c7473a255a2b41ebe5b29f6495346a267aceeb4299e12926d28378624b62dd17
@@ -0,0 +1,70 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ main ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ main ]
20
+ schedule:
21
+ - cron: '21 7 * * 4'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'ruby' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://git.io/codeql-language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v3
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v2
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
52
+
53
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54
+ # If this step fails, then you should remove it and run the build manually (see below)
55
+ - name: Autobuild
56
+ uses: github/codeql-action/autobuild@v2
57
+
58
+ # ℹ️ Command-line programs to run using the OS shell.
59
+ # 📚 https://git.io/JvXDl
60
+
61
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62
+ # and modify them (or add more) to build your code if your project
63
+ # uses a compiled language
64
+
65
+ #- run: |
66
+ # make bootstrap
67
+ # make release
68
+
69
+ - name: Perform CodeQL Analysis
70
+ uses: github/codeql-action/analyze@v2
@@ -12,6 +12,13 @@ on:
12
12
  branches: [ main ]
13
13
  pull_request:
14
14
  branches: [ main ]
15
+ types:
16
+ - opened
17
+ - synchronize
18
+ - reopened
19
+ - ready_for_review
20
+ - labeled
21
+ - unlabeled
15
22
 
16
23
  jobs:
17
24
  changelog:
data/CHANGELOG.md CHANGED
@@ -4,22 +4,54 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [Unreleased]
8
+ - No unreleased changes!
9
+
10
+ ## [0.2.4]
11
+ ### Fixed
12
+ - Output task fixed (by [@kauredo](https://github.com/kauredo))
13
+ - Spec task added to run tests from a given day (by [@kauredo](https://github.com/kauredo))
14
+
15
+ ## [0.2.3]
16
+ ### Changed
17
+ - Update minimum nokogiri version
18
+ - Update thor gem
19
+
7
20
  ## [0.2.2]
8
21
  ### Fixed
9
22
  - FileUtils uninitialized constant bug ([#10](https://github.com/pacso/aoc_rb/pull/10))
10
23
 
11
24
  ## [0.2.1]
25
+ ### Changed
26
+ - Allow any number of arguments to be passed to solutions
12
27
 
13
28
  ## [0.2.0]
29
+ ### Changed
30
+ - Improved input handling in puzzle solutions
31
+
32
+ ## [0.1.1]
33
+ ### Changed
34
+ - Switch from Travis to GitHub Actions
35
+ - Added Gem version badge
36
+ - Update gems and fix specs
14
37
 
15
38
  ## [0.1.0]
39
+ ### Changed
40
+ - Simplified README
41
+
42
+ ### Fixed
43
+ - Added require for pathname
16
44
 
17
45
  ## [0.0.0]
18
46
 
19
47
  Initial release.
20
48
 
21
- [Unreleased]: https://github.com/pacso/aoc_rb/compare/v0.2.2...HEAD
49
+ [Unreleased]: https://github.com/pacso/aoc_rb/compare/v0.2.4...HEAD
50
+ [0.2.4]: https://github.com/pacso/aoc_rb/compare/v0.2.3...v0.2.4
51
+ [0.2.3]: https://github.com/pacso/aoc_rb/compare/v0.2.2...v0.2.3
22
52
  [0.2.2]: https://github.com/pacso/aoc_rb/compare/v0.2.1...v0.2.2
23
53
  [0.2.1]: https://github.com/pacso/aoc_rb/compare/v0.2.0...v0.2.1
24
- [0.2.0]: https://github.com/pacso/aoc_rb/compare/v0.1.0...v0.2.0
25
- [0.1.0]: https://github.com/pacso/aoc_rb/compare/v0.0.0...v0.1.0
54
+ [0.2.0]: https://github.com/pacso/aoc_rb/compare/v0.1.1...v0.2.0
55
+ [0.1.1]: https://github.com/pacso/aoc_rb/compare/v0.1.0...v0.1.1
56
+ [0.1.0]: https://github.com/pacso/aoc_rb/compare/v0.0.0...v0.1.0
57
+ [0.0.0]: https://github.com/pacso/aoc_rb/tree/9fc471cb0accb95ddad1aeb138d542056a0034c2
data/Gemfile CHANGED
@@ -3,5 +3,5 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in aoc_rb.gemspec
4
4
  gemspec
5
5
 
6
- gem "rake", "~> 12.0"
6
+ gem "rake", "~> 13.0"
7
7
  gem "byebug"
data/aoc_rb.gemspec CHANGED
@@ -27,9 +27,9 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.add_dependency "dotenv", "~> 2.7.6"
29
29
  spec.add_dependency "httparty", "~> 0.20.0"
30
- spec.add_dependency "thor", "~> 1.1.0"
30
+ spec.add_dependency "thor", "~> 1.2.1"
31
31
  spec.add_dependency "rspec", "~> 3.0"
32
- spec.add_dependency "nokogiri", "~> 1.12.5"
32
+ spec.add_dependency "nokogiri", "~> 1.13.6"
33
33
 
34
34
  spec.add_development_dependency "webmock", "~> 3.14.0"
35
35
  end
data/lib/aoc_rb/app.rb CHANGED
@@ -108,12 +108,22 @@ module AocRb
108
108
  method_option :day, aliases: "-d", type: :numeric, default: Time.now.day
109
109
 
110
110
  def output(year = options[:year], day = options[:day])
111
- puzzle = AocRb::PuzzleSource.create_puzzle(year, day)
112
111
  input = AocRb::PuzzleInput.load(year, day)
112
+ puzzle = AocRb::PuzzleSource.create_puzzle(year, day, input)
113
113
 
114
- AocRb::PuzzleSource.run_part('part 1') { puzzle.part_1(input) }
114
+ AocRb::PuzzleSource.run_part('part 1') { puzzle.part_1 }
115
115
  puts
116
- AocRb::PuzzleSource.run_part('part 2') { puzzle.part_2(input) }
116
+ AocRb::PuzzleSource.run_part('part 2') { puzzle.part_2 }
117
+ end
118
+
119
+ desc "spec", "runs tests for today, or the specified date"
120
+ method_option :year, aliases: "-y", type: :numeric, default: Time.now.year
121
+ method_option :day, aliases: "-d", type: :numeric, default: Time.now.day
122
+
123
+ def spec(year = options[:year], day = options[:day])
124
+ spec_dir = File.join("spec", year.to_s, AocRb::Puzzle.padded(day))
125
+
126
+ Kernel.exec( "bundle exec rspec #{spec_dir}" )
117
127
  end
118
128
 
119
129
  desc "prep", "preps everything you need for a new puzzle"
@@ -1,3 +1,3 @@
1
1
  module AocRb
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aoc_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Pascoe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-12 00:00:00.000000000 Z
11
+ date: 2022-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.1.0
47
+ version: 1.2.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.1.0
54
+ version: 1.2.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.12.5
75
+ version: 1.13.6
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.12.5
82
+ version: 1.13.6
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: webmock
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -103,6 +103,7 @@ executables:
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
+ - ".github/workflows/codeql-analysis.yml"
106
107
  - ".github/workflows/tests.yml"
107
108
  - ".gitignore"
108
109
  - ".rspec"