crusoe 0.1.0 → 0.2.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: b4a32192daf5b633da6ab3d4b914f79c1a76c08e48f22651656c65b4c63321ce
4
- data.tar.gz: 83af5b4c5f515d1ca57fb24bddf6d0e49b01c90d68e62cd09a12b2d19344eed7
3
+ metadata.gz: ab82f877cbeec3310704961cf66b8563632263e18a1bb827273e9387edfae31e
4
+ data.tar.gz: 2b01f8406c25d12e0e8bd2685ccf2753508066e36bef7adff06f82a123016aa7
5
5
  SHA512:
6
- metadata.gz: f721eb5652b8232650348c78a5a1e0285da99c6584bb48b8ff850c72c135b53041fbdf58790bfa4539583410a20f4b6e543dd505629035cf7788b5dfba6463c8
7
- data.tar.gz: 43afa28420513bba378085b33313ad997d9203430baaca25c025fd5499861d981447bc7e80a0447f48662aa46b41451ebae62573d011324d8bc80dc92a952f4b
6
+ metadata.gz: f1183a6b331ceab966bcf2af06e5367502cc599923ece7874b81561d7a54a82638695ac370336e7d350fc8814dd35e3a46bb1194272690a8afa833b69bbf8283
7
+ data.tar.gz: 37a8e6da079c79f4b1ac86b93277769e246ecc0cb979c84e6b413f483b02680452ee28bbdb4069d27775ab8e6b6d0e671280d4ddc6fff726d2dd533e487380ac
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- crusoe (0.1.0)
4
+ crusoe (0.2.0)
5
5
  git
6
6
  thor
7
7
  yaml
data/README.md CHANGED
@@ -1,24 +1,51 @@
1
1
  # Crusoe
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- 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/crusoe`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ A simple daily work journal from your command-line
4
+
5
+ ```
6
+ # Open today's journal and add to it
7
+ $ crusoe
8
+ ```
9
+
10
+ ```
11
+ crusoe help
12
+ Commands:
13
+ crusoe help [COMMAND] # Describe available commands or one specific command
14
+ crusoe journal # This is the default task.
15
+ crusoe read # Read an entry
16
+ crusoe report # Generate a report for the last week
17
+ crusoe toc # Update the ToC on the README.md
18
+ ```
6
19
 
7
20
  ## Installation
8
21
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
22
+ ```
23
+ gem install crusoe
24
+ ```
25
+
26
+ ## Feature list
27
+
28
+ ### Write to journal
29
+
30
+ #### `crusoe journal ✅`
31
+
32
+ - Write a single journal entry for given day (defaults to today)
33
+ - Automatically saves to git repo configured by you
34
+ - Default command for `crusoe`
35
+ - Can provide an optional `--date` value (e.g. one of `"today"`, `"yesterday"`, `"2023-12-25"`)
10
36
 
11
- Install the gem and add to the application's Gemfile by executing:
37
+ #### `crusoe read ✅`
12
38
 
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
39
+ - Read a single journal entry for given day (defaults to today)
40
+ - Can provide an optional `--date` value (e.g. one of `"today"`, `"yesterday"`, `"2023-12-25"`)
14
41
 
15
- If bundler is not being used to manage dependencies, install the gem by executing:
42
+ #### `crusoe report ✅`
16
43
 
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
44
+ - Print the entries from the current week
18
45
 
19
- ## Usage
46
+ #### Organise journal in the README 🏗
20
47
 
21
- TODO: Write usage instructions here
48
+ - WIP: Keep an up-to-date index of all entries in the README
22
49
 
23
50
  ## Development
24
51
 
@@ -28,7 +55,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
28
55
 
29
56
  ## Contributing
30
57
 
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/crusoe.
58
+ Bug reports and pull requests are welcome on GitHub at https://github.com/bodacious/crusoe.
32
59
 
33
60
  ## License
34
61
 
data/lib/crusoe/cli.rb CHANGED
@@ -85,6 +85,8 @@ module Crusoe
85
85
  end
86
86
 
87
87
  def update_remote_repo
88
+ return if Commands::Git::Status.new(directory: configuration.entries_directory_path).empty?
89
+
88
90
  Commands::Git::Add.new(directory: configuration.entries_directory_path).all
89
91
  Commands::Git::Commit.new(directory: configuration.entries_directory_path).commit!
90
92
  Commands::Git::Push.new(directory: configuration.entries_directory_path).main
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Crusoe
4
+ module Commands
5
+ module Git
6
+ class Status < GitCommand
7
+ def empty?
8
+ # TODO: Clean this up
9
+ git_client.status.changed.empty?
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -6,6 +6,7 @@ module Crusoe
6
6
  require_relative "git/commit"
7
7
  require_relative "git/pull"
8
8
  require_relative "git/push"
9
+ require_relative "git/status"
9
10
  end
10
11
  end
11
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Crusoe
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crusoe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Morrice
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-15 00:00:00.000000000 Z
11
+ date: 2024-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -84,6 +84,7 @@ files:
84
84
  - lib/crusoe/commands/git/pull.rb
85
85
  - lib/crusoe/commands/git/push.rb
86
86
  - lib/crusoe/commands/git/remote_git_command.rb
87
+ - lib/crusoe/commands/git/status.rb
87
88
  - lib/crusoe/commands/journal.rb
88
89
  - lib/crusoe/commands/read.rb
89
90
  - lib/crusoe/configuration.rb
@@ -118,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
119
  - !ruby/object:Gem::Version
119
120
  version: '0'
120
121
  requirements: []
121
- rubygems_version: 3.4.8
122
+ rubygems_version: 3.4.6
122
123
  signing_key:
123
124
  specification_version: 4
124
125
  summary: A journaling tool for developers.