notes_cli 0.1.5 → 1.0.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: 333db1b8b6dbbcd790a58549547ba44ddc8928fb63a4f1d1af1f565987da1865
4
- data.tar.gz: be86e4e00485b7a7ebe8001565b40bde1002c057ce0ab7239e9d4d8a66ed95d1
3
+ metadata.gz: 6624e27858770f04d3c3b2eb740c55c3c688bf23a76b996b27aad967ec5a4734
4
+ data.tar.gz: f1d493a601faa6ee2f1925cb1e4a7362e755471d47005fa43327c69f599399f2
5
5
  SHA512:
6
- metadata.gz: 62e99f63a3bd462f3852227d54eabaee0e3982909d2317650bc84522f31921b47d34e26b5403953f961e89b18ce221a2f88c8d849d55664558b4fa1e686bb8ed
7
- data.tar.gz: 89e4aa5bd7648cace82ed0febae82344cfcc4ed9ad8fc9c101d9ec0b88ad13b5419a42ed6d0b4ffa6c3226f451e2b64c43c985a59d1e6a1d6bd70a73e63b7b65
6
+ metadata.gz: e5e8f1bd09caec7c073c9c3d7a416a7825290ecaf623cbbe13f0ca91db19be563dba61eb5356d56966e4687ddec5401e11b9bd08e3090ab8c586cb5f1c1b709d
7
+ data.tar.gz: 8440c749b88e8d4f8ae7108cf133aeb7f75e27b1684bc0e8be03a9fa7391546b54702ad5e8357686caef774a3d27402ed83573e2e15f9653cc6713cb24b52233
@@ -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.
@@ -1,21 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- notes_cli (0.0.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.0)
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 (1.2.2)
14
+ fakefs (0.20.1)
15
15
  method_source (1.0.0)
16
- parallel (1.19.1)
17
- parser (2.7.1.2)
18
- ast (~> 2.4.0)
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.84.0)
41
+ rubocop (0.93.1)
41
42
  parallel (~> 1.10)
42
- parser (>= 2.7.0.1)
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.3)
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.3)
49
- parser (>= 2.7.0.1)
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
@@ -20,6 +20,11 @@ Define your first workspace
20
20
  notes -w workspace_name
21
21
  ```
22
22
 
23
+ Set your default editor
24
+ ```bash
25
+ notes -e subl
26
+ ```
27
+
23
28
  # DSL
24
29
  ## Notes folder
25
30
  Where you will store all notes, including your workspaces and notebooks as the top layers
@@ -57,12 +62,12 @@ notes
57
62
  ```
58
63
 
59
64
  ## Create
60
- ### Create a note in the current workspace
65
+ Create a note in the current workspace
61
66
  ```bash
62
67
  notes -n notebook note_title
63
68
  ```
64
69
 
65
- ### Creating a note in a nested notebook
70
+ Creating a note in a nested notebook
66
71
  ```bash
67
72
  notes -n path/to/notebook note_title
68
73
  ```
@@ -101,6 +106,12 @@ Listing all notes in a given notebook
101
106
  notes -l notebook
102
107
  ```
103
108
 
109
+ ## Open
110
+ Open a notebook in the context of your favourite editor
111
+ ```bash
112
+ notes -o notebook
113
+ ```
114
+
104
115
  ## Switch
105
116
  Switching workspace
106
117
  ```bash
@@ -16,14 +16,18 @@ OptionParser.new do |opt|
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 }
@@ -1,3 +1,3 @@
1
1
  module NotesCli
2
- VERSION = '0.1.5'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -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.6.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: 0.1.5
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joeffrey Lamy
@@ -105,6 +105,7 @@ 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
@@ -133,7 +134,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
134
  requirements:
134
135
  - - ">="
135
136
  - !ruby/object:Gem::Version
136
- version: '0'
137
+ version: 2.6.5
137
138
  required_rubygems_version: !ruby/object:Gem::Requirement
138
139
  requirements:
139
140
  - - ">="