jekylljournal 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: a44abe75dfa7920dce9b4666ab647e2ed0a0948a
4
- data.tar.gz: c0520e4ef5b764a402918a62a8c5de7273b169ac
3
+ metadata.gz: 0fc6ad9978910357a144f88b586328c42aa91174
4
+ data.tar.gz: d50615a74fae909730492dda69f0d8e155f4c54a
5
5
  SHA512:
6
- metadata.gz: 80b49507ed639b3cc5f23d025230031701c9a790dc8e1f137c2caa1bb366c7d17e1c75d5f8f5ea2ac7607212fe8696c793c11850e03ad6bcc29b93fa42ddb098
7
- data.tar.gz: 7a7f8d27caf9f670a64721e469252fe7cfa894a1782625f0e15dae50578110f0591e5f43ddbab5b37ec05765a660e317422d64ac067092a90accf2f1691f33b1
6
+ metadata.gz: 5a5f5b91d1a018f411e8a6fe3e4f31522a83b98812b5495bece38ca8df698d101f2f31598f0fee46fc995e680c141dc847a6abf75febc2e695345ff0102eaa0b
7
+ data.tar.gz: 6a224e4f131a63f8ef16390ec6f2103fcf047dd0432b2fa8e99195975a3e9e1fa0e60b31119953c799c8f083fc64abaad918b6f71a113c5e33df0acc43c7b1ea
data/README.rdoc CHANGED
@@ -22,11 +22,24 @@ below.
22
22
 
23
23
  :blog_location: /path/to/your/jekyll/blog/root
24
24
 
25
+ == Custom Alias
26
+
27
+ It's super handy to map an alias to this app. My configuration just uses
28
+ `j` to open up my daily journal. Pretty slick, if I do say so myself.
29
+ Which I do.
30
+
31
+ Here's what's in my `.zshrc` file:
32
+
33
+ alias j="jekylljournal"
34
+
25
35
  == Project Links
26
36
 
27
37
  Gem on Rubygems:
28
38
  https://rubygems.org/gems/jekylljournal
29
39
 
40
+ Bug tracking on Github:
41
+ https://github.com/lorentrogers/jekylljournal/issues
42
+
30
43
  Source on Github:
31
44
  https://github.com/lorentrogers/jekylljournal
32
45
 
data/bin/jekylljournal CHANGED
@@ -2,7 +2,7 @@
2
2
  require 'gli'
3
3
  require 'yaml'
4
4
  require 'date'
5
- require './lib/jekylljournal'
5
+ require 'jekylljournal'
6
6
 
7
7
  include GLI::App
8
8
 
@@ -34,7 +34,7 @@ pre do |global,command,options,args|
34
34
  # chosen command
35
35
  # Use skips_pre before a command to skip this block
36
36
  # on that command only
37
- @journal_handler = Journalhandler.new
37
+ @journal_handler = Jekylljournal::Journalhandler.new
38
38
  return false unless @journal_handler
39
39
  true
40
40
  end
@@ -9,9 +9,11 @@ spec = Gem::Specification.new do |s|
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.summary = 'A super awesome way of writing daily blog posts with Jekyll.'
11
11
  s.license = 'GPL-3.0'
12
+ s.required_ruby_version = '>= 2.2.0'
12
13
  s.files = `git ls-files`.split("
13
14
  ")
14
15
  s.require_paths << 'lib'
16
+ s.require_paths << 'lib/jekylljournal'
15
17
  s.has_rdoc = true
16
18
  s.extra_rdoc_files = ['README.rdoc','jekylljournal.rdoc']
17
19
  s.rdoc_options << '--title' << 'jekylljournal' << '--main' << 'README.rdoc' << '-ri'
@@ -20,5 +22,6 @@ spec = Gem::Specification.new do |s|
20
22
  s.add_development_dependency('rake')
21
23
  s.add_development_dependency('rdoc')
22
24
  s.add_development_dependency('aruba')
25
+ s.add_development_dependency('jekylljournal')
23
26
  s.add_runtime_dependency('gli','2.13.4')
24
27
  end
@@ -1,34 +1,34 @@
1
- # This class is used to handle Jekyll Journals.
2
- # It is generally called from the command line wrapper.
3
- class Journalhandler
1
+ module Jekylljournal
2
+ # This class is used to handle Jekyll Journals.
3
+ # It is generally called from the command line wrapper.
4
+ class Journalhandler
5
+ # Loads the config dotfile from the default directory and sets the
6
+ # application options
7
+ def initialize
8
+ @options = { }
4
9
 
5
- # Loads the config dotfile from the default directory and sets the
6
- # application options
7
- def initialize
8
- @options = { }
9
-
10
- config_file = File.join(ENV['HOME'],'.jekylljournal.yaml')
11
- if File.exists? config_file
12
- config_options = YAML.load_file(config_file)
13
- if !config_options
14
- puts 'Config file empty, please see the readme.'
10
+ config_file = File.join(ENV['HOME'],'.jekylljournal.yaml')
11
+ if File.exists? config_file
12
+ config_options = YAML.load_file(config_file)
13
+ if !config_options
14
+ puts 'Config file empty, please see the readme.'
15
+ else
16
+ @options.merge!(config_options)
17
+ end
15
18
  else
16
- @options.merge!(config_options)
19
+ puts 'Config file not found, please create one.'
17
20
  end
18
- else
19
- puts 'Config file not found, please create one.'
20
21
  end
21
- end
22
22
 
23
- # Opens today's post if it exists, otherwise
24
- # it creates a new post, populates it with
25
- # the default yaml frontmatter, then opens
26
- # this newly created file.
27
- def open
28
- today = Date.today.strftime '%Y-%m-%d'
29
- file_name = "#{@options[:blog_location]}/_posts/#{today}-#{today}.md"
30
- # create the file if it doesn't exist
31
- frontmatter = <<eol
23
+ # Opens today's post if it exists, otherwise
24
+ # it creates a new post, populates it with
25
+ # the default yaml frontmatter, then opens
26
+ # this newly created file.
27
+ def open
28
+ today = Date.today.strftime '%Y-%m-%d'
29
+ file_name = "#{@options[:blog_location]}/_posts/#{today}-#{today}.md"
30
+ # create the file if it doesn't exist
31
+ frontmatter = <<eol
32
32
  ---
33
33
  layout: post
34
34
  title: #{today}
@@ -36,31 +36,32 @@ title: #{today}
36
36
 
37
37
  eol
38
38
 
39
- File.write file_name, frontmatter unless File.file? file_name
39
+ File.write file_name, frontmatter unless File.file? file_name
40
40
 
41
- puts "Opening #{file_name}"
42
- system 'vim', file_name
43
- end
41
+ puts "Opening #{file_name}"
42
+ system 'vim', file_name
43
+ end
44
44
 
45
- # Adds and commits all new posts and assets to git, then
46
- # pushes to the default repositories.
47
- # TODO
48
- def save
49
- puts 'Saving...'
50
- run_git_cmd 'add _posts/*'
51
- run_git_cmd 'add assets/*'
52
- # TODO: this should use more flexible values.
53
- # Date format should be a dotfile option
54
- # Message format should be a dotfile option
55
- run_git_cmd "commit -m \"Save: #{Date.today.strftime '%Y-%m-%d'}\""
56
- run_git_cmd 'push'
57
- puts 'done.'
58
- end
45
+ # Adds and commits all new posts and assets to git, then
46
+ # pushes to the default repositories.
47
+ # TODO
48
+ def save
49
+ puts 'Saving...'
50
+ run_git_cmd 'add _posts/*'
51
+ run_git_cmd 'add assets/*'
52
+ # TODO: this should use more flexible values.
53
+ # Date format should be a dotfile option
54
+ # Message format should be a dotfile option
55
+ run_git_cmd "commit -m \"Save: #{Date.today.strftime '%Y-%m-%d'}\""
56
+ run_git_cmd 'push'
57
+ puts 'done.'
58
+ end
59
59
 
60
- private
60
+ private
61
61
 
62
- def run_git_cmd cmd
63
- location = @options[:blog_location]
64
- `git --git-dir=#{location}/.git --work-tree=#{location} #{cmd}`
62
+ def run_git_cmd cmd
63
+ location = @options[:blog_location]
64
+ `git --git-dir=#{location}/.git --work-tree=#{location} #{cmd}`
65
+ end
65
66
  end
66
67
  end
@@ -1,3 +1,3 @@
1
1
  module Jekylljournal
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekylljournal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loren Rogers
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: jekylljournal
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: gli
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -110,11 +124,12 @@ rdoc_options:
110
124
  require_paths:
111
125
  - lib
112
126
  - lib
127
+ - lib/jekylljournal
113
128
  required_ruby_version: !ruby/object:Gem::Requirement
114
129
  requirements:
115
130
  - - ">="
116
131
  - !ruby/object:Gem::Version
117
- version: '0'
132
+ version: 2.2.0
118
133
  required_rubygems_version: !ruby/object:Gem::Requirement
119
134
  requirements:
120
135
  - - ">="