aoc 0.0.0 → 0.0.1

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: 199b5f89d04bfb1cdac22dad9ec2d117674a22384f7b38d5832484d97be3447b
4
- data.tar.gz: 4a90c8df854aa70ef42fdf8b01f6963526d5d409e61f7ee4eacaf33b35487449
3
+ metadata.gz: faa8a3235f95d551355cea01ee9bde5c77aee16ec62007425b1c8317850e9719
4
+ data.tar.gz: 963d67b1e96bfd7e425dbf24ea3f575be483aed51c2f80bc8e4543fca7e924c2
5
5
  SHA512:
6
- metadata.gz: 3686a308fddc9dec9542de0e9d9f9e351ccee9a883cb6da7146c3ffcc26d47d1dc7effb432cecffb7af1db54125e90d0e6ecf4cc48ab13be69ffb56763073ee1
7
- data.tar.gz: 4bd6b59ed9f8af49569f1f64d29928be36c91c72b4b486dcced6754ff2ada446fe3c302a1c60a448435f3974bfbb984b055ec65ca8e01f3fb39ee110c0601030
6
+ metadata.gz: 35066eb71322b66e3da4bb98240639dd3746096bd4d004bff522fd2b80c32140aa1e4afa116b5bf480e6b02d5cf994d3fd08ff105455a3ce02a505752af58e23
7
+ data.tar.gz: ff9b3f9061aecbba7484566e00c93e3e8fe6fcaed1fb96b20e1825f834a3c9b88717051ff8113aa79fac583784adea9e6b937f60db300718cbd71774ea5a3486
@@ -1,18 +1,18 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aoc (0.1.0)
4
+ aoc (0.0.1)
5
5
  nokogiri (~> 1.6, >= 1.6.8)
6
6
  thor (~> 0.19.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- mini_portile2 (2.3.0)
12
- minitest (5.8.5)
13
- nokogiri (1.8.5)
14
- mini_portile2 (~> 2.3.0)
15
- rake (10.4.2)
11
+ mini_portile2 (2.4.0)
12
+ minitest (5.13.0)
13
+ nokogiri (1.10.5)
14
+ mini_portile2 (~> 2.4.0)
15
+ rake (10.5.0)
16
16
  thor (0.19.4)
17
17
 
18
18
  PLATFORMS
@@ -20,9 +20,9 @@ PLATFORMS
20
20
 
21
21
  DEPENDENCIES
22
22
  aoc!
23
- bundler (~> 1.17)
23
+ bundler (~> 2.0.2)
24
24
  minitest (~> 5.0)
25
25
  rake (~> 10.0)
26
26
 
27
27
  BUNDLED WITH
28
- 1.17.1
28
+ 2.0.2
data/README.md CHANGED
@@ -1,23 +1,10 @@
1
1
  # Aoc
2
+ Advent of Code toolkit to fetch inputs and submit answers efficiently.
2
3
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/aoc`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
4
+ Work is still in progress
6
5
 
7
6
  ## Installation
8
7
 
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'aoc'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
8
  $ gem install aoc
22
9
 
23
10
  ## Usage
@@ -28,8 +15,13 @@ You can bootstrap an advent of code challenge by using:
28
15
  $ aoc bootstrap
29
16
  ```
30
17
 
31
- This will create a directory containing today's challenge instructions, input file and a solution.rb file where you can start coding
32
- your solution.
18
+ This will create the following directory structure containing today's challenge instructions, input file and a solution.rb file where you can start coding your solution.
19
+ ```
20
+ day8/
21
+ ├── README
22
+ ├── input.txt
23
+ ├── solution.rb
24
+ ```
33
25
 
34
26
  You can also bootstrap a challenge of an other day:
35
27
  ```
@@ -65,7 +57,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
65
57
 
66
58
  ## Contributing
67
59
 
68
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/aoc.
60
+ Bug reports and pull requests are welcome on GitHub at https://github.com/zergov/aoc.
69
61
 
70
62
  ## License
71
63
 
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = ["aoc"]
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.add_development_dependency "bundler", "~> 1.17"
26
+ spec.add_development_dependency "bundler", "~> 2.0.2"
27
27
  spec.add_development_dependency "rake", "~> 10.0"
28
28
  spec.add_development_dependency "minitest", "~> 5.0"
29
29
 
data/bin/aoc CHANGED
@@ -5,6 +5,12 @@ require 'thor'
5
5
  require 'date'
6
6
 
7
7
  class CLI < Thor
8
+ map %w[--version -v] => :__print_version
9
+ desc "--version, -v", "print the version"
10
+ def __print_version
11
+ puts Aoc::VERSION
12
+ end
13
+
8
14
  desc "fetch [day] [year]", "fetch and display a challenge description. If no day and year, use today's date."
9
15
  method_option :input, :aliases => "-i", :type => :boolean, :default => false, :desc => "only show the input of the challenge."
10
16
  def fetch(day = Date.today.day, year = Date.today.year)
@@ -19,7 +25,8 @@ class CLI < Thor
19
25
  begin
20
26
  puts "Fetching: day #{day}, #{year}"
21
27
  puts challenge.part1
22
- puts challenge.part2
28
+ puts ""
29
+ puts challenge.part2 if challenge.part2?
23
30
  rescue OpenURI::HTTPError
24
31
  puts "Cannot find this challenge, make sure it exists."
25
32
  end
@@ -30,6 +37,12 @@ class CLI < Thor
30
37
  challenge = Aoc::Challenge.new(day, year)
31
38
  puts "Bootstrapping: day #{day}, #{year}"
32
39
 
40
+ begin
41
+ challenge.input
42
+ rescue OpenURI::HTTPError
43
+ return puts "Cannot find the input for your challenge. Make sure your session key is valid."
44
+ end
45
+
33
46
  begin
34
47
  dir = "day#{day}"
35
48
  readme = File.join(dir, "README")
@@ -1,3 +1,3 @@
1
1
  module Aoc
2
- VERSION = "0.0.0"
2
+ VERSION = "0.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Lalande
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-08 00:00:00.000000000 Z
11
+ date: 2019-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.17'
19
+ version: 2.0.2
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.17'
26
+ version: 2.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  requirements: []
131
131
  rubyforge_project:
132
- rubygems_version: 2.7.7
132
+ rubygems_version: 2.7.6
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Advent of Code toolkit