aoc_rb 0.0.0 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c55b5953ec5f5609a93d35056a675811dd5777a71514b6f3ed90eb64223212a4
4
- data.tar.gz: 1cc0e2404ad5efb0a38b5f4870785089fbd3b9d9edf86f8134cb793f43b47d2b
3
+ metadata.gz: 9d763b1d508f20a6ac9a31196dcca33a6ab06fef1f8f4dcf86f97644bedc5209
4
+ data.tar.gz: e91707d5c8f0c8249d11ba8882b18dbf89373ba6e72a0bb3a96800d2122db768
5
5
  SHA512:
6
- metadata.gz: f1d9532728421583243011320330aeb9a5279627fd2c05b842ced50b92ff19650cbaf7e31aa336c71d35f80a6f1dc5e02060aafc9dfb6718cde52f519eb845de
7
- data.tar.gz: d13d273694aa76935fd809ee3c7a777dbb9ba3449b2a18b411b905c06dd7876961b78e539fa33c4906d7ceaf929c8831615f2d818593cf32900553f6c16be3ff
6
+ metadata.gz: c1c324fc8c23867c6fea7586e7296fc89dba3f6473e9c5328aad328b3171197203215339e43058befaf0da2d4e705c445881d5a90e383c566433718f8ebf3c43
7
+ data.tar.gz: f4c7d9c2c8e0df6ee897c2acb68de5e252054f664c780bf0c245dcb8dbb573bbca09edaeb99a89dcf9f479114193f978dd37ae277cef01128c2c3a706f173f16
data/README.md CHANGED
@@ -1,39 +1,62 @@
1
1
  # AocRb
2
2
 
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_rb`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ This gem provides a simple way to create a project for solving [Advent of Code](https://adventofcode.com) puzzles.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ It also provides some handy tools to automate your interactions with the Advent of Code website.
6
6
 
7
- ## Installation
7
+ ## Getting Started
8
8
 
9
- Add this line to your application's Gemfile:
9
+ First of all, install the gem:
10
10
 
11
- ```ruby
12
- gem 'aoc_rb'
13
- ```
11
+ $ gem install aoc_rb
14
12
 
15
- And then execute:
13
+ Next, generate your Advent of Code project:
16
14
 
17
- $ bundle install
15
+ $ aoc new my-project-name
16
+
17
+ This will generate a new project with the given name. After this you should be ready to go!
18
18
 
19
- Or install it yourself as:
19
+ $ cd my-project-name
20
+ $ aoc
21
+
22
+ Before running any commands, you must set up your `AOC_COOKIE` environment variable:
20
23
 
21
- $ gem install aoc_rb
24
+ $ cp .env-template .env
22
25
 
23
- ## Usage
26
+ You'll need to log in to the [Advent of Code](https://adventofcode.com) website and then grab a copy of your session key from your cookies.
27
+ In Chrome you can do this via [chrome settings](chrome://settings/cookies/detail?site=adventofcode.com) by entering `chrome://settings/cookies/detail?site=adventofcode.com` in your address bar. Just click on `session` and copy your key from the `Content` section.
24
28
 
25
- TODO: Write usage instructions here
29
+ Now edit the new `.env` file, so that it looks like the following, replacing `ABCDE12345` with the session key you just copied:
26
30
 
27
- ## Development
31
+ AOC_COOKIE=ABCDE12345
28
32
 
29
- 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.
33
+ You're now able to run all the `aoc` commands provided by this gem.
34
+
35
+ You'll see you have a few options when running the `aoc` command within your project.
30
36
 
31
- 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
37
+ `prep` will set everything up for a new daily puzzle. It defaults to the puzzle for today, but you can work with older puzzles by passing the year and day:
32
38
 
33
- ## Contributing
39
+ $ aoc prep 2017 12
40
+
41
+ This will generate a `challenges/2017/12` folder with an `input.txt` file (your puzzle input), a `part_1.md` file with the instructions for part 1, and a `solution.rb` file for you to use when implementing your solution.
42
+
43
+ In `spec/2017/12` there will be a `solution_spec.rb` which you can use to write tests for your solution. It's a good idea to use the examples provided in the `part_1.md` to test your solution!
44
+
45
+ When you've got a working solution you can see what it generates by running:
34
46
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/aoc_rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/aoc_rb/blob/master/CODE_OF_CONDUCT.md).
47
+ $ aoc exec
48
+
49
+ Which runs todays solution. For previous days, just like with `prep`, you can provide a date:
50
+
51
+ $ aoc exec 2017 12
52
+
53
+ If you're happy with the output, you can respond to the prompt and `aoc` will submit your answer for you. If you're successful with part 1, it will automatically download the instructions for part 2 for you.
54
+
55
+ Rinse & repeat!
56
+
57
+ ## Contributing
36
58
 
59
+ Bug reports and pull requests are welcome on GitHub at https://github.com/pacso/aoc_rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/pacso/aoc_rb/blob/master/CODE_OF_CONDUCT.md).
37
60
 
38
61
  ## License
39
62
 
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'pathname'
4
+
3
5
  module AocRb
4
6
  module AppLoader
5
7
  extend self
@@ -1,3 +1,3 @@
1
1
  module AocRb
2
- VERSION = "0.0.0"
2
+ VERSION = "0.1.0"
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.0.0
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Pascoe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-02 00:00:00.000000000 Z
11
+ date: 2020-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv