notes_cli 0.1.2 → 1.1.0
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 +5 -5
- data/CHANGELOG.md +30 -0
- data/Gemfile.lock +19 -17
- data/README.md +31 -8
- data/lib/notes_cli.rb +0 -2
- data/lib/notes_cli/controllers/option_parser.rb +9 -5
- data/lib/notes_cli/models/workspace.rb +10 -0
- data/lib/notes_cli/version.rb +1 -1
- data/notes_cli.gemspec +1 -0
- metadata +5 -5
- data/config.db +0 -0
- data/config.yml.db +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 703bf6eb0b39aeabf5eaa825da21a1221bb8e1c9
|
4
|
+
data.tar.gz: 1c806cbd4af8f51045323465898d47f3e9ea722e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3739e2cf764f11614da6fef9e9e10c8c6634e6aa0d5b4c62e33428f4028e91048a96518df54b8ab8de80f9d9b3d89a101a6868d20fd0be1bc775579a286e556e
|
7
|
+
data.tar.gz: 425b283bed17d841477b442e41a0c30794ee28d009686314f0e7bda657b8c72f91485346e7ef06eb8dcc0bfec3f900c0a3c0636e913d9b42831b5c3520a147e4
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 0.0.0
|
4
|
+
Core functionalities implemented.
|
5
|
+
|
6
|
+
## 0.1.0
|
7
|
+
Specify gem versions in Gemspec.
|
8
|
+
|
9
|
+
## 0.1.1
|
10
|
+
Add install instruction to documentation.
|
11
|
+
|
12
|
+
## 0.1.2
|
13
|
+
Minor refactor of `NoteLister`, adding a previously missing private section.
|
14
|
+
|
15
|
+
## 0.1.3
|
16
|
+
Amend available commands and README to provide accurate documentation.
|
17
|
+
|
18
|
+
## 0.1.4
|
19
|
+
Fix punctuation inconsistencies in documentation.
|
20
|
+
|
21
|
+
## 0.1.5
|
22
|
+
Removes require statements for debuggers out of the main app.
|
23
|
+
Adds about section.
|
24
|
+
|
25
|
+
## 0.2.0
|
26
|
+
Introduce `notes -e --editor` to allow users to set their favourite editor to open notebooks with.
|
27
|
+
Add `notes -o --open_notebook` to allow users to open a notebook in the context of their favourite editors.
|
28
|
+
|
29
|
+
## 1.0.0
|
30
|
+
Specify a ruby version of 2.6.5.
|
data/Gemfile.lock
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
notes_cli (0.
|
4
|
+
notes_cli (0.2.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
ast (2.4.
|
9
|
+
ast (2.4.1)
|
10
10
|
byebug (11.1.3)
|
11
11
|
coderay (1.1.2)
|
12
12
|
diff-lcs (1.3)
|
13
13
|
docile (1.3.2)
|
14
|
-
fakefs (
|
14
|
+
fakefs (0.20.1)
|
15
15
|
method_source (1.0.0)
|
16
|
-
parallel (1.19.
|
17
|
-
parser (2.7.
|
18
|
-
ast (~> 2.4.
|
16
|
+
parallel (1.19.2)
|
17
|
+
parser (2.7.2.0)
|
18
|
+
ast (~> 2.4.1)
|
19
19
|
pry (0.13.1)
|
20
20
|
coderay (~> 1.1)
|
21
21
|
method_source (~> 1.0)
|
@@ -23,6 +23,7 @@ GEM
|
|
23
23
|
byebug (~> 11.0)
|
24
24
|
pry (~> 0.13.0)
|
25
25
|
rainbow (3.0.0)
|
26
|
+
regexp_parser (1.8.2)
|
26
27
|
rexml (3.2.4)
|
27
28
|
rspec (3.9.0)
|
28
29
|
rspec-core (~> 3.9.0)
|
@@ -37,16 +38,17 @@ GEM
|
|
37
38
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
39
|
rspec-support (~> 3.9.0)
|
39
40
|
rspec-support (3.9.3)
|
40
|
-
rubocop (0.
|
41
|
+
rubocop (0.93.1)
|
41
42
|
parallel (~> 1.10)
|
42
|
-
parser (>= 2.7.
|
43
|
+
parser (>= 2.7.1.5)
|
43
44
|
rainbow (>= 2.2.2, < 4.0)
|
45
|
+
regexp_parser (>= 1.8)
|
44
46
|
rexml
|
45
|
-
rubocop-ast (>= 0.0
|
47
|
+
rubocop-ast (>= 0.6.0)
|
46
48
|
ruby-progressbar (~> 1.7)
|
47
49
|
unicode-display_width (>= 1.4.0, < 2.0)
|
48
|
-
rubocop-ast (0.0
|
49
|
-
parser (>= 2.7.
|
50
|
+
rubocop-ast (0.8.0)
|
51
|
+
parser (>= 2.7.1.5)
|
50
52
|
ruby-progressbar (1.10.1)
|
51
53
|
simplecov (0.18.5)
|
52
54
|
docile (~> 1.1)
|
@@ -58,13 +60,13 @@ PLATFORMS
|
|
58
60
|
ruby
|
59
61
|
|
60
62
|
DEPENDENCIES
|
61
|
-
fakefs
|
63
|
+
fakefs (~> 0.5)
|
62
64
|
notes_cli!
|
63
|
-
pry
|
64
|
-
pry-byebug
|
65
|
-
rspec
|
66
|
-
rubocop
|
67
|
-
simplecov
|
65
|
+
pry (~> 0.12)
|
66
|
+
pry-byebug (~> 3.9)
|
67
|
+
rspec (~> 3.9)
|
68
|
+
rubocop (~> 0.86)
|
69
|
+
simplecov (~> 0.18)
|
68
70
|
|
69
71
|
BUNDLED WITH
|
70
72
|
1.17.2
|
data/README.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
# About
|
2
|
+
Easily create, delete, list and open all your notes.
|
3
|
+
NotesCli lets you create workspaces and notebooks in which you can store notes.
|
4
|
+
Notes are created as md files for ease of storing code snippets.
|
5
|
+
|
1
6
|
# Installation
|
2
7
|
```bash
|
3
8
|
gem install notes_cli
|
@@ -5,25 +10,30 @@ gem install notes_cli
|
|
5
10
|
|
6
11
|
# Getting started
|
7
12
|
|
8
|
-
Tell notes_cli where your notes will be stored
|
13
|
+
Tell notes_cli where your notes will be stored
|
9
14
|
```bash
|
10
15
|
notes --notes_folder path/to/where/you/will/store/notes
|
11
16
|
```
|
12
17
|
|
13
|
-
Define your first workspace
|
18
|
+
Define your first workspace
|
14
19
|
```bash
|
15
20
|
notes -w workspace_name
|
16
21
|
```
|
17
22
|
|
23
|
+
Set your default editor
|
24
|
+
```bash
|
25
|
+
notes -e subl
|
26
|
+
```
|
27
|
+
|
18
28
|
# DSL
|
19
29
|
## Notes folder
|
20
|
-
Where you will store all notes, including your workspaces and notebooks as the top layers
|
30
|
+
Where you will store all notes, including your workspaces and notebooks as the top layers
|
21
31
|
|
22
32
|
## Workspace
|
23
|
-
Where you will store notebooks
|
33
|
+
Where you will store notebooks
|
24
34
|
|
25
35
|
## Notebook
|
26
|
-
Where you will store notes
|
36
|
+
Where you will store notes
|
27
37
|
|
28
38
|
## Example
|
29
39
|
Basic case scenario, where:
|
@@ -52,12 +62,12 @@ notes
|
|
52
62
|
```
|
53
63
|
|
54
64
|
## Create
|
55
|
-
|
65
|
+
Create a note in the current workspace
|
56
66
|
```bash
|
57
67
|
notes -n notebook note_title
|
58
68
|
```
|
59
69
|
|
60
|
-
|
70
|
+
Creating a note in a nested notebook
|
61
71
|
```bash
|
62
72
|
notes -n path/to/notebook note_title
|
63
73
|
```
|
@@ -96,6 +106,12 @@ Listing all notes in a given notebook
|
|
96
106
|
notes -l notebook
|
97
107
|
```
|
98
108
|
|
109
|
+
## Open
|
110
|
+
Open a notebook in the context of your favourite editor
|
111
|
+
```bash
|
112
|
+
notes -o notebook
|
113
|
+
```
|
114
|
+
|
99
115
|
## Switch
|
100
116
|
Switching workspace
|
101
117
|
```bash
|
@@ -105,4 +121,11 @@ notes -w workspace_name
|
|
105
121
|
Switching workspace and creating a note there
|
106
122
|
```bash
|
107
123
|
notes -w workspace_name -n notebook note_title
|
108
|
-
```
|
124
|
+
```
|
125
|
+
|
126
|
+
## Help
|
127
|
+
Display available commands
|
128
|
+
|
129
|
+
```bash
|
130
|
+
notes --help
|
131
|
+
```
|
data/lib/notes_cli.rb
CHANGED
@@ -8,22 +8,26 @@ if ARGV.empty?
|
|
8
8
|
end
|
9
9
|
|
10
10
|
OptionParser.new do |opt|
|
11
|
-
opt.on('-n --new_note
|
11
|
+
opt.on('-n --new_note NOTEBOOK NOTE_TITLE') { |option| workspace.create_note(option, ARGV) }
|
12
12
|
|
13
|
-
opt.on('-d --delete_note
|
13
|
+
opt.on('-d --delete_note NOTEBOOK NOTE_TITLE ') { |option| workspace.delete_note(option, ARGV) }
|
14
14
|
|
15
|
-
opt.on('-l --list_notes
|
15
|
+
opt.on('-l --list_notes NOTEBOOK NOTE_TITLE') do |option|
|
16
16
|
workspace.list_notes(option)
|
17
17
|
end
|
18
18
|
|
19
|
+
opt.on('-o --open_notebook NOTEBOOK') { |option| workspace.open_notebook(option) }
|
20
|
+
|
21
|
+
opt.on('-e --editor EDITOR') { |option| workspace.update_entry('editor', option) }
|
22
|
+
|
19
23
|
opt.on('-w --workspace WORKSPACE') do |option|
|
20
24
|
puts "Switched to #{option} wokspace" if workspace.switch(option)
|
21
|
-
end
|
25
|
+
end
|
22
26
|
|
23
27
|
opt.on('--notes_folder PATH/TO/FOLDER') do |option|
|
24
28
|
workspace.update_entry('notes_folder', option)
|
25
29
|
end
|
26
|
-
|
30
|
+
|
27
31
|
opt.on('--which_workspace ANY_CHARACTER') do |_option|
|
28
32
|
puts "Current workspace is #{workspace.current_workspace}"
|
29
33
|
end
|
@@ -19,12 +19,22 @@ class Workspace
|
|
19
19
|
NoteLister.new(notebook).call
|
20
20
|
end
|
21
21
|
|
22
|
+
def open_notebook(notebook)
|
23
|
+
system("#{editor} #{notebook_path(notebook)}")
|
24
|
+
end
|
25
|
+
|
22
26
|
def switch(workspace)
|
23
27
|
return unless workspace_exists?(workspace) || create?('workspace')
|
24
28
|
|
25
29
|
update_entry('workspace', workspace)
|
26
30
|
end
|
27
31
|
|
32
|
+
def editor
|
33
|
+
return config['editor'] if config && config['editor']
|
34
|
+
|
35
|
+
raise StandardError, 'Please set your editor'
|
36
|
+
end
|
37
|
+
|
28
38
|
def update_entry(key, value)
|
29
39
|
current_config = config
|
30
40
|
current_config ? current_config[key] = value.strip.chomp : current_config = { key => value }
|
data/lib/notes_cli/version.rb
CHANGED
data/notes_cli.gemspec
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.homepage =
|
23
23
|
'https://github.com/joe-at-github/notes_cli'
|
24
24
|
s.license = 'MIT'
|
25
|
+
s.required_ruby_version = Gem::Requirement.new('>= 2.3.5')
|
25
26
|
s.add_development_dependency 'fakefs', '~> 0.5'
|
26
27
|
s.add_development_dependency 'pry', '~> 0.12'
|
27
28
|
s.add_development_dependency 'pry-byebug', '~> 3.9'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notes_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joeffrey Lamy
|
@@ -105,13 +105,12 @@ extra_rdoc_files: []
|
|
105
105
|
files:
|
106
106
|
- ".gitignore"
|
107
107
|
- ".rspec"
|
108
|
+
- CHANGELOG.md
|
108
109
|
- Gemfile
|
109
110
|
- Gemfile.lock
|
110
111
|
- LICENSE.txt
|
111
112
|
- README.md
|
112
113
|
- bin/notes
|
113
|
-
- config.db
|
114
|
-
- config.yml.db
|
115
114
|
- lib/notes_cli.rb
|
116
115
|
- lib/notes_cli/controllers/option_parser.rb
|
117
116
|
- lib/notes_cli/models/workspace.rb
|
@@ -135,14 +134,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
134
|
requirements:
|
136
135
|
- - ">="
|
137
136
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
137
|
+
version: 2.3.5
|
139
138
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
139
|
requirements:
|
141
140
|
- - ">="
|
142
141
|
- !ruby/object:Gem::Version
|
143
142
|
version: '0'
|
144
143
|
requirements: []
|
145
|
-
|
144
|
+
rubyforge_project:
|
145
|
+
rubygems_version: 2.5.2.1
|
146
146
|
signing_key:
|
147
147
|
specification_version: 4
|
148
148
|
summary: Easy note management from the command line
|
data/config.db
DELETED
Binary file
|
data/config.yml.db
DELETED
Binary file
|